import org.apache.bcel.generic.InstructionFactory;
import org.apache.bcel.generic.InstructionHandle;
import org.apache.bcel.generic.InstructionList;
-import org.apache.bcel.generic.ObjectType;
+import org.apache.bcel.generic.ReferenceType;
import org.apache.bcel.generic.Type;
import org.aspectj.weaver.BCException;
import org.aspectj.weaver.Member;
public void visit(Instanceof i) {
instructions.insert(createJumpBasedOnBooleanOnStack());
instructions.insert(
- Utility.createInstanceof(fact, (ObjectType) world.makeBcelType(i.getType())));
+ Utility.createInstanceof(fact, (ReferenceType) world.makeBcelType(i.getType())));
i.getVar().accept(this);
}
import org.apache.bcel.generic.InstructionTargeter;
import org.apache.bcel.generic.LDC;
import org.apache.bcel.generic.ObjectType;
+import org.apache.bcel.generic.ArrayType;
import org.apache.bcel.generic.ReferenceType;
import org.apache.bcel.generic.SIPUSH;
import org.apache.bcel.generic.TargetLostException;
kind);
}
- public static Instruction createInstanceof(InstructionFactory fact, ObjectType t) {
- return new INSTANCEOF(fact.getConstantPool().addClass(t));
+ public static Instruction createInstanceof(InstructionFactory fact, ReferenceType t) {
+ int cpoolEntry =
+ (t instanceof ArrayType)
+ ? fact.getConstantPool().addArrayClass((ArrayType)t)
+ : fact.getConstantPool().addClass((ObjectType)t);
+ return new INSTANCEOF(cpoolEntry);
}
-
public static Instruction createInvoke(
InstructionFactory fact,
LazyMethodGen m) {