Community
Participate
Working Groups
The following styles of array references with type annotations need some work: // inner types with multi dimensional arrays @B AA.@A BB[] @C[] field; Object o = new @B(1) Outer.@B(2) Inner @B(3) [2]; Object o = new @B(1) Outer.@B(2) Inner @B(3) [2] @B(4)[4]; // new multi dim array with initializer X[][] x = new @A X @B [] @C[]{ { null }, { null } }; // new multi dim X[][] x = new @A X @B [1] @C[2]; // new multi dim, not all dimensions specified X [][][] x = new @A X @B[10] @C[10] @D[]; // fully qualified names when inner types and multi dim arrays in use Object o = new org.foo.bar.@B(1) Outer.@B(2) Inner @B(3) [2] @B(4)[4];
Created attachment 231761 [details] Patch including tests and fixes Multiple new tests in TypeAnnotationTests for those problematic variants. Changes to Annotation such that it builds the type path correctly for these case and one small change in TypeAnnotationCodeStream to pass over the dimensions rather than just assuming 1.
*** Bug 409248 has been marked as a duplicate of this bug. ***
Fix and tests released via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=cf1c51fea432a69f6f934132d762d7abff4de048. While comparing the behavior of 8b100 javac, I can see quite a way instances where javac is imprecise in code generation. Thanks for the extra care that has gone into this effort, Andy.