Fri, 10 Jan 2014 12:47:15 +0100
8028389: NullPointerException compiling annotation values that have bodies
Summary: Made sure anonymous class declarations inside class- and package-level annotations are properly entered.
Reviewed-by: jfranck
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8028389
4 * @summary javac should output a proper error message when given something
5 * like new Object(){} as annotation argument.
6 *
7 * @compile/fail/ref=AnonSubclass.out -XDrawDiagnostics AnonSubclass.java
8 */
10 @AnonSubclass(new Object(){})
11 @interface AnonSubclass {
12 String value();
13 }