use of org.candle.decompiler.intermediate.expression.StringLiteral in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitLDC2_W.
public void visitLDC2_W(LDC2_W instruction) {
// load from constant pool.
LOG.debug("Loading from constant pool" + instruction.getClass());
MethodGen mg = context.getMethodGen();
ConstantPoolGen cpg = mg.getConstantPool();
Type type = instruction.getType(cpg);
Object instructionValue = instruction.getValue(cpg);
if (Type.STRING == type) {
Expression resolved = new StringLiteral(context.getCurrentInstruction(), instructionValue.toString());
context.getExpressions().push(resolved);
return;
} else {
}
StringBuilder resolvedValue = new StringBuilder();
if (instructionValue instanceof ConstantClass) {
String clzName = getClassName((ConstantClass) instructionValue, cpg.getConstantPool());
resolvedValue.append(clzName);
} else {
resolvedValue.append(instructionValue.toString());
}
Expression resolved = new Resolved(context.getCurrentInstruction(), type, resolvedValue.toString());
context.getExpressions().push(resolved);
}
Aggregations