// Call addParameter() from this class
il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
ADD_PARAMETER,
ADD_PARAMETER_SIG)));
if (className != EMPTYSTRING) {
il.append(new CHECKCAST(cpg.addClass(className)));
}
_type.translateUnBox(classGen, methodGen);
if (_refs.isEmpty()) { // nobody uses the value
il.append(_type.POP());
_local = null;
}
else { // normal case
_local = methodGen.addLocalVariable2(name,
_type.toJCType(),
il.getEnd());
// Cache the result of addParameter() in a local variable
il.append(_type.STORE(_local.getIndex()));
}
}
else {
if (classGen.containsField(name) == null) {
classGen.addField(new Field(ACC_PUBLIC, cpg.addUtf8(name),
cpg.addUtf8(signature),
null, cpg.getConstantPool()));
il.append(classGen.loadTranslet());
il.append(DUP);
il.append(new PUSH(cpg, name));
translateValue(classGen, methodGen);
il.append(new PUSH(cpg, true));
// Call addParameter() from this class
il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
ADD_PARAMETER,
ADD_PARAMETER_SIG)));
_type.translateUnBox(classGen, methodGen);
// Cache the result of addParameter() in a field
if (className != EMPTYSTRING) {
il.append(new CHECKCAST(cpg.addClass(className)));
}
il.append(new PUTFIELD(cpg.addFieldref(classGen.getClassName(),
name, signature)));
}
}