// A new array instruction obviously tells us it is an array type !
if (searchPtr.getInstruction().opcode == Constants.ANEWARRAY) {
// ANEWARRAY ana = (ANEWARRAY)searchPoint.getInstruction();
// Type t = ana.getType(getEnclosingClass().getConstantPool());
// Just use a standard java.lang.object array - that will work fine
return BcelWorld.fromBcel(new ArrayType(Type.OBJECT, 1));
}
// A multi new array instruction obviously tells us it is an array type !
if (searchPtr.getInstruction() instanceof MULTIANEWARRAY) {
MULTIANEWARRAY ana = (MULTIANEWARRAY) searchPtr.getInstruction();
// Type t = ana.getType(getEnclosingClass().getConstantPool());
// t = new ArrayType(t,ana.getDimensions());
// Just use a standard java.lang.object array - that will work fine
return BcelWorld.fromBcel(new ArrayType(Type.OBJECT, ana.getDimensions()));
}
throw new BCException("Can't determine real target of clone() when processing instruction "
+ searchPtr.getInstruction() + ". Perhaps avoid selecting clone with your pointcut?");
}
return tx;