aboutsummaryrefslogtreecommitdiff
path: root/test/tools/javac/annotations/testCrashNestedAnnos/TestCrashNestedAnnos.java
diff options
context:
space:
mode:
authorjfranck <none@none>2013-11-11 17:26:09 +0100
committerjfranck <none@none>2013-11-11 17:26:09 +0100
commitc7988919de73eb7a431be93055298b4613811e86 (patch)
treef3757268cbb5c0b3a9cb925abade928a6ca324ad /test/tools/javac/annotations/testCrashNestedAnnos/TestCrashNestedAnnos.java
parent415ca8aa977a85e4637c41a74603f73885fb5e44 (diff)
8027375: javac asserts on nested erroneous annotations
Summary: make sure JCAnnotation trees have type != null before annotation processing Reviewed-by: jjg
Diffstat (limited to 'test/tools/javac/annotations/testCrashNestedAnnos/TestCrashNestedAnnos.java')
-rw-r--r--test/tools/javac/annotations/testCrashNestedAnnos/TestCrashNestedAnnos.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/tools/javac/annotations/testCrashNestedAnnos/TestCrashNestedAnnos.java b/test/tools/javac/annotations/testCrashNestedAnnos/TestCrashNestedAnnos.java
new file mode 100644
index 00000000..5c7a4a33
--- /dev/null
+++ b/test/tools/javac/annotations/testCrashNestedAnnos/TestCrashNestedAnnos.java
@@ -0,0 +1,14 @@
+/* @test /nodynamiccopyright/
+ * @bug 8027375
+ * @summary Test that javac doesn't assert/crash when there are what looks to
+ * be annotations nested inside erroneous annotations.
+ * @compile/fail/ref=TestCrashNestedAnnos.out -XDrawDiagnostics TestCrashNestedAnnos.java
+ */
+public class TestCrashNestedAnnos {
+ // A and B are not annotation types
+ @A(@A1()) int foo() {}
+ @B(@B1()) int bar() {}
+}
+
+class B {}
+class B1 {}