mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8028389: NullPointerException compiling annotation values that have bodies
Made sure anonymous class declarations inside class- and package-level annotations are properly entered. Reviewed-by: jfranck
This commit is contained in:
parent
e32b40185e
commit
a76d1ab5a2
8 changed files with 85 additions and 6 deletions
13
langtools/test/tools/javac/annotations/neg/AnonSubclass.java
Normal file
13
langtools/test/tools/javac/annotations/neg/AnonSubclass.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8028389
|
||||
* @summary javac should output a proper error message when given something
|
||||
* like new Object(){} as annotation argument.
|
||||
*
|
||||
* @compile/fail/ref=AnonSubclass.out -XDrawDiagnostics AnonSubclass.java
|
||||
*/
|
||||
|
||||
@AnonSubclass(new Object(){})
|
||||
@interface AnonSubclass {
|
||||
String value();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue