changeset 3235:792c10e66b63

Expand test cases to ensure that post-identifier and post-method array dimension annotations are stored correctly.
author wmdietl
date Tue, 04 Mar 2014 12:46:30 -0500
parents 36b65df33194
children 942a1e7cbb16
files test/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReturns.java
diffstat 2 files changed, 104 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java	Mon Mar 03 22:04:47 2014 -0500
+++ b/test/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java	Tue Mar 04 12:46:30 2014 -0500
@@ -77,6 +77,58 @@
         return "@TC String test @TA [] @TB [];";
     }
 
+    @TADescriptions({
+        @TADescription(annotation = "TA", type = FIELD),
+        @TADescription(annotation = "TB", type = FIELD,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TC", type = FIELD,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = FIELD,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String fieldAsArray2() {
+        return "@TD String @TA [] @TB [] @TC [] test;";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TC", type = FIELD),
+        @TADescription(annotation = "TA", type = FIELD,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TB", type = FIELD,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = FIELD,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String fieldAsArray2aOld() {
+        return "@TD String @TA [] @TB [] test @TC [];";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TB", type = FIELD),
+        @TADescription(annotation = "TC", type = FIELD,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TA", type = FIELD,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = FIELD,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String fieldAsArray2bOld() {
+        return "@TD String @TA [] test @TB [] @TC [];";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TA", type = FIELD),
+        @TADescription(annotation = "TB", type = FIELD,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TC", type = FIELD,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = FIELD,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String fieldAsArray2cOld() {
+        return "@TD String test @TA [] @TB [] @TC [];";
+    }
+
     @TADescriptions({})
     public String fieldWithDeclarationAnnotatin() {
         return "@Decl String test;";
--- a/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReturns.java	Mon Mar 03 22:04:47 2014 -0500
+++ b/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReturns.java	Tue Mar 04 12:46:30 2014 -0500
@@ -77,6 +77,58 @@
         return "@TC String test() @TA [] @TB [] { return null; }";
     }
 
+    @TADescriptions({
+        @TADescription(annotation = "TA", type = METHOD_RETURN),
+        @TADescription(annotation = "TB", type = METHOD_RETURN,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TC", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String methodReturnAsArray2() {
+        return "@TD String @TA [] @TB [] @TC [] test() { return null; }";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TC", type = METHOD_RETURN),
+        @TADescription(annotation = "TA", type = METHOD_RETURN,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TB", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String methodReturnAsArray2aOld() {
+        return "@TD String @TA [] @TB [] test() @TC [] { return null; } ";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TB", type = METHOD_RETURN),
+        @TADescription(annotation = "TC", type = METHOD_RETURN,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TA", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String methodReturnAsArray2bOld() {
+        return "@TD String @TA [] test() @TB [] @TC [] { return null; } ";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TA", type = METHOD_RETURN),
+        @TADescription(annotation = "TB", type = METHOD_RETURN,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TC", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String methodReturnAsArray2cOld() {
+        return "@TD String test() @TA [] @TB [] @TC [] { return null; } ";
+    }
+
     @TADescriptions({})
     public String methodWithDeclarationAnnotation() {
         return "@Decl String test() { return null; }";