Project: AspectJ
Bug 148786 new array construction join point can fail for freaky array constructors
Reported: 2006-06-27 05:42:49 | Status: resolved fixed

Took me a while to discover how to recreate this problem, but this class: public class A { public static void main(String []argv) { byte[][] bytes = new byte[][]{{0},{1}}; } } causes this bytecode: 0: iconst_2 1: anewarray #18; //class "[B" and this causes the newarray joinpoint code to go bang. (eg. before(): call(*[].new(..)) {}) java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelWorld.fromBcel(BcelWorld.java:236) at org.aspectj.weaver.bcel.BcelWorld.makeJoinPointSignatureForArrayConstruction(BcelWorld.java:483) at org.aspectj.weaver.bcel.BcelShadow.makeArrayConstructorCall(BcelShadow.java:801) at org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:2510) at org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:2325) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:490) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:115) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1574) at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1525) at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1305) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1127)

Files changed in fix:
tests/bugs152/pr148786/A.java tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java weaver/src/org/aspectj/weaver/bcel/BcelWorld.java