stEnv = enter.getEnv(c);
if (stEnv != null && env != stEnv) {
- if (dependencies.add(stEnv))
+ if (dependencies.add(stEnv)) {
scan(stEnv.tree);
+ }
+ envForSuperTypeFound = true;
}
+ st = types.supertype(st);
}
super.visitClassDef(node);
}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Wed Apr 17 21:50:43 2013 -0700
@@ -59,7 +59,6 @@
import com.sun.tools.javac.jvm.*;
import com.sun.tools.javac.jvm.ClassReader.BadClassFile;
import com.sun.tools.javac.main.JavaCompiler;
-import com.sun.tools.javac.main.JavaCompiler.CompileState;
import com.sun.tools.javac.model.JavacElements;
import com.sun.tools.javac.model.JavacTypes;
import com.sun.tools.javac.parser.*;
@@ -79,6 +78,7 @@
import com.sun.tools.javac.util.Options;
import static com.sun.tools.javac.code.Lint.LintCategory.PROCESSING;
import static com.sun.tools.javac.main.Option.*;
+import static com.sun.tools.javac.comp.CompileStates.CompileState;
import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*;
/**
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Wed Apr 17 21:50:43 2013 -0700
@@ -249,23 +249,6 @@
}
}
- /** Return true if a a tree corresponds to a poly expression. */
- public static boolean isPoly(JCTree tree, JCTree origin) {
- switch (tree.getTag()) {
- case APPLY:
- case NEWCLASS:
- case CONDEXPR:
- return !origin.hasTag(TYPECAST);
- case LAMBDA:
- case REFERENCE:
- return true;
- case PARENS:
- return isPoly(((JCParens)tree).expr, origin);
- default:
- return false;
- }
- }
-
/** set 'polyKind' on given tree */
public static void setPolyKind(JCTree tree, PolyKind pkind) {
switch (tree.getTag()) {
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/src/share/classes/com/sun/tools/javadoc/AbstractTypeImpl.java
--- a/langtools/src/share/classes/com/sun/tools/javadoc/AbstractTypeImpl.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/AbstractTypeImpl.java Wed Apr 17 21:50:43 2013 -0700
@@ -61,6 +61,10 @@
return type.tsym.getQualifiedName().toString();
}
+ public com.sun.javadoc.Type getElementType() {
+ return null;
+ }
+
public String simpleTypeName() {
return type.tsym.name.toString();
}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Wed Apr 17 21:50:43 2013 -0700
@@ -108,6 +108,10 @@
this.tsym = sym;
}
+ public com.sun.javadoc.Type getElementType() {
+ return null;
+ }
+
/**
* Returns the flags in terms of javac's flags
*/
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java Wed Apr 17 21:50:43 2013 -0700
@@ -199,22 +199,15 @@
return result;
}
- public AnnotationDesc[] receiverAnnotations() {
- // TODO: change how receiver annotations are output!
+ /**
+ * Get the receiver type of this executable element.
+ *
+ * @return the receiver type of this executable element.
+ * @since 1.8
+ */
+ public com.sun.javadoc.Type receiverType() {
Type recvtype = sym.type.asMethodType().recvtype;
- if (recvtype == null) {
- return new AnnotationDesc[0];
- }
- if (!recvtype.isAnnotated()) {
- return new AnnotationDesc[0];
- }
- List extends Compound> typeAnnos = ((com.sun.tools.javac.code.Type.AnnotatedType)recvtype).typeAnnotations;
- AnnotationDesc result[] = new AnnotationDesc[typeAnnos.length()];
- int i = 0;
- for (Attribute.Compound a : typeAnnos) {
- result[i++] = new AnnotationDescImpl(env, a);
- }
- return result;
+ return (recvtype != null) ? TypeMaker.getType(env, recvtype, false, true) : null;
}
/**
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/src/share/classes/com/sun/tools/javadoc/PrimitiveType.java
--- a/langtools/src/share/classes/com/sun/tools/javadoc/PrimitiveType.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/PrimitiveType.java Wed Apr 17 21:50:43 2013 -0700
@@ -63,6 +63,10 @@
return name;
}
+ public com.sun.javadoc.Type getElementType() {
+ return null;
+ }
+
/**
* Return qualified name of type excluding any dimension information.
*
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java
--- a/langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java Wed Apr 17 21:50:43 2013 -0700
@@ -222,6 +222,10 @@
private com.sun.javadoc.Type skipArraysCache = null;
+ public com.sun.javadoc.Type getElementType() {
+ return TypeMaker.getType(env, env.types.elemtype(arrayType));
+ }
+
private com.sun.javadoc.Type skipArrays() {
if (skipArraysCache == null) {
Type t;
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,421 @@
+/*
+ * Copyright (c) 2013, 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 A 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.
+ */
+
+/*
+ * @test
+ * @bug 8005091 8009686
+ * @summary Make sure that type annotations are displayed correctly
+ * @author Bhavesh Patel
+ * @library ../lib/
+ * @build JavadocTester TestTypeAnnotations
+ * @run main TestTypeAnnotations
+ */
+
+public class TestTypeAnnotations extends JavadocTester {
+
+ //Test information.
+ private static final String BUG_ID = "8005091-8009686";
+
+ //Javadoc arguments.
+ private static final String[] ARGS = new String[] {
+ "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "typeannos"
+ };
+
+ //Input for string search tests.
+ private static final String[][] NEGATED_TEST = NO_TEST;
+ private static final String[][] TEST = {
+ // Test for type annotations on Class Extends (ClassExtends.java).
+ /* @ignore 8012173
+ {BUG_ID + FS + "typeannos" + FS + "MyClass.html",
+ "extends @ClassExtA ParameterizedClass<" +
+ "@ClassExtB java.lang.String>"
+ },
+ */
+ /* @ignore 8012173
+ {BUG_ID + FS + "typeannos" + FS + "MyClass.html",
+ "implements @ClassExtB java.lang.CharSequence, " +
+ "@ClassExtA ParameterizedInterface<" +
+ "@ClassExtB java.lang.String>"
+ },
+ */
+ /* @ignore 8012173
+ {BUG_ID + FS + "typeannos" + FS + "MyInterface.html",
+ "extends @ClassExtA " +
+ "ParameterizedInterface<@ClassExtA java.lang.String>, " +
+ "@ClassExtB java.lang.CharSequence"
+ },
+ */
+
+ // Test for type annotations on Class Parameters (ClassParameters.java).
+ {BUG_ID + FS + "typeannos" + FS + "ExtendsBound.html",
+ "class ExtendsBound<K extends @ClassParamA java.lang.String>"
+ },
+ /* @ignore 8012173
+ {BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html",
+ "
class ExtendsGeneric<K extends " +
+ "@ClassParamA Unannotated<" +
+ "@ClassParamB java.lang.String>>"
+ },
+ */
+ {BUG_ID + FS + "typeannos" + FS + "TwoBounds.html",
+ " class TwoBounds<K extends " +
+ "@ClassParamA java.lang.String,V extends @ClassParamB" +
+ " java.lang.String>"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "Complex1.html",
+ "class Complex1<K extends " +
+ "@ClassParamA java.lang.String & java.lang.Runnable>"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "Complex2.html",
+ "class Complex2<K extends java.lang." +
+ "String & @ClassParamB java.lang.Runnable>"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "ComplexBoth.html",
+ "class ComplexBoth<K extends @ClassParamA java.lang.String & @ClassParamA" +
+ " java.lang.Runnable>"
+ },
+
+ // Test for type annotations on fields (Fields.java).
+ /* @ignore 8012173
+ {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html",
+ "Parameterized<@FldA java.lang.String," +
+ "@FldB java.lang.String> bothTypeArgs
"
+ },
+ */
+ {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html",
+ "@FldA java.lang.String @FldB [] " +
+ "array1Deep
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html",
+ "java.lang.String[] @FldB [] array2SecondOld
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html",
+ "@FldD java.lang.String @FldC @FldA" +
+ " [] @FldC @FldB [] array2Deep
"
+ },
+ /* @ignore 8012173
+ {BUG_ID + FS + "typeannos" + FS + "ModifiedScoped.html",
+ "public final Parameterized<@FldA " +
+ "Parameterized<@FldA java.lang.String," +
+ "@FldB java.lang.String>,@FldB java.lang.String> " +
+ "nestedParameterized
"
+ },
+ */
+ {BUG_ID + FS + "typeannos" + FS + "ModifiedScoped.html",
+ "public final @FldA java.lang.String[][] " +
+ "array2
"
+ },
+
+ // Test for type annotations on method return types (MethodReturnType.java).
+ {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html",
+ "public <T> @MRtnA java.lang.String" +
+ " method()
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html",
+ "@MRtnA java.lang.String @MRtnA [] " +
+ "@MRtnB [] array2Deep()
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html",
+ "@MRtnA java.lang.String[][] array2()
"
+ },
+ /* @ignore 8012173
+ {BUG_ID + FS + "typeannos" + FS + "MtdModifiedScoped.html",
+ "public final MtdParameterized<@MRtnA " +
+ "MtdParameterized<@MRtnA java.lang." +
+ "String,@MRtnB java.lang.String>,@MRtnB java." +
+ "lang.String> nestedMtdParameterized()
"
+ },
+ */
+
+ // Test for type annotations on method type parameters (MethodTypeParameters.java).
+ {BUG_ID + FS + "typeannos" + FS + "UnscopedUnmodified.html",
+ "<K extends @MTyParamA java.lang.String>" +
+ " void methodExtends()
"
+ },
+ /* @ignore 8012173
+ {BUG_ID + FS + "typeannos" + FS + "UnscopedUnmodified.html",
+ "<K extends @MTyParamA " +
+ "MtdTyParameterized<@MTyParamB java.lang.String" +
+ ">> void nestedExtends()
"
+ },
+ */
+ {BUG_ID + FS + "typeannos" + FS + "PublicModifiedMethods.html",
+ "public final <K extends @MTyParamA " +
+ "java.lang.String> void methodExtends()
"
+ },
+ /* @ignore 8012173
+ {BUG_ID + FS + "typeannos" + FS + "PublicModifiedMethods.html",
+ "public final <K extends @MTyParamA " +
+ "java.lang.String,V extends @MTyParamA " +
+ "MtdTyParameterized<@MTyParamB java.lang.String" +
+ ">> void dual()
"
+ },
+ */
+
+ // Test for type annotations on parameters (Parameters.java).
+ {BUG_ID + FS + "typeannos" + FS + "Parameters.html",
+ "void unannotated(" +
+ "ParaParameterized<java.lang.String,java.lang.String>" +
+ " a)
"
+ },
+ /* @ignore 8012173
+ {BUG_ID + FS + "typeannos" + FS + "Parameters.html",
+ "void nestedParaParameterized(" +
+ "ParaParameterized<@ParamA " +
+ "ParaParameterized<@ParamA java.lang.String," +
+ "@ParamB java.lang.String>,@ParamB" +
+ " java.lang.String> a)
"
+ },
+ */
+ {BUG_ID + FS + "typeannos" + FS + "Parameters.html",
+ "void array2Deep(@ParamA java.lang.String " +
+ "@ParamA [] @ParamB [] a)
"
+ },
+
+ // Test for type annotations on throws (Throws.java).
+ {BUG_ID + FS + "typeannos" + FS + "ThrDefaultUnmodified.html",
+ "void oneException()" + NL +
+ " throws @ThrA java.lang.Exception
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "ThrDefaultUnmodified.html",
+ "void twoExceptions()" + NL +
+ " throws @ThrA java.lang.RuntimeException," + NL +
+ " @ThrA java.lang.Exception
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "ThrPublicModified.html",
+ "public final void oneException(java.lang.String a)" + NL +
+ " throws @ThrA java.lang.Exception
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "ThrPublicModified.html",
+ "public final void twoExceptions(java.lang.String a)" + NL +
+ " throws @ThrA java.lang.RuntimeException," + NL +
+ " @ThrA java.lang.Exception
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "ThrWithValue.html",
+ "void oneException()" + NL +
+ " throws @ThrB(value=\"m\") java.lang.Exception
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "ThrWithValue.html",
+ "void twoExceptions()" + NL +
+ " throws @ThrB(value=\"m\") java.lang.RuntimeException," + NL +
+ " @ThrA java.lang.Exception
"
+ },
+
+ // Test for type annotations on type parameters (TypeParameters.java).
+ {BUG_ID + FS + "typeannos" + FS + "TestMethods.html",
+ "<K,V extends @TyParaA java.lang.String> " +
+ "void secondAnnotated()
"
+ },
+
+ // Test for type annotations on wildcard type (Wildcards.java).
+ {BUG_ID + FS + "typeannos" + FS + "BoundTest.html",
+ "void wcExtends(MyList<? extends @WldA" +
+ " java.lang.String> l)
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "BoundTest.html",
+ "MyList<? super @WldA java.lang.String>" +
+ " returnWcSuper()
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "BoundWithValue.html",
+ "void wcSuper(MyList<? super @WldB(value=\"m\") java.lang." +
+ "String> l)
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "BoundWithValue.html",
+ "MyList<? extends @WldB(value=\"m\") java.lang.String" +
+ "> returnWcExtends()
"
+ },
+
+ // Test for receiver annotations (Receivers.java).
+ {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html",
+ "void withException(@RcvrA " +
+ "DefaultUnmodified this)" + NL + " throws java." +
+ "lang.Exception
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html",
+ "java.lang.String nonVoid(@RcvrA @RcvrB" +
+ "(value=\"m\")" +
+ " DefaultUnmodified this)
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html",
+ "<T extends java.lang.Runnable> void accept(" +
+ "@RcvrA DefaultUnmodified this," + NL +
+ " T r)" + NL +
+ " throws java.lang.Exception
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "PublicModified.html",
+ "public final java.lang.String nonVoid(" +
+ "@RcvrA PublicModified this)
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "PublicModified.html",
+ "public final <T extends java.lang.Runnable> " +
+ "void accept(@RcvrA PublicModified this," + NL +
+ " T r)" + NL +
+ " throws java.lang.Exception
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "WithValue.html",
+ "<T extends java.lang.Runnable> void accept(" +
+ "@RcvrB(" +
+ "value=\"m\") WithValue this," + NL +
+ " T r)" + NL +
+ " throws java.lang.Exception
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "WithFinal.html",
+ "java.lang.String nonVoid(@RcvrB(value=\"m\") WithFinal" +
+ " this)
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "WithBody.html",
+ "void field(@RcvrA WithBody this)
"
+ },
+ {BUG_ID + FS + "typeannos" + FS + "Generic2.html",
+ "void test2(@RcvrA Generic2<X> this)
"
+ }
+ };
+
+ /**
+ * The entry point of the test.
+ * @param args the array of command line arguments.
+ */
+ public static void main(String[] args) {
+ TestTypeAnnotations tester = new TestTypeAnnotations();
+ run(tester, ARGS, TEST, NEGATED_TEST);
+ tester.printSummary();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBugId() {
+ return BUG_ID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBugName() {
+ return getClass().getName();
+ }
+}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassExtends.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassExtends.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+abstract class MyClass extends @ClassExtA ParameterizedClass<@ClassExtB String>
+ implements @ClassExtB CharSequence, @ClassExtA ParameterizedInterface<@ClassExtB String> { }
+
+interface MyInterface extends @ClassExtA ParameterizedInterface<@ClassExtA String>,
+ @ClassExtB CharSequence { }
+
+class ParameterizedClass {}
+interface ParameterizedInterface {}
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ClassExtA {}
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ClassExtB {}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassParameters.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassParameters.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class Unannotated { }
+
+class ExtendsBound { }
+class ExtendsGeneric> { }
+class TwoBounds { }
+
+class Complex1 { }
+class Complex2 { }
+class ComplexBoth { }
+
+class ClassParamOuter {
+ void inner() {
+ class LUnannotated { }
+
+ class LExtendsBound { }
+ class LExtendsGeneric> { }
+ class LTwoBounds { }
+
+ class LComplex1 { }
+ class LComplex2 { }
+ class LComplexBoth { }
+ }
+}
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ClassParamA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ClassParamB { }
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Fields.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Fields.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class DefaultScope {
+ Parameterized unannotated;
+ Parameterized<@FldA String, String> firstTypeArg;
+ Parameterized secondTypeArg;
+ Parameterized<@FldA String, @FldB String> bothTypeArgs;
+
+ Parameterized<@FldA Parameterized<@FldA String, @FldB String>, @FldB String>
+ nestedParameterized;
+
+ @FldA String [] array1;
+ @FldA String @FldB [] array1Deep;
+ @FldA String [] [] array2;
+ @FldD String @FldC @FldA [] @FldC @FldB [] array2Deep;
+ String @FldA [] [] array2First;
+ String [] @FldB [] array2Second;
+
+ // Old-style array syntax
+ String array2FirstOld @FldA [];
+ String array2SecondOld [] @FldB [];
+}
+
+class ModifiedScoped {
+ public final Parameterized unannotated = null;
+ public final Parameterized<@FldA String, String> firstTypeArg = null;
+ public final Parameterized secondTypeArg = null;
+ public final Parameterized<@FldA String, @FldB String> bothTypeArgs = null;
+
+ public final Parameterized<@FldA Parameterized<@FldA String, @FldB String>, @FldB String>
+ nestedParameterized = null;
+
+ public final @FldA String [] array1 = null;
+ public final @FldA String @FldB [] array1Deep = null;
+ public final @FldA String [] [] array2 = null;
+ public final @FldA String @FldA [] @FldB [] array2Deep = null;
+ public final String @FldA [] [] array2First = null;
+ public final String [] @FldB [] array2Second = null;
+}
+
+class Parameterized { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface FldA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface FldB { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface FldC { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface FldD { }
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodReturnType.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodReturnType.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class MtdDefaultScope {
+ MtdParameterized unannotated() { return null; }
+ MtdParameterized<@MRtnA String, String> firstTypeArg() { return null; }
+ MtdParameterized secondTypeArg() { return null; }
+ MtdParameterized<@MRtnA String, @MRtnB String> bothTypeArgs() { return null; }
+
+ MtdParameterized<@MRtnA MtdParameterized<@MRtnA String, @MRtnB String>, @MRtnB String>
+ nestedMtdParameterized() { return null; }
+
+ public @MRtnA String method() { return null; }
+
+ @MRtnA String [] array1() { return null; }
+ @MRtnA String @MRtnB [] array1Deep() { return null; }
+ @MRtnA String [] [] array2() { return null; }
+ @MRtnA String @MRtnA [] @MRtnB [] array2Deep() { return null; }
+ String @MRtnA [] [] array2First() { return null; }
+ String [] @MRtnB [] array2Second() { return null; }
+
+ // Old-style array syntax
+ String array2FirstOld() @MRtnA [] { return null; }
+ String array2SecondOld() [] @MRtnB [] { return null; }
+}
+
+class MtdModifiedScoped {
+ public final MtdParameterized unannotated() { return null; }
+ public final MtdParameterized<@MRtnA String, String> firstTypeArg() { return null; }
+ public final MtdParameterized secondTypeArg() { return null; }
+ public final MtdParameterized<@MRtnA String, @MRtnB String> bothTypeArgs() { return null; }
+
+ public final MtdParameterized<@MRtnA MtdParameterized<@MRtnA String, @MRtnB String>, @MRtnB String>
+ nestedMtdParameterized() { return null; }
+
+ public final @MRtnA String [] array1() { return null; }
+ public final @MRtnA String @MRtnB [] array1Deep() { return null; }
+ public final @MRtnA String [] [] array2() { return null; }
+ public final @MRtnA String @MRtnA [] @MRtnB [] array2Deep() { return null; }
+ public final String @MRtnA [] [] array2First() { return null; }
+ public final String [] @MRtnB [] array2Second() { return null; }
+}
+
+class MtdParameterized { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface MRtnA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface MRtnB { }
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodTypeParameters.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodTypeParameters.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class UnscopedUnmodified {
+ void methodExtends() {}
+ > void nestedExtends() {}
+ > void dual() {}
+ > void dualOneAnno() {}
+}
+
+class PublicModifiedMethods {
+ public final void methodExtends() {}
+ public final > void nestedExtends() {}
+ public final > void dual() {}
+ public final > void dualOneAnno() {}
+}
+
+class MtdTyParameterized { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface MTyParamA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface MTyParamB { }
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Parameters.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Parameters.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class Parameters {
+ void unannotated(ParaParameterized a) {}
+ void firstTypeArg(ParaParameterized<@ParamA String, String> a) {}
+ void secondTypeArg(ParaParameterized a) {}
+ void bothTypeArgs(ParaParameterized<@ParamA String, @ParamB String> both) {}
+
+ void nestedParaParameterized(ParaParameterized<@ParamA ParaParameterized<@ParamA String, @ParamB String>, @ParamB String> a) {}
+
+ void array1(@ParamA String [] a) {}
+ void array1Deep(@ParamA String @ParamB [] a) {}
+ void array2(@ParamA String [] [] a) {}
+ void array2Deep(@ParamA String @ParamA [] @ParamB [] a) {}
+ void array2First(String @ParamA [] [] a) {}
+ void array2Second(String [] @ParamB [] a) {}
+}
+
+class ParaParameterized { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ParamA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ParamB { }
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Receivers.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Receivers.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class DefaultUnmodified {
+ void plain(@RcvrA DefaultUnmodified this) { }
+ void generic(@RcvrA DefaultUnmodified this) { }
+ void withException(@RcvrA DefaultUnmodified this) throws Exception { }
+ String nonVoid(@RcvrA @RcvrB("m") DefaultUnmodified this) { return null; }
+ void accept(@RcvrA DefaultUnmodified this, T r) throws Exception { }
+}
+
+class PublicModified {
+ public final void plain(@RcvrA PublicModified this) { }
+ public final void generic(@RcvrA PublicModified this) { }
+ public final void withException(@RcvrA PublicModified this) throws Exception { }
+ public final String nonVoid(@RcvrA PublicModified this) { return null; }
+ public final void accept(@RcvrA PublicModified this, T r) throws Exception { }
+}
+
+class WithValue {
+ void plain(@RcvrB("m") WithValue this) { }
+ void generic(@RcvrB("m") WithValue this) { }
+ void withException(@RcvrB("m") WithValue this) throws Exception { }
+ String nonVoid(@RcvrB("m") WithValue this) { return null; }
+ void accept(@RcvrB("m") WithValue this, T r) throws Exception { }
+}
+
+class WithFinal {
+ void plain(final @RcvrB("m") WithFinal this) { }
+ void generic(final @RcvrB("m") WithFinal this) { }
+ void withException(final @RcvrB("m") WithFinal this) throws Exception { }
+ String nonVoid(final @RcvrB("m") WithFinal this) { return null; }
+ void accept(final @RcvrB("m") WithFinal this, T r) throws Exception { }
+}
+
+class WithBody {
+ Object f;
+
+ void field(@RcvrA WithBody this) {
+ this.f = null;
+ }
+ void meth(@RcvrA WithBody this) {
+ this.toString();
+ }
+}
+
+class Generic1 {
+ void test1(Generic1 this) {}
+ void test2(@RcvrA Generic1 this) {}
+ void test3(Generic1<@RcvrA X> this) {}
+ void test4(@RcvrA Generic1<@RcvrA X> this) {}
+}
+
+class Generic2<@RcvrA X> {
+ void test1(Generic2 this) {}
+ void test2(@RcvrA Generic2 this) {}
+ void test3(Generic2<@RcvrA X> this) {}
+ void test4(@RcvrA Generic2<@RcvrA X> this) {}
+}
+
+class Generic3 {
+ void test1(Generic3 this) {}
+ void test2(@RcvrA Generic3 this) {}
+ void test3(Generic3<@RcvrA X> this) {}
+ void test4(@RcvrA Generic3<@RcvrA X> this) {}
+}
+
+class Generic4 {
+ void test1(Generic4 this) {}
+ void test2(@RcvrA Generic4 this) {}
+ void test3(Generic4<@RcvrA X> this) {}
+ void test4(@RcvrA Generic4<@RcvrA X> this) {}
+}
+
+class Outer {
+ class Inner {
+ void none(Outer.Inner this) {}
+ void outer(@RcvrA Outer.Inner this) {}
+ void inner(Outer. @RcvrB("i") Inner this) {}
+ void both(@RcvrA Outer.@RcvrB("i") Inner this) {}
+
+ void innerOnlyNone(Inner this) {}
+ void innerOnly(@RcvrA Inner this) {}
+ }
+}
+
+class GenericOuter {
+ class GenericInner {
+ void none(GenericOuter.GenericInner this) {}
+ void outer(@RcvrA GenericOuter.GenericInner this) {}
+ void inner(GenericOuter. @RcvrB("i") GenericInner this) {}
+ void both(@RcvrA GenericOuter.@RcvrB("i") GenericInner this) {}
+
+ void innerOnlyNone(GenericInner this) {}
+ void innerOnly(@RcvrA GenericInner this) {}
+ }
+}
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface RcvrA {}
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface RcvrB { String value(); }
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Throws.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Throws.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class ThrDefaultUnmodified {
+ void oneException() throws @ThrA Exception {}
+ void twoExceptions() throws @ThrA RuntimeException, @ThrA Exception {}
+}
+
+class ThrPublicModified {
+ public final void oneException(String a) throws @ThrA Exception {}
+ public final void twoExceptions(String a) throws @ThrA RuntimeException, @ThrA Exception {}
+}
+
+class ThrWithValue {
+ void oneException() throws @ThrB("m") Exception {}
+ void twoExceptions() throws @ThrB(value="m") RuntimeException, @ThrA Exception {}
+}
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ThrA {}
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ThrB { String value(); }
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/TypeParameters.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/TypeParameters.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class TypUnannotated { }
+class OneAnnotated<@TyParaA K> { }
+class TwoAnnotated<@TyParaA K, @TyParaA V> { }
+class SecondAnnotated { }
+
+class TestMethods {
+ void unannotated() { }
+ <@TyParaA K> void oneAnnotated() { }
+ <@TyParaA K, @TyParaB("m") V> void twoAnnotated() { }
+ void secondAnnotated() { }
+}
+
+class UnannotatedB { }
+class OneAnnotatedB<@TyParaB("m") K> { }
+class TwoAnnotatedB<@TyParaB("m") K, @TyParaB("m") V> { }
+class SecondAnnotatedB { }
+
+class OneAnnotatedC<@TyParaC K> { }
+class TwoAnnotatedC<@TyParaC K, @TyParaC V> { }
+class SecondAnnotatedC { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface TyParaA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface TyParaB { String value(); }
+@Target(ElementType.TYPE_USE)
+@Documented
+@interface TyParaC { }
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Varargs.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Varargs.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface VarArgA {}
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class Varargs {
+
+ // Handle annotations on a varargs element type
+ void varargPlain(Object @VarArgA... objs) {
+ }
+
+ void varargGeneric(Class> @VarArgA ... clz) {
+ }
+}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Wildcards.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/typeannos/Wildcards.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2013, 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 A 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.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class BoundTest {
+ void wcExtends(MyList extends @WldA String> l) { }
+ void wcSuper(MyList super @WldA String> l) { }
+
+ MyList extends @WldA String> returnWcExtends() { return null; }
+ MyList super @WldA String> returnWcSuper() { return null; }
+ MyList extends @WldA MyList super @WldB("m") String>> complex() { return null; }
+}
+
+class BoundWithValue {
+ void wcExtends(MyList extends @WldB("m") String> l) { }
+ void wcSuper(MyList super @WldB(value="m") String> l) { }
+
+ MyList extends @WldB("m") String> returnWcExtends() { return null; }
+ MyList super @WldB(value="m") String> returnWcSuper() { return null; }
+ MyList extends @WldB("m") MyList super @WldB("m") String>> complex() { return null; }
+}
+
+class SelfTest {
+ void wcExtends(MyList<@WldA ?> l) { }
+ void wcSuper(MyList<@WldA ?> l) { }
+
+ MyList<@WldA ?> returnWcExtends() { return null; }
+ MyList<@WldA ?> returnWcSuper() { return null; }
+ MyList<@WldA ? extends @WldA MyList<@WldB("m") ?>> complex() { return null; }
+}
+
+class SelfWithValue {
+ void wcExtends(MyList<@WldB("m") ?> l) { }
+ void wcSuper(MyList<@WldB(value="m") ?> l) { }
+
+ MyList<@WldB("m") ?> returnWcExtends() { return null; }
+ MyList<@WldB(value="m") ?> returnWcSuper() { return null; }
+ MyList<@WldB("m") ? extends MyList<@WldB("m") ? super String>> complex() { return null; }
+}
+
+class MyList { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface WldA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface WldB { String value(); }
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java
--- a/langtools/test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java Wed Apr 17 21:50:43 2013 -0700
@@ -23,8 +23,9 @@
/*
* @test
- * @bug 5053846
+ * @bug 5053846 8011432
* @summary javac: MethodRef entries are duplicated in the constant pool
+ * @summary javac, compiler regression iterable + captured type
*/
import java.io.PrintWriter;
@@ -43,9 +44,13 @@
void run() {
check("-v", Paths.get(System.getProperty("test.classes"),
- "TestHelper1.class").toString());
+ this.getClass().getSimpleName() + "$TestHelper1.class").toString());
+ check("-v", Paths.get(System.getProperty("test.classes"),
+ this.getClass().getSimpleName() + "$TestHelper2.class").toString());
check("-v", Paths.get(System.getProperty("test.classes"),
- "TestHelper2.class").toString());
+ this.getClass().getSimpleName() + "$TestHelper3.class").toString());
+ check("-v", Paths.get(System.getProperty("test.classes"),
+ this.getClass().getSimpleName() + "$TestHelper4.class").toString());
}
void check(String... params) {
@@ -68,24 +73,38 @@
int end = out.indexOf("{");
return out.substring(start, end);
}
-}
-class TestHelper1 {
- void m() {
- Vector v = new Vector();
- Iterator iter = v.iterator();
- while (iter.hasNext()) {
- Object o = iter.next();
- Object o2 = o;
- }
- for (Object o: v) {
- Object o2 = o;
+ class TestHelper1 {
+ void m() {
+ Vector v = new Vector();
+ Iterator iter = v.iterator();
+ while (iter.hasNext()) {
+ Object o = iter.next();
+ Object o2 = o;
+ }
+ for (Object o: v) {
+ Object o2 = o;
+ }
}
}
-}
+
+ class TestHelper2> {
+ void test(X x) {
+ for (String s : x) { }
+ }
+ }
+
+ interface Data extends Iterable {}
-class TestHelper2> {
- void test(X x) {
- for (String s : x) { }
+ class TestHelper3> {
+ void test(X x) {
+ for (Data s : x) { }
+ }
+ }
+
+ class TestHelper4 {
+ void test(Iterable extends Data> t) {
+ for(Object a: t.iterator().next());
+ }
}
}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/T8010659/CompilerCrashWhenMixingBinariesAndSourcesTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8010659/CompilerCrashWhenMixingBinariesAndSourcesTest.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2013, 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. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 A 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.
+ */
+
+/*
+ * @test
+ * @bug 8010659
+ * @summary Javac Crashes while building OpenJFX
+ * @library /tools/javac/lib
+ * @build ToolBox
+ * @run main CompilerCrashWhenMixingBinariesAndSourcesTest
+ */
+
+public class CompilerCrashWhenMixingBinariesAndSourcesTest {
+ private static final String ASource =
+ "class A {\n" +
+ " void test() {new B(){};}\n" +
+ "}";
+ private static final String BSource =
+ "class B extends C {}";
+ private static final String CSource =
+ "class C extends D {\n" +
+ " String m(int i) {return null;}\n" +
+ "}";
+ private static final String DSource =
+ "class D {\n" +
+ " Object m(int i) {return null;}\n" +
+ "}";
+
+ public static void main (String[] args) throws Exception{
+ ToolBox.JavaToolArgs javacParams = new ToolBox.JavaToolArgs()
+ .setSources(ASource, BSource, CSource, DSource);
+ ToolBox.javac(javacParams);
+
+ ToolBox.rm("A.class");
+ ToolBox.rm("A$1.class");
+ ToolBox.rm("C.class");
+ ToolBox.rm("D.class");
+
+ javacParams = new ToolBox.JavaToolArgs()
+ .setOptions("-cp", ".")
+ .setSources(ASource, CSource, DSource);
+ ToolBox.javac(javacParams);
+ }
+}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/T8011181/EmptyUTF8ForInnerClassNameTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8011181/EmptyUTF8ForInnerClassNameTest.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2013, 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. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 A 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.
+ */
+
+/*
+ * @test
+ * @bug 8011181
+ * @summary javac, empty UTF8 entry generated for inner class
+ */
+
+import java.io.BufferedInputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.classfile.ClassFile;
+
+import static com.sun.tools.classfile.ConstantPool.CONSTANT_Utf8;
+import static com.sun.tools.classfile.ConstantPool.CONSTANT_Utf8_info;
+import static com.sun.tools.classfile.ConstantPool.CPInfo;
+
+public class EmptyUTF8ForInnerClassNameTest {
+
+ public static void main(String[] args) throws Exception {
+ new EmptyUTF8ForInnerClassNameTest().run();
+ }
+
+ void run() throws Exception {
+ checkClassFile(Paths.get(System.getProperty("test.classes"),
+ this.getClass().getName() + "$1.class"));
+ checkClassFile(Paths.get(System.getProperty("test.classes"),
+ this.getClass().getName() + "$EnumPlusSwitch.class"));
+ }
+
+ void checkClassFile(final Path path) throws Exception {
+ ClassFile classFile = ClassFile.read(
+ new BufferedInputStream(Files.newInputStream(path)));
+ for (CPInfo cpInfo : classFile.constant_pool.entries()) {
+ if (cpInfo.getTag() == CONSTANT_Utf8) {
+ CONSTANT_Utf8_info utf8Info = (CONSTANT_Utf8_info)cpInfo;
+ Assert.check(utf8Info.value.length() > 0,
+ "UTF8 with length 0 found at class " + classFile.getName());
+ }
+ }
+ }
+
+ static class EnumPlusSwitch {
+ enum E {E1}
+
+ public int m (E e) {
+ switch (e) {
+ case E1:
+ return 0;
+ }
+ return -1;
+ }
+ }
+
+}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/annotations/typeAnnotations/TypeProcOnly.java
--- a/langtools/test/tools/javac/annotations/typeAnnotations/TypeProcOnly.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/TypeProcOnly.java Wed Apr 17 21:50:43 2013 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, 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
@@ -32,12 +32,12 @@
import com.sun.source.util.JavacTask;
import com.sun.source.util.TaskEvent;
import com.sun.source.util.TaskListener;
-import com.sun.source.util.TreePath;
import com.sun.tools.javac.main.JavaCompiler;
-import com.sun.tools.javac.main.JavaCompiler.CompileState;
import com.sun.tools.javac.processing.JavacProcessingEnvironment;
import com.sun.tools.javac.util.Context;
+import static com.sun.tools.javac.comp.CompileStates.CompileState;
+
/*
* @test
* @summary test that type processors are run when -proc:only is passed.
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/annotations/typeAnnotations/packageanno/PackageProcessor.java
--- a/langtools/test/tools/javac/annotations/typeAnnotations/packageanno/PackageProcessor.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/packageanno/PackageProcessor.java Wed Apr 17 21:50:43 2013 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, 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
@@ -31,12 +31,12 @@
import com.sun.source.util.JavacTask;
import com.sun.source.util.TaskEvent;
import com.sun.source.util.TaskListener;
-import com.sun.source.util.TreePath;
import com.sun.tools.javac.main.JavaCompiler;
-import com.sun.tools.javac.main.JavaCompiler.CompileState;
import com.sun.tools.javac.processing.JavacProcessingEnvironment;
import com.sun.tools.javac.util.Context;
+import static com.sun.tools.javac.comp.CompileStates.CompileState;
+
/*
* @test
* @summary test that package annotations are available to type processors.
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/defaultMethods/DefaultMethodFlags.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/DefaultMethodFlags.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2013, 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 A 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.
+ */
+
+/*
+ * @test
+ * @bug 8011383
+ * @summary Symbol.getModifiers omits ACC_ABSTRACT from interface with default methods
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+
+import javax.lang.model.element.*;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.TaskEvent;
+import com.sun.source.util.TaskListener;
+import com.sun.tools.javac.util.Assert;
+
+public class DefaultMethodFlags {
+
+ public static void main(String[] args) throws IOException {
+ new DefaultMethodFlags().run(args);
+ }
+
+ void run(String[] args) throws IOException {
+ checkDefaultMethodFlags();
+ }
+
+ void checkDefaultMethodFlags() throws IOException {
+ JavaCompiler c = ToolProvider.getSystemJavaCompiler();
+ StandardJavaFileManager fm = c.getStandardFileManager(null, null, null);
+ Iterable extends JavaFileObject> fos =
+ fm.getJavaFileObjectsFromFiles(
+ Arrays.asList(new File(
+ System.getProperty("test.src"),
+ this.getClass().getSimpleName() + ".java")));
+ JavacTask task = (JavacTask) c.getTask(null, fm, null, null, null, fos);
+
+ task.addTaskListener(new TaskListener() {
+
+ @Override
+ public void started(TaskEvent e) {}
+
+ @Override
+ public void finished(TaskEvent e) {
+ if (e.getKind() == TaskEvent.Kind.ANALYZE) {
+ TypeElement te = e.getTypeElement();
+ if (te.getSimpleName().toString().equals("I")) {
+ checkDefaultInterface(te);
+ }
+ }
+ }
+ });
+
+ task.analyze();
+ }
+
+ void checkDefaultInterface(TypeElement te) {
+ System.err.println("Checking " + te.getSimpleName());
+ Assert.check(te.getModifiers().contains(Modifier.ABSTRACT));
+ for (Element e : te.getEnclosedElements()) {
+ if (e.getSimpleName().toString().matches("(\\w)_(default|static|abstract)")) {
+ boolean abstractExpected = false;
+ String methodKind = e.getSimpleName().toString().substring(2);
+ switch (methodKind) {
+ case "default":
+ case "static":
+ break;
+ case "abstract":
+ abstractExpected = true;
+ break;
+ default:
+ Assert.error("Cannot get here!" + methodKind);
+ }
+ Assert.check(e.getModifiers().contains(Modifier.ABSTRACT) == abstractExpected);
+ }
+ }
+ }
+}
+
+interface I {
+ default void m_default() { }
+ static void m_static() { }
+ void m_abstract();
+}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/lambda/Intersection03.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/Intersection03.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013, 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 A 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.
+ */
+
+/*
+ * @test
+ * @bug 8011392
+ * @summary Missing checkcast when casting to intersection type
+ */
+import java.util.*;
+
+public class Intersection03 {
+
+ static int assertionCount = 0;
+
+ static void assertTrue(boolean cond) {
+ assertionCount++;
+ if (!cond) throw new AssertionError();
+ }
+
+ public static void main(String[] args) {
+ try {
+ Runnable r = (List> & Runnable)new ArrayList();
+ assertTrue(false);
+ } catch (ClassCastException cce) {
+ assertTrue(true);
+ }
+ assertTrue(assertionCount == 1);
+ }
+}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/lambda/TargetType69.java
--- a/langtools/test/tools/javac/lambda/TargetType69.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/test/tools/javac/lambda/TargetType69.java Wed Apr 17 21:50:43 2013 -0700
@@ -25,11 +25,11 @@
* @test
* @bug 8010303
* @summary Graph inference: missing incorporation step causes spurious inference error
- * @compile TargetType68.java
+ * @compile TargetType69.java
*/
import java.util.*;
-class TargetType68 {
+class TargetType69 {
interface Function {
Y m(X x);
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/lambda/TargetType70.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType70.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2013, 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 A 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.
+ */
+
+/*
+ * @test
+ * @bug 8011028
+ * @summary lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
+ * @compile TargetType70.java
+ */
+class TargetType70 {
+
+ static class Sup {}
+ static class Sub extends Sup {}
+
+ interface I, U> {
+ T m(U o);
+ }
+
+ static class GenSup {
+ GenSup(T f) { }
+ }
+
+ static class GenSub extends GenSup {
+ GenSub(T f) { super(f); }
+ }
+
+ void m(I extends GenSup, T> o1, T o2) { }
+
+ void test(Sub sub) {
+ m(GenSub::new, sub);
+ }
+}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/lambda/TargetType71.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType71.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2013, 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 A 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.
+ */
+
+/*
+ * @test
+ * @bug 8011377
+ * @summary Javac crashes when multiple lambdas are defined in an array
+ * @compile TargetType71.java
+ */
+class TargetType71 {
+ void test() {
+ Runnable[] rs = { () -> { String x = null; }, () -> { String x = null; } };
+ }
+}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/lambda/TargetType72.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType72.java Wed Apr 17 21:50:43 2013 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013, 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 A 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.
+ */
+
+/*
+ * @test
+ * @bug 8011376
+ * @summary Spurious checked exception errors in nested method call
+ * @compile TargetType72.java
+ */
+import java.io.IOException;
+import java.util.concurrent.Callable;
+
+class TargetType72 {
+
+ Callable c = id(id(()->{ if (true) throw new java.io.IOException(); return 0; }));
+
+ Z id(Z z) { return null; }
+
+}
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/scope/7017664/CompoundScopeTest.java
--- a/langtools/test/tools/javac/scope/7017664/CompoundScopeTest.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/test/tools/javac/scope/7017664/CompoundScopeTest.java Wed Apr 17 21:50:43 2013 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -147,7 +147,7 @@
Scope createScope(int nelems) {
Scope s = new Scope(symtab.noSymbol);
for (int i = 0 ; i < nelems ; i++) {
- Symbol sym = new TypeSymbol(0, names.fromString("s" + i), null, null);
+ Symbol sym = new TypeVariableSymbol(0, names.fromString("s" + i), null, null);
s.enter(sym);
elems = elems.prepend(sym);
List shadowed = shadowedMap.get(sym.name);
diff -r da9a4c931281 -r 5f6c0e7766b7 langtools/test/tools/javac/types/TypeHarness.java
--- a/langtools/test/tools/javac/types/TypeHarness.java Wed Jul 05 18:50:42 2017 +0200
+++ b/langtools/test/tools/javac/types/TypeHarness.java Wed Apr 17 21:50:43 2013 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, 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
@@ -309,7 +309,7 @@
}
public TypeVar TypeVariable(Type bound) {
- TypeSymbol tvsym = new TypeSymbol(0, syntheticName(), null, predef.noSymbol);
+ TypeSymbol tvsym = new TypeVariableSymbol(0, syntheticName(), null, predef.noSymbol);
tvsym.type = new TypeVar(tvsym, bound, null);
return (TypeVar)tvsym.type;
}