--- /dev/null
+public class A {
+ public static void main(String []argv) {
+ byte[][] bytes = new byte[][]{{0},{1}};
+ }
+}
+
+aspect X {
+ after() returning(Object o) : call(*[][].new(..)) {
+ System.err.println("new array: "+o.getClass());
+ }
+}
// public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");}
// public void testAdviceNotWovenAspectPath_pr147841() { runTest("advice not woven on aspectpath");}
// public void testClassCastForInvalidAnnotationValue_pr148537() { runTest("classcast annotation value");}
+ public void testFreakyNewArrayJoinpoint_pr148786() { runTest("freaky new array joinpoint"); }
public void testPrivilegeGeneric_pr148545() { runTest("nosuchmethoderror for privileged aspect");}
public void testPrivilegeGeneric_pr148545_2() { runTest("nosuchmethoderror for privileged aspect - 2");}
public void testUnknownAnnotationNPE() { runTest("NPE for unknown annotation");}
<compile files="TheWholeShow.aj" options="-1.5"/>
<run class="TheWholeShow"/>
</ajc-test>
+
+ <ajc-test dir="bugs152/pr148786" title="freaky new array joinpoint">
+ <compile files="A.java" options="-Xjoinpoints:arrayconstruction"/>
+ <run class="A">
+ <stderr>
+ <line text="new array: class [[B"/>
+ </stderr>
+ </run>
+ </ajc-test>
</suite>
\ No newline at end of file
if (i instanceof ANEWARRAY) {
ANEWARRAY arrayInstruction = (ANEWARRAY)i;
- ObjectType ot = arrayInstruction.getLoadClassType(cpg);
+ Type ot = arrayInstruction.getType(cpg);
UnresolvedType ut = fromBcel(ot);
ut = UnresolvedType.makeArray(ut,1);
retval = MemberImpl.method(ut, Modifier.PUBLIC, ResolvedType.VOID, "<init>", new ResolvedType[]{ResolvedType.INT});
-
} else if (i instanceof MULTIANEWARRAY) {
MULTIANEWARRAY arrayInstruction = (MULTIANEWARRAY)i;
UnresolvedType ut = null;