diff -r 9b4c916633f8 -r 4e6a73cb55da test/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java --- a/test/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java Fri Mar 11 13:00:33 2016 +0100 +++ b/test/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java Mon Mar 14 15:04:57 2016 -0700 @@ -23,7 +23,7 @@ /* * @test - * @bug 8005091 8009686 8025633 8026567 6469562 + * @bug 8005091 8009686 8025633 8026567 6469562 8071982 8071984 * @summary Make sure that type annotations are displayed correctly * @author Bhavesh Patel * @library ../lib @@ -355,5 +355,369 @@ checkOutput("typeannos/Generic2.html", true, "
void test2(@RcvrA Generic2<X> this)"); + + + // Test for repeated type annotations (RepeatedAnnotations.java). + checkOutput("typeannos/RepeatingAtClassLevel.html", true, + "
@RepTypeA @RepTypeA\n"
+ + "@RepTypeB @RepTypeB\nclass RepeatingAtClassLevel\nextends "
+ + "java.lang.Object
");
+
+// @ignore 8146008
+// checkOutput("typeannos/RepeatingAtClassLevel2.html", true,
+// "@RepTypeUseA @RepTypeUseA\n@RepTypeUseB @RepTypeUseB\nclass RepeatingAtClassLevel2\nextends "
+// + "java.lang.Object
");
+//
+// checkOutput("typeannos/RepeatingAtClassLevel2.html", true,
+// "@RepAllContextsA @RepAllContextsA\n@RepAllContextsB @RepAllContextsB\n"
+// + "class RepeatingAtClassLevel3\n"
+// + "extends java.lang.Object
");
+
+ checkOutput("typeannos/RepeatingOnConstructor.html", true,
+ "@RepConstructorA @RepConstructorA\n@RepConstructorB @RepConstructorB\n" + + "RepeatingOnConstructor()", + + "
@RepConstructorA @RepConstructorA\n@RepConstructorB @RepConstructorB\n" + + "RepeatingOnConstructor(int i,\n int j)", + + "
@RepAllContextsA @RepAllContextsA\n" + + "@RepAllContextsB @RepAllContextsB\n" + + "RepeatingOnConstructor(int i,\n int j,\n" + + " int k)", + + "
RepeatingOnConstructor(@RepParameterA @RepParameterA @RepParameterB " + + "@RepParameterB\n java.lang.String parameter,\n" + + " @RepParameterA " + + "@RepParameterA @RepParameterB " + + "@RepParameterB\n java.lang.String " + + "" + + "@RepTypeUseA @RepTypeUseA @RepTypeUseB " + + "" + + "@RepTypeUseB ... vararg)" + ); + + checkOutput("typeannos/RepeatingOnConstructor.Inner.html", true, + "
Inner"
+ + "(java.lang.String parameter,\n java.lang.String "
+ + "@RepTypeUseA @RepTypeUseA @RepTypeUseB "
+ + "@RepTypeUseB ... vararg)
",
+
+ "Inner("
+ + "@RepTypeUseA @RepTypeUseA @RepTypeUseB "
+ + "@RepTypeUseB RepeatingOnConstructor this,\n "
+ + "@RepParameterA @RepParameterA @RepParameterB "
+ + "@RepParameterB\n java.lang.String parameter,\n"
+ + " "
+ + "@RepParameterA @RepParameterA @RepParameterB "
+ + "@RepParameterB\n java.lang.String @RepTypeUseA "
+ + "@RepTypeUseA @RepTypeUseB @RepTypeUseB ... vararg)");
+
+ checkOutput("typeannos/RepeatingOnField.html", true,
+ "(package private) java.lang.Integer
\ni1
",
+
+ "(package private) @RepTypeUseA "
+ + "@RepTypeUseA @RepTypeUseB @RepTypeUseB java.lang.Integer
i2
",
+
+ "(package private) @RepTypeUseA @RepTypeUseA "
+ + "@RepTypeUseB @RepTypeUseB java.lang.Integer
"
+ + ""
+ + "i3
",
+
+ "(package private) @RepAllContextsA @RepAllContextsA "
+ + "@RepAllContextsB @RepAllContextsB java.lang.Integer
"
+ + ""
+ + "i4
",
+
+ "(package private) java.lang.String @RepTypeUseA "
+ + "@RepTypeUseA @RepTypeUseB @RepTypeUseB [] "
+ + "@RepTypeUseA @RepTypeUseA @RepTypeUseB "
+ + "@RepTypeUseB []
sa
",
+
+ "" + + "@RepFieldA @RepFieldA\n@RepFieldB " + + "@RepFieldB\njava.lang.Integer i1", + + "
@RepTypeUseA @RepTypeUseA " + + "" + + "@RepTypeUseB @RepTypeUseB java.lang.Integer i2", + + "
" + + "@RepFieldA @RepFieldA\n@RepFieldB " + + "@RepFieldB\n@RepTypeUseA @RepTypeUseA " + + "@RepTypeUseB @RepTypeUseB java.lang.Integer i3", + + "
" + + "@RepAllContextsA @RepAllContextsA\n" + + "@RepAllContextsB @RepAllContextsB\n" + + "" + + "@RepAllContextsA @RepAllContextsA " + + "@RepAllContextsB @RepAllContextsB java.lang.Integer i4", + + "
java.lang.String @RepTypeUseA @RepTypeUseA " + + "@RepTypeUseB @RepTypeUseB [] " + + "@RepTypeUseA @RepTypeUseA @RepTypeUseB " + + "@RepTypeUseB [] sa"); + + checkOutput("typeannos/RepeatingOnMethod.html", true, + "
(package private) java.lang.String
test1()
",
+
+ "(package private) @RepTypeUseA "
+ + "@RepTypeUseA @RepTypeUseB @RepTypeUseB java.lang.String
"
+ + ""
+ + "test2"
+ + "()
",
+
+ "(package private) @RepTypeUseA "
+ + "@RepTypeUseA @RepTypeUseB @RepTypeUseB java.lang.String
"
+ + ""
+ + "test3"
+ + "()
",
+
+ "(package private) @RepAllContextsA "
+ + "@RepAllContextsA @RepAllContextsB "
+ + "@RepAllContextsB java.lang.String
test4()
",
+
+ "test5"
+ + "(java.lang.String parameter,\n java.lang.String "
+ + "@RepTypeUseA @RepTypeUseA @RepTypeUseB "
+ + "@RepTypeUseB ... vararg)
",
+
+ ""
+ + "@RepMethodA @RepMethodA\n@RepMethodB "
+ + "@RepMethodB\njava.lang.String test1()",
+
+ ""
+ + "@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB java.lang.String test2()",
+
+ ""
+ + "@RepMethodA @RepMethodA\n@RepMethodB "
+ + "@RepMethodB\n@RepTypeUseA @RepTypeUseA "
+ + "@RepTypeUseB @RepTypeUseB java.lang.String test3()",
+
+ ""
+ + "@RepAllContextsA @RepAllContextsA\n"
+ + "@RepAllContextsB @RepAllContextsB\n"
+ + "@RepAllContextsA @RepAllContextsA "
+ + "@RepAllContextsB @RepAllContextsB java.lang.String test4()",
+
+ "java.lang.String test5(@RepTypeUseA "
+ + "@RepTypeUseA @RepTypeUseB @RepTypeUseB RepeatingOnMethod "
+ + "this,\n @RepParameterA "
+ + "@RepParameterA @RepParameterB "
+ + "@RepParameterB\n java.lang.String parameter,\n"
+ + " @RepParameterA @RepParameterA "
+ + "@RepParameterB @RepParameterB\n "
+ + "java.lang.String @RepTypeUseA @RepTypeUseA "
+ + "@RepTypeUseB @RepTypeUseB ... vararg)");
+
+ checkOutput("typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html", true,
+ "(package private) <T> java.lang.String
genericMethod(T t)
",
+
+ "(package private) <T> java.lang.String
genericMethod2(@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB T t)
",
+
+ "(package private) java.lang.String
"
+ + "test()
",
+
+ "java.lang.String test(@RepTypeUseA "
+ + "@RepTypeUseA @RepTypeUseB @RepTypeUseB "
+ + "RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod<"
+ + "@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB T> this)");
+
+ checkOutput("typeannos/RepeatingOnVoidMethodDeclaration.html", true,
+ ""
+ + "@RepMethodA @RepMethodA\n@RepMethodB "
+ + "@RepMethodB\nvoid test()");
}
}
diff -r 9b4c916633f8 -r 4e6a73cb55da test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/RepeatedAnnotations.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/RepeatedAnnotations.java Mon Mar 14 15:04:57 2016 -0700
@@ -0,0 +1,346 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR RepeatingA PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+
+/*
+ * This class is partially replicated from test/tools/javac/annotations/typeAnnotations/classfile/CombinationsTargetTest1.java; CombinationsTargetTest2.java; CombinationsTargetTest3.java
+ */
+@RepTypeA @RepTypeA @RepTypeB @RepTypeB class RepeatingAtClassLevel {
+}
+
+@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB class RepeatingAtClassLevel2 {
+}
+
+@RepAllContextsA @RepAllContextsA @RepAllContextsB @RepAllContextsB class RepeatingAtClassLevel3 {
+}
+
+class RepeatingOnConstructor {
+
+ @RepConstructorA @RepConstructorA @RepConstructorB @RepConstructorB
+ RepeatingOnConstructor() {
+ }
+
+ @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB RepeatingOnConstructor(int i) {
+ }
+
+ @RepConstructorA @RepConstructorA @RepConstructorB @RepConstructorB
+ @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB RepeatingOnConstructor(int i, int j) {
+ }
+
+ @RepAllContextsA @RepAllContextsA @RepAllContextsB @RepAllContextsB RepeatingOnConstructor(int i, int j, int k) {
+ }
+
+ RepeatingOnConstructor(@RepParameterA @RepParameterA @RepParameterB @RepParameterB String parameter, @RepParameterA @RepParameterA @RepParameterB @RepParameterB String @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB ... vararg) {
+ }
+
+ class Inner {
+ Inner(@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB RepeatingOnConstructor RepeatingOnConstructor.this, @RepParameterA @RepParameterA @RepParameterB @RepParameterB String parameter, @RepParameterA @RepParameterA @RepParameterB @RepParameterB String @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB ... vararg) {
+ }
+ }
+}
+
+class RepeatingOnField {
+ @RepFieldA @RepFieldA @RepFieldB @RepFieldB
+ Integer i1;
+
+ @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB Integer i2;
+
+ @RepFieldA @RepFieldA @RepFieldB @RepFieldB
+ @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB Integer i3;
+
+ @RepAllContextsA @RepAllContextsA @RepAllContextsB @RepAllContextsB Integer i4;
+
+ String @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB [] @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB [] sa = null;
+}
+
+class RepeatingOnMethod {
+
+ @RepMethodA @RepMethodA @RepMethodB @RepMethodB
+ String test1() {
+ return null;
+ }
+
+ @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB String test2() {
+ return null;
+ }
+
+ @RepMethodA @RepMethodA @RepMethodB @RepMethodB
+ @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB String test3() {
+ return null;
+ }
+
+ @RepAllContextsA @RepAllContextsA @RepAllContextsB @RepAllContextsB String test4() {
+ return null;
+ }
+
+ String test5(@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB RepeatingOnMethod this, @RepParameterA @RepParameterA @RepParameterB @RepParameterB String parameter, @RepParameterA @RepParameterA @RepParameterB @RepParameterB String @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB ... vararg) {
+ return null;
+ }
+}
+
+class RepeatingOnTypeParametersBoundsTypeArgumentsOnClassDecl <@RepTypeParameterA @RepTypeParameterA @RepTypeParameterB @RepTypeParameterB T extends @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB Object> {
+
+