changeset 813:7af674c07fca

merge with jdk7-b121
author mcimadamore
date Wed, 15 Dec 2010 13:26:05 +0000
parents 3122e07ad069 11e7b4c0476e
children 72a97b863b48
files make/build.properties src/share/classes/com/sun/source/tree/AnnotatedTypeTree.java src/share/classes/com/sun/source/tree/DisjointTypeTree.java src/share/classes/com/sun/source/tree/Tree.java src/share/classes/com/sun/source/tree/TreeVisitor.java src/share/classes/com/sun/source/util/AbstractTypeProcessor.java src/share/classes/com/sun/source/util/SimpleTreeVisitor.java src/share/classes/com/sun/source/util/TreeScanner.java src/share/classes/com/sun/tools/javac/code/Flags.java src/share/classes/com/sun/tools/javac/code/Printer.java src/share/classes/com/sun/tools/javac/code/Scope.java src/share/classes/com/sun/tools/javac/code/Source.java src/share/classes/com/sun/tools/javac/code/Type.java src/share/classes/com/sun/tools/javac/code/Types.java src/share/classes/com/sun/tools/javac/comp/Attr.java src/share/classes/com/sun/tools/javac/comp/Check.java src/share/classes/com/sun/tools/javac/comp/Flow.java src/share/classes/com/sun/tools/javac/comp/Infer.java src/share/classes/com/sun/tools/javac/comp/Lower.java src/share/classes/com/sun/tools/javac/comp/MemberEnter.java src/share/classes/com/sun/tools/javac/comp/Resolve.java src/share/classes/com/sun/tools/javac/comp/TransTypes.java src/share/classes/com/sun/tools/javac/jvm/ClassReader.java src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java src/share/classes/com/sun/tools/javac/jvm/Code.java src/share/classes/com/sun/tools/javac/jvm/Gen.java src/share/classes/com/sun/tools/javac/main/JavaCompiler.java src/share/classes/com/sun/tools/javac/model/JavacTypes.java src/share/classes/com/sun/tools/javac/parser/JavacParser.java src/share/classes/com/sun/tools/javac/parser/Scanner.java src/share/classes/com/sun/tools/javac/resources/compiler.properties src/share/classes/com/sun/tools/javac/tree/JCTree.java src/share/classes/com/sun/tools/javac/tree/Pretty.java src/share/classes/com/sun/tools/javac/tree/TreeCopier.java src/share/classes/com/sun/tools/javac/tree/TreeInfo.java src/share/classes/com/sun/tools/javac/tree/TreeMaker.java src/share/classes/com/sun/tools/javac/tree/TreeScanner.java src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java src/share/classes/com/sun/tools/javac/util/Names.java src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java test/tools/javac/T6985181.java test/tools/javac/TryWithResources/ArmLint.java test/tools/javac/TryWithResources/ArmLint.out test/tools/javac/diags/examples/EmptyBytecodeIdent.java test/tools/javac/diags/examples/IllegalBytecodeIdentChar.java test/tools/javac/diags/examples/MulticatchMustBeFinal.java test/tools/javac/diags/examples/TypeAnnotationsNotSupported.java test/tools/javac/diags/examples/UnclosedBytecodeIdent.java test/tools/javac/diags/examples/UnsupportedExoticID.java test/tools/javac/multicatch/Neg05.out test/tools/javac/quid/QuotedIdent.java test/tools/javac/quid/QuotedIdent2.java test/tools/javac/quid/T6999438.out test/tools/javac/treeannotests/AnnoTreeTests.java test/tools/javac/typeAnnotations/6967002/T6967002.java test/tools/javac/typeAnnotations/6967002/T6967002.out test/tools/javac/typeAnnotations/InnerClass.java test/tools/javac/typeAnnotations/MultipleTargets.java test/tools/javac/typeAnnotations/TypeParameterTarget.java test/tools/javac/typeAnnotations/TypeUseTarget.java test/tools/javac/typeAnnotations/attribution/Scopes.java test/tools/javac/typeAnnotations/classfile/DeadCode.java test/tools/javac/typeAnnotations/failures/AnnotationVersion.java test/tools/javac/typeAnnotations/failures/AnnotationVersion.out test/tools/javac/typeAnnotations/failures/IncompleteArray.java test/tools/javac/typeAnnotations/failures/IncompleteArray.out test/tools/javac/typeAnnotations/failures/IncompleteVararg.java test/tools/javac/typeAnnotations/failures/IncompleteVararg.out test/tools/javac/typeAnnotations/failures/IndexArray.java test/tools/javac/typeAnnotations/failures/IndexArray.out test/tools/javac/typeAnnotations/failures/LintCast.java test/tools/javac/typeAnnotations/failures/LintCast.out test/tools/javac/typeAnnotations/failures/OldArray.java test/tools/javac/typeAnnotations/failures/Scopes.java test/tools/javac/typeAnnotations/failures/Scopes.out test/tools/javac/typeAnnotations/failures/StaticFields.java test/tools/javac/typeAnnotations/failures/StaticFields.out test/tools/javac/typeAnnotations/failures/StaticMethods.java test/tools/javac/typeAnnotations/failures/StaticMethods.out test/tools/javac/typeAnnotations/failures/VoidGenericMethod.java test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateTypeAnnotation.java test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateTypeAnnotation.out test/tools/javac/typeAnnotations/failures/common/arrayclass/InvalidLocation.java test/tools/javac/typeAnnotations/failures/common/arrayclass/InvalidLocation.out test/tools/javac/typeAnnotations/failures/common/arrayclass/MissingAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/arrayclass/MissingAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateTypeAnnotation.java test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateTypeAnnotation.out test/tools/javac/typeAnnotations/failures/common/arrays/InvalidLocation.java test/tools/javac/typeAnnotations/failures/common/arrays/InvalidLocation.out test/tools/javac/typeAnnotations/failures/common/arrays/MissingAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/arrays/MissingAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateTypeAnnotation.java test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateTypeAnnotation.out test/tools/javac/typeAnnotations/failures/common/innertypeparams/InvalidLocation.java test/tools/javac/typeAnnotations/failures/common/innertypeparams/InvalidLocation.out test/tools/javac/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateTypeAnnotation.java test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateTypeAnnotation.out test/tools/javac/typeAnnotations/failures/common/newarray/InvalidLocation.java test/tools/javac/typeAnnotations/failures/common/newarray/InvalidLocation.out test/tools/javac/typeAnnotations/failures/common/newarray/MissingAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/newarray/MissingAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateTypeAnnotation.java test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateTypeAnnotation.out test/tools/javac/typeAnnotations/failures/common/parambounds/InvalidLocation.java test/tools/javac/typeAnnotations/failures/common/parambounds/InvalidLocation.out test/tools/javac/typeAnnotations/failures/common/parambounds/MissingAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/parambounds/MissingAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateTypeAnnotation.java test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateTypeAnnotation.out test/tools/javac/typeAnnotations/failures/common/receiver/InvalidLocation.java test/tools/javac/typeAnnotations/failures/common/receiver/InvalidLocation.out test/tools/javac/typeAnnotations/failures/common/receiver/MissingAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/receiver/MissingAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/rest/DuplicateAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/rest/DuplicateAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/rest/DuplicateTypeAnnotation.java test/tools/javac/typeAnnotations/failures/common/rest/DuplicateTypeAnnotation.out test/tools/javac/typeAnnotations/failures/common/rest/InvalidLocation.java test/tools/javac/typeAnnotations/failures/common/rest/InvalidLocation.out test/tools/javac/typeAnnotations/failures/common/rest/MissingAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/rest/MissingAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateTypeAnnotation.java test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateTypeAnnotation.out test/tools/javac/typeAnnotations/failures/common/typeArgs/InvalidLocation.java test/tools/javac/typeAnnotations/failures/common/typeArgs/InvalidLocation.out test/tools/javac/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateTypeAnnotation.java test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateTypeAnnotation.out test/tools/javac/typeAnnotations/failures/common/typeparams/InvalidLocation.java test/tools/javac/typeAnnotations/failures/common/typeparams/InvalidLocation.out test/tools/javac/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.out test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateTypeAnnotation.java test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateTypeAnnotation.out test/tools/javac/typeAnnotations/failures/common/wildcards/InvalidLocation.java test/tools/javac/typeAnnotations/failures/common/wildcards/InvalidLocation.out test/tools/javac/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.java test/tools/javac/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.out test/tools/javac/typeAnnotations/failures/target/Constructor.java test/tools/javac/typeAnnotations/failures/target/Constructor.out test/tools/javac/typeAnnotations/failures/target/IncompleteArray.java test/tools/javac/typeAnnotations/failures/target/IncompleteArray.out test/tools/javac/typeAnnotations/failures/target/NotTypeParameter.java test/tools/javac/typeAnnotations/failures/target/NotTypeParameter.out test/tools/javac/typeAnnotations/failures/target/NotTypeUse.java test/tools/javac/typeAnnotations/failures/target/NotTypeUse.out test/tools/javac/typeAnnotations/failures/target/VoidMethod.java test/tools/javac/typeAnnotations/failures/target/VoidMethod.out test/tools/javac/typeAnnotations/newlocations/ClassExtends.java test/tools/javac/typeAnnotations/newlocations/ClassLiterals.java test/tools/javac/typeAnnotations/newlocations/ClassParameters.java test/tools/javac/typeAnnotations/newlocations/ConstructorTypeArgs.java test/tools/javac/typeAnnotations/newlocations/Expressions.java test/tools/javac/typeAnnotations/newlocations/Fields.java test/tools/javac/typeAnnotations/newlocations/LocalVariables.java test/tools/javac/typeAnnotations/newlocations/MethodReturnType.java test/tools/javac/typeAnnotations/newlocations/MethodTypeArgs.java test/tools/javac/typeAnnotations/newlocations/MethodTypeParameters.java test/tools/javac/typeAnnotations/newlocations/Parameters.java test/tools/javac/typeAnnotations/newlocations/Receivers.java test/tools/javac/typeAnnotations/newlocations/Throws.java test/tools/javac/typeAnnotations/newlocations/TypeCasts.java test/tools/javac/typeAnnotations/newlocations/TypeParameters.java test/tools/javac/typeAnnotations/newlocations/Wildcards.java test/tools/javap/typeAnnotations/ArrayClassLiterals.java test/tools/javap/typeAnnotations/ArrayClassLiterals2.java test/tools/javap/typeAnnotations/ClassLiterals.java test/tools/javap/typeAnnotations/JSR175Annotations.java test/tools/javap/typeAnnotations/NewArray.java test/tools/javap/typeAnnotations/Presence.java test/tools/javap/typeAnnotations/PresenceInner.java test/tools/javap/typeAnnotations/T6855990.java test/tools/javap/typeAnnotations/Visibility.java
diffstat 352 files changed, 3791 insertions(+), 5704 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Dec 02 10:35:09 2010 +0000
+++ b/.hgtags	Wed Dec 15 13:26:05 2010 +0000
@@ -89,3 +89,10 @@
 fd2579b80b83bf5d4289426016c7d29174ba5dd9 jdk7-b112
 6dbd2d869b0573fa5b799a23cccff47d20c12696 jdk7-b113
 e4e7408cdc5b3d91d39161e1e94aad576ecc2dcd jdk7-b114
+01e8ac5fbefd35d2d9a0996213cf2390fd164e57 jdk7-b115
+857bfcea3f30cb5f4ae96f46a53ae1c772f9b0e5 jdk7-b116
+2129a046f117547fc8a5cb3397a767e6d528f5b6 jdk7-b117
+c491eec0acc73fa41b77e1619ed03e56d8a75b83 jdk7-b118
+814561077c448292f78de461b6de5d78d57c2089 jdk7-b119
+1dd813a529cfa06d850ee7dc42da42efb8f6af0e jdk7-b120
+1bf969e9792f977a8593496681539840a54fe644 jdk7-b121
--- a/make/build.properties	Thu Dec 02 10:35:09 2010 +0000
+++ b/make/build.properties	Wed Dec 15 13:26:05 2010 +0000
@@ -185,7 +185,9 @@
     java/nio/channels/CompletionHandler.java \
     java/nio/channels/SeekableByteChannel.java \
     java/dyn/**.java \
+    java/lang/ReflectiveOperationException.java \
     sun/dyn/**.java \
+    sun/dyn/util/**.java \
     sun/dyn/empty/**.java
 
 # The following value is used by the main jtreg target.
--- a/src/share/classes/com/sun/source/tree/AnnotatedTypeTree.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 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.
- */
-
-package com.sun.source.tree;
-
-import java.util.List;
-
-/**
- * A tree node for an annotated type
- *
- * For example:
- * <pre>
- *    {@code @}<em>annotationType String</em>
- *    {@code @}<em>annotationType</em> ( <em>arguments</em> ) <em>Date</em>
- * </pre>
- *
- * @see "JSR 308: Annotations on Java Types"
- *
- * @author Mahmood Ali
- * @since 1.7
- */
-public interface AnnotatedTypeTree extends ExpressionTree {
-    List<? extends AnnotationTree> getAnnotations();
-    ExpressionTree getUnderlyingType();
-}
--- a/src/share/classes/com/sun/source/tree/DisjointTypeTree.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2010, 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.
- */
-
-package com.sun.source.tree;
-
-import java.util.List;
-
-/**
- * A tree node for a disjoint type expression in a multicatch var declaration.
- *
- *
- * @author Maurizio Cimadamore
- *
- * @since 1.7
- */
-public interface DisjointTypeTree extends Tree {
-    List<? extends Tree> getTypeComponents();
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/source/tree/DisjunctiveTypeTree.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+package com.sun.source.tree;
+
+import java.util.List;
+
+/**
+ * A tree node for a disjunctive type expression in a multicatch var declaration.
+ *
+ *
+ * @author Maurizio Cimadamore
+ *
+ * @since 1.7
+ */
+public interface DisjunctiveTypeTree extends Tree {
+    List<? extends Tree> getTypeAlternatives();
+}
--- a/src/share/classes/com/sun/source/tree/MethodTree.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/source/tree/MethodTree.java	Wed Dec 15 13:26:05 2010 +0000
@@ -53,7 +53,7 @@
     Tree getReturnType();
     List<? extends TypeParameterTree> getTypeParameters();
     List<? extends VariableTree> getParameters();
-    List<? extends AnnotationTree> getReceiverAnnotations();
+//308    List<? extends AnnotationTree> getReceiverAnnotations();
     List<? extends ExpressionTree> getThrows();
     BlockTree getBody();
     Tree getDefaultValue(); // for annotation types
--- a/src/share/classes/com/sun/source/tree/Tree.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/source/tree/Tree.java	Wed Dec 15 13:26:05 2010 +0000
@@ -46,7 +46,7 @@
      */
     public enum Kind {
 
-        ANNOTATED_TYPE(AnnotatedTypeTree.class),
+//308        ANNOTATED_TYPE(AnnotatedTypeTree.class),
 
         /**
          * Used for instances of {@link AnnotationTree}.
@@ -244,9 +244,9 @@
         PARAMETERIZED_TYPE(ParameterizedTypeTree.class),
 
         /**
-         * Used for instances of {@link DisjointTypeTree}.
+         * Used for instances of {@link DisjunctiveTypeTree}.
          */
-        DISJOINT_TYPE(DisjointTypeTree.class),
+        DISJUNCTIVE_TYPE(DisjunctiveTypeTree.class),
 
         /**
          * Used for instances of {@link FunctionTypeTree}.
--- a/src/share/classes/com/sun/source/tree/TreeVisitor.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/source/tree/TreeVisitor.java	Wed Dec 15 13:26:05 2010 +0000
@@ -57,7 +57,7 @@
  * @since 1.6
  */
 public interface TreeVisitor<R,P> {
-    R visitAnnotatedType(AnnotatedTypeTree node, P p);
+//308    R visitAnnotatedType(AnnotatedTypeTree node, P p);
     R visitAnnotation(AnnotationTree node, P p);
     R visitMethodInvocation(MethodInvocationTree node, P p);
     R visitAssert(AssertTree node, P p);
@@ -98,7 +98,7 @@
     R visitCompilationUnit(CompilationUnitTree node, P p);
     R visitTry(TryTree node, P p);
     R visitParameterizedType(ParameterizedTypeTree node, P p);
-    R visitDisjointType(DisjointTypeTree node, P p);
+    R visitDisjunctiveType(DisjunctiveTypeTree node, P p);
     R visitFunctionType(FunctionTypeTree node, P p);
     R visitArrayType(ArrayTypeTree node, P p);
     R visitTypeCast(TypeCastTree node, P p);
--- a/src/share/classes/com/sun/source/tree/TypeParameterTree.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/source/tree/TypeParameterTree.java	Wed Dec 15 13:26:05 2010 +0000
@@ -47,5 +47,5 @@
 public interface TypeParameterTree extends Tree {
     Name getName();
     List<? extends Tree> getBounds();
-    List<? extends AnnotationTree> getAnnotations();
+//308    List<? extends AnnotationTree> getAnnotations();
 }
--- a/src/share/classes/com/sun/source/util/AbstractTypeProcessor.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +0,0 @@
-/*
- * Copyright (c) 2009, 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.
- */
-
-package com.sun.source.util;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.annotation.processing.*;
-import javax.lang.model.element.Name;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.util.ElementFilter;
-
-import com.sun.tools.javac.processing.JavacProcessingEnvironment;
-import com.sun.tools.javac.util.Context;
-import com.sun.tools.javac.util.Log;
-
-import com.sun.source.tree.ClassTree;
-
-/**
- * This class is an abstract annotation processor designed to be a
- * convenient superclass for concrete "type processors", processors that
- * require the type information in the processed source.
- *
- * <p>Type processing occurs in one round after the tool (e.g. java compiler)
- * analyzes the source (all sources taken as input to the tool and sources
- * generated by other annotation processors).
- *
- * <p>The tool infrastructure will interact with classes extending this abstract
- * class as follows:
- *
- * <ol>
- * [1-3: Identical to {@link Processor} life cycle]
- *
- * <li>If an existing {@code Processor} object is not being used, to
- * create an instance of a processor the tool calls the no-arg
- * constructor of the processor class.
- *
- * <li>Next, the tool calls the {@link #init init} method with
- * an appropriate {@code ProcessingEnvironment}.
- *
- * <li>Afterwards, the tool calls {@link #getSupportedAnnotationTypes
- * getSupportedAnnotationTypes}, {@link #getSupportedOptions
- * getSupportedOptions}, and {@link #getSupportedSourceVersion
- * getSupportedSourceVersion}.  These methods are only called once per
- * run, not on each round.
- *
- * [4-5Unique to {@code AbstractTypeProcessor} subclasses]
- *
- * <li>For each class containing a supported annotation, the tool calls
- * {@link #typeProcess(TypeElement, TreePath) typeProcess} method on the
- * {@code Processor}.  The class is guaranteed to be type-checked Java code
- * and all the tree type and symbol information is resolved.
- *
- * <li>Finally, the tools calls the
- * {@link #typeProcessingOver() typeProcessingOver} method
- * on the {@code Processor}.
- *
- * </ol>
- *
- * <p>The tool is permitted to ask type processors to process a class once
- * it is analyzed before the rest of classes are analyzed.  The tool is also
- * permitted to stop type processing immediately if any errors are raised,
- * without invoking {@code typeProcessingOver}
- *
- * <p>A subclass may override any of the methods in this class, as long as the
- * general {@link javax.annotation.processing.Processor Processor}
- * contract is obeyed, with one notable exception.
- * {@link #process(Set, RoundEnvironment)} may not be overridden, as it
- * is called during the regular annotation phase before classes are analyzed.
- *
- * @author Mahmood Ali
- * @since 1.7
- */
-public abstract class AbstractTypeProcessor extends AbstractProcessor {
-    private final Set<Name> elements = new HashSet<Name>();
-    private boolean hasInvokedTypeProcessingOver = false;
-    private JavacProcessingEnvironment env;
-    private final AttributionTaskListener listener = new AttributionTaskListener();
-
-    /**
-     * Constructor for subclasses to call.
-     */
-    protected AbstractTypeProcessor() { }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void init(ProcessingEnvironment env) {
-        super.init(env);
-        this.env = (JavacProcessingEnvironment)env;
-        prepareContext(this.env.getContext());
-    }
-
-    /**
-     * The use of this method is obsolete in type processors.  The method is
-     * called during regular annotation processing phase only.
-     */
-    @Override
-    public final boolean process(Set<? extends TypeElement> annotations,
-            RoundEnvironment roundEnv) {
-        for (TypeElement elem : ElementFilter.typesIn(roundEnv.getRootElements())) {
-            elements.add(elem.getQualifiedName());
-        }
-        return false;
-    }
-
-    /**
-     * Processes a fully analyzed class that contains a supported annotation
-     * (look {@link #getSupportedAnnotationTypes()}).
-     *
-     * <p>The passed class is always a valid type-checked Java code.
-     *
-     * @param element       element of the analyzed class
-     * @param tree  the tree path to the element, with the leaf being a
-     *              {@link ClassTree}
-     */
-    public abstract void typeProcess(TypeElement element, TreePath tree);
-
-    /**
-     * A method to be called once all the classes are processed and no error
-     * is reported.
-     *
-     * <p>Subclasses may override this method to do any aggregate analysis
-     * (e.g. generate report, persistence) or resource deallocation.
-     *
-     * <p>If an error (a Java error or a processor error) is reported, this
-     * method is not guaranteed to be invoked.
-     */
-    public void typeProcessingOver() { }
-
-    /**
-     * adds a listener for attribution.
-     */
-    private void prepareContext(Context context) {
-        TaskListener otherListener = context.get(TaskListener.class);
-        if (otherListener == null) {
-            context.put(TaskListener.class, listener);
-        } else {
-            // handle cases of multiple listeners
-            context.put(TaskListener.class, (TaskListener)null);
-            TaskListeners listeners = new TaskListeners();
-            listeners.add(otherListener);
-            listeners.add(listener);
-            context.put(TaskListener.class, listeners);
-        }
-    }
-
-    /**
-     * A task listener that invokes the processor whenever a class is fully
-     * analyzed.
-     */
-    private final class AttributionTaskListener implements TaskListener {
-
-        @Override
-        public void finished(TaskEvent e) {
-            Log log = Log.instance(env.getContext());
-
-            if (!hasInvokedTypeProcessingOver && elements.isEmpty() && log.nerrors == 0) {
-                typeProcessingOver();
-                hasInvokedTypeProcessingOver = true;
-            }
-
-            if (e.getKind() != TaskEvent.Kind.ANALYZE)
-                return;
-
-            if (e.getTypeElement() == null)
-                throw new AssertionError("event task without a type element");
-            if (e.getCompilationUnit() == null)
-                throw new AssertionError("even task without compilation unit");
-
-            if (!elements.remove(e.getTypeElement().getQualifiedName()))
-                return;
-
-            if (log.nerrors != 0)
-                return;
-
-            TypeElement elem = e.getTypeElement();
-            TreePath p = Trees.instance(env).getPath(elem);
-
-            typeProcess(elem, p);
-
-            if (!hasInvokedTypeProcessingOver && elements.isEmpty() && log.nerrors == 0) {
-                typeProcessingOver();
-                hasInvokedTypeProcessingOver = true;
-            }
-        }
-
-        @Override
-        public void started(TaskEvent e) { }
-
-    }
-
-    /**
-     * A task listener multiplexer.
-     */
-    private static class TaskListeners implements TaskListener {
-        private final List<TaskListener> listeners = new ArrayList<TaskListener>();
-
-        public void add(TaskListener listener) {
-            listeners.add(listener);
-        }
-
-        public void remove(TaskListener listener) {
-            listeners.remove(listener);
-        }
-
-        @Override
-        public void finished(TaskEvent e) {
-            for (TaskListener listener : listeners)
-                listener.finished(e);
-        }
-
-        @Override
-        public void started(TaskEvent e) {
-            for (TaskListener listener : listeners)
-                listener.started(e);
-        }
-    }
-}
--- a/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java	Wed Dec 15 13:26:05 2010 +0000
@@ -236,7 +236,7 @@
         return defaultAction(node, p);
     }
 
-    public R visitDisjointType(DisjointTypeTree node, P p) {
+    public R visitDisjunctiveType(DisjunctiveTypeTree node, P p) {
         return defaultAction(node, p);
     }
 
@@ -260,9 +260,9 @@
         return defaultAction(node, p);
     }
 
-    public R visitAnnotatedType(AnnotatedTypeTree node, P p) {
-        return defaultAction(node, p);
-    }
+//308    public R visitAnnotatedType(AnnotatedTypeTree node, P p) {
+//308        return defaultAction(node, p);
+//308    }
 
     public R visitErroneous(ErroneousTree node, P p) {
         return defaultAction(node, p);
--- a/src/share/classes/com/sun/source/util/TreeScanner.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/source/util/TreeScanner.java	Wed Dec 15 13:26:05 2010 +0000
@@ -138,7 +138,7 @@
         r = scanAndReduce(node.getReturnType(), p, r);
         r = scanAndReduce(node.getTypeParameters(), p, r);
         r = scanAndReduce(node.getParameters(), p, r);
-        r = scanAndReduce(node.getReceiverAnnotations(), p, r);
+//308        r = scanAndReduce(node.getReceiverAnnotations(), p, r);
         r = scanAndReduce(node.getThrows(), p, r);
         r = scanAndReduce(node.getBody(), p, r);
         r = scanAndReduce(node.getDefaultValue(), p, r);
@@ -366,8 +366,8 @@
         return r;
     }
 
-    public R visitDisjointType(DisjointTypeTree node, P p) {
-        return scan(node.getTypeComponents(), p);
+    public R visitDisjunctiveType(DisjunctiveTypeTree node, P p) {
+        return scan(node.getTypeAlternatives(), p);
     }
 
     public R visitFunctionType(FunctionTypeTree node, P p) {
@@ -378,8 +378,8 @@
     }
 
     public R visitTypeParameter(TypeParameterTree node, P p) {
-        R r = scan(node.getAnnotations(), p);
-        r = scanAndReduce(node.getBounds(), p, r);
+        R r = scan(node.getBounds(), p);
+//308        R r = scanAndReduce(node.getAnnotations(), p, r);
         return r;
     }
 
@@ -397,11 +397,11 @@
         return r;
     }
 
-   public R visitAnnotatedType(AnnotatedTypeTree node, P p) {
-       R r = scan(node.getAnnotations(), p);
-       r = scanAndReduce(node.getUnderlyingType(), p, r);
-       return r;
-   }
+//308   public R visitAnnotatedType(AnnotatedTypeTree node, P p) {
+//308       R r = scan(node.getAnnotations(), p);
+//308       r = scanAndReduce(node.getUnderlyingType(), p, r);
+//308       return r;
+//308   }
 
     public R visitOther(Tree node, P p) {
         return null;
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java	Wed Dec 15 13:26:05 2010 +0000
@@ -250,9 +250,13 @@
         /**
          * Sets "value" to an ExceptionProxy indicating a type mismatch.
          */
-        private void typeMismatch(final Method method, final Attribute attr) {
-            value = new ExceptionProxy() {
+        private void typeMismatch(Method method, final Attribute attr) {
+            class AnnotationTypeMismatchExceptionProxy extends ExceptionProxy {
                 private static final long serialVersionUID = 8473323277815075163L;
+                transient final Method method;
+                AnnotationTypeMismatchExceptionProxy(Method method) {
+                    this.method = method;
+                }
                 public String toString() {
                     return "<error>";   // eg:  @Anno(value=<error>)
                 }
@@ -260,7 +264,8 @@
                     return new AnnotationTypeMismatchException(method,
                                 attr.type.toString());
                 }
-            };
+            }
+            value = new AnnotationTypeMismatchExceptionProxy(method);
         }
     }
 
--- a/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Wed Dec 15 13:26:05 2010 +0000
@@ -49,6 +49,7 @@
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.code.Symbol.TypeSymbol;
 import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.code.Type;
 import com.sun.tools.javac.comp.Attr;
 import com.sun.tools.javac.comp.AttrContext;
 import com.sun.tools.javac.comp.Enter;
@@ -230,7 +231,7 @@
     public boolean isAccessible(Scope scope, TypeElement type) {
         if (scope instanceof JavacScope && type instanceof ClassSymbol) {
             Env<AttrContext> env = ((JavacScope) scope).env;
-            return resolve.isAccessible(env, (ClassSymbol)type);
+            return resolve.isAccessible(env, (ClassSymbol)type, true);
         } else
             return false;
     }
@@ -240,7 +241,7 @@
                 && member instanceof Symbol
                 && type instanceof com.sun.tools.javac.code.Type) {
             Env<AttrContext> env = ((JavacScope) scope).env;
-            return resolve.isAccessible(env, (com.sun.tools.javac.code.Type)type, (Symbol)member);
+            return resolve.isAccessible(env, (com.sun.tools.javac.code.Type)type, (Symbol)member, true);
         } else
             return false;
     }
@@ -282,9 +283,10 @@
 //                    System.err.println("COMP: " + ((JCCompilationUnit)tree).sourcefile);
                     env = enter.getTopLevelEnv((JCCompilationUnit)tree);
                     break;
+                case ANNOTATION_TYPE:
                 case CLASS:
+                case ENUM:
                 case INTERFACE:
-                case ENUM:
 //                    System.err.println("CLASS: " + ((JCClassDecl)tree).sym.getSimpleName());
                     env = enter.getClassEnv(((JCClassDecl)tree).sym);
                     break;
--- a/src/share/classes/com/sun/tools/javac/code/Flags.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Flags.java	Wed Dec 15 13:26:05 2010 +0000
@@ -268,11 +268,16 @@
      */
     public static final long EFFECTIVELY_FINAL = 1L<<45;
 
+   /**
+     * Flag that marks a disjunction var in a multi-catch clause
+     */
+    public static final long DISJUNCTION = 1L<<46;
+
     /**
      * Flag that marks a special kind of bridge methods (the ones that
      * come from restricted supertype bounds)
      */
-    public static final long OVERRIDE_BRIDGE = 1L<<41;
+    public static final long OVERRIDE_BRIDGE = 1L<<47;
 
     /** Modifier masks.
      */
--- a/src/share/classes/com/sun/tools/javac/code/Lint.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Lint.java	Wed Dec 15 13:26:05 2010 +0000
@@ -165,6 +165,11 @@
         FINALLY("finally"),
 
         /**
+         * Warn about issues relating to use of command line options
+         */
+        OPTIONS("options"),
+
+        /**
          * Warn about issues regarding method overrides.
          */
         OVERRIDES("overrides"),
@@ -182,39 +187,39 @@
         PROCESSING("processing"),
 
         /**
+         * Warn about unchecked operations on raw types.
+         */
+        RAW("rawtypes"),
+
+        /**
          * Warn about Serializable classes that do not provide a serial version ID.
          */
         SERIAL("serial"),
 
         /**
+         * Warn about issues relating to use of statics
+         */
+        STATIC("static"),
+
+        /**
+         * Warn about proprietary API that may be removed in a future release.
+         */
+        SUNAPI("sunapi", true),
+
+        /**
+         * Warn about issues relating to use of try blocks (i.e. try-with-resources)
+         */
+        TRY("try"),
+
+        /**
          * Warn about unchecked operations on raw types.
          */
         UNCHECKED("unchecked"),
 
         /**
-         * Warn about unchecked operations on raw types.
-         */
-        RAW("rawtypes"),
-
-        /**
-         * Warn about proprietary API that may be removed in a future release.
-         */
-        SUNAPI("sunapi", true),
-
-        /**
-         * Warn about issues relating to use of statics
-         */
-        STATIC("static"),
-
-        /**
          * Warn about potentially unsafe vararg methods
          */
-        VARARGS("varargs"),
-
-        /**
-         * Warn about arm resources
-         */
-        ARM("arm");
+        VARARGS("varargs");
 
         LintCategory(String option) {
             this(option, false);
--- a/src/share/classes/com/sun/tools/javac/code/Printer.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Printer.java	Wed Dec 15 13:26:05 2010 +0000
@@ -220,7 +220,7 @@
 
     @Override
     public String visitDisjunctiveType(DisjunctiveType t, Locale locale) {
-        return t.types.toString("|");
+        return t.alternatives.toString("|");
     }
 
     @Override
--- a/src/share/classes/com/sun/tools/javac/code/Scope.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Scope.java	Wed Dec 15 13:26:05 2010 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, 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,7 +31,8 @@
 /** A scope represents an area of visibility in a Java program. The
  *  Scope class is a container for symbols which provides
  *  efficient access to symbols given their names. Scopes are implemented
- *  as hash tables. Scopes can be nested; the next field of a scope points
+ *  as hash tables with "open addressing" and "double hashing".
+ *  Scopes can be nested; the next field of a scope points
  *  to its next outer scope. Nested scopes can share their hash tables.
  *
  *  <p><b>This is NOT part of any supported API.
@@ -55,7 +56,7 @@
 
     /** A hash table for the scope's entries.
      */
-    public Entry[] table;
+    Entry[] table;
 
     /** Mask for hash codes, always equal to (table.length - 1).
      */
@@ -67,8 +68,9 @@
     public Entry elems;
 
     /** The number of elements in this scope.
+     * This includes deleted elements, whose value is the sentinel.
      */
-    public int nelems = 0;
+    int nelems = 0;
 
     /** A timestamp - useful to quickly check whether a scope has changed or not
      */
@@ -109,7 +111,8 @@
         }
     }
 
-    /** Every hash bucket is a list of Entry's which ends in sentinel.
+    /** Use as a "not-found" result for lookup.
+     * Also used to mark deleted entries in the table.
      */
     private static final Entry sentinel = new Entry(null, null, null, null);
 
@@ -130,12 +133,15 @@
         this.owner = owner;
         this.table = table;
         this.hashMask = table.length - 1;
-        this.elems = null;
-        this.nelems = 0;
-        this.shared = 0;
         this.scopeCounter = scopeCounter;
     }
 
+    /** Convenience constructor used for dup and dupUnshared. */
+    private Scope(Scope next, Symbol owner, Entry[] table) {
+        this(next, owner, table, next.scopeCounter);
+        this.nelems = next.nelems;
+    }
+
     /** Construct a new scope, within scope next, with given owner,
      *  using a fresh table of length INITIAL_SIZE.
      */
@@ -145,7 +151,6 @@
 
     protected Scope(Symbol owner, ScopeCounter scopeCounter) {
         this(null, owner, new Entry[INITIAL_SIZE], scopeCounter);
-        for (int i = 0; i < INITIAL_SIZE; i++) table[i] = sentinel;
     }
 
     /** Construct a fresh scope within this scope, with same owner,
@@ -154,11 +159,7 @@
      *  of fresh tables.
      */
     public Scope dup() {
-        Scope result = new Scope(this, this.owner, this.table, scopeCounter);
-        shared++;
-        // System.out.println("====> duping scope " + this.hashCode() + " owned by " + this.owner + " to " + result.hashCode());
-        // new Error().printStackTrace(System.out);
-        return result;
+        return dup(this.owner);
     }
 
     /** Construct a fresh scope within this scope, with new owner,
@@ -167,7 +168,7 @@
      *  of fresh tables.
      */
     public Scope dup(Symbol newOwner) {
-        Scope result = new Scope(this, newOwner, this.table, scopeCounter);
+        Scope result = new Scope(this, newOwner, this.table);
         shared++;
         // System.out.println("====> duping scope " + this.hashCode() + " owned by " + newOwner + " to " + result.hashCode());
         // new Error().printStackTrace(System.out);
@@ -179,7 +180,7 @@
      *  the table of its outer scope.
      */
     public Scope dupUnshared() {
-        return new Scope(this, this.owner, this.table.clone(), scopeCounter);
+        return new Scope(this, this.owner, this.table.clone());
     }
 
     /** Remove all entries of this scope from its table, if shared
@@ -189,7 +190,7 @@
         assert shared == 0;
         if (table != next.table) return next;
         while (elems != null) {
-            int hash = elems.sym.name.hashCode() & hashMask;
+            int hash = getIndex(elems.sym.name);
             Entry e = table[hash];
             assert e == elems : elems.sym;
             table[hash] = elems.shadowed;
@@ -197,6 +198,7 @@
         }
         assert next.shared > 0;
         next.shared--;
+        next.nelems = nelems;
         // System.out.println("====> leaving scope " + this.hashCode() + " owned by " + this.owner + " to " + next.hashCode());
         // new Error().printStackTrace(System.out);
         return next;
@@ -215,19 +217,17 @@
                 s.hashMask = newtable.length - 1;
             }
         }
-        for (int i = 0; i < newtable.length; i++) newtable[i] = sentinel;
-        for (int i = 0; i < oldtable.length; i++) copy(oldtable[i]);
-    }
-
-    /** Copy the given entry and all entries shadowed by it to table
-     */
-    private void copy(Entry e) {
-        if (e.sym != null) {
-            copy(e.shadowed);
-            int hash = e.sym.name.hashCode() & hashMask;
-            e.shadowed = table[hash];
-            table[hash] = e;
+        int n = 0;
+        for (int i = oldtable.length; --i >= 0; ) {
+            Entry e = oldtable[i];
+            if (e != null && e != sentinel && ! e.isBogus()) {
+                table[getIndex(e.sym.name)] = e;
+                n++;
+            }
         }
+        // We don't need to update nelems for shared inherited scopes,
+        // since that gets handled by leave().
+        nelems = n;
     }
 
     /** Enter symbol sym in this scope.
@@ -248,13 +248,17 @@
      */
     public void enter(Symbol sym, Scope s, Scope origin) {
         assert shared == 0;
-        // Temporarily disabled (bug 6460352):
-        // if (nelems * 3 >= hashMask * 2) dble();
-        int hash = sym.name.hashCode() & hashMask;
-        Entry e = makeEntry(sym, table[hash], elems, s, origin);
+        if (nelems * 3 >= hashMask * 2)
+            dble();
+        int hash = getIndex(sym.name);
+        Entry old = table[hash];
+        if (old == null) {
+            old = sentinel;
+            nelems++;
+        }
+        Entry e = makeEntry(sym, old, elems, s, origin);
         table[hash] = e;
         elems = e;
-        nelems++;
         scopeCounter.inc();
     }
 
@@ -268,15 +272,15 @@
     public void remove(Symbol sym) {
         assert shared == 0;
         Entry e = lookup(sym.name);
-        while (e.scope == this && e.sym != sym) e = e.next();
         if (e.scope == null) return;
 
         scopeCounter.inc();
 
         // remove e from table and shadowed list;
-        Entry te = table[sym.name.hashCode() & hashMask];
+        int i = getIndex(sym.name);
+        Entry te = table[i];
         if (te == e)
-            table[sym.name.hashCode() & hashMask] = e.shadowed;
+            table[i] = e.shadowed;
         else while (true) {
             if (te.shadowed == e) {
                 te.shadowed = e.shadowed;
@@ -335,12 +339,50 @@
         return lookup(name, noFilter);
     }
     public Entry lookup(Name name, Filter<Symbol> sf) {
-        Entry e = table[name.hashCode() & hashMask];
+        Entry e = table[getIndex(name)];
+        if (e == null || e == sentinel)
+            return sentinel;
         while (e.scope != null && (e.sym.name != name || !sf.accepts(e.sym)))
             e = e.shadowed;
         return e;
     }
 
+    /*void dump (java.io.PrintStream out) {
+        out.println(this);
+        for (int l=0; l < table.length; l++) {
+            Entry le = table[l];
+            out.print("#"+l+": ");
+            if (le==sentinel) out.println("sentinel");
+            else if(le == null) out.println("null");
+            else out.println(""+le+" s:"+le.sym);
+        }
+    }*/
+
+    /** Look for slot in the table.
+     *  We use open addressing with double hashing.
+     */
+    int getIndex (Name name) {
+        int h = name.hashCode();
+        int i = h & hashMask;
+        // The expression below is always odd, so it is guaranteed
+        // be be mutually prime with table.length, a power of 2.
+        int x = hashMask - ((h + (h >> 16)) << 1);
+        int d = -1; // Index of a deleted item.
+        for (;;) {
+            Entry e = table[i];
+            if (e == null)
+                return d >= 0 ? d : i;
+            if (e == sentinel) {
+                // We have to keep searching even if we see a deleted item.
+                // However, remember the index in case we fail to find the name.
+                if (d < 0)
+                    d = i;
+            } else if (e.sym.name == name)
+                return i;
+            i = (i + x) & hashMask;
+        }
+    }
+
     public Iterable<Symbol> getElements() {
         return getElements(noFilter);
     }
@@ -441,10 +483,7 @@
          *  outwards if not found in this scope.
          */
         public Entry next() {
-            Entry e = shadowed;
-            while (e.scope != null && e.sym.name != sym.name)
-                e = e.shadowed;
-            return e;
+            return shadowed;
         }
 
         public Scope getOrigin() {
@@ -456,6 +495,8 @@
             // in many cases.
             return scope;
         }
+
+        protected boolean isBogus () { return false; }
     }
 
     public static class ImportScope extends Scope {
@@ -470,22 +511,10 @@
         }
 
         public Entry lookup(Name name) {
-            Entry e = table[name.hashCode() & hashMask];
-            while (e.scope != null &&
-                   (e.sym.name != name ||
-                    /* Since an inner class will show up in package and
-                     * import scopes until its inner class attribute has
-                     * been processed, we have to weed it out here.  This
-                     * is done by comparing the owners of the entry's
-                     * scope and symbol fields.  The scope field's owner
-                     * points to where the class originally was imported
-                     * from.  The symbol field's owner points to where the
-                     * class is situated now.  This can change when an
-                     * inner class is read (see ClassReader.enterClass).
-                     * By comparing the two fields we make sure that we do
-                     * not accidentally import an inner class that started
-                     * life as a flat class in a package. */
-                    e.sym.owner != e.scope.owner))
+            Entry e = table[getIndex(name)];
+            if (e == null)
+                return sentinel;
+            while (e.isBogus())
                 e = e.shadowed;
             return e;
         }
@@ -499,15 +528,33 @@
             }
             public Entry next() {
                 Entry e = super.shadowed;
-                while (e.scope != null &&
-                       (e.sym.name != sym.name ||
-                        e.sym.owner != e.scope.owner)) // see lookup()
+                while (e.isBogus())
                     e = e.shadowed;
                 return e;
             }
 
             @Override
             public Scope getOrigin() { return origin; }
+
+            /**
+             * Is this a bogus inner-class import?
+             * An inner class {@code Outer$Inner.class} read from a class file
+             * starts out in a package scope under the name {@code Outer$Inner},
+             * which (if star-imported) gets copied to the import scope.
+             * When the InnerClasses attribute is processed, the ClassSymbol
+             * is renamed in place (to {@code Inner}), and the owner changed
+             * to the {@code Outer} class.  The ImportScope still has the old
+             * Entry that was created and hashed as {@code "Outer$Inner"},
+             * but whose name was changed to {@code "Inner"}.  This violates
+             * the invariants for the Scope hash table, and so is pretty bogus.
+             * When the symbol was renamed, it should have been removed from
+             * the import scope (and not just the package scope); however,
+             * doing so is difficult.  A better fix would be to change
+             * import scopes to indirectly reference package symbols, rather
+             * than copy from them.
+             * Until then, we detect and skip the bogus entries using this test.
+             */
+            protected boolean isBogus () { return sym.owner != scope.owner; }
         }
     }
 
--- a/src/share/classes/com/sun/tools/javac/code/Source.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Source.java	Wed Dec 15 13:26:05 2010 +0000
@@ -177,9 +177,6 @@
     public boolean allowUnderscoresInLiterals() {
         return compareTo(JDK1_7) >= 0;
     }
-    public boolean allowExoticIdentifiers() {
-        return compareTo(JDK1_7) >= 0;
-    }
     public boolean allowStringsInSwitch() {
         return compareTo(JDK1_7) >= 0;
     }
--- a/src/share/classes/com/sun/tools/javac/code/Type.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Type.java	Wed Dec 15 13:26:05 2010 +0000
@@ -913,19 +913,19 @@
     /** Multiple types used in a throws type parameter */
     public static class DisjunctiveType extends Type {
 
-        public List<Type> types;
+        public List<Type> alternatives;
 
         public List<Type> getTypes() {
-            return types;
+            return alternatives;
         }
 
-        public DisjunctiveType(List<Type> types, TypeSymbol tsym) {
-            super(TypeTags.DISJOINT, tsym);
-            this.types = types;
+        public DisjunctiveType(List<Type> alternatives, com.sun.tools.javac.code.Types types) {
+            super(TypeTags.DISJOINT, types.lub(alternatives).tsym);
+            this.alternatives = alternatives;
         }
 
         public String toString() {
-            return types.toString("|");
+            return alternatives.toString("|");
         }
 
         @Override
--- a/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Wed Dec 15 13:26:05 2010 +0000
@@ -55,8 +55,8 @@
     }
 
     public void taFillAndLift(JCClassDecl tree, boolean visitBodies) {
-        new TypeAnnotationPositions().scan(tree);
-        new TypeAnnotationLift().scan(tree);
+//308        new TypeAnnotationPositions().scan(tree);
+//308        new TypeAnnotationLift().scan(tree);
     }
 
     private static class TypeAnnotationPositions extends TreeScanner {
@@ -113,9 +113,10 @@
                     p.pos = frame.pos;
                     return p;
 
+                case ANNOTATION_TYPE:
                 case CLASS:
+                case ENUM:
                 case INTERFACE:
-                case ENUM:
                     p.pos = frame.pos;
                     if (((JCClassDecl)frame).extending == tree) {
                         p.type = TargetType.CLASS_EXTENDS;
@@ -208,11 +209,11 @@
                     }
                     return p;
 
-                case ANNOTATED_TYPE: {
-                    List<JCTree> newPath = path.tail;
-                    return resolveFrame(newPath.head, newPath.tail.head,
-                            newPath, p);
-                }
+//308                case ANNOTATED_TYPE: {
+//308                    List<JCTree> newPath = path.tail;
+//308                    return resolveFrame(newPath.head, newPath.tail.head,
+//308                            newPath, p);
+//308                }
 
                 case METHOD_INVOCATION: {
                     JCMethodInvocation invocation = (JCMethodInvocation)frame;
--- a/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Dec 15 13:26:05 2010 +0000
@@ -282,12 +282,6 @@
         return isConvertible(null, t, s, warn);
     }
 
-    Type boxedTypeOrType(Type t) {
-        return t.tag <= VOID ?
-            boxedClass(t).type :
-            t;
-    }
-
     List<Type> boxedTypesOrTypes(List<Type> ts) {
         ListBuffer<Type> buf = lb();
         for (Type t : ts) {
@@ -589,9 +583,7 @@
                         //return type is the smallest between all candidate types
                         resType = resType == Type.noType ?
                             mtype.getReturnType() :
-                                mtype.getReturnType() == syms.voidType ?
-                                    syms.voidType :
-                                    glb(resType, mtype.getReturnType());
+                            bestReturnType(resType, mtype.getReturnType());
 
                         if (resType.isErroneous()) {
                             setDiagnostic("incompatible.targets.in.lambda.conv");
@@ -606,6 +598,12 @@
                 }
             }
         }
+        //WHERE
+            private Type bestReturnType(Type bestSoFar, Type t) {
+                if (bestSoFar.tag == VOID) return syms.voidType;
+                else if (bestSoFar.isPrimitive()) return isSameType(bestSoFar, t) ? t : syms.errType;
+                else return glb(bestSoFar, t);
+            }
 
         public JCDiagnostic getDiagnostic(JCDiagnostic.Factory diags) {
             return errKey != null ?
@@ -764,7 +762,7 @@
         }
 
         if (s.tag == DISJOINT && t.tag != DISJOINT) {
-            for (Type s2 : ((DisjunctiveType)s).types) {
+            for (Type s2 : ((DisjunctiveType)s).alternatives) {
                 if (isSubtype(t, s2, capture))
                     return true;
             }
@@ -869,10 +867,10 @@
             @Override
             public Boolean visitDisjunctiveType(DisjunctiveType t, Type s) {
                 List<Type> ss = s.tag == DISJOINT ?
-                    ((DisjunctiveType)s).types :
+                    ((DisjunctiveType)s).alternatives :
                     List.of(s);
 
-                return chk.unhandled(t.types, ss).isEmpty();
+                return chk.unhandled(t.alternatives, ss).isEmpty();
             }
 
             @Override
@@ -1156,17 +1154,17 @@
             @Override
             public Boolean visitDisjunctiveType(DisjunctiveType t, Type s) {
                 if (s.tag != DISJOINT) {
-                    return t.types.size() == 1 &&
-                            visit(t.types.head,s);
+                    return t.alternatives.size() == 1 &&
+                            visit(t.alternatives.head,s);
                 }
                 DisjunctiveType s2 = (DisjunctiveType)s;
-                if (t.types.length() != s2.types.length()) {
+                if (t.alternatives.length() != s2.alternatives.length()) {
                     return false;
                 }
                 //check commutativity
-                for (Type t2 : t.types) {
+                for (Type t2 : t.alternatives) {
                     boolean ok = false;
-                    for (Type s3 : s2.types) {
+                    for (Type s3 : s2.alternatives) {
                         if (visit(t2, s3)) {
                             ok = true;
                         }
@@ -1605,7 +1603,7 @@
 
             @Override
             public Boolean visitDisjunctiveType(DisjunctiveType t, Type s) {
-                for (Type t2 : t.types) {
+                for (Type t2 : t.alternatives) {
                     if (isCastableReference(t2, s)) {
                         return true;
                     }
@@ -2144,7 +2142,7 @@
 
             @Override
             public Type visitDisjunctiveType(DisjunctiveType t, Boolean recurse) {
-                return erasure(lub(t.types));
+                return erasure(lub(t.alternatives));
             }
 
             @Override
@@ -2294,7 +2292,7 @@
 
             @Override
             public Type visitDisjunctiveType(DisjunctiveType t, Void ignored) {
-                return lub(t.types);
+                return lub(t.alternatives);
             }
 
             @Override
@@ -2863,9 +2861,9 @@
 
         @Override
         public Type visitDisjunctiveType(DisjunctiveType t, Void s) {
-            List<Type> types1 = subst(t.types);
-            return (types1 != t.types) ?
-                new DisjunctiveType(types1, syms.disjointClass) :
+            List<Type> types1 = subst(t.alternatives);
+            return (types1 != t.alternatives) ?
+                new DisjunctiveType(types1, Types.this) :
                 t;
         }
 
@@ -3414,6 +3412,8 @@
     public Type glb(Type t, Type s) {
         if (s == null)
             return t;
+        else if (t.isPrimitive() || s.isPrimitive())
+            return syms.errType;
         else if (isSubtypeNoCapture(t, s))
             return t;
         else if (isSubtypeNoCapture(s, t))
@@ -3570,6 +3570,15 @@
     }
 
     /**
+     * Return the boxed type if 't' is primitive, otherwise return 't' itself.
+     */
+    public Type boxedTypeOrType(Type t) {
+        return t.isPrimitive() ?
+            boxedClass(t).type :
+            t;
+    }
+
+    /**
      * Return the primitive type corresponding to a boxed type.
      */
     public Type unboxedType(Type t) {
@@ -3793,7 +3802,7 @@
         return to.isParameterized() &&
                 (!(isUnbounded(to) ||
                 isSubtype(from, to) ||
-                ((subFrom != null) && isSameType(subFrom, to))));
+                ((subFrom != null) && containsType(to.allparams(), subFrom.allparams()))));
     }
 
     private List<Type> superClosure(Type t, Type s) {
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Dec 15 13:26:05 2010 +0000
@@ -128,6 +128,8 @@
         sourceName = source.name;
         relax = (options.isSet("-retrofit") ||
                  options.isSet("-relax"));
+        findDiamonds = options.get("findDiamond") != null &&
+                 source.allowDiamond();
         useBeforeDeclarationWarning = options.isSet("useBeforeDeclarationWarning");
         enableSunApiLintControl = options.isSet("enableSunApiLintControl");
         identifyLambdaCandidate = options.isSet("identifyLambdaCandidate") &&
@@ -167,6 +169,16 @@
      */
     boolean allowAnonOuterThis;
 
+    /** Switch: generates a warning if diamond can be safely applied
+     *  to a given new expression
+     */
+    boolean findDiamonds;
+
+    /**
+     * Internally enables/disables diamond finder feature
+     */
+    static final boolean allowDiamondFinder = true;
+
     /**
      * Switch: warn about use of variable before declaration?
      * RFE: 6425594
@@ -264,7 +276,7 @@
                (base.getTag() == JCTree.IDENT && TreeInfo.name(base) == names._this)) &&
                isAssignableAsBlankFinal(v, env)))) {
             if (v.isResourceVariable()) { //TWR resource
-                log.error(pos, "twr.resource.may.not.be.assigned", v);
+                log.error(pos, "try.resource.may.not.be.assigned", v);
             } else {
                 log.error(pos, "cant.assign.val.to.final.var", v);
             }
@@ -1086,11 +1098,11 @@
         for (JCTree resource : tree.resources) {
             if (resource.getTag() == JCTree.VARDEF) {
                 attribStat(resource, tryEnv);
-                chk.checkType(resource, tryEnv, resource.type, syms.autoCloseableType, "twr.not.applicable.to.type");
+                chk.checkType(resource, tryEnv, resource.type, syms.autoCloseableType, "try.not.applicable.to.type");
                 VarSymbol var = (VarSymbol)TreeInfo.symbolFor(resource);
                 var.setData(ElementKind.RESOURCE_VARIABLE);
             } else {
-                attribExpr(resource, tryEnv, syms.autoCloseableType, "twr.not.applicable.to.type");
+                attribExpr(resource, tryEnv, syms.autoCloseableType, "try.not.applicable.to.type");
             }
         }
         // Attribute body
@@ -1106,12 +1118,10 @@
 			catchEnv.info.allowsDisjointTypes = true;
             Type ctype = attribStat(c.param, catchEnv);
             if (TreeInfo.isMultiCatch(c)) {
-                //check that multi-catch parameter is marked as final
-                if ((c.param.sym.flags() & FINAL) == 0) {
-                    log.error(c.param.pos(), "multicatch.param.must.be.final", c.param.sym);
-                }
+                //multi-catch parameter is implicitly marked as final
+                c.param.sym.flags_field |= FINAL | DISJUNCTION;
             }
-            if (c.param.type.tsym.kind == Kinds.VAR) {
+            if (c.param.sym.kind == Kinds.VAR) {
                 c.param.sym.setData(ElementKind.EXCEPTION_PARAMETER);
             }
             chk.checkType(c.param.vartype.pos(), catchEnv,
@@ -1637,7 +1647,7 @@
         // Attribute clazz expression and store
         // symbol + type back into the attributed tree.
         Type clazztype = attribType(clazz, env);
-        Pair<Scope,Scope> mapping = getSyntheticScopeMapping(clazztype);
+        Pair<Scope,Scope> mapping = getSyntheticScopeMapping(clazztype, cdef != null);
         if (!TreeInfo.isDiamond(tree)) {
             clazztype = chk.checkClassType(
                 tree.clazz.pos(), clazztype, true);
@@ -1669,6 +1679,24 @@
         if (TreeInfo.isDiamond(tree)) {
             clazztype = attribDiamond(localEnv, tree, clazztype, mapping, argtypes, typeargtypes);
             clazz.type = clazztype;
+        } else if (allowDiamondFinder &&
+                clazztype.getTypeArguments().nonEmpty() &&
+                findDiamonds) {
+            Type inferred = attribDiamond(localEnv,
+                    tree,
+                    clazztype,
+                    mapping,
+                    argtypes,
+                    typeargtypes);
+            if (!inferred.isErroneous() &&
+                    inferred.tag == CLASS &&
+                    types.isAssignable(localEnv, inferred, pt.tag == NONE ? clazztype : pt, Warner.noWarnings) &&
+                    chk.checkDiamond((ClassType)inferred).isEmpty()) {
+                String key = types.isSameType(clazztype, inferred) ?
+                    "diamond.redundant.args" :
+                    "diamond.redundant.args.1";
+                log.warning(tree.clazz.pos(), key, clazztype, inferred);
+            }
         }
 
         // If we have made no mistakes in the class type...
@@ -1932,7 +1960,7 @@
      *  inference. The inferred return type of the synthetic constructor IS
      *  the inferred type for the diamond operator.
      */
-    private Pair<Scope, Scope> getSyntheticScopeMapping(Type ctype) {
+    private Pair<Scope, Scope> getSyntheticScopeMapping(Type ctype, boolean overrideProtectedAccess) {
         if (ctype.tag != CLASS) {
             return erroneousMapping;
         }
@@ -1943,6 +1971,12 @@
                 e.scope != null;
                 e = e.next()) {
             MethodSymbol newConstr = (MethodSymbol) e.sym.clone(ctype.tsym);
+            if (overrideProtectedAccess && (newConstr.flags() & PROTECTED) != 0) {
+                //make protected constructor public (this is required for
+                //anonymous inner class creation expressions using diamond)
+                newConstr.flags_field |= PUBLIC;
+                newConstr.flags_field &= ~PROTECTED;
+            }
             newConstr.name = names.init;
             List<Type> oldTypeargs = List.nil();
             if (newConstr.type.tag == FORALL) {
@@ -2821,8 +2855,8 @@
                 ((VarSymbol)sitesym).isResourceVariable() &&
                 sym.kind == MTH &&
                 sym.overrides(syms.autoCloseableClose, sitesym.type.tsym, types, true) &&
-                env.info.lint.isEnabled(Lint.LintCategory.ARM)) {
-            log.warning(tree, "twr.explicit.close.call");
+                env.info.lint.isEnabled(Lint.LintCategory.TRY)) {
+            log.warning(Lint.LintCategory.TRY, tree, "try.explicit.close.call");
         }
 
         // Disallow selecting a type from an expression
@@ -2945,7 +2979,7 @@
                 }
             case DISJOINT: {
                 DisjunctiveType ut = (DisjunctiveType) site;
-                tree.selected.type = site = types.lub(ut.types);
+                tree.selected.type = site = types.lub(ut.alternatives);
                 return selectSym(tree, site, env, pt, pkind);
             }
             case ERROR:
@@ -3450,21 +3484,21 @@
         result = check(tree, owntype, TYP, pkind, pt);
     }
 
-    public void visitTypeDisjoint(JCTypeDisjoint tree) {
-        List<Type> componentTypes = attribTypes(tree.components, env);
+    public void visitTypeDisjunction(JCTypeDisjunction tree) {
+        List<Type> componentTypes = attribTypes(tree.alternatives, env);
         List<Type> union = chk.union(componentTypes);
 
         //build a mapping from types in the union to component AST nodes
         //this is required in order to generate correct diagnostic
         //since chk.union might swap types
         for (Type t1 : union) {
-            for (JCExpression comp : tree.components) {
+            for (JCExpression comp : tree.alternatives) {
                 if (t1 == comp.type) {
-                    tree.componentsFromTypeMap.put(t1, comp);
+                    tree.alternativesFromTypeMap.put(t1, comp);
                 }
             }
         }
-        Type owntype = new DisjunctiveType(union, syms.disjointClass);
+        Type owntype = new DisjunctiveType(union, types);
         tree.type = result = check(tree, owntype, TYP, pkind, pt);
     }
 
@@ -3552,7 +3586,7 @@
             ? syms.objectType
             : attribType(tree.inner, env);
         if (type.tag == VOID) {
-            type = new DisjunctiveType(List.<Type>nil(), syms.disjointClass);
+            type = new DisjunctiveType(List.<Type>nil(), types);
         }
         result = check(tree, new WildcardType(chk.checkRefType(tree.pos(), type),
                                               tree.kind.kind,
--- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Dec 15 13:26:05 2010 +0000
@@ -534,13 +534,13 @@
             TreeInfo.typeIn(((JCWildcard)TreeInfo.typeIn(tree)).getBound()) :
             tree;        
         List<Type> ss = s.tag == DISJOINT ?
-            ((DisjunctiveType)s).types :
+            ((DisjunctiveType)s).alternatives :
             List.of(s);
         boolean isOk = true;
         for (Type s2 : ss) {
             if (!checkExtends1(s2, f, bk)) {
-                DiagnosticPosition pos = tree.getTag() == JCTree.TYPEDISJOINT ?
-                    ((JCTypeDisjoint)tree).componentsFromTypeMap.get(s2).pos() :
+                DiagnosticPosition pos = tree.getTag() == JCTree.TYPEDISJUNCTION ?
+                    ((JCTypeDisjunction)tree).alternativesFromTypeMap.get(s2).pos() :
                     tree.pos();
                 log.error(pos, "not.within.bounds", s2, types.getBounds(bs));
                 isOk = false;
@@ -723,7 +723,7 @@
     Type checkParameterType(Type actual, Type formal) {
         return ((formal.tsym.flags() & THROWS) != 0 &&
                 actual.tag == VOID) ?
-            new DisjunctiveType(List.<Type>nil(), syms.disjointClass) :
+            new DisjunctiveType(List.<Type>nil(), types) :
             actual;
     }
 
@@ -800,6 +800,14 @@
         public Boolean visitCapturedType(CapturedType t, Void s) {
             return false;
         }
+        @Override
+        public Boolean visitDisjunctiveType(DisjunctiveType t, Void s) {
+            return false; //TODO: see if we can lift this
+        }
+        @Override
+        public Boolean visitFunctionType(FunctionType t, Void s) {
+            return false;
+        }
     }
 
     Type checkSAM(DiagnosticPosition pos, Type t, Env<AttrContext> env) {
@@ -1149,11 +1157,11 @@
         }
 
         @Override
-        public void visitTypeDisjoint(JCTypeDisjoint tree) {            
+        public void visitTypeDisjunction(JCTypeDisjunction tree) {
             if (!env.info.allowsDisjointTypes) {
                 log.error(tree.pos, "disjoint.type.not.allowed.here");
             }
-            validate(tree.components, env);
+            validate(tree.alternatives, env);
         }
 
         @Override
@@ -1676,14 +1684,7 @@
                                             Type t1,
                                             Type t2,
                                             Type site) {
-        CompatibilityResult res = firstIncompatibility(t1, t2, site);
-        if (res.isErroneous()) {
-            log.error(pos, res.errKey,
-                      t1, t2, res.sym.name +
-                      "(" + types.memberType(t2, res.sym).getParameterTypes() + ")");
-            return false;
-        }
-        return true;
+        return firstIncompatibility(pos, t1, t2, site) == null;
     }
 
     /** Return the first method which is defined with same args
@@ -1694,21 +1695,7 @@
      *  @param site   The most derived type.
      *  @returns symbol from t2 that conflicts with one in t1.
      */
-    static class CompatibilityResult {
-        CompatibilityResult(Symbol sym, String errKey) {
-            this.sym = sym;
-            this.errKey = errKey;
-        }
-        CompatibilityResult() {
-            this(null, null);
-        }
-        boolean isErroneous() {
-            return sym != null;
-        }
-        Symbol sym;
-        String errKey;
-    }
-    private CompatibilityResult firstIncompatibility(Type t1, Type t2, Type site) {
+    private Symbol firstIncompatibility(DiagnosticPosition pos, Type t1, Type t2, Type site) {
         Map<TypeSymbol,Type> interfaces1 = new HashMap<TypeSymbol,Type>();
         closure(t1, interfaces1);
         Map<TypeSymbol,Type> interfaces2;
@@ -1719,11 +1706,11 @@
 
         for (Type t3 : interfaces1.values()) {
             for (Type t4 : interfaces2.values()) {
-                CompatibilityResult res = firstDirectIncompatibility(t3, t4, site);
-                if (res.isErroneous()) return res;
+                Symbol s = firstDirectIncompatibility(pos, t3, t4, site);
+                if (s != null) return s;
             }
         }
-        return new CompatibilityResult();
+        return null;
     }
 
     /** Compute all the supertypes of t, indexed by type symbol. */
@@ -1748,7 +1735,7 @@
     }
 
     /** Return the first method in t2 that conflicts with a method from t1. */
-    private CompatibilityResult firstDirectIncompatibility(Type t1, Type t2, Type site) {
+    private Symbol firstDirectIncompatibility(DiagnosticPosition pos, Type t1, Type t2, Type site) {
         for (Scope.Entry e1 = t1.tsym.members().elems; e1 != null; e1 = e1.sibling) {
             Symbol s1 = e1.sym;
             Type st1 = null;
@@ -1786,11 +1773,22 @@
                         }
                         errKey = "types.incompatible.diff.default";
                     }
-                    if (!compat) return new CompatibilityResult(s2, errKey);
+                    if (!compat) {
+                        log.error(pos, errKey,
+                            t1, t2, s2.name +
+                            "(" + types.memberType(t2, s2).getParameterTypes() + ")");
+                        return s2;
+                    }
+                } else if (!checkNameClash((ClassSymbol)site.tsym, s1, s2)) {
+                    log.error(pos,
+                            "name.clash.same.erasure.no.override",
+                            s1, s1.location(),
+                            s2, s2.location());
+                    return s2;
                 }
             }
         }
-        return new CompatibilityResult();
+        return null;
     }
     //WHERE
     boolean checkCommonOverriderIn(Symbol s1, Symbol s2, Type site) {
@@ -1838,32 +1836,52 @@
                 log.error(tree.pos(), "enum.no.finalize");
                 return;
             }
-        for (Type t = types.supertype(origin.type); t.tag == CLASS;
+        for (Type t = origin.type; t.tag == CLASS;
              t = types.supertype(t)) {
-            TypeSymbol c = t.tsym;
-            Scope.Entry e = c.members().lookup(m.name);
-            while (e.scope != null) {
-                if (m.overrides(e.sym, origin, types, false))
-                    checkOverride(tree, m, (MethodSymbol)e.sym, origin);
-                else if (e.sym.kind == MTH &&
-                        e.sym.isInheritedIn(origin, types) &&
-                        (e.sym.flags() & SYNTHETIC) == 0 &&
-                        !m.isConstructor()) {
-                    Type er1 = m.erasure(types);
-                    Type er2 = e.sym.erasure(types);
-                    if (types.isSameTypes(er1.getParameterTypes(),
-                            er2.getParameterTypes())) {
-                            log.error(TreeInfo.diagnosticPositionFor(m, tree),
-                                    "name.clash.same.erasure.no.override",
-                                    m, m.location(),
-                                    e.sym, e.sym.location());
-                    }
-                }
-                e = e.next();
+            if (t != origin.type) {
+                checkOverride(tree, t, origin, m);
+            }
+            for (Type t2 : types.interfaces(t)) {
+                checkOverride(tree, t2, origin, m);
             }
         }
     }
 
+    void checkOverride(JCTree tree, Type site, ClassSymbol origin, MethodSymbol m) {
+        TypeSymbol c = site.tsym;
+        Scope.Entry e = c.members().lookup(m.name);
+        while (e.scope != null) {
+            if (m.overrides(e.sym, origin, types, false)) {
+                if ((e.sym.flags() & ABSTRACT) == 0) {
+                    checkOverride(tree, m, (MethodSymbol)e.sym, origin);
+                }
+            }
+            else if (!checkNameClash(origin, e.sym, m)) {
+                log.error(tree,
+                            "name.clash.same.erasure.no.override",
+                            m, m.location(),
+                            e.sym, e.sym.location());
+            }
+            e = e.next();
+        }
+    }
+
+    private boolean checkNameClash(ClassSymbol origin, Symbol s1, Symbol s2) {
+        if (s1.kind == MTH &&
+                    s1.isInheritedIn(origin, types) &&
+                    (s1.flags() & SYNTHETIC) == 0 &&
+                    !s2.isConstructor()) {
+            Type er1 = s2.erasure(types);
+            Type er2 = s1.erasure(types);
+            if (types.isSameTypes(er1.getParameterTypes(),
+                    er2.getParameterTypes())) {
+                    return false;
+            }
+        }
+        return true;
+    }
+
+
     /** Check that all abstract members of given class have definitions.
      *  @param pos          Position to be used for error reporting.
      *  @param c            The class.
--- a/src/share/classes/com/sun/tools/javac/comp/Flow.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Dec 15 13:26:05 2010 +0000
@@ -229,7 +229,7 @@
      */
     Bits uninits;
 
-    HashMap<Symbol, List<Type>> multicatchTypes;
+    HashMap<Symbol, List<Type>> preciseRethrowTypes;
 
     /** The set of variables that are definitely unassigned everywhere
      *  in current try block. This variable is maintained lazily; it is
@@ -335,7 +335,7 @@
         if (!chk.isUnchecked(tree.pos(), exc)) {
             if (exc.tag == DISJOINT) {
                 DisjunctiveType dt = (DisjunctiveType)exc;
-                for (Type exc2 : dt.types) {
+                for (Type exc2 : dt.alternatives) {
                     if (!chk.isHandled(exc2, caught))
                         pendingExits.append(new PendingExit(tree, exc2));
                     thrown = chk.incl(exc2, thrown);
@@ -1009,7 +1009,7 @@
         thrown = List.nil();
         for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
             List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
-                    ((JCTypeDisjoint)l.head.param.vartype).components :
+                    ((JCTypeDisjunction)l.head.param.vartype).alternatives :
                     List.of(l.head.param.vartype);
             for (JCExpression ct : subClauses) {
                 caught = chk.incl(types.erasure(ct.type), caught);
@@ -1063,10 +1063,10 @@
         int nextadrCatch = nextadr;
 
         if (!unrefdResources.isEmpty() &&
-                lint.isEnabled(Lint.LintCategory.ARM)) {
+                lint.isEnabled(Lint.LintCategory.TRY)) {
             for (Map.Entry<VarSymbol, JCVariableDecl> e : unrefdResources.entrySet()) {
-                log.warning(e.getValue().pos(),
-                            "automatic.resource.not.referenced", e.getKey());
+                log.warning(Lint.LintCategory.TRY, e.getValue().pos(),
+                            "try.resource.not.referenced", e.getKey());
             }
         }
 
@@ -1075,7 +1075,7 @@
             alive = true;
             JCVariableDecl param = l.head.param;
             List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
-                    ((JCTypeDisjoint)l.head.param.vartype).components :
+                    ((JCTypeDisjunction)l.head.param.vartype).alternatives :
                     List.of(l.head.param.vartype);
             List<Type> ctypes = List.nil();
             List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry);
@@ -1103,12 +1103,12 @@
             scan(param);
             inits.incl(param.sym.adr);
             uninits.excl(param.sym.adr);
-            multicatchTypes.put(param.sym, chk.intersect(ctypes, rethrownTypes));
+            preciseRethrowTypes.put(param.sym, chk.intersect(ctypes, rethrownTypes));
             scanStat(l.head.body);
             initsEnd.andSet(inits);
             uninitsEnd.andSet(uninits);
             nextadr = nextadrCatch;
-            multicatchTypes.remove(param.sym);
+            preciseRethrowTypes.remove(param.sym);
             aliveEnd |= alive;
         }
         if (tree.finalizer != null) {
@@ -1241,10 +1241,10 @@
         Symbol sym = TreeInfo.symbol(tree.expr);
         if (sym != null &&
             sym.kind == VAR &&
-            (sym.flags() & FINAL) != 0 &&
-            multicatchTypes.get(sym) != null &&
+            (sym.flags() & (FINAL | EFFECTIVELY_FINAL)) != 0 &&
+            preciseRethrowTypes.get(sym) != null &&
             allowRethrowAnalysis) {
-            for (Type t : multicatchTypes.get(sym)) {
+            for (Type t : preciseRethrowTypes.get(sym)) {
                 markThrown(tree, t);
             }
         }
@@ -1463,11 +1463,24 @@
         if (!tree.type.isErroneous()
             && lint.isEnabled(Lint.LintCategory.CAST)
             && types.isSameType(tree.expr.type, tree.clazz.type)
-            && !(ignoreAnnotatedCasts && containsTypeAnnotation(tree.clazz))) {
+            && !(ignoreAnnotatedCasts && containsTypeAnnotation(tree.clazz))
+            && !is292targetTypeCast(tree)) {
             log.warning(Lint.LintCategory.CAST,
                     tree.pos(), "redundant.cast", tree.expr.type);
         }
     }
+    //where
+        private boolean is292targetTypeCast(JCTypeCast tree) {
+            boolean is292targetTypeCast = false;
+            if (tree.expr.getTag() == JCTree.APPLY) {
+                JCMethodInvocation apply = (JCMethodInvocation)tree.expr;
+                Symbol sym = TreeInfo.symbol(apply.meth);
+                is292targetTypeCast = sym != null &&
+                    sym.kind == MTH &&
+                    (sym.flags() & POLYMORPHIC_SIGNATURE) != 0;
+            }
+            return is292targetTypeCast;
+        }
 
     public void visitTopLevel(JCCompilationUnit tree) {
         // Do nothing for TopLevel since each class is visited individually
@@ -1517,7 +1530,7 @@
             firstadr = 0;
             nextadr = 0;
             pendingExits = new ListBuffer<PendingExit>();
-            multicatchTypes = new HashMap<Symbol, List<Type>>();
+            preciseRethrowTypes = new HashMap<Symbol, List<Type>>();
             alive = true;
             this.thrown = this.caught = null;
             this.classDef = null;
--- a/src/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java	Wed Dec 15 13:26:05 2010 +0000
@@ -251,7 +251,7 @@
                 that.inst = syms.botType;
             else if ((that.qtype.tsym.flags() & Flags.THROWS) != 0 ) {
                 List<Type> compTypes = List.filter(that.lobounds, syms.voidType);
-                that.inst = new DisjunctiveType(chk.union(compTypes), syms.disjointClass);
+                that.inst = new DisjunctiveType(chk.union(compTypes), types);
             } else {
                 that.inst = types.lub(that.lobounds);
             }
@@ -329,7 +329,8 @@
                 }
             }
         } else {
-            works = types.isSubtype(qtype1, to2);
+            works = types.isSubtype(qtype1,
+                qtype1.tag == UNDETVAR ? types.boxedTypeOrType(to2) : to2);
         }
         if (!works) {
             throw unambiguousNoInstanceException
@@ -689,12 +690,24 @@
             //the enclosing tree E, as follows: if E is a cast, then use the
             //target type of the cast expression as a return type; if E is an
             //expression statement, the return type is 'void' - otherwise the
-            //return type is simply 'Object'.
-            switch (env.outer.tree.getTag()) {
+            //return type is simply 'Object'. A correctness check ensures that
+            //env.next refers to the lexically enclosing environment in which
+            //the polymorphic signature call environment is nested.
+
+            switch (env.next.tree.getTag()) {
                 case JCTree.TYPECAST:
-                    restype = ((JCTypeCast)env.outer.tree).clazz.type; break;
+                    JCTypeCast castTree = (JCTypeCast)env.next.tree;
+                    restype = (castTree.expr == env.tree) ?
+                        castTree.clazz.type :
+                        syms.objectType;
+                    break;
                 case JCTree.EXEC:
-                    restype = syms.voidType; break;
+                    JCTree.JCExpressionStatement execTree =
+                            (JCTree.JCExpressionStatement)env.next.tree;
+                    restype = (execTree.expr == env.tree) ?
+                        syms.voidType :
+                        syms.objectType;
+                    break;
                 default:
                     restype = syms.objectType;
             }
--- a/src/share/classes/com/sun/tools/javac/comp/Lower.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/Lower.java	Wed Dec 15 13:26:05 2010 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, 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
@@ -1570,17 +1570,17 @@
     }
 
     private JCBlock makeArmFinallyClause(Symbol primaryException, JCExpression resource) {
-        // primaryException.addSuppressedException(catchException);
+        // primaryException.addSuppressed(catchException);
         VarSymbol catchException =
             new VarSymbol(0, make.paramName(2),
                           syms.throwableType,
                           currentMethodSym);
         JCStatement addSuppressionStatement =
             make.Exec(makeCall(make.Ident(primaryException),
-                               names.fromString("addSuppressedException"),
+                               names.addSuppressed,
                                List.<JCExpression>of(make.Ident(catchException))));
 
-        // try { resource.close(); } catch (e) { primaryException.addSuppressedException(e); }
+        // try { resource.close(); } catch (e) { primaryException.addSuppressed(e); }
         JCBlock tryBlock =
             make.Block(0L, List.<JCStatement>of(makeResourceCloseInvocation(resource)));
         JCVariableDecl catchExceptionDecl = make.VarDef(catchException, null);
--- a/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Dec 15 13:26:05 2010 +0000
@@ -707,9 +707,9 @@
     public void visitTree(JCTree tree) {
     }
 
-
     public void visitErroneous(JCErroneous tree) {
-        memberEnter(tree.errs, env);
+        if (tree.errs != null)
+            memberEnter(tree.errs, env);
     }
 
     public Env<AttrContext> getMethodEnv(JCMethodDecl tree, Env<AttrContext> env) {
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Dec 15 13:26:05 2010 +0000
@@ -161,33 +161,45 @@
      *  @param c      The class whose accessibility is checked.
      */
     public boolean isAccessible(Env<AttrContext> env, TypeSymbol c) {
+        return isAccessible(env, c, false);
+    }
+
+    public boolean isAccessible(Env<AttrContext> env, TypeSymbol c, boolean checkInner) {
+        boolean isAccessible = false;
         switch ((short)(c.flags() & AccessFlags)) {
-        case PRIVATE:
-            return
-                env.enclClass.sym.outermostClass() ==
-                c.owner.outermostClass();
-        case 0:
-            return
-                env.toplevel.packge == c.owner // fast special case
-                ||
-                env.toplevel.packge == c.packge()
-                ||
-                // Hack: this case is added since synthesized default constructors
-                // of anonymous classes should be allowed to access
-                // classes which would be inaccessible otherwise.
-                env.enclMethod != null &&
-                (env.enclMethod.mods.flags & ANONCONSTR) != 0;
-        default: // error recovery
-        case PUBLIC:
-            return true;
-        case PROTECTED:
-            return
-                env.toplevel.packge == c.owner // fast special case
-                ||
-                env.toplevel.packge == c.packge()
-                ||
-                isInnerSubClass(env.enclClass.sym, c.owner);
+            case PRIVATE:
+                isAccessible =
+                    env.enclClass.sym.outermostClass() ==
+                    c.owner.outermostClass();
+                break;
+            case 0:
+                isAccessible =
+                    env.toplevel.packge == c.owner // fast special case
+                    ||
+                    env.toplevel.packge == c.packge()
+                    ||
+                    // Hack: this case is added since synthesized default constructors
+                    // of anonymous classes should be allowed to access
+                    // classes which would be inaccessible otherwise.
+                    env.enclMethod != null &&
+                    (env.enclMethod.mods.flags & ANONCONSTR) != 0;
+                break;
+            default: // error recovery
+            case PUBLIC:
+                isAccessible = true;
+                break;
+            case PROTECTED:
+                isAccessible =
+                    env.toplevel.packge == c.owner // fast special case
+                    ||
+                    env.toplevel.packge == c.packge()
+                    ||
+                    isInnerSubClass(env.enclClass.sym, c.owner);
+                break;
         }
+        return (checkInner == false || c.type.getEnclosingType() == Type.noType) ?
+            isAccessible :
+            isAccessible & isAccessible(env, c.type.getEnclosingType(), checkInner);
     }
     //where
         /** Is given class a subclass of given base class, or an inner class
@@ -204,9 +216,13 @@
         }
 
     boolean isAccessible(Env<AttrContext> env, Type t) {
+        return isAccessible(env, t, false);
+    }
+
+    boolean isAccessible(Env<AttrContext> env, Type t, boolean checkInner) {
         return (t.tag == ARRAY)
             ? isAccessible(env, types.elemtype(t))
-            : isAccessible(env, t.tsym);
+            : isAccessible(env, t.tsym, checkInner);
     }
 
     /** Is symbol accessible as a member of given type in given evironment?
@@ -216,6 +232,9 @@
      *  @param sym    The symbol.
      */
     public boolean isAccessible(Env<AttrContext> env, Type site, Symbol sym) {
+        return isAccessible(env, site, sym, false);
+    }
+    public boolean isAccessible(Env<AttrContext> env, Type site, Symbol sym, boolean checkInner) {
         if (sym.name == names.init && sym.owner != site.tsym) return false;
         ClassSymbol sub;
         switch ((short)(sym.flags() & AccessFlags)) {
@@ -233,7 +252,7 @@
                  ||
                  env.toplevel.packge == sym.packge())
                 &&
-                isAccessible(env, site)
+                isAccessible(env, site, checkInner)
                 &&
                 sym.isInheritedIn(site.tsym, types)
                 &&
@@ -250,11 +269,11 @@
                  // (but type names should be disallowed elsewhere!)
                  env.info.selectSuper && (sym.flags() & STATIC) == 0 && sym.kind != TYP)
                 &&
-                isAccessible(env, site)
+                isAccessible(env, site, checkInner)
                 &&
                 notOverriddenIn(site, sym);
         default: // this case includes erroneous combinations as well
-            return isAccessible(env, site) && notOverriddenIn(site, sym);
+            return isAccessible(env, site, checkInner) && notOverriddenIn(site, sym);
         }
     }
     //where
--- a/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Wed Dec 15 13:26:05 2010 +0000
@@ -906,7 +906,8 @@
                 make.at(tree.pos);
                 if (addBridges) {
                     ListBuffer<JCTree> bridges = new ListBuffer<JCTree>();
-                    bridges.appendList(addOverrideBridgesIfNeeded(tree, c));
+                    if (false) //see CR: 6996415
+                        bridges.appendList(addOverrideBridgesIfNeeded(tree, c));
                     if ((tree.sym.flags() & INTERFACE) == 0)
                         addBridges(tree.pos(), tree.sym, bridges);
                     tree.defs = bridges.toList().prependList(tree.defs);
--- a/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Wed Dec 15 13:26:05 2010 +0000
@@ -25,6 +25,7 @@
 
 package com.sun.tools.javac.file;
 
+import java.util.Comparator;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -110,6 +111,20 @@
     protected boolean mmappedIO;
     protected boolean ignoreSymbolFile;
 
+    protected enum SortFiles implements Comparator<File> {
+        FORWARD {
+            public int compare(File f1, File f2) {
+                return f1.getName().compareTo(f2.getName());
+            }
+        },
+        REVERSE {
+            public int compare(File f1, File f2) {
+                return -f1.getName().compareTo(f2.getName());
+            }
+        };
+    };
+    protected SortFiles sortFiles;
+
     /**
      * Register a Context.Factory to create a JavacFileManager.
      */
@@ -152,6 +167,16 @@
 
         mmappedIO = options.isSet("mmappedIO");
         ignoreSymbolFile = options.isSet("ignore.symbol.file");
+
+        String sf = options.get("sortFiles");
+        if (sf != null) {
+            sortFiles = (sf.equals("reverse") ? SortFiles.REVERSE : SortFiles.FORWARD);
+        }
+    }
+
+    @Override
+    public boolean isDefaultBootClassPath() {
+        return paths.isDefaultBootClassPath();
     }
 
     public JavaFileObject getFileForInput(String name) {
@@ -293,6 +318,9 @@
             if (files == null)
                 return;
 
+            if (sortFiles != null)
+                Arrays.sort(files, sortFiles);
+
             for (File f: files) {
                 String fname = f.getName();
                 if (f.isDirectory()) {
--- a/src/share/classes/com/sun/tools/javac/file/Paths.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/file/Paths.java	Wed Dec 15 13:26:05 2010 +0000
@@ -114,6 +114,11 @@
      */
     private File bootClassPathRtJar = null;
 
+    /**
+     *  Is bootclasspath the default?
+     */
+    private boolean isDefaultBootClassPath;
+
     Path getPathForLocation(Location location) {
         Path path = pathsForLocation.get(location);
         if (path == null)
@@ -129,7 +134,7 @@
             if (location == CLASS_PATH)
                 p = computeUserClassPath();
             else if (location == PLATFORM_CLASS_PATH)
-                p = computeBootClassPath();
+                p = computeBootClassPath(); // sets isDefaultBootClassPath
             else if (location == ANNOTATION_PROCESSOR_PATH)
                 p = computeAnnotationProcessorPath();
             else if (location == SOURCE_PATH)
@@ -138,6 +143,8 @@
                 // no defaults for other paths
                 p = null;
         } else {
+            if (location == PLATFORM_CLASS_PATH)
+                isDefaultBootClassPath = false;
             p = new Path();
             for (File f: path)
                 p.addFile(f, warn); // TODO: is use of warn appropriate?
@@ -145,6 +152,11 @@
         pathsForLocation.put(location, p);
     }
 
+    public boolean isDefaultBootClassPath() {
+        lazy();
+        return isDefaultBootClassPath;
+    }
+
     protected void lazy() {
         if (!inited) {
             warn = lint.isEnabled(Lint.LintCategory.PATH);
@@ -262,9 +274,10 @@
         }
 
         public Path addFiles(String files, boolean warn) {
-            if (files != null)
+            if (files != null) {
                 for (File file : getPathEntries(files, emptyPathDefault))
                     addFile(file, warn);
+            }
             return this;
         }
 
@@ -334,18 +347,23 @@
 
     private Path computeBootClassPath() {
         bootClassPathRtJar = null;
-        String optionValue;
         Path path = new Path();
 
-        path.addFiles(options.get(XBOOTCLASSPATH_PREPEND));
+        String bootclasspathOpt = options.get(BOOTCLASSPATH);
+        String endorseddirsOpt = options.get(ENDORSEDDIRS);
+        String extdirsOpt = options.get(EXTDIRS);
+        String xbootclasspathPrependOpt = options.get(XBOOTCLASSPATH_PREPEND);
+        String xbootclasspathAppendOpt = options.get(XBOOTCLASSPATH_APPEND);
 
-        if ((optionValue = options.get(ENDORSEDDIRS)) != null)
-            path.addDirectories(optionValue);
+        path.addFiles(xbootclasspathPrependOpt);
+
+        if (endorseddirsOpt != null)
+            path.addDirectories(endorseddirsOpt);
         else
             path.addDirectories(System.getProperty("java.endorsed.dirs"), false);
 
-        if ((optionValue = options.get(BOOTCLASSPATH)) != null) {
-            path.addFiles(optionValue);
+        if (bootclasspathOpt != null) {
+            path.addFiles(bootclasspathOpt);
         } else {
             // Standard system classes for this compiler's release.
             String files = System.getProperty("sun.boot.class.path");
@@ -357,16 +375,21 @@
             }
         }
 
-        path.addFiles(options.get(XBOOTCLASSPATH_APPEND));
+        path.addFiles(xbootclasspathAppendOpt);
 
         // Strictly speaking, standard extensions are not bootstrap
         // classes, but we treat them identically, so we'll pretend
         // that they are.
-        if ((optionValue = options.get(EXTDIRS)) != null)
-            path.addDirectories(optionValue);
+        if (extdirsOpt != null)
+            path.addDirectories(extdirsOpt);
         else
             path.addDirectories(System.getProperty("java.ext.dirs"), false);
 
+        isDefaultBootClassPath =
+                (xbootclasspathPrependOpt == null) &&
+                (bootclasspathOpt == null) &&
+                (xbootclasspathAppendOpt == null);
+
         return path;
     }
 
--- a/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Wed Dec 15 13:26:05 2010 +0000
@@ -659,7 +659,7 @@
             {
                 sigp++;
                 List<Type> argtypes = sigToTypes(';');
-                return new DisjunctiveType(argtypes, syms.disjointClass);
+                return new DisjunctiveType(argtypes, types);
             }
         case 'S':
             sigp++;
@@ -2692,7 +2692,6 @@
                     String binaryName = fileManager.inferBinaryName(currentLoc, fo);
                     String simpleName = binaryName.substring(binaryName.lastIndexOf(".") + 1);
                     if (SourceVersion.isIdentifier(simpleName) ||
-                        fo.getKind() == JavaFileObject.Kind.CLASS ||
                         simpleName.equals("package-info"))
                         includeClassFile(p, fo);
                     break;
--- a/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Wed Dec 15 13:26:05 2010 +0000
@@ -352,7 +352,7 @@
         case DISJOINT:
             DisjunctiveType dt = (DisjunctiveType)type;
             sigbuf.appendByte('|');
-            assembleSig(dt.types);
+            assembleSig(dt.alternatives);
             sigbuf.appendByte(';');
             break;
         case UNINITIALIZED_THIS:
@@ -1024,7 +1024,9 @@
     /** Enter an inner class into the `innerClasses' set/queue.
      */
     void enterInner(ClassSymbol c) {
-        assert !c.type.isCompound();
+        if (c.type.isCompound()) {
+            throw new AssertionError("Unexpected intersection type: " + c.type);
+        }
         try {
             c.complete();
         } catch (CompletionFailure ex) {
--- a/src/share/classes/com/sun/tools/javac/jvm/Code.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/jvm/Code.java	Wed Dec 15 13:26:05 2010 +0000
@@ -1306,7 +1306,7 @@
         stackCount = 0;
         for (int i=0; i<state.stacksize; i++) {
             if (state.stack[i] != null) {
-                frame.stack[stackCount++] = state.stack[i];
+                frame.stack[stackCount++] = types.erasure(state.stack[i]);
             }
         }
 
--- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Dec 15 13:26:05 2010 +0000
@@ -1460,7 +1460,7 @@
                       List<Integer> gaps) {
             if (startpc != endpc) {
                 List<JCExpression> subClauses = TreeInfo.isMultiCatch(tree) ?
-                        ((JCTypeDisjoint)tree.param.vartype).components :
+                        ((JCTypeDisjunction)tree.param.vartype).alternatives :
                         List.of(tree.param.vartype);
                 while (gaps.nonEmpty()) {
                     for (JCExpression subCatch : subClauses) {
--- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Wed Dec 15 13:26:05 2010 +0000
@@ -51,6 +51,7 @@
 import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.code.Lint.LintCategory;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.tree.JCTree.*;
@@ -375,6 +376,15 @@
         processPcks   = options.isSet("process.packages");
         werror        = options.isSet(WERROR);
 
+        if (source.compareTo(Source.DEFAULT) < 0) {
+            if (options.isUnset(XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option)) {
+                if (fileManager instanceof BaseFileManager) {
+                    if (((BaseFileManager) fileManager).isDefaultBootClassPath())
+                        log.warning(LintCategory.OPTIONS, "source.no.bootclasspath", source.name);
+                }
+            }
+        }
+
         verboseCompilePolicy = options.isSet("verboseCompilePolicy");
 
         if (attrParseOnly)
@@ -518,7 +528,7 @@
 
     protected boolean shouldStop(CompileState cs) {
         if (shouldStopPolicy == null)
-            return (errorCount() > 0);
+            return (errorCount() > 0 || unrecoverableError());
         else
             return cs.ordinal() > shouldStopPolicy.ordinal();
     }
@@ -790,6 +800,7 @@
         hasBeenUsed = true;
 
         start_msec = now();
+
         try {
             initProcessAnnotations(processors);
 
@@ -804,7 +815,7 @@
             elapsed_msec = delegateCompiler.elapsed_msec;
         } catch (Abort ex) {
             if (devVerbose)
-                ex.printStackTrace();
+                ex.printStackTrace(System.err);
         } finally {
             if (procEnvImpl != null)
                 procEnvImpl.close();
@@ -848,7 +859,7 @@
             }
         } catch (Abort ex) {
             if (devVerbose)
-                ex.printStackTrace();
+                ex.printStackTrace(System.err);
         }
 
         if (verbose) {
@@ -1097,7 +1108,7 @@
 
     private boolean unrecoverableError() {
         for (JCDiagnostic d: log.deferredDiagnostics) {
-            if (d.getKind() == JCDiagnostic.Kind.ERROR && !d.isFlagSet(RESOLVE_ERROR))
+            if (d.getKind() == JCDiagnostic.Kind.ERROR && !d.isFlagSet(RECOVERABLE))
                 return true;
         }
         return false;
--- a/src/share/classes/com/sun/tools/javac/main/Main.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/main/Main.java	Wed Dec 15 13:26:05 2010 +0000
@@ -420,7 +420,7 @@
                          processors);
 
             if (log.expectDiagKeys != null) {
-                if (log.expectDiagKeys.size() == 0) {
+                if (log.expectDiagKeys.isEmpty()) {
                     Log.printLines(log.noticeWriter, "all expected diagnostics found");
                     return EXIT_OK;
                 } else {
@@ -506,7 +506,7 @@
     void apMessage(AnnotationProcessingError ex) {
         Log.printLines(out,
                        getLocalizedString("msg.proc.annotation.uncaught.exception"));
-        ex.getCause().printStackTrace();
+        ex.getCause().printStackTrace(out);
     }
 
     /** Display the location and checksum of a class. */
@@ -563,6 +563,7 @@
     public static void useRawMessages(boolean enable) {
         if (enable) {
             messages = new JavacMessages(javacBundleName) {
+                    @Override
                     public String getLocalizedString(String key, Object... args) {
                         return key;
                     }
--- a/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java	Wed Dec 15 13:26:05 2010 +0000
@@ -250,9 +250,13 @@
         /**
          * Sets "value" to an ExceptionProxy indicating a type mismatch.
          */
-        private void typeMismatch(final Method method, final Attribute attr) {
-            value = new ExceptionProxy() {
+        private void typeMismatch(Method method, final Attribute attr) {
+            class AnnotationTypeMismatchExceptionProxy extends ExceptionProxy {
                 static final long serialVersionUID = 269;
+                transient final Method method;
+                AnnotationTypeMismatchExceptionProxy(Method method) {
+                    this.method = method;
+                }
                 public String toString() {
                     return "<error>";   // eg:  @Anno(value=<error>)
                 }
@@ -260,7 +264,8 @@
                     return new AnnotationTypeMismatchException(method,
                                 attr.type.toString());
                 }
-            };
+            }
+            value = new AnnotationTypeMismatchExceptionProxy(method);
         }
     }
 
--- a/src/share/classes/com/sun/tools/javac/model/JavacElements.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/model/JavacElements.java	Wed Dec 15 13:26:05 2010 +0000
@@ -66,32 +66,26 @@
     private Types types;
     private Enter enter;
 
-    private static final Context.Key<JavacElements> KEY =
-            new Context.Key<JavacElements>();
-
     public static JavacElements instance(Context context) {
-        JavacElements instance = context.get(KEY);
-        if (instance == null) {
+        JavacElements instance = context.get(JavacElements.class);
+        if (instance == null)
             instance = new JavacElements(context);
-            context.put(KEY, instance);
-        }
         return instance;
     }
 
     /**
      * Public for use only by JavacProcessingEnvironment
      */
-    // TODO JavacElements constructor should be protected
-    public JavacElements(Context context) {
+    protected JavacElements(Context context) {
         setContext(context);
     }
 
     /**
      * Use a new context.  May be called from outside to update
      * internal state for a new annotation-processing round.
-     * This instance is *not* then registered with the new context.
      */
     public void setContext(Context context) {
+        context.put(JavacElements.class, this);
         javaCompiler = JavaCompiler.instance(context);
         syms = Symtab.instance(context);
         names = Names.instance(context);
--- a/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Wed Dec 15 13:26:05 2010 +0000
@@ -47,39 +47,34 @@
     private Symtab syms;
     private Types types;
 
-    private static final Context.Key<JavacTypes> KEY =
-            new Context.Key<JavacTypes>();
-
     public static JavacTypes instance(Context context) {
-        JavacTypes instance = context.get(KEY);
-        if (instance == null) {
+        JavacTypes instance = context.get(JavacTypes.class);
+        if (instance == null)
             instance = new JavacTypes(context);
-            context.put(KEY, instance);
-        }
         return instance;
     }
 
     /**
      * Public for use only by JavacProcessingEnvironment
      */
-    // TODO JavacTypes constructor should be protected
-    public JavacTypes(Context context) {
+    protected JavacTypes(Context context) {
         setContext(context);
     }
 
     /**
      * Use a new context.  May be called from outside to update
      * internal state for a new annotation-processing round.
-     * This instance is *not* then registered with the new context.
      */
     public void setContext(Context context) {
+        context.put(JavacTypes.class, this);
         syms = Symtab.instance(context);
         types = Types.instance(context);
     }
 
     public Element asElement(TypeMirror t) {
         Type type = cast(Type.class, t);
-        if (type.tag != TypeTags.CLASS && type.tag != TypeTags.TYPEVAR)
+        if (type.tag != TypeTags.CLASS && type.tag != TypeTags.TYPEVAR &&
+                type.tag != TypeTags.DISJOINT)
             return null;
         return type.asElement();
     }
--- a/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java	Wed Dec 15 13:26:05 2010 +0000
@@ -172,6 +172,11 @@
         return getClassLoader(lb.toArray(new URL[lb.size()]));
     }
 
+    @Override
+    public boolean isDefaultBootClassPath() {
+        return searchPaths.isDefaultBootClassPath();
+    }
+
     // <editor-fold defaultstate="collapsed" desc="Location handling">
 
     public boolean hasLocation(Location location) {
--- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed Dec 15 13:26:05 2010 +0000
@@ -32,6 +32,7 @@
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Flags;
 import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;
 import com.sun.tools.javac.util.List;
 import static com.sun.tools.javac.util.ListBuffer.lb;
 
@@ -77,42 +78,6 @@
     /** The name table. */
     private Names names;
 
-    // Because of javac's limited lookahead, some contexts are ambiguous in
-    // the presence of type annotations even though they are not ambiguous
-    // in the absence of type annotations.  Consider this code:
-    //   void m(String [] m) { }
-    //   void m(String ... m) { }
-    // After parsing "String", javac calls bracketsOpt which immediately
-    // returns if the next character is not '['.  Similarly, javac can see
-    // if the next token is ... and in that case parse an ellipsis.  But in
-    // the presence of type annotations:
-    //   void m(String @A [] m) { }
-    //   void m(String @A ... m) { }
-    // no finite lookahead is enough to determine whether to read array
-    // levels or an ellipsis.  Furthermore, if you call bracketsOpt, then
-    // bracketsOpt first reads all the leading annotations and only then
-    // discovers that it needs to fail.  bracketsOpt needs a way to push
-    // back the extra annotations that it read.  (But, bracketsOpt should
-    // not *always* be allowed to push back extra annotations that it finds
-    // -- in most contexts, any such extra annotation is an error.
-    // Another similar case occurs with arrays and receiver annotations:
-    //   String b() @Array [] @Receiver { }
-    //   String b() @Receiver { }
-    //
-    // The following two variables permit type annotations that have
-    // already been read to be stored for later use.  Alternate
-    // implementations are possible but would cause much larger changes to
-    // the parser.
-    /** Type annotations that have already been read but have not yet been used. **/
-    private List<JCTypeAnnotation> typeAnnotationsPushedBack = null;
-    /**
-     * If the parser notices extra annotations, then it either immediately
-     * issues an error (if this variable is false) or places the extra
-     * annotations in variable typeAnnotationsPushedBack (if this variable
-     * is true).
-     */
-    private boolean permitTypeAnnotationsPushBack = false;
-
     /** Construct a parser from a given scanner, tree factory and log.
      */
     protected JavacParser(ParserFactory fac,
@@ -137,7 +102,6 @@
         this.allowDiamond = source.allowDiamond();
         this.allowMulticatch = source.allowMulticatch();
         this.allowDefenderMethods = source.allowDefenderMethods();
-        this.allowTypeAnnotations = source.allowTypeAnnotations();
         this.allowThrowTypeParameters = source.allowThrowTypeParameters();
         this.allowLambda = source.allowLambda();
         this.allowFunctionTypes = source.allowLambda() && false && //disabled!!!
@@ -147,14 +111,9 @@
             docComments = new HashMap<JCTree,String>();
         this.keepLineMap = keepLineMap;
         this.errorTree = F.Erroneous();
-        this.debugJSR308 = fac.options.get("TA:parser") != null;
         this.allowMethodReferences = source.allowMethodReferences();
     }
 
-    /** Switch: debug output for type-annotations operations
-     */
-    boolean debugJSR308;
-
     /** Switch: Should generics be recognized?
      */
     boolean allowGenerics;
@@ -195,11 +154,7 @@
      */
     boolean allowAnnotations;
 
-    /** Switch: should we recognize type annotations?
-     */
-    boolean allowTypeAnnotations;
-
-	/** Switch: should we recognize automatic resource management?
+    /** Switch: should we recognize automatic resource management?
      */
     boolean allowTWR;
 
@@ -342,9 +297,9 @@
     private void reportSyntaxError(int pos, String key, Object... args) {
         if (pos > S.errPos() || pos == Position.NOPOS) {
             if (S.token() == EOF)
-                log.error(pos, "premature.eof");
+                error(pos, "premature.eof");
             else
-                log.error(pos, key, args);
+                error(pos, key, args);
         }
         S.errPos(pos);
         if (S.pos() == errorPos)
@@ -400,7 +355,7 @@
     void checkNoMods(long mods) {
         if (mods != 0) {
             long lowestMod = mods & -mods;
-            log.error(S.pos(), "mod.not.allowed.here",
+            error(S.pos(), "mod.not.allowed.here",
                       Flags.asFlagSet(lowestMod));
         }
     }
@@ -494,22 +449,22 @@
             return name;
         } else if (S.token() == ASSERT) {
             if (allowAsserts) {
-                log.error(S.pos(), "assert.as.identifier");
+                error(S.pos(), "assert.as.identifier");
                 S.nextToken();
                 return names.error;
             } else {
-                log.warning(S.pos(), "assert.as.identifier");
+                warning(S.pos(), "assert.as.identifier");
                 Name name = S.name();
                 S.nextToken();
                 return name;
             }
         } else if (S.token() == ENUM) {
             if (allowEnums) {
-                log.error(S.pos(), "enum.as.identifier");
+                error(S.pos(), "enum.as.identifier");
                 S.nextToken();
                 return names.error;
             } else {
-                log.warning(S.pos(), "enum.as.identifier");
+                warning(S.pos(), "enum.as.identifier");
                 Name name = S.name();
                 S.nextToken();
                 return name;
@@ -555,7 +510,7 @@
                     TypeTags.INT,
                     Convert.string2int(strval(prefix), S.radix()));
             } catch (NumberFormatException ex) {
-                log.error(S.pos(), "int.number.too.large", strval(prefix));
+                error(S.pos(), "int.number.too.large", strval(prefix));
             }
             break;
         case LONGLITERAL:
@@ -564,7 +519,7 @@
                     TypeTags.LONG,
                     new Long(Convert.string2long(strval(prefix), S.radix())));
             } catch (NumberFormatException ex) {
-                log.error(S.pos(), "int.number.too.large", strval(prefix));
+                error(S.pos(), "int.number.too.large", strval(prefix));
             }
             break;
         case FLOATLITERAL: {
@@ -577,9 +532,9 @@
                 n = Float.NaN;
             }
             if (n.floatValue() == 0.0f && !isZero(proper))
-                log.error(S.pos(), "fp.number.too.small");
+                error(S.pos(), "fp.number.too.small");
             else if (n.floatValue() == Float.POSITIVE_INFINITY)
-                log.error(S.pos(), "fp.number.too.large");
+                error(S.pos(), "fp.number.too.large");
             else
                 t = F.at(pos).Literal(TypeTags.FLOAT, n);
             break;
@@ -594,9 +549,9 @@
                 n = Double.NaN;
             }
             if (n.doubleValue() == 0.0d && !isZero(proper))
-                log.error(S.pos(), "fp.number.too.small");
+                error(S.pos(), "fp.number.too.small");
             else if (n.doubleValue() == Double.POSITIVE_INFINITY)
-                log.error(S.pos(), "fp.number.too.large");
+                error(S.pos(), "fp.number.too.large");
             else
                 t = F.at(pos).Literal(TypeTags.DOUBLE, n);
             break;
@@ -650,39 +605,12 @@
         return term(EXPR);
     }
 
-    /**
-     * parses (optional) type annotations followed by a type. If the
-     * annotations are present before the type and are not consumed during array
-     * parsing, this method returns a {@link JCAnnotatedType} consisting of
-     * these annotations and the underlying type. Otherwise, it returns the
-     * underlying type.
-     *
-     * <p>
-     *
-     * Note that this method sets {@code mode} to {@code TYPE} first, before
-     * parsing annotations.
-     */
     public JCExpression parseType(int mode) {
-        List<JCTypeAnnotation> annotations = typeAnnotationsOpt();
-        return parseType(annotations, mode);
+        return term(mode);
     }
 
     public JCExpression parseType() {
-        List<JCTypeAnnotation> annotations = typeAnnotationsOpt();
-        return parseType(annotations, TYPE | NOLAMBDA);
-    }
-
-    public JCExpression parseType(List<JCTypeAnnotation> annotations, int mode) {
-        JCExpression result = unannotatedType(mode);
-        
-        if (!annotations.isEmpty())
-            result = F.AnnotatedType(annotations, result);
-
-        return result;
-    }
-
-    public JCExpression unannotatedType(int mode) {
-        return term(mode);
+        return parseType(TYPE | NOLAMBDA);
     }
 
     JCExpression term(int newmode) {
@@ -930,8 +858,8 @@
      *                 | [TypeArguments] THIS [Arguments]
      *                 | [TypeArguments] SUPER SuperSuffix
      *                 | NEW [TypeArguments] Creator
-     *                 | [Annotations] Ident { "." Ident }
-     *                   [ [Annotations] "[" ( "]" BracketsOpt "." CLASS | Expression "]" )
+     *                 | Ident { "." Ident }
+     *                   [ "[" ( "]" BracketsOpt "." CLASS | Expression "]" )
      *                   | Arguments
      *                   | "." ( CLASS | THIS | [TypeArguments] SUPER Arguments | NEW [TypeArguments] InnerCreator )
      *                   ]
@@ -1099,62 +1027,23 @@
                 typeArgs = null;
             } else return illegal();
             break;
-        case MONKEYS_AT:
-
-            // only annotated targetting class literals or cast types are valid
-            List<JCTypeAnnotation> typeAnnos = typeAnnotationsOpt();
-            if (typeAnnos.isEmpty()) {
-                // else there would be no '@'
-                throw new AssertionError("type annos is empty");
-            }
-
-            JCExpression expr = term3();
-
-            // Type annotations: If term3 just parsed a non-type, expect a
-            // class literal (and issue a syntax error if there is no class
-            // literal). Otherwise, create a JCAnnotatedType.
-            if ((mode & TYPE) == 0) {
-                if (expr.getTag() != JCTree.SELECT)
-                    return illegal(typeAnnos.head.pos);
-                JCFieldAccess sel = (JCFieldAccess)expr;
-                if (sel.name != names._class)
-                    return illegal();
-                else {
-                    sel.selected = F.AnnotatedType(typeAnnos, sel.selected);
-                    t = expr;
-                }
-            } else {
-                // type annotation targeting a cast
-                t = toP(F.at(S.pos()).AnnotatedType(typeAnnos, expr));
-            }
-            break;
         case IDENTIFIER: case ASSERT: case ENUM:
             if (typeArgs != null) return illegal();
             t = toP(F.at(S.pos()).Ident(ident()));
             loop: while (true) {
                 pos = S.pos();
-                final List<JCTypeAnnotation> annos = typeAnnotationsOpt();
-
-                // need to report an error later if LBRACKET is for array
-                // index access rather than array creation level
-                if (!annos.isEmpty() && S.token() != LBRACKET && S.token() != ELLIPSIS)
-                    return illegal(annos.head.pos);
                 switch (S.token()) {
                 case LBRACKET:
                     S.nextToken();
-
                     if (S.token() == RBRACKET) {
-
                         S.nextToken();
-
-                        t = bracketsOpt(t, annos);
+                        t = bracketsOpt(t);
                         t = toP(F.at(pos).TypeArray(t));
                         t = bracketsSuffix(t);
                     } else {
                         if ((mode & EXPR) != 0) {
                             mode = EXPR;
                             JCExpression t1 = term();
-                            if (!annos.isEmpty()) t = illegal(annos.head.pos);
                             t = to(F.at(pos).Indexed(t, t1));
                         }
                         accept(RBRACKET);
@@ -1209,14 +1098,6 @@
                     // typeArgs saved for next loop iteration.
                     t = toP(F.at(pos).Select(t, ident()));
                     break;
-                case ELLIPSIS:
-                    if (this.permitTypeAnnotationsPushBack) {
-                        this.typeAnnotationsPushedBack = annos;
-                    } else if (annos.nonEmpty()) {
-                        // Don't return here -- error recovery attempt
-                        illegal(annos.head.pos);
-                    }
-                    break loop;
                 case LT:
                     if ((mode & NOLAMBDA) == 0) {
                         S.pushState();
@@ -1309,18 +1190,14 @@
         if (typeArgs != null) illegal();
         while (true) {
             int pos1 = S.pos();
-
-            final List<JCTypeAnnotation> annos = typeAnnotationsOpt();
-
             if (S.token() == LBRACKET) {
                 S.nextToken();
-
                 if ((mode & TYPE) != 0) {
                     int oldmode = mode;
                     mode = TYPE;
                     if (S.token() == RBRACKET) {
                         S.nextToken();
-                        t = bracketsOpt(t, annos);
+                        t = bracketsOpt(t);
                         t = toP(F.at(pos1).TypeArray(t));
                         return t;
                     }
@@ -1342,7 +1219,7 @@
                         accept(BAR);
                         types = types.append(parseType());
                     }
-                    t = toP(F.at(t.getStartPosition()).TypeDisjoint(types));
+                    t = toP(F.at(t.getStartPosition()).TypeDisjunction(types));
                     mode = oldmode;
                 }
                 else {
@@ -1375,12 +1252,6 @@
                 accept(HASH);
                 t = memberReferenceSuffix(pos1, t);
             } else {
-                if (!annos.isEmpty()) {
-                    if (permitTypeAnnotationsPushBack)
-                        typeAnnotationsPushedBack = annos;
-                    else
-                        return illegal(annos.head.pos);
-                }
                 break;
             }
         }
@@ -1390,7 +1261,6 @@
                   S.token() == PLUSPLUS ? JCTree.POSTINC : JCTree.POSTDEC, t));
             S.nextToken();
         }
-
         return toP(t);
     }
 
@@ -1635,26 +1505,24 @@
     }
     
     /** TypeArgument = Type
-     *               | [Annotations] "?"
-     *               | [Annotations] "?" EXTENDS Type {"&" Type}
-     *               | [Annotations] "?" SUPER Type
+     *               | "?"
+     *               | "?" EXTENDS Type {"&" Type}
+     *               | "?" SUPER Type
      */
     JCExpression typeArgument() {
-        List<JCTypeAnnotation> annotations = typeAnnotationsOpt();
-        if (S.token() != QUES) return parseType(annotations, TYPE | NOLAMBDA | DISJOINT);
+        if (S.token() != QUES) return parseType(TYPE | NOLAMBDA | DISJOINT);
         int pos = S.pos();
-            S.nextToken();
-        JCExpression result;
+        S.nextToken();
         if (S.token() == EXTENDS) {
             TypeBoundKind t = to(F.at(pos).TypeBoundKind(BoundKind.EXTENDS));
             S.nextToken();
             JCExpression bound = parseType(TYPE | NOLAMBDA | DISJOINT);
-            result = F.at(pos).Wildcard(t, bound);
+            return F.at(pos).Wildcard(t, bound);
         } else if (S.token() == SUPER) {
             TypeBoundKind t = to(F.at(pos).TypeBoundKind(BoundKind.SUPER));
             S.nextToken();
             JCExpression bound = parseType(TYPE | NOLAMBDA | DISJOINT);
-            result = F.at(pos).Wildcard(t, bound);
+            return F.at(pos).Wildcard(t, bound);
         } else if (S.token() == IDENTIFIER) {
             //error recovery
             reportSyntaxError(S.prevEndPos(), "expected3",
@@ -1662,14 +1530,11 @@
             TypeBoundKind t = F.at(Position.NOPOS).TypeBoundKind(BoundKind.UNBOUND);
             JCExpression wc = toP(F.at(pos).Wildcard(t, null));
             JCIdent id = toP(F.at(S.pos()).Ident(ident()));
-            result = F.at(pos).Erroneous(List.<JCTree>of(wc, id));
+            return F.at(pos).Erroneous(List.<JCTree>of(wc, id));
         } else {
             TypeBoundKind t = toP(F.at(pos).TypeBoundKind(BoundKind.UNBOUND));
-            result = toP(F.at(pos).Wildcard(t, null));
+            return toP(F.at(pos).Wildcard(t, null));
         }
-        if (!annotations.isEmpty())
-            result = toP(F.at(annotations.head.pos).AnnotatedType(annotations,result));
-        return result;
     }
 
     JCTypeApply typeArguments(JCExpression t) {
@@ -1678,47 +1543,21 @@
         return toP(F.at(pos).TypeApply(t, args));
     }
 
-    /**
-     * BracketsOpt = { [Annotations] "[" "]" }
-     *
-     * <p>
-     *
-     * <code>annotations</code> is the list of annotations targeting
-     * the expression <code>t</code>.
+    /** BracketsOpt = {"[" "]"}
      */
-    private JCExpression bracketsOpt(JCExpression t,
-            List<JCTypeAnnotation> annotations) {
-        List<JCTypeAnnotation> nextLevelAnnotations = typeAnnotationsOpt();
-
+    private JCExpression bracketsOpt(JCExpression t) {
         if (S.token() == LBRACKET) {
             int pos = S.pos();
             S.nextToken();
-
-            JCExpression orig = t;
-            t = bracketsOptCont(t, pos, nextLevelAnnotations);
-        } else if (!nextLevelAnnotations.isEmpty()) {
-            if (permitTypeAnnotationsPushBack) {
-                this.typeAnnotationsPushedBack = nextLevelAnnotations;
-            } else
-                return illegal(nextLevelAnnotations.head.pos);
+            t = bracketsOptCont(t, pos);
+            F.at(pos);
         }
-
-        int apos = S.pos();
-        if (!annotations.isEmpty())
-            t = F.at(apos).AnnotatedType(annotations, t);
         return t;
     }
 
-    /** BracketsOpt = {"[" TypeAnnotations "]"}
-     */
-    private JCExpression bracketsOpt(JCExpression t) {
-        return bracketsOpt(t, List.<JCTypeAnnotation>nil());
-    }
-
-    private JCArrayTypeTree bracketsOptCont(JCExpression t, int pos,
-            List<JCTypeAnnotation> annotations) {
+    private JCArrayTypeTree bracketsOptCont(JCExpression t, int pos) {
         accept(RBRACKET);
-        t = bracketsOpt(t, annotations);
+        t = bracketsOpt(t);
         return toP(F.at(pos).TypeArray(t));
     }
 
@@ -1802,29 +1641,18 @@
         return ts.toList();
     }
 
-    /** Creator = [Annotations] Qualident [TypeArguments] ( ArrayCreatorRest | ClassCreatorRest )
+    /** Creator = Qualident [TypeArguments] ( ArrayCreatorRest | ClassCreatorRest )
      */
     JCExpression creator(int newpos, List<JCExpression> typeArgs) {
-
-        List<JCTypeAnnotation> newAnnotations = typeAnnotationsOpt();
-
         switch (S.token()) {
         case BYTE: case SHORT: case CHAR: case INT: case LONG: case FLOAT:
         case DOUBLE: case BOOLEAN:
-            if (typeArgs == null) {
-                if (newAnnotations.isEmpty())
-                    return arrayCreatorRest(newpos, basicType());
-                else
-                    return arrayCreatorRest(newpos, F.AnnotatedType(newAnnotations, basicType()));
-            }
+            if (typeArgs == null)
+                return arrayCreatorRest(newpos, basicType());
             break;
         default:
         }
         JCExpression t = qualident();
-        // handle type annotations for non primitive arrays
-        if (!newAnnotations.isEmpty())
-            t = F.AnnotatedType(newAnnotations, t);
-
         int oldmode = mode;
         mode = TYPE | DIAMOND;
         if (S.token() == LT) {
@@ -1841,7 +1669,7 @@
             }
         }
         mode = oldmode;
-        if (S.token() == LBRACKET || S.token() == MONKEYS_AT) {
+        if (S.token() == LBRACKET) {
             JCExpression e = arrayCreatorRest(newpos, t);
             if (typeArgs != null) {
                 int pos = newpos;
@@ -1857,15 +1685,7 @@
             }
             return e;
         } else if (S.token() == LPAREN) {
-            JCNewClass newClass = classCreatorRest(newpos, null, typeArgs, t);
-            if (newClass.def != null) {
-                assert newClass.def.mods.annotations.isEmpty();
-                if (newAnnotations.nonEmpty()) {
-                    newClass.def.mods.pos = earlier(newClass.def.mods.pos, newAnnotations.head.pos);
-                    newClass.def.mods.annotations = List.convert(JCAnnotation.class, newAnnotations);
-                }
-            }
-            return newClass;
+            return classCreatorRest(newpos, null, typeArgs, t);
         } else {
             reportSyntaxError(S.pos(), "expected2",
                                LPAREN, LBRACKET);
@@ -1888,67 +1708,34 @@
         return classCreatorRest(newpos, encl, typeArgs, t);
     }
 
-    /** ArrayCreatorRest = [Annotations] "[" ( "]" BracketsOpt ArrayInitializer
-     *                         | Expression "]" {[Annotations]  "[" Expression "]"} BracketsOpt )
+    /** ArrayCreatorRest = "[" ( "]" BracketsOpt ArrayInitializer
+     *                         | Expression "]" {"[" Expression "]"} BracketsOpt )
      */
     JCExpression arrayCreatorRest(int newpos, JCExpression elemtype) {
-
-        List<JCTypeAnnotation> topAnnos = List.nil();
-        if (elemtype.getTag() == JCTree.ANNOTATED_TYPE) {
-            JCAnnotatedType atype = (JCAnnotatedType) elemtype;
-            topAnnos = atype.annotations;
-            elemtype = atype.underlyingType;
-        }
-
-        List<JCTypeAnnotation> annos = typeAnnotationsOpt();
-
         accept(LBRACKET);
-
         if (S.token() == RBRACKET) {
             accept(RBRACKET);
-
-            elemtype = bracketsOpt(elemtype, annos);
-
+            elemtype = bracketsOpt(elemtype);
             if (S.token() == LBRACE) {
-                JCNewArray na = (JCNewArray)arrayInitializer(newpos, elemtype);
-
-                na.annotations = topAnnos;
-
-                return na;
+                return arrayInitializer(newpos, elemtype);
             } else {
                 return syntaxError(S.pos(), "array.dimension.missing");
             }
         } else {
             ListBuffer<JCExpression> dims = new ListBuffer<JCExpression>();
-
-            // maintain array dimension type annotations
-            ListBuffer<List<JCTypeAnnotation>> dimAnnotations = ListBuffer.lb();
-            dimAnnotations.append(annos);
-
             dims.append(parseExpression());
             accept(RBRACKET);
-            while (S.token() == LBRACKET
-                    || (S.token() == MONKEYS_AT)) {
-                List<JCTypeAnnotation> maybeDimAnnos = typeAnnotationsOpt();
+            while (S.token() == LBRACKET) {
                 int pos = S.pos();
                 S.nextToken();
                 if (S.token() == RBRACKET) {
-                    elemtype = bracketsOptCont(elemtype, pos, maybeDimAnnos);
+                    elemtype = bracketsOptCont(elemtype, pos);
                 } else {
-                    if (S.token() == RBRACKET) { // no dimension
-                        elemtype = bracketsOptCont(elemtype, pos, maybeDimAnnos);
-                    } else {
-                        dimAnnotations.append(maybeDimAnnos);
-                        dims.append(parseExpression());
-                        accept(RBRACKET);
-                    }
+                    dims.append(parseExpression());
+                    accept(RBRACKET);
                 }
             }
-
-            JCNewArray na = toP(F.at(newpos).NewArray(elemtype, dims.toList(), null));
-            na.annotations = topAnnos;
-            na.dimAnnotations = dimAnnotations.toList();
-            return na;
+            return toP(F.at(newpos).NewArray(elemtype, dims.toList(), null));
         }
     }
 
@@ -2090,7 +1877,7 @@
             case ENUM:
             case ASSERT:
                 if (allowEnums && S.token() == ENUM) {
-                    log.error(S.pos(), "local.enum");
+                    error(S.pos(), "local.enum");
                     stats.
                         append(classOrInterfaceOrEnumDeclaration(modifiersOpt(),
                                                                  S.docComment()));
@@ -2267,7 +2054,7 @@
             S.nextToken();
             List<JCTree> resources = List.<JCTree>nil();
             if (S.token() == LPAREN) {
-                checkAutomaticResourceManagement();
+                checkTryWithResources();
                 S.nextToken();
                 resources = resources();
                 accept(RPAREN);
@@ -2284,9 +2071,9 @@
             } else {
                 if (allowTWR) {
                     if (resources.isEmpty())
-                        log.error(pos, "try.without.catch.finally.or.resource.decls");
+                        error(pos, "try.without.catch.finally.or.resource.decls");
                 } else
-                    log.error(pos, "try.without.catch.or.finally");
+                    error(pos, "try.without.catch.or.finally");
             }
             return F.at(pos).Try(resources, body, catchers.toList(), finalizer);
         }
@@ -2383,7 +2170,7 @@
         JCModifiers mods = optFinal(Flags.PARAMETER);
         List<JCExpression> catchTypes = catchTypes();
         JCExpression paramType = catchTypes.size() > 1 ?
-                toP(F.at(catchTypes.head.getStartPosition()).TypeDisjoint(catchTypes)) :
+                toP(F.at(catchTypes.head.getStartPosition()).TypeDisjunction(catchTypes)) :
                 catchTypes.head;
         JCVariableDecl formal = variableDeclaratorId(mods, paramType);
         accept(RPAREN);
@@ -2485,32 +2272,17 @@
                                         new ListBuffer<JCExpressionStatement>()).toList();
     }
 
-    enum AnnotationKind { DEFAULT_ANNO, TYPE_ANNO };
-
     /** AnnotationsOpt = { '@' Annotation }
      */
-    List<JCAnnotation> annotationsOpt(AnnotationKind kind) {
+    List<JCAnnotation> annotationsOpt() {
         if (S.token() != MONKEYS_AT) return List.nil(); // optimization
         ListBuffer<JCAnnotation> buf = new ListBuffer<JCAnnotation>();
-        int prevmode = mode;
         while (S.token() == MONKEYS_AT) {
             int pos = S.pos();
             S.nextToken();
-            buf.append(annotation(pos, kind));
+            buf.append(annotation(pos));
         }
-        lastmode = mode;
-        mode = prevmode;
-        List<JCAnnotation> annotations = buf.toList();
-
-        if (debugJSR308 && kind == AnnotationKind.TYPE_ANNO)
-            System.out.println("TA: parsing " + annotations
-                    + " in " + log.currentSourceFile());
-        return annotations;
-    }
-
-    List<JCTypeAnnotation> typeAnnotationsOpt() {
-        List<JCAnnotation> annotations = annotationsOpt(AnnotationKind.TYPE_ANNO);
-        return List.convert(JCTypeAnnotation.class, annotations);
+        return buf.toList();
     }
 
     /** ModifiersOpt = { Modifier }
@@ -2556,13 +2328,13 @@
             case MONKEYS_AT  : flag = Flags.ANNOTATION; break;
             default: break loop;
             }
-            if ((flags & flag) != 0) log.error(S.pos(), "repeated.modifier");
+            if ((flags & flag) != 0) error(S.pos(), "repeated.modifier");
             lastPos = S.pos();
             S.nextToken();
             if (flag == Flags.ANNOTATION) {
                 checkAnnotations();
                 if (S.token() != INTERFACE) {
-                    JCAnnotation ann = annotation(lastPos, AnnotationKind.DEFAULT_ANNO);
+                    JCAnnotation ann = annotation(lastPos);
                     // if first modifier is an annotation, set pos to annotation's.
                     if (flags == 0 && annotations.isEmpty())
                         pos = ann.pos;
@@ -2593,18 +2365,12 @@
     /** Annotation              = "@" Qualident [ "(" AnnotationFieldValues ")" ]
      * @param pos position of "@" token
      */
-    JCAnnotation annotation(int pos, AnnotationKind kind) {
+    JCAnnotation annotation(int pos) {
         // accept(AT); // AT consumed by caller
         checkAnnotations();
-        if (kind == AnnotationKind.TYPE_ANNO)
-            checkTypeAnnotations();
         JCTree ident = qualident();
         List<JCExpression> fieldValues = annotationFieldValuesOpt();
-        JCAnnotation ann;
-        if (kind == AnnotationKind.DEFAULT_ANNO)
-            ann = F.at(pos).Annotation(ident, fieldValues);
-        else
-            ann = F.at(pos).TypeAnnotation(ident, fieldValues);
+        JCAnnotation ann = F.at(pos).Annotation(ident, fieldValues);
         storeEnd(ann, S.prevEndPos());
         return ann;
     }
@@ -2657,7 +2423,7 @@
         case MONKEYS_AT:
             pos = S.pos();
             S.nextToken();
-            return annotation(pos, AnnotationKind.DEFAULT_ANNO);
+            return annotation(pos);
         case LBRACE:
             pos = S.pos();
             accept(LBRACE);
@@ -2908,7 +2674,7 @@
             }
         } else {
             if (S.token() == ENUM) {
-                log.error(S.pos(), "enums.not.supported.in.source", source.name);
+                error(S.pos(), "enums.not.supported.in.source", source.name);
                 allowEnums = true;
                 return enumDeclaration(mods, dc);
             }
@@ -3048,7 +2814,7 @@
             S.resetDeprecatedFlag();
         }
         int pos = S.pos();
-        List<JCAnnotation> annotations = annotationsOpt(AnnotationKind.DEFAULT_ANNO);
+        List<JCAnnotation> annotations = annotationsOpt();
         JCModifiers mods = F.at(annotations.isEmpty() ? Position.NOPOS : pos).Modifiers(flags, annotations);
         List<JCExpression> typeArgs = typeArgumentsOpt();
         int identPos = S.pos();
@@ -3149,8 +2915,6 @@
             } else {
                 pos = S.pos();
                 List<JCTypeParameter> typarams = typeParametersOpt();
-                List<JCAnnotation> annosAfterParams = annotationsOpt(AnnotationKind.DEFAULT_ANNO);
-
                 Name name = S.name();
                 if (isInterface && name.equals(names._extension)) {
                     log.warning(pos, "redundant.extension.keyword");
@@ -3160,22 +2924,14 @@
                 JCExpression type;
                 boolean isVoid = S.token() == VOID;
                 if (isVoid) {
-                    if (annosAfterParams.nonEmpty())
-                        illegal(annosAfterParams.head.pos);
                     type = to(F.at(pos).TypeIdent(TypeTags.VOID));
                     S.nextToken();
                 } else {
-                    if (annosAfterParams.nonEmpty()) {
-                        mods.annotations = mods.annotations.appendList(annosAfterParams);
-                        if (mods.pos == Position.NOPOS)
-                            mods.pos = mods.annotations.head.pos;
-                    }
-                    // method returns types are un-annotated types
-                    type = unannotatedType(TYPE);
+                    type = parseType();
                 }
                 if (S.token() == LPAREN && !isInterface && type.getTag() == JCTree.IDENT) {
                     if (isInterface || name != className)
-                        log.error(pos, "invalid.meth.decl.ret.type.req");
+                        error(pos, "invalid.meth.decl.ret.type.req");
                     return List.of(methodDeclaratorRest(
                         pos, mods, null, names.init, typarams, isAnno, true, dc));
                 } else {
@@ -3205,15 +2961,15 @@
     }
 
     /** MethodDeclaratorRest =
-     *      FormalParameters BracketsOpt [Annotations] [Throws TypeList] ( MethodBody | [DEFAULT AnnotationValue] ";")
+     *      FormalParameters BracketsOpt [Throws TypeList] ( MethodBody | [DEFAULT AnnotationValue] ";")
      *  VoidMethodDeclaratorRest =
-     *      FormalParameters [Annotations] [Throws TypeList] ( MethodBody | ";")
+     *      FormalParameters [Throws TypeList] ( MethodBody | ";")
      *  InterfaceMethodDeclaratorRest =
-     *      FormalParameters BracketsOpt [Annotations] [THROWS TypeList] ";"
+     *      FormalParameters BracketsOpt [THROWS TypeList] ";"
      *  VoidInterfaceMethodDeclaratorRest =
-     *      FormalParameters [Annotations] [THROWS TypeList] ";"
+     *      FormalParameters [THROWS TypeList] ";"
      *  ConstructorDeclaratorRest =
-     *      "(" FormalParameterListOpt ")" [Annotations] [THROWS TypeList] MethodBody
+     *      "(" FormalParameterListOpt ")" [THROWS TypeList] MethodBody
      *  DefenderMethodDeclaratorRest =
      *      "(" FormalParameterListOpt ")" [Annotations] [THROWS TypeList] DEFAULT IDENT { '.' [TYPEARGS] IDENT }
      */
@@ -3226,22 +2982,7 @@
                               boolean isVoid,
                               String dc) {
         List<JCVariableDecl> params = formalParameters();
-
-        List<JCTypeAnnotation> receiverAnnotations;
-        if (!isVoid) {
-            // need to distinguish between receiver anno and array anno
-            // look at typeAnnotationsPushedBack comment
-            this.permitTypeAnnotationsPushBack = true;
-            type = methodReturnArrayRest(type);
-            this.permitTypeAnnotationsPushBack = false;
-            if (typeAnnotationsPushedBack == null)
-                receiverAnnotations = List.nil();
-            else
-                receiverAnnotations = typeAnnotationsPushedBack;
-            typeAnnotationsPushedBack = null;
-        } else
-            receiverAnnotations = typeAnnotationsOpt();
-
+        if (!isVoid) type = bracketsOpt(type);
         List<JCExpression> thrown = List.nil();
         if (S.token() == THROWS) {
             S.nextToken();
@@ -3302,51 +3043,20 @@
 
         JCMethodDecl result =
             toP(F.at(pos).MethodDef(mods, name, type, typarams,
-                                    params, receiverAnnotations, thrown,
+                                    params, thrown,
                                     body, defaultValue));
         attach(result, dc);
         return result;
     }
 
-    /** Parses the array levels after the format parameters list, and append
-     * them to the return type, while preseving the order of type annotations
-     */
-    private JCExpression methodReturnArrayRest(JCExpression type) {
-        if (type.getTag() != JCTree.TYPEARRAY)
-            return bracketsOpt(type);
-
-        JCArrayTypeTree baseArray = (JCArrayTypeTree)type;
-        while (TreeInfo.typeIn(baseArray.elemtype) instanceof JCArrayTypeTree)
-            baseArray = (JCArrayTypeTree)TreeInfo.typeIn(baseArray.elemtype);
-
-        if (baseArray.elemtype.getTag() == JCTree.ANNOTATED_TYPE) {
-            JCAnnotatedType at = (JCAnnotatedType)baseArray.elemtype;
-            at.underlyingType = bracketsOpt(at.underlyingType);
-        } else {
-            baseArray.elemtype = bracketsOpt(baseArray.elemtype);
-        }
-
-        return type;
-    }
-
-    /** QualidentList = [Annotations] Qualident {"," [Annotations] Qualident}
+    /** QualidentList = Qualident {"," Qualident}
      */
     List<JCExpression> qualidentList() {
         ListBuffer<JCExpression> ts = new ListBuffer<JCExpression>();
-
-        List<JCTypeAnnotation> typeAnnos = typeAnnotationsOpt();
-        if (!typeAnnos.isEmpty())
-            ts.append(F.AnnotatedType(typeAnnos, qualident()));
-        else
-            ts.append(qualident());
+        ts.append(qualident());
         while (S.token() == COMMA) {
             S.nextToken();
-
-            typeAnnos = typeAnnotationsOpt();
-            if (!typeAnnos.isEmpty())
-                ts.append(F.AnnotatedType(typeAnnos, qualident()));
-            else
-                ts.append(qualident());
+            ts.append(qualident());
         }
         return ts.toList();
     }
@@ -3370,13 +3080,12 @@
         }
     }
 
-    /** TypeParameter = [Annotations] TypeVariable [TypeParameterBound]
+    /** TypeParameter = TypeVariable [TypeParameterBound]
      *  TypeParameterBound = EXTENDS Type {"&" Type}
      *  TypeVariable = Ident
      */
     JCTypeParameter typeParameter() {
         int pos = S.pos();
-        List<JCTypeAnnotation> annos = typeAnnotationsOpt();
         long flags = 0;        
         if (S.token() == THROWS) {
             checkThrowTypeParameters();
@@ -3393,7 +3102,7 @@
                 bounds.append(parseType());
             }
         }
-        return toP(F.at(pos).TypeParameter(flags, name, bounds.toList(), annos));
+        return toP(F.at(pos).TypeParameter(flags, name, bounds.toList()));
     }
 
     /** FormalParameters = "(" [ FormalParameterList ] ")"
@@ -3437,12 +3146,7 @@
         if (lambda) {
             S.pushState();
         }
-        // need to distinguish between vararg annos and array annos
-        // look at typeAnnotaitonsPushedBack comment
-        this.permitTypeAnnotationsPushBack = true;
         JCExpression type = parseType();
-        this.permitTypeAnnotationsPushBack = false;
-
         if (lambda && (
                 S.token() == COMMA ||
                 S.token() == ARROW)) {
@@ -3452,30 +3156,24 @@
         S.mergeState();
 
         if (S.token() == ELLIPSIS) {
-            List<JCTypeAnnotation> varargsAnnos = typeAnnotationsPushedBack;
-            typeAnnotationsPushedBack = null;
             checkVarargs();
             mods.flags |= Flags.VARARGS;
-            // insert var arg type annotations
-            if (varargsAnnos != null && varargsAnnos.nonEmpty())
-                type = F.at(S.pos()).AnnotatedType(varargsAnnos, type);
             type = to(F.at(S.pos()).TypeArray(type));
-
             S.nextToken();
-        } else {
-            // if not a var arg, then typeAnnotationsPushedBack should be null
-            if (typeAnnotationsPushedBack != null
-                    && !typeAnnotationsPushedBack.isEmpty()) {
-                reportSyntaxError(typeAnnotationsPushedBack.head.pos,
-                        "illegal.start.of.type");
-            }
-            typeAnnotationsPushedBack = null;
         }
         return variableDeclaratorId(mods, type);
     }
 
 /* ---------- auxiliary methods -------------- */
 
+    void error(int pos, String key, Object ... args) {
+        log.error(DiagnosticFlag.SYNTAX, pos, key, args);
+    }
+
+    void warning(int pos, String key, Object ... args) {
+        log.warning(pos, key, args);
+    }
+
     /** Check that given tree is a legal expression statement.
      */
     protected JCExpression checkExprStat(JCExpression t) {
@@ -3491,7 +3189,7 @@
         case JCTree.ERRONEOUS:
             return t;
         default:
-            log.error(t.pos, "not.stmt");
+            error(t.pos, "not.stmt");
             return F.at(t.pos).Erroneous(List.<JCTree>of(t));
         }
     }
@@ -3657,55 +3355,49 @@
     }
     void checkGenerics(int pos) {
         if (!allowGenerics) {
-            log.error(pos, "generics.not.supported.in.source", source.name);
+            error(pos, "generics.not.supported.in.source", source.name);
             allowGenerics = true;
         }
     }
     void checkVarargs() {
         if (!allowVarargs) {
-            log.error(S.pos(), "varargs.not.supported.in.source", source.name);
+            error(S.pos(), "varargs.not.supported.in.source", source.name);
             allowVarargs = true;
         }
     }
     void checkForeach() {
         if (!allowForeach) {
-            log.error(S.pos(), "foreach.not.supported.in.source", source.name);
+            error(S.pos(), "foreach.not.supported.in.source", source.name);
             allowForeach = true;
         }
     }
     void checkStaticImports() {
         if (!allowStaticImport) {
-            log.error(S.pos(), "static.import.not.supported.in.source", source.name);
+            error(S.pos(), "static.import.not.supported.in.source", source.name);
             allowStaticImport = true;
         }
     }
     void checkAnnotations() {
         if (!allowAnnotations) {
-            log.error(S.pos(), "annotations.not.supported.in.source", source.name);
+            error(S.pos(), "annotations.not.supported.in.source", source.name);
             allowAnnotations = true;
         }
     }
-    void checkTypeAnnotations() {
-        if (!allowTypeAnnotations) {
-            log.error(S.pos(), "type.annotations.not.supported.in.source", source.name);
-            allowTypeAnnotations = true;
-        }
-    }
     void checkDiamond() {
         if (!allowDiamond) {
-            log.error(S.pos(), "diamond.not.supported.in.source", source.name);
+            error(S.pos(), "diamond.not.supported.in.source", source.name);
             allowDiamond = true;
         }
     }
     void checkMulticatch() {
         if (!allowMulticatch) {
-            log.error(S.pos(), "multicatch.not.supported.in.source", source.name);
+            error(S.pos(), "multicatch.not.supported.in.source", source.name);
             allowMulticatch = true;
         }
     }
-	void checkAutomaticResourceManagement() {
+    void checkTryWithResources() {
         if (!allowTWR) {
-            log.error(S.pos(), "automatic.resource.management.not.supported.in.source", source.name);
+            error(S.pos(), "try.with.resources.not.supported.in.source", source.name);
             allowTWR = true;
         }
     }
--- a/src/share/classes/com/sun/tools/javac/parser/Scanner.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/parser/Scanner.java	Wed Dec 15 13:26:05 2010 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, 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
@@ -46,6 +46,7 @@
 public class Scanner implements Lexer {
 
     private static boolean scannerDebug = false;
+
     /* Output variables; set by nextToken():
      */
 
@@ -65,11 +66,6 @@
      */
     private boolean allowUnderscoresInLiterals;
 
-	/** Allow exotic identifiers.
-     */
-    private boolean allowExoticIdentifiers;
-
-
     /** Give experimental assist to JSR 292 "ldc CONSTANT_MethodHandle".
      *  Note: this code should be removed from the final version
      */
@@ -216,7 +212,6 @@
         allowHexFloats = source.allowHexFloats();
         allowUnderscoresInLiterals = source.allowBinaryLiterals();
         allowMethodReferences = source.allowMethodReferences();
-        allowExoticIdentifiers = source.allowExoticIdentifiers();  // for invokedynamic
         stateStack = List.of(new ScannerState());
     }
 
@@ -384,7 +379,7 @@
 
     /** Read next character in character or string literal and copy into sbuf.
      */
-    private void scanLitChar(boolean forBytecodeName) {
+    private void scanLitChar() {
         if (ch == '\\') {
             if (buf[bp+1] == '\\' && unicodeConversionBp != bp) {
                 bp++;
@@ -424,18 +419,6 @@
                     putChar('\"'); scanChar(); break;
                 case '\\':
                     putChar('\\'); scanChar(); break;
-                case '|': case ',': case '?': case '%':
-                case '^': case '_': case '{': case '}':
-                case '!': case '-': case '=':
-                    if (forBytecodeName) {
-                        // Accept escape sequences for dangerous bytecode chars.
-                        // This is illegal in normal Java string or character literals.
-                        // Note that the escape sequence itself is passed through.
-                        putChar('\\'); putChar(ch); scanChar();
-                    } else {
-                        lexError(bp, "illegal.esc.char");
-                    }
-                    break;
                 default:
                     lexError(bp, "illegal.esc.char");
                 }
@@ -444,24 +427,6 @@
             putChar(ch); scanChar();
         }
     }
-    private void scanLitChar() {
-        scanLitChar(false);
-    }
-
-    /** Read next character in an exotic name #"foo"
-     */
-    private void scanBytecodeNameChar() {
-        switch (ch) {
-        // reject any "dangerous" char which is illegal somewhere in the JVM spec
-        // cf. http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm
-        case '/': case '.': case ';':  // illegal everywhere
-        case '<': case '>':  // illegal in methods, dangerous in classes
-        case '[':  // illegal in classes
-            lexError(bp, "illegal.bytecode.ident.char", String.valueOf((int)ch));
-            break;
-        }
-        scanLitChar(true);
-    }
 
     private void scanDigits(int digitRadix) {
         char saveCh;
@@ -1079,25 +1044,7 @@
                     return;
                 case '#':
                     scanChar();
-                    if (ch == '\"') {
-                        if (!allowExoticIdentifiers) {
-                            lexError("unsupported.exotic.id", source.name);
-                            allowExoticIdentifiers = true;
-                        }
-                        scanChar();
-                        if (ch == '\"')
-                            lexError(pos, "empty.bytecode.ident");
-                        while (ch != '\"' && ch != CR && ch != LF && bp < buflen) {
-                            scanBytecodeNameChar();
-                        }
-                        if (ch == '\"') {
-                            name = names.fromChars(sbuf, 0, sp);
-                            token = IDENTIFIER;  // even if #"int" or #"do"
-                            scanChar();
-                        } else {
-                            lexError(pos, "unclosed.bytecode.ident");
-                        }
-                    } else if (ch == '{') {
+                    if (ch == '{') {
                         scanChar();
                         token = LAMBDA;
                     } else if (allowMethodReferences && scanOperator('#')) {
--- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Wed Dec 15 13:26:05 2010 +0000
@@ -49,11 +49,11 @@
 import javax.tools.JavaFileObject;
 import javax.tools.DiagnosticListener;
 
-import com.sun.tools.javac.api.JavacTrees;
-import com.sun.source.util.AbstractTypeProcessor;
+//308 import com.sun.source.util.AbstractTypeProcessor;
 import com.sun.source.util.TaskEvent;
 import com.sun.source.util.TaskListener;
 import com.sun.tools.javac.api.JavacTaskImpl;
+import com.sun.tools.javac.api.JavacTrees;
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.file.JavacFileManager;
@@ -173,12 +173,12 @@
         platformAnnotations = initPlatformAnnotations();
         foundTypeProcessors = false;
 
-        // Initialize services before any processors are initialzied
+        // Initialize services before any processors are initialized
         // in case processors use them.
         filer = new JavacFiler(context);
         messager = new JavacMessager(context, this);
-        elementUtils = new JavacElements(context);
-        typeUtils = new JavacTypes(context);
+        elementUtils = JavacElements.instance(context);
+        typeUtils = JavacTypes.instance(context);
         processorOptions = initProcessorOptions(context);
         unmatchedProcessorOptions = initUnmatchedProcessorOptions();
         messages = JavacMessages.instance(context);
@@ -712,7 +712,7 @@
             }
 
             if (matchedNames.size() > 0 || ps.contributed) {
-                foundTypeProcessors = foundTypeProcessors || (ps.processor instanceof AbstractTypeProcessor);
+//308                foundTypeProcessors = foundTypeProcessors || (ps.processor instanceof AbstractTypeProcessor);
                 boolean processingResult = callProcessor(ps.processor, typeElements, renv);
                 ps.contributed = true;
                 ps.removeSupportedOptions(unmatchedProcessorOptions);
@@ -865,8 +865,6 @@
             this(prev.nextContext(), prev.number+1, prev.compiler.log.nwarnings);
             this.genClassFiles = prev.genClassFiles;
 
-            updateProcessingState();
-
             List<JCCompilationUnit> parsedFiles = compiler.parseFiles(newSourceFiles);
             roots = cleanTrees(prev.roots).appendList(parsedFiles);
 
@@ -941,7 +939,7 @@
                         break;
 
                     case ERROR:
-                        if (fatalErrors || !d.isFlagSet(RESOLVE_ERROR))
+                        if (fatalErrors || !d.isFlagSet(RECOVERABLE))
                             return true;
                         break;
                 }
@@ -1029,15 +1027,6 @@
             log.reportDeferredDiagnostics(kinds);
         }
 
-        /** Update the processing state for the current context. */
-        private void updateProcessingState() {
-            filer.newRound(context);
-            messager.newRound(context);
-
-            elementUtils.setContext(context);
-            typeUtils.setContext(context);
-        }
-
         /** Print info about this round. */
         private void printRoundInfo(boolean lastRound) {
             if (printRounds || verbose) {
@@ -1100,6 +1089,11 @@
             JavaCompiler nextCompiler = JavaCompiler.instance(next);
             nextCompiler.initRound(oldCompiler);
 
+            filer.newRound(next);
+            messager.newRound(next);
+            elementUtils.setContext(next);
+            typeUtils.setContext(next);
+
             JavacTaskImpl task = context.get(JavacTaskImpl.class);
             if (task != null) {
                 next.put(JavacTaskImpl.class, task);
--- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Dec 15 13:26:05 2010 +0000
@@ -63,8 +63,6 @@
     anonymous class implements interface; cannot have type arguments
 compiler.err.anon.class.impl.intf.no.qual.for.new=\
     anonymous class implements interface; cannot have qualifier for new
-compiler.misc.twr.not.applicable.to.type=\
-    automatic resource management not applicable to variable type
 compiler.err.array.and.varargs=\
     cannot declare both {0} and {1} in {2}
 compiler.err.array.dimension.missing=\
@@ -198,8 +196,6 @@
 
 compiler.err.else.without.if=\
     ''else'' without ''if''
-compiler.err.empty.bytecode.ident=\
-    empty bytecode identifier
 compiler.err.empty.char.lit=\
     empty character literal
 compiler.err.encl.class.required=\
@@ -226,12 +222,10 @@
 
 compiler.err.final.parameter.may.not.be.assigned=\
     final parameter {0} may not be assigned
-compiler.err.twr.resource.may.not.be.assigned=\
-    automatic resource {0} may not be assigned
+compiler.err.try.resource.may.not.be.assigned=\
+    auto-closeable resource {0} may not be assigned
 compiler.err.multicatch.parameter.may.not.be.assigned=\
     multi-catch parameter {0} may not be assigned
-compiler.err.multicatch.param.must.be.final=\
-    multi-catch parameter {0} must be final
 compiler.err.finally.without.try=\
     ''finally'' without ''try''
 compiler.err.foreach.not.applicable.to.type=\
@@ -248,8 +242,6 @@
 
 compiler.err.icls.cant.have.static.decl=\
     inner classes cannot have static declarations
-compiler.err.illegal.bytecode.ident.char=\
-    illegal bytecode identifier character: \\{0}
 compiler.err.illegal.char=\
     illegal character: \\{0}
 compiler.err.illegal.char.for.encoding=\
@@ -534,8 +526,6 @@
 compiler.err.types.incompatible.diff.default=\
     types {0} and {1} are incompatible; both define {2}, but with unrelated default implementations
 
-compiler.err.unclosed.bytecode.ident=\
-    unclosed bytecode identifier
 compiler.err.unclosed.char.lit=\
     unclosed character literal
 compiler.err.unclosed.comment=\
@@ -839,6 +829,9 @@
 compiler.warn.static.not.qualified.by.type=\
     static {0} should be qualified by type name, {1}, instead of by an expression
 
+compiler.warn.source.no.bootclasspath=\
+    bootstrap class path not set in conjunction with -source {0}
+
 # Warnings related to annotation processing
 compiler.warn.proc.package.does.not.exist=\
     package {0} does not exist
@@ -890,10 +883,10 @@
 compiler.warn.proc.unmatched.processor.options=\
     The following options were not recognized by any processor: ''{0}''
 
-compiler.warn.twr.explicit.close.call=\
-    [arm] explicit call to close() on an automatic resource
-compiler.warn.automatic.resource.not.referenced=\
-    [arm] automatic resource {0} is never referenced in body of corresponding try statement
+compiler.warn.try.explicit.close.call=\
+    explicit call to close() on an auto-closeable resource
+compiler.warn.try.resource.not.referenced=\
+    auto-closeable resource {0} is never referenced in body of corresponding try statement
 compiler.warn.unchecked.assign=\
     unchecked assignment: {0} to {1}
 compiler.warn.unchecked.assign.to.var=\
@@ -938,6 +931,13 @@
     found raw type: {0}\n\
     missing type parameters for generic class {1}
 
+compiler.warn.diamond.redundant.args=\
+    redundant type arguments in new expression (use diamond operator instead).
+compiler.warn.diamond.redundant.args.1=\
+    redundant type arguments in new expression (use diamond operator instead).\n\
+    explicit: {0}\n\
+    inferred: {1}
+
 compiler.warn.redundant.extension.keyword=\
     The ''extension'' keyword is no longer required to denote an extension method.\n\
     (might be disallowed in future versions of the compiler)
@@ -1118,6 +1118,9 @@
 # compiler.err.no.elem.type=\
 #     \[\*\] cannot have a type
 
+compiler.misc.try.not.applicable.to.type=\
+    try-with-resources not applicable to variable type
+
 #####
 
 compiler.err.type.found.req=\
@@ -1359,13 +1362,9 @@
     underscores in literals are not supported in -source {0}\n\
 (use -source 7 or higher to enable underscores in literals)
 
-compiler.err.unsupported.exotic.id=\
-    exotic identifiers #"___" are not supported in -source {0}\n\
-(use -source 7 or higher to enable exotic identifiers)
-
-compiler.err.automatic.resource.management.not.supported.in.source=\
-    automatic resource management is not supported in -source {0}\n\
-(use -source 7 or higher to enable automatic resource management)
+compiler.err.try.with.resources.not.supported.in.source=\
+    try-with-resources is not supported in -source {0}\n\
+(use -source 7 or higher to enable try-with-resources)
 
 compiler.warn.enum.as.identifier=\
     as of release 5, ''enum'' is a keyword, and may not be used as an identifier\n\
@@ -1395,9 +1394,9 @@
     annotations are not supported in -source {0}\n\
 (use -source 5 or higher to enable annotations)
 
-compiler.err.type.annotations.not.supported.in.source=\
-    type annotations are not supported in -source {0}\n\
-(use -source 7 or higher to enable type annotations)
+#308 compiler.err.type.annotations.not.supported.in.source=\
+#308     type annotations are not supported in -source {0}\n\
+#308 (use -source 7 or higher to enable type annotations)
 
 compiler.err.foreach.not.supported.in.source=\
     for-each loops are not supported in -source {0}\n\
--- a/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Wed Dec 15 13:26:05 2010 +0000
@@ -247,11 +247,11 @@
 
     /** Disjunctive types, of type TypeDisjoint.
      */
-    public static final int TYPEDISJOINT = TYPEAPPLY + 1;
+    public static final int TYPEDISJUNCTION = TYPEAPPLY + 1;
 
     /** Function types, of type FunctionType.
      */
-    public static final int TYPEFUNCTION = TYPEDISJOINT + 1;
+    public static final int TYPEFUNCTION = TYPEDISJUNCTION + 1;
 
     /** Formal type parameters, of type TypeParameter.
      */
@@ -2013,29 +2013,29 @@
     /**
      * A disjoint type, T1 | T2 | ... Tn (used in multicatch statements)
      */
-    public static class JCTypeDisjoint extends JCExpression implements DisjointTypeTree {
+     public static class JCTypeDisjunction extends JCExpression implements DisjunctiveTypeTree {
 
-        public List<JCExpression> components;
-        public HashMap<Type, JCExpression> componentsFromTypeMap = new HashMap<Type, JCExpression>();
+        public List<JCExpression> alternatives;
+        public HashMap<Type, JCExpression> alternativesFromTypeMap = new HashMap<Type, JCExpression>();
 
-        protected JCTypeDisjoint(List<JCExpression> components) {
-            this.components = components;
+        protected JCTypeDisjunction(List<JCExpression> components) {
+            this.alternatives = components;
         }
         @Override
-        public void accept(Visitor v) { v.visitTypeDisjoint(this); }
+        public void accept(Visitor v) { v.visitTypeDisjunction(this); }
 
-        public Kind getKind() { return Kind.DISJOINT_TYPE; }
+        public Kind getKind() { return Kind.DISJUNCTIVE_TYPE; }
 
-        public List<JCExpression> getTypeComponents() {
-            return components;
+        public List<JCExpression> getTypeAlternatives() {
+            return alternatives;
         }
         @Override
         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
-            return v.visitDisjointType(this, d);
+            return v.visitDisjunctiveType(this, d);
         }
         @Override
         public int getTag() {
-            return TYPEDISJOINT;
+            return TYPEDISJUNCTION;
         }
     }
 
@@ -2236,17 +2236,23 @@
         }
     }
 
-    public static class JCAnnotatedType extends JCExpression implements com.sun.source.tree.AnnotatedTypeTree {
+    public static class JCAnnotatedType extends JCExpression
+//308            implements com.sun.source.tree.AnnotatedTypeTree
+    {
         public List<JCTypeAnnotation> annotations;
         public JCExpression underlyingType;
         protected JCAnnotatedType(List<JCTypeAnnotation> annotations, JCExpression underlyingType) {
-            this.annotations = annotations;
-            this.underlyingType = underlyingType;
+            throw new UnsupportedOperationException();
+//308            this.annotations = annotations;
+//308            this.underlyingType = underlyingType;
         }
         @Override
         public void accept(Visitor v) { v.visitAnnotatedType(this); }
 
-        public Kind getKind() { return Kind.ANNOTATED_TYPE; }
+        public Kind getKind() {
+            throw new UnsupportedOperationException();
+//308            return Kind.ANNOTATED_TYPE;
+        }
         public List<JCTypeAnnotation> getAnnotations() {
             return annotations;
         }
@@ -2255,7 +2261,8 @@
         }
         @Override
         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
-            return v.visitAnnotatedType(this, d);
+            throw new UnsupportedOperationException();
+//308            return v.visitAnnotatedType(this, d);
         }
         @Override
         public int getTag() {
@@ -2449,7 +2456,7 @@
         public void visitTypeIdent(JCPrimitiveTypeTree that) { visitTree(that); }
         public void visitTypeArray(JCArrayTypeTree that)     { visitTree(that); }
         public void visitTypeApply(JCTypeApply that)         { visitTree(that); }
-        public void visitTypeDisjoint(JCTypeDisjoint that)   { visitTree(that); }
+        public void visitTypeDisjunction(JCTypeDisjunction that)   { visitTree(that); }
         public void visitFunctionType(JCFunctionType that)   { visitTree(that); }
         public void visitTypeParameter(JCTypeParameter that) { visitTree(that); }
         public void visitWildcard(JCWildcard that)           { visitTree(that); }
--- a/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Wed Dec 15 13:26:05 2010 +0000
@@ -1257,9 +1257,9 @@
         }
     }
 
-    public void visitTypeDisjoint(JCTypeDisjoint tree) {
+    public void visitTypeDisjunction(JCTypeDisjunction tree) {
         try {
-            printExprs(tree.components, " | ");
+            printExprs(tree.alternatives, " | ");
         } catch (IOException e) {
             throw new UncheckedIOException(e);
         }
--- a/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Wed Dec 15 13:26:05 2010 +0000
@@ -71,12 +71,12 @@
         return lb.toList();
     }
 
-    public JCTree visitAnnotatedType(AnnotatedTypeTree node, P p) {
-        JCAnnotatedType t = (JCAnnotatedType) node;
-        List<JCTypeAnnotation> annotations = copy(t.annotations, p);
-        JCExpression underlyingType = copy(t.underlyingType, p);
-        return M.at(t.pos).AnnotatedType(annotations, underlyingType);
-    }
+//308    public JCTree visitAnnotatedType(AnnotatedTypeTree node, P p) {
+//308        JCAnnotatedType t = (JCAnnotatedType) node;
+//308        List<JCTypeAnnotation> annotations = copy(t.annotations, p);
+//308        JCExpression underlyingType = copy(t.underlyingType, p);
+//308        return M.at(t.pos).AnnotatedType(annotations, underlyingType);
+//308    }
 
     public JCTree visitAnnotation(AnnotationTree node, P p) {
         JCAnnotation t = (JCAnnotation) node;
@@ -359,10 +359,10 @@
         return M.at(t.pos).TypeApply(clazz, arguments);
     }
 
-    public JCTree visitDisjointType(DisjointTypeTree node, P p) {
-        JCTypeDisjoint t = (JCTypeDisjoint) node;
-        List<JCExpression> components = copy(t.components, p);
-        return M.at(t.pos).TypeDisjoint(components);
+    public JCTree visitDisjunctiveType(DisjunctiveTypeTree node, P p) {
+        JCTypeDisjunction t = (JCTypeDisjunction) node;
+        List<JCExpression> components = copy(t.alternatives, p);
+        return M.at(t.pos).TypeDisjunction(components);
     }
 
     public JCTree visitFunctionType(FunctionTypeTree node, P p) {
--- a/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Wed Dec 15 13:26:05 2010 +0000
@@ -119,7 +119,7 @@
     }
 
     public static boolean isMultiCatch(JCCatch catchClause) {
-        return catchClause.param.vartype.getTag() == JCTree.TYPEDISJOINT;
+        return catchClause.param.vartype.getTag() == JCTree.TYPEDISJUNCTION;
     }
 
     /** Is statement an initializer for a synthetic field?
@@ -964,7 +964,7 @@
         case JCTree.WILDCARD: /* wild cards */
         case JCTree.TYPEPARAMETER: /* type parameters */
         case JCTree.TYPEAPPLY: /* parameterized types */
-        case JCTree.TYPEDISJOINT: /* disjoint types */
+        case JCTree.TYPEDISJUNCTION: /* disjoint types */
             return tree;
         default:
             throw new AssertionError("Unexpected type tree: " + tree);
--- a/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Wed Dec 15 13:26:05 2010 +0000
@@ -465,8 +465,8 @@
         return tree;
     }
 
-    public JCTypeDisjoint TypeDisjoint(List<JCExpression> components) {
-        JCTypeDisjoint tree = new JCTypeDisjoint(components);
+    public JCTypeDisjunction TypeDisjunction(List<JCExpression> components) {
+        JCTypeDisjunction tree = new JCTypeDisjunction(components);
         tree.pos = pos;
         return tree;
     }
@@ -478,13 +478,17 @@
     }
 
     public JCTypeParameter TypeParameter(Name name, List<JCExpression> bounds) {
-        return TypeParameter(name, bounds, List.<JCTypeAnnotation>nil());
+        return TypeParameter(0, name, bounds);
     }
 
     public JCTypeParameter TypeParameter(Name name, List<JCExpression> bounds, List<JCTypeAnnotation> annos) {
         return TypeParameter(0, name, bounds, annos);
     }
 
+    public JCTypeParameter TypeParameter(long flags, Name name, List<JCExpression> bounds) {
+        return TypeParameter(flags, name, bounds, List.<JCTypeAnnotation>nil());
+    }
+
     public JCTypeParameter TypeParameter(long flags, Name name, List<JCExpression> bounds, List<JCTypeAnnotation> annos) {
         JCTypeParameter tree = new JCTypeParameter(flags, name, bounds, annos);
         tree.pos = pos;
@@ -686,10 +690,10 @@
         case DISJOINT: {
             DisjunctiveType dt = (DisjunctiveType)t;
             ListBuffer<JCExpression> subTypes = ListBuffer.lb();
-            for (Type t2 : dt.types) {
+            for (Type t2 : dt.alternatives) {
                 subTypes.append(Type(t2));
             }
-            tp = TypeDisjoint(subTypes.toList());
+            tp = TypeDisjunction(subTypes.toList());
             break;
         }
         case CLASS:
--- a/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java	Wed Dec 15 13:26:05 2010 +0000
@@ -291,8 +291,8 @@
         scan(tree.arguments);
     }
 
-    public void visitTypeDisjoint(JCTypeDisjoint tree) {
-        scan(tree.components);
+    public void visitTypeDisjunction(JCTypeDisjunction tree) {
+        scan(tree.alternatives);
     }
 
     public void visitTypeParameter(JCTypeParameter tree) {
--- a/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java	Wed Dec 15 13:26:05 2010 +0000
@@ -379,8 +379,8 @@
         result = tree;
     }
 
-    public void visitTypeDisjoint(JCTypeDisjoint tree) {
-        tree.components = translate(tree.components);
+    public void visitTypeDisjunction(JCTypeDisjunction tree) {
+        tree.alternatives = translate(tree.alternatives);
         result = tree;
     }
 
--- a/src/share/classes/com/sun/tools/javac/util/AbstractLog.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/util/AbstractLog.java	Wed Dec 15 13:26:05 2010 +0000
@@ -30,6 +30,7 @@
 import javax.tools.JavaFileObject;
 
 import com.sun.tools.javac.code.Lint.LintCategory;
+import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition;
 
@@ -103,6 +104,19 @@
         report(diags.error(source, wrap(pos), key, args));
     }
 
+    /** Report an error, unless another error was already reported at same
+     *  source position.
+     *  @param flag   A flag to set on the diagnostic
+     *  @param pos    The source position at which to report the error.
+     *  @param key    The key for the localized error message.
+     *  @param args   Fields of the error message.
+     */
+    public void error(DiagnosticFlag flag, int pos, String key, Object ... args) {
+        JCDiagnostic d = diags.error(source, wrap(pos), key, args);
+        d.setFlag(flag);
+        report(d);
+    }
+
     /** Report a warning, unless suppressed by the  -nowarn option or the
      *  maximum number of warnings has been reached.
      *  @param pos    The source position at which to report the warning.
--- a/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java	Wed Dec 15 13:26:05 2010 +0000
@@ -59,7 +59,7 @@
  * There are no references here to file-system specific objects such as
  * java.io.File or java.nio.file.Path.
  */
-public class BaseFileManager {
+public abstract class BaseFileManager {
     protected BaseFileManager(Charset charset) {
         this.charset = charset;
         byteBufferCache = new ByteBufferCache();
@@ -163,6 +163,9 @@
         }
         return -1;
     }
+
+    public abstract boolean isDefaultBootClassPath();
+
     // </editor-fold>
 
     // <editor-fold defaultstate="collapsed" desc="Encoding">
--- a/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java	Wed Dec 15 13:26:05 2010 +0000
@@ -63,17 +63,23 @@
 
         DiagnosticFormatter<JCDiagnostic> formatter;
         final String prefix;
+        final Set<DiagnosticFlag> defaultErrorFlags;
 
         /** Create a new diagnostic factory. */
         protected Factory(Context context) {
             this(JavacMessages.instance(context), "compiler");
             context.put(diagnosticFactoryKey, this);
+
+            Options options = Options.instance(context);
+            if (options.isSet("onlySyntaxErrorsUnrecoverable"))
+                defaultErrorFlags.add(DiagnosticFlag.RECOVERABLE);
         }
 
         /** Create a new diagnostic factory. */
         public Factory(JavacMessages messages, String prefix) {
             this.prefix = prefix;
             this.formatter = new BasicDiagnosticFormatter(messages);
+            defaultErrorFlags = EnumSet.of(DiagnosticFlag.MANDATORY);
         }
 
         /**
@@ -85,7 +91,7 @@
          */
         public JCDiagnostic error(
                 DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
-            return create(ERROR, null, EnumSet.of(DiagnosticFlag.MANDATORY), source, pos, key, args);
+            return create(ERROR, null, defaultErrorFlags, source, pos, key, args);
         }
 
         /**
@@ -331,7 +337,9 @@
 
     public enum DiagnosticFlag {
         MANDATORY,
-        RESOLVE_ERROR
+        RESOLVE_ERROR,
+        SYNTAX,
+        RECOVERABLE
     }
 
     private final DiagnosticType type;
@@ -547,6 +555,17 @@
 
     public void setFlag(DiagnosticFlag flag) {
         flags.add(flag);
+
+        if (type == DiagnosticType.ERROR) {
+            switch (flag) {
+                case SYNTAX:
+                    flags.remove(DiagnosticFlag.RECOVERABLE);
+                    break;
+                case RESOLVE_ERROR:
+                    flags.add(DiagnosticFlag.RECOVERABLE);
+                    break;
+            }
+        }
     }
 
     public boolean isFlagSet(DiagnosticFlag flag) {
--- a/src/share/classes/com/sun/tools/javac/util/Names.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/util/Names.java	Wed Dec 15 13:26:05 2010 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, 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
@@ -161,8 +161,9 @@
     public final Name getDeclaringClass;
     public final Name ex;
     public final Name finalize;
-	public final Name java_lang_AutoCloseable;
+    public final Name java_lang_AutoCloseable;
     public final Name close;
+    public final Name addSuppressed;
     public final Name _extension;
     public final Name _className;
     public final Name _methodName;
@@ -295,8 +296,10 @@
         getDeclaringClass = fromString("getDeclaringClass");
         ex = fromString("ex");
         finalize = fromString("finalize");
-		java_lang_AutoCloseable = fromString("java.lang.AutoCloseable");
+
+        java_lang_AutoCloseable = fromString("java.lang.AutoCloseable");
         close = fromString("close");
+        addSuppressed = fromString("addSuppressed");
         _extension = fromString("extension");
         _className = fromString("className");
         _methodName = fromString("methodName");
--- a/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Dec 15 13:26:05 2010 +0000
@@ -506,12 +506,12 @@
         @Override
         public Void visitDisjunctiveType(DisjunctiveType t, Void ignored) {
             if (indexOf(t, WhereClauseKind.DISJUNCTIVE) == -1) {
-                String subkey = t.types.isEmpty() ?
+                String subkey = t.alternatives.isEmpty() ?
                     ".1" :
                     "";
-                JCDiagnostic d = diags.fragment("where.disjunctive" + subkey, t, t.types);
+                JCDiagnostic d = diags.fragment("where.disjunctive" + subkey, t, t.alternatives);
                 whereClauses.get(WhereClauseKind.DISJUNCTIVE).put(t, d);
-                visit(t.types);
+                visit(t.alternatives);
             }
             return null;
         }
--- a/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Wed Dec 15 13:26:05 2010 +0000
@@ -850,6 +850,12 @@
                                        String[] paramTypes, Set<ClassDocImpl> searched) {
         //### Note that this search is not necessarily what the compiler would do!
 
+        Names names = tsym.name.table.names;
+        // do not match constructors
+        if (names.init.contentEquals(methodName)) {
+            return null;
+        }
+
         ClassDocImpl cdi;
         MethodDocImpl mdi;
 
@@ -876,7 +882,6 @@
          *---------------------------------*/
 
         // search current class
-        Names names = tsym.name.table.names;
         Scope.Entry e = tsym.members().lookup(names.fromString(methodName));
 
         //### Using modifier filter here isn't really correct,
--- a/src/share/classes/com/sun/tools/javadoc/DocEnv.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javadoc/DocEnv.java	Wed Dec 15 13:26:05 2010 +0000
@@ -637,6 +637,7 @@
      * Should be called only on symbols representing methods.
      */
     public MethodDocImpl getMethodDoc(MethodSymbol meth) {
+        assert !meth.isConstructor() : "not expecting a constructor symbol";
         MethodDocImpl result = (MethodDocImpl)methodMap.get(meth);
         if (result != null) return result;
         result = new MethodDocImpl(this, meth);
@@ -665,6 +666,7 @@
      * Should be called only on symbols representing constructors.
      */
     public ConstructorDocImpl getConstructorDoc(MethodSymbol meth) {
+        assert meth.isConstructor() : "expecting a constructor symbol";
         ConstructorDocImpl result = (ConstructorDocImpl)methodMap.get(meth);
         if (result != null) return result;
         result = new ConstructorDocImpl(this, meth);
--- a/src/share/classes/com/sun/tools/javadoc/JavadocClassReader.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javadoc/JavadocClassReader.java	Wed Dec 15 13:26:05 2010 +0000
@@ -62,6 +62,7 @@
     private JavadocClassReader(Context context) {
         super(context, true);
         docenv = DocEnv.instance(context);
+        preferSource = true;
     }
 
     /**
--- a/src/share/classes/com/sun/tools/javah/JNI.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javah/JNI.java	Wed Dec 15 13:26:05 2010 +0000
@@ -59,72 +59,76 @@
     }
 
     public void write(OutputStream o, TypeElement clazz) throws Util.Exit {
-        String cname = mangler.mangle(clazz.getQualifiedName(), Mangle.Type.CLASS);
-        PrintWriter pw = wrapWriter(o);
-        pw.println(guardBegin(cname));
-        pw.println(cppGuardBegin());
+        try {
+            String cname = mangler.mangle(clazz.getQualifiedName(), Mangle.Type.CLASS);
+            PrintWriter pw = wrapWriter(o);
+            pw.println(guardBegin(cname));
+            pw.println(cppGuardBegin());
 
-        /* Write statics. */
-        List<VariableElement> classfields = getAllFields(clazz);
+            /* Write statics. */
+            List<VariableElement> classfields = getAllFields(clazz);
 
-        for (VariableElement v: classfields) {
-            if (!v.getModifiers().contains(Modifier.STATIC))
-                continue;
-            String s = null;
-            s = defineForStatic(clazz, v);
-            if (s != null) {
-                pw.println(s);
+            for (VariableElement v: classfields) {
+                if (!v.getModifiers().contains(Modifier.STATIC))
+                    continue;
+                String s = null;
+                s = defineForStatic(clazz, v);
+                if (s != null) {
+                    pw.println(s);
+                }
             }
+
+            /* Write methods. */
+            List<ExecutableElement> classmethods = ElementFilter.methodsIn(clazz.getEnclosedElements());
+            for (ExecutableElement md: classmethods) {
+                if(md.getModifiers().contains(Modifier.NATIVE)){
+                    TypeMirror mtr = types.erasure(md.getReturnType());
+                    String sig = signature(md);
+                    TypeSignature newtypesig = new TypeSignature(elems);
+                    CharSequence methodName = md.getSimpleName();
+                    boolean longName = false;
+                    for (ExecutableElement md2: classmethods) {
+                        if ((md2 != md)
+                            && (methodName.equals(md2.getSimpleName()))
+                            && (md2.getModifiers().contains(Modifier.NATIVE)))
+                            longName = true;
+
+                    }
+                    pw.println("/*");
+                    pw.println(" * Class:     " + cname);
+                    pw.println(" * Method:    " +
+                               mangler.mangle(methodName, Mangle.Type.FIELDSTUB));
+                    pw.println(" * Signature: " + newtypesig.getTypeSignature(sig, mtr));
+                    pw.println(" */");
+                    pw.println("JNIEXPORT " + jniType(mtr) +
+                               " JNICALL " +
+                               mangler.mangleMethod(md, clazz,
+                                                   (longName) ?
+                                                   Mangle.Type.METHOD_JNI_LONG :
+                                                   Mangle.Type.METHOD_JNI_SHORT));
+                    pw.print("  (JNIEnv *, ");
+                    List<? extends VariableElement> paramargs = md.getParameters();
+                    List<TypeMirror> args = new ArrayList<TypeMirror>();
+                    for (VariableElement p: paramargs) {
+                        args.add(types.erasure(p.asType()));
+                    }
+                    if (md.getModifiers().contains(Modifier.STATIC))
+                        pw.print("jclass");
+                    else
+                        pw.print("jobject");
+
+                    for (TypeMirror arg: args) {
+                        pw.print(", ");
+                        pw.print(jniType(arg));
+                    }
+                    pw.println(");" + lineSep);
+                }
+            }
+            pw.println(cppGuardEnd());
+            pw.println(guardEnd(cname));
+        } catch (TypeSignature.SignatureException e) {
+            util.error("jni.sigerror", e.getMessage());
         }
-
-        /* Write methods. */
-        List<ExecutableElement> classmethods = ElementFilter.methodsIn(clazz.getEnclosedElements());
-        for (ExecutableElement md: classmethods) {
-            if(md.getModifiers().contains(Modifier.NATIVE)){
-                TypeMirror mtr = types.erasure(md.getReturnType());
-                String sig = signature(md);
-                TypeSignature newtypesig = new TypeSignature(elems);
-                CharSequence methodName = md.getSimpleName();
-                boolean longName = false;
-                for (ExecutableElement md2: classmethods) {
-                    if ((md2 != md)
-                        && (methodName.equals(md2.getSimpleName()))
-                        && (md2.getModifiers().contains(Modifier.NATIVE)))
-                        longName = true;
-
-                }
-                pw.println("/*");
-                pw.println(" * Class:     " + cname);
-                pw.println(" * Method:    " +
-                           mangler.mangle(methodName, Mangle.Type.FIELDSTUB));
-                pw.println(" * Signature: " + newtypesig.getTypeSignature(sig, mtr));
-                pw.println(" */");
-                pw.println("JNIEXPORT " + jniType(mtr) +
-                           " JNICALL " +
-                           mangler.mangleMethod(md, clazz,
-                                               (longName) ?
-                                               Mangle.Type.METHOD_JNI_LONG :
-                                               Mangle.Type.METHOD_JNI_SHORT));
-                pw.print("  (JNIEnv *, ");
-                List<? extends VariableElement> paramargs = md.getParameters();
-                List<TypeMirror> args = new ArrayList<TypeMirror>();
-                for (VariableElement p: paramargs) {
-                    args.add(types.erasure(p.asType()));
-                }
-                if (md.getModifiers().contains(Modifier.STATIC))
-                    pw.print("jclass");
-                else
-                    pw.print("jobject");
-
-                for (TypeMirror arg: args) {
-                    pw.print(", ");
-                    pw.print(jniType(arg));
-                }
-                pw.println(");" + lineSep);
-            }
-        }
-        pw.println(cppGuardEnd());
-        pw.println(guardEnd(cname));
     }
 
 
--- a/src/share/classes/com/sun/tools/javah/JavahTask.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javah/JavahTask.java	Wed Dec 15 13:26:05 2010 +0000
@@ -26,6 +26,7 @@
 package com.sun.tools.javah;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintWriter;
@@ -46,9 +47,9 @@
 
 import javax.annotation.processing.AbstractProcessor;
 import javax.annotation.processing.Messager;
+import javax.annotation.processing.ProcessingEnvironment;
 import javax.annotation.processing.RoundEnvironment;
 import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.annotation.processing.SupportedSourceVersion;
 
 import javax.lang.model.SourceVersion;
 import javax.lang.model.element.ExecutableElement;
@@ -71,6 +72,10 @@
 import javax.tools.StandardJavaFileManager;
 import javax.tools.StandardLocation;
 import javax.tools.ToolProvider;
+import static javax.tools.Diagnostic.Kind.*;
+
+import com.sun.tools.javac.code.Symbol.CompletionFailure;
+import com.sun.tools.javac.main.CommandLine;
 
 /**
  * Javah generates support files for native methods.
@@ -173,7 +178,7 @@
             }
         },
 
-        new Option(false, "-help", "--help", "-?") {
+        new Option(false, "-h", "-help", "--help", "-?") {
             void process(JavahTask task, String opt, String arg) {
                 task.help = true;
             }
@@ -233,6 +238,15 @@
                 task.doubleAlign = true;
             }
         },
+
+        new HiddenOption(false) {
+            boolean matches(String opt) {
+                return opt.startsWith("-XD");
+            }
+            void process(JavahTask task, String opt, String arg) {
+                task.javac_extras.add(opt);
+            }
+        },
     };
 
     JavahTask() {
@@ -326,6 +340,8 @@
         } catch (InternalError e) {
             diagnosticListener.report(createDiagnostic("err.internal.error", e.getMessage()));
             return 1;
+        } catch (Util.Exit e) {
+            return e.exitValue;
         } finally {
             log.flush();
         }
@@ -348,7 +364,7 @@
         if (fileManager == null)
             fileManager = getDefaultFileManager(diagnosticListener, log);
 
-        Iterator<String> iter = args.iterator();
+        Iterator<String> iter = expandAtArgs(args).iterator();
         noArgs = !iter.hasNext();
 
         while (iter.hasNext()) {
@@ -402,6 +418,18 @@
         throw new BadArgs("err.unknown.option", name).showUsage(true);
     }
 
+    private Iterable<String> expandAtArgs(Iterable<String> args) throws BadArgs {
+        try {
+            List<String> l = new ArrayList<String>();
+            for (String arg: args) l.add(arg);
+            return Arrays.asList(CommandLine.parse(l.toArray(new String[l.size()])));
+        } catch (FileNotFoundException e) {
+            throw new BadArgs("at.args.file.not.found", e.getLocalizedMessage());
+        } catch (IOException e) {
+            throw new BadArgs("at.args.io.exception", e.getLocalizedMessage());
+        }
+    }
+
     public Boolean call() {
         return run();
     }
@@ -475,7 +503,9 @@
             ((JavahFileManager) fileManager).setIgnoreSymbolFile(true);
 
         JavaCompiler c = ToolProvider.getSystemJavaCompiler();
-        List<String> opts = Arrays.asList("-proc:only");
+        List<String> opts = new ArrayList<String>();
+        opts.add("-proc:only");
+        opts.addAll(javac_extras);
         CompilationTask t = c.getTask(log, fileManager, diagnosticListener, opts, internalize(classes), null);
         JavahProcessor p = new JavahProcessor(g);
         t.setProcessors(Collections.singleton(p));
@@ -591,8 +621,8 @@
             }
 
         };
+    }
 
-    }
     private String getMessage(String key, Object... args) {
         return getMessage(task_locale, key, args);
     }
@@ -642,6 +672,7 @@
     boolean doubleAlign;
     boolean force;
     boolean old;
+    Set<String> javac_extras = new LinkedHashSet<String>();
 
     PrintWriter log;
     JavaFileManager fileManager;
@@ -652,30 +683,45 @@
     private static final String progname = "javah";
 
     @SupportedAnnotationTypes("*")
-    @SupportedSourceVersion(SourceVersion.RELEASE_7)
     class JavahProcessor extends AbstractProcessor {
+        private Messager messager;
+
         JavahProcessor(Gen g) {
             this.g = g;
         }
 
+        @Override
+        public SourceVersion getSupportedSourceVersion() {
+            // since this is co-bundled with javac, we can assume it supports
+            // the latest source version
+            return SourceVersion.latest();
+        }
+
+        @Override
+        public void init(ProcessingEnvironment pEnv) {
+            super.init(pEnv);
+            messager  = processingEnv.getMessager();
+        }
+
         public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-            Messager messager  = processingEnv.getMessager();
-            Set<TypeElement> classes = getAllClasses(ElementFilter.typesIn(roundEnv.getRootElements()));
-            if (classes.size() > 0) {
-                checkMethodParameters(classes);
-                g.setProcessingEnvironment(processingEnv);
-                g.setClasses(classes);
+            try {
+                Set<TypeElement> classes = getAllClasses(ElementFilter.typesIn(roundEnv.getRootElements()));
+                if (classes.size() > 0) {
+                    checkMethodParameters(classes);
+                    g.setProcessingEnvironment(processingEnv);
+                    g.setClasses(classes);
+                    g.run();
+                }
+            } catch (CompletionFailure cf) {
+                messager.printMessage(ERROR, getMessage("class.not.found", cf.sym.getQualifiedName().toString()));
+            } catch (ClassNotFoundException cnfe) {
+                messager.printMessage(ERROR, getMessage("class.not.found", cnfe.getMessage()));
+            } catch (IOException ioe) {
+                messager.printMessage(ERROR, getMessage("io.exception", ioe.getMessage()));
+            } catch (Util.Exit e) {
+                exit = e;
+            }
 
-                try {
-                    g.run();
-                } catch (ClassNotFoundException cnfe) {
-                    messager.printMessage(Diagnostic.Kind.ERROR, getMessage("class.not.found", cnfe.getMessage()));
-                } catch (IOException ioe) {
-                    messager.printMessage(Diagnostic.Kind.ERROR, getMessage("io.exception", ioe.getMessage()));
-                } catch (Util.Exit e) {
-                    exit = e;
-                }
-            }
             return true;
         }
 
--- a/src/share/classes/com/sun/tools/javah/LLNI.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javah/LLNI.java	Wed Dec 15 13:26:05 2010 +0000
@@ -74,16 +74,21 @@
     }
 
     protected void write(OutputStream o, TypeElement clazz) throws Util.Exit {
-        String cname     = mangleClassName(clazz.getQualifiedName().toString());
-        PrintWriter pw   = wrapWriter(o);
-        fields = ElementFilter.fieldsIn(clazz.getEnclosedElements());
-        methods = ElementFilter.methodsIn(clazz.getEnclosedElements());
-        generateDeclsForClass(pw, clazz, cname);
-        // FIXME check if errors occurred on the PrintWriter and throw exception if so
+        try {
+            String cname     = mangleClassName(clazz.getQualifiedName().toString());
+            PrintWriter pw   = wrapWriter(o);
+            fields = ElementFilter.fieldsIn(clazz.getEnclosedElements());
+            methods = ElementFilter.methodsIn(clazz.getEnclosedElements());
+            generateDeclsForClass(pw, clazz, cname);
+            // FIXME check if errors occurred on the PrintWriter and throw exception if so
+        } catch (TypeSignature.SignatureException e) {
+            util.error("llni.sigerror", e.getMessage());
+        }
     }
 
     protected void generateDeclsForClass(PrintWriter pw,
-            TypeElement clazz, String cname) throws Util.Exit {
+            TypeElement clazz, String cname)
+            throws TypeSignature.SignatureException, Util.Exit {
         doneHandleTypes  = new HashSet<String>();
         /* The following handle types are predefined in "typedefs.h". Suppress
            inclusion in the output by generating them "into the blue" here. */
@@ -127,7 +132,8 @@
             .replace(innerDelim, '_');
     }
 
-    protected void forwardDecls(PrintWriter pw, TypeElement clazz) {
+    protected void forwardDecls(PrintWriter pw, TypeElement clazz)
+            throws TypeSignature.SignatureException {
         TypeElement object = elems.getTypeElement("java.lang.Object");
         if (clazz.equals(object))
             return;
@@ -403,7 +409,7 @@
 
     protected void methodSectionForClass(PrintWriter pw,
             TypeElement clazz, String cname)
-            throws Util.Exit {
+            throws TypeSignature.SignatureException, Util.Exit {
         String methods = methodDecls(clazz, cname);
 
         if (methods.length() != 0) {
@@ -418,7 +424,8 @@
         }
     }
 
-    protected String methodDecls(TypeElement clazz, String cname) throws Util.Exit {
+    protected String methodDecls(TypeElement clazz, String cname)
+            throws TypeSignature.SignatureException, Util.Exit {
 
         String res = "";
         for (ExecutableElement method: methods) {
@@ -430,7 +437,7 @@
 
     protected String methodDecl(ExecutableElement method,
                                 TypeElement clazz, String cname)
-    throws Util.Exit {
+            throws TypeSignature.SignatureException, Util.Exit {
         String res = null;
 
         TypeMirror retType = types.erasure(method.getReturnType());
@@ -474,7 +481,8 @@
     }
 
     protected final String jniMethodName(ExecutableElement method, String cname,
-                                         boolean longName) {
+                                         boolean longName)
+                throws TypeSignature.SignatureException {
         String res = "Java_" + cname + "_" + method.getSimpleName();
 
         if (longName) {
--- a/src/share/classes/com/sun/tools/javah/Mangle.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javah/Mangle.java	Wed Dec 15 13:26:05 2010 +0000
@@ -114,7 +114,7 @@
     }
 
     public String mangleMethod(ExecutableElement method, TypeElement clazz,
-                                      int mtype) {
+                                      int mtype) throws TypeSignature.SignatureException {
         StringBuffer result = new StringBuffer(100);
         result.append("Java_");
 
--- a/src/share/classes/com/sun/tools/javah/TypeSignature.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javah/TypeSignature.java	Wed Dec 15 13:26:05 2010 +0000
@@ -51,7 +51,13 @@
  * @author Sucheta Dambalkar
  */
 
-public class TypeSignature{
+public class TypeSignature {
+    static class SignatureException extends Exception {
+        private static final long serialVersionUID = 1L;
+        SignatureException(String reason) {
+            super(reason);
+        }
+    }
 
     Elements elems;
 
@@ -78,14 +84,15 @@
     /*
      * Returns the type signature of a field according to JVM specs
      */
-    public String getTypeSignature(String javasignature){
+    public String getTypeSignature(String javasignature) throws SignatureException {
         return getParamJVMSignature(javasignature);
     }
 
     /*
      * Returns the type signature of a method according to JVM specs
      */
-    public String getTypeSignature(String javasignature, TypeMirror returnType){
+    public String getTypeSignature(String javasignature, TypeMirror returnType)
+            throws SignatureException {
         String signature = null; //Java type signature.
         String typeSignature = null; //Internal type signature.
         List<String> params = new ArrayList<String>(); //List of parameters.
@@ -166,7 +173,7 @@
     /*
      * Returns internal signature of a parameter.
      */
-    private String getParamJVMSignature(String paramsig) {
+    private String getParamJVMSignature(String paramsig) throws SignatureException {
         String paramJVMSig = "";
         String componentType ="";
 
@@ -197,7 +204,7 @@
     /*
      * Returns internal signature of a component.
      */
-    private String getComponentType(String componentType){
+    private String getComponentType(String componentType) throws SignatureException {
 
         String JVMSig = "";
 
@@ -216,8 +223,7 @@
                     TypeElement classNameDoc = elems.getTypeElement(componentType);
 
                     if(classNameDoc == null){
-                        System.out.println("Invalid class type for " + componentType);
-                        new Exception().printStackTrace();
+                        throw new SignatureException(componentType);
                     }else {
                         String classname = classNameDoc.getQualifiedName().toString();
                         String newclassname = classname.replace('.', '/');
--- a/src/share/classes/com/sun/tools/javah/resources/l10n.properties	Thu Dec 02 10:35:09 2010 +0000
+++ b/src/share/classes/com/sun/tools/javah/resources/l10n.properties	Wed Dec 15 13:26:05 2010 +0000
@@ -30,6 +30,8 @@
         The directory {0} could not be create for output.
 at.args.cant.read=\
         Can''t read command line arguments from file {1}.
+at.args.file.not.found=\
+        Can''t find file {0}.
 at.args.io.exception=\
         The following I/O problem was encountered when processing an @ \
         argument on the command line: {0}.
@@ -45,6 +47,8 @@
         Can''t mix options -jni and -llni.  Try -help.
 jni.no.stubs=\
         JNI does not require stubs, please refer to the JNI documentation.
+jni.sigerror=\
+        Cannot determine signature for {0}
 dir.file.mixed=\
         Can''t mix options -d and -o.  Try -help.
 no.classes.specified=\
@@ -94,7 +98,7 @@
 \  -d <dir>                 Output directory
 main.opt.v=\
 \  -v  -verbose             Enable verbose output
-main.opt.help=\
+main.opt.h=\
 \  -h  --help  -?           Print this message
 main.opt.version=\
 \  -version                 Print version information
--- a/test/tools/javac/6341866/T6341866.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/6341866/T6341866.java	Wed Dec 15 13:26:05 2010 +0000
@@ -97,7 +97,7 @@
         processorServices.delete();
 
         List<String> opts = new ArrayList<String>();
-        opts.addAll(Arrays.asList("-d", ".", "-sourcepath", testSrc, "-classpath", testClasses, "-source", "1.6"));
+        opts.addAll(Arrays.asList("-d", ".", "-sourcepath", testSrc, "-classpath", testClasses, "-source", "1.6", "-Xlint:-options"));
         if (implicitType.opt != null)
             opts.add(implicitType.opt);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6996626/Main.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2010, 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 6996626
+ * @summary Scope fix issues for ImportScope
+ * @compile pack1/Symbol.java
+ * @compile Main.java
+ */
+
+import pack1.*;
+import pack1.Symbol.*;
+
+// The following imports are just to trigger re-hashing (in
+// com.sun.tools.javac.code.Scope.dble()) of the star-import scope.
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+public class Main {
+    public void main (String[] args) {
+        throw new CompletionFailure();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6996626/pack1/Symbol.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010, 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 pack1;
+
+public class Symbol {
+   public static class CompletionFailure extends RuntimeException { }
+}
+
+
+
--- a/test/tools/javac/ClassFileModifiers/MemberModifiers.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/ClassFileModifiers/MemberModifiers.java	Wed Dec 15 13:26:05 2010 +0000
@@ -26,7 +26,7 @@
  * @bug 4249112 4785453
  * @summary Verify that implicit member modifiers are set correctly.
  *
- * @compile/ref=MemberModifiers.out  -source 1.4 -target 1.4.2 -XDdumpmodifiers=cfm MemberModifiers.java
+ * @compile/ref=MemberModifiers.out  -source 1.4 -target 1.4.2 -Xlint:-options -XDdumpmodifiers=cfm MemberModifiers.java
  */
 
 // Currently, we check only that members of final classes are not final.
--- a/test/tools/javac/T6705935.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/T6705935.java	Wed Dec 15 13:26:05 2010 +0000
@@ -31,6 +31,8 @@
 import java.util.*;
 import javax.tools.*;
 import com.sun.tools.javac.file.*;
+import com.sun.tools.javac.file.ZipArchive.ZipFileObject;
+import com.sun.tools.javac.file.ZipFileIndexArchive.ZipFileIndexFileObject;
 
 public class T6705935 {
     public static void main(String... args) throws Exception {
@@ -43,11 +45,22 @@
             java_home = java_home.getParentFile();
 
         JavaCompiler c = ToolProvider.getSystemJavaCompiler();
-        JavaFileManager fm = c.getStandardFileManager(null, null, null);
+        StandardJavaFileManager fm = c.getStandardFileManager(null, null, null);
+        //System.err.println("platform class path: " + asList(fm.getLocation(StandardLocation.PLATFORM_CLASS_PATH)));
+
         for (JavaFileObject fo: fm.list(StandardLocation.PLATFORM_CLASS_PATH,
                                         "java.lang",
                                         Collections.singleton(JavaFileObject.Kind.CLASS),
                                         false)) {
+            test++;
+
+            if (!(fo instanceof ZipFileObject || fo instanceof ZipFileIndexFileObject)) {
+                System.out.println("Skip " + fo.getClass().getSimpleName() + " " + fo.getName());
+                skip++;
+                continue;
+            }
+
+            //System.err.println(fo.getName());
             String p = fo.getName();
             int bra = p.indexOf("(");
             int ket = p.indexOf(")");
@@ -61,5 +74,26 @@
                 throw new Exception("bad path: " + p);
 
         }
+
+        if (test == 0)
+            throw new Exception("no files found");
+
+        if (skip == 0)
+            System.out.println(test + " files found");
+        else
+            System.out.println(test + " files found, " + skip + " files skipped");
+
+        if (test == skip)
+            System.out.println("Warning: all files skipped; no platform classes found in zip files.");
     }
+
+    private <T> List<T> asList(Iterable<? extends T> items) {
+        List<T> list = new ArrayList<T>();
+        for (T item: items)
+            list.add(item);
+        return list;
+     }
+
+    private int skip;
+    private int test;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6900037.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2010, 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 6900037
+ * @summary javac should warn if earlier -source is used and bootclasspath not set
+ * @compile T6900037.java
+ * @compile -source 1.6 T6900037.java
+ * @compile/fail/ref=T6900037.out -XDrawDiagnostics -Werror -source 1.6 T6900037.java
+ * @compile -Werror -source 1.6 -Xlint:-options T6900037.java
+ */
+
+class T6900037 { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6900037.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,4 @@
+- compiler.warn.source.no.bootclasspath: 1.6
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- a/test/tools/javac/T6985181.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2010, 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 6985181
- * @summary Annotations lost from classfile
- */
-
-import java.io.*;
-import java.util.*;
-
-public class T6985181 {
-    public static void main(String... args) throws Exception{
-        new T6985181().run();
-    }
-
-    public void run() throws Exception {
-        String code = "@interface Simple { }\ninterface Test<@Simple T> { }";
-
-        File srcFile = writeFile("Test.java", code);
-        File classesDir = new File("classes");
-        classesDir.mkdirs();
-        compile("-d", classesDir.getPath(), srcFile.getPath());
-        String out = javap(new File(classesDir, srcFile.getName().replace(".java", ".class")));
-        if (!out.contains("RuntimeInvisibleTypeAnnotations"))
-            throw new Exception("RuntimeInvisibleTypeAnnotations not found");
-    }
-
-    void compile(String... args) throws Exception {
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
-        int rc = com.sun.tools.javac.Main.compile(args, pw);
-        pw.close();
-        String out = sw.toString();
-        if (out.length() > 0)
-            System.err.println(out);
-        if (rc != 0)
-            throw new Exception("Compilation failed: rc=" + rc);
-    }
-
-    String javap(File classFile) throws Exception {
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
-        String[] args = { "-v", classFile.getPath() };
-        int rc = com.sun.tools.javap.Main.run(args, pw);
-        pw.close();
-        String out = sw.toString();
-        if (out.length() > 0)
-            System.err.println(out);
-        if (rc != 0)
-            throw new Exception("javap failed: rc=" + rc);
-        return out;
-    }
-
-    File writeFile(String path, String body) throws IOException {
-        File f = new File(path);
-        FileWriter out = new FileWriter(f);
-        try {
-            out.write(body);
-        } finally {
-            out.close();
-        }
-        return f;
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6993301.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2010, 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 6993301
+ * @summary catch parameters do not have correct kind (i.e. ElementKind.EXCEPTION_PARAMETER)
+ */
+
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.tree.IdentifierTree;
+import com.sun.source.tree.VariableTree;
+import com.sun.source.util.TreePathScanner;
+import com.sun.source.util.Trees;
+import com.sun.tools.javac.api.JavacTaskImpl;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Arrays;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+/**
+ *
+ * @author Jan Lahoda
+ */
+public class T6993301 {
+    public static void main(String... args) throws Exception {
+        new T6993301().testExceptionParameterCorrectKind();
+    }
+
+    static class MyFileObject extends SimpleJavaFileObject {
+        private String text;
+        public MyFileObject(String text) {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            this.text = text;
+        }
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return text;
+        }
+    }
+
+    public void testExceptionParameterCorrectKind() throws IOException {
+        final String bootPath = System.getProperty("sun.boot.class.path");
+        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+        assert tool != null;
+
+        String code = "package test; public class Test { { try { } catch (NullPointerException ex) {} } }";
+
+        final JavacTaskImpl ct = (JavacTaskImpl)tool.getTask(null, null, null,
+                Arrays.asList("-bootclasspath",  bootPath),
+                null, Arrays.asList(new MyFileObject(code)));
+        CompilationUnitTree cut = ct.parse().iterator().next();
+
+        ct.analyze();
+
+        new TreePathScanner<Void, Void>() {
+            @Override
+            public Void visitVariable(VariableTree node, Void p) {
+                Element el = Trees.instance(ct).getElement(getCurrentPath());
+
+                assertNotNull(el);
+                assertEquals(ElementKind.EXCEPTION_PARAMETER, el.getKind());
+
+                return super.visitVariable(node, p);
+            }
+        }.scan(cut, null);
+    }
+
+    private void assertNotNull(Object o) {
+        if (o == null)
+            throw new AssertionError();
+    }
+
+    private <T> void assertEquals(T expected, T actual) {
+        if (expected == null ? actual == null : expected.equals(actual))
+            return;
+        throw new AssertionError("expected: " + expected + ", actual: " + actual);
+    }
+
+}
--- a/test/tools/javac/TryWithResources/ArmLint.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * @test  /nodynamiccopyright/
- * @bug 6911256 6964740 6965277 6967065
- * @author Joseph D. Darcy
- * @summary Check that -Xlint:arm warnings are generated as expected
- * @compile/ref=ArmLint.out -Xlint:arm,deprecation -XDrawDiagnostics ArmLint.java
- */
-
-class ArmLint implements AutoCloseable {
-    private static void test1() {
-        try(ArmLint r1 = new ArmLint();
-            ArmLint r2 = new ArmLint();
-            ArmLint r3 = new ArmLint()) {
-            r1.close();   // The resource's close
-            r2.close(42); // *Not* the resource's close
-            // r3 not referenced
-        }
-
-    }
-
-    @SuppressWarnings("arm")
-    private static void test2() {
-        try(@SuppressWarnings("deprecation") AutoCloseable r4 =
-            new DeprecatedAutoCloseable()) {
-            // r4 not referenced
-        } catch(Exception e) {
-            ;
-        }
-    }
-
-    /**
-     * The AutoCloseable method of a resource.
-     */
-    @Override
-    public void close () {
-        return;
-    }
-
-    /**
-     * <em>Not</em> the AutoCloseable method of a resource.
-     */
-    public void close (int arg) {
-        return;
-    }
-}
-
-@Deprecated
-class DeprecatedAutoCloseable implements AutoCloseable {
-    public DeprecatedAutoCloseable(){super();}
-
-    @Override
-    public void close () {
-        return;
-    }
-}
--- a/test/tools/javac/TryWithResources/ArmLint.out	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-ArmLint.java:14:15: compiler.warn.twr.explicit.close.call
-ArmLint.java:13:13: compiler.warn.automatic.resource.not.referenced: r3
-2 warnings
--- a/test/tools/javac/TryWithResources/ImplicitFinal.out	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/TryWithResources/ImplicitFinal.out	Wed Dec 15 13:26:05 2010 +0000
@@ -1,2 +1,2 @@
-ImplicitFinal.java:14:13: compiler.err.twr.resource.may.not.be.assigned: r
+ImplicitFinal.java:14:13: compiler.err.try.resource.may.not.be.assigned: r
 1 error
--- a/test/tools/javac/TryWithResources/PlainTry.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/TryWithResources/PlainTry.java	Wed Dec 15 13:26:05 2010 +0000
@@ -3,8 +3,8 @@
  * @bug 6911256 6964740
  * @author Joseph D. Darcy
  * @summary Test error messages for an unadorned try
- * @compile/fail/ref=PlainTry6.out -XDrawDiagnostics -source 6 PlainTry.java
- * @compile/fail/ref=PlainTry.out  -XDrawDiagnostics           PlainTry.java
+ * @compile/fail/ref=PlainTry6.out -XDrawDiagnostics -source 6 -Xlint:-options PlainTry.java
+ * @compile/fail/ref=PlainTry.out  -XDrawDiagnostics                           PlainTry.java
  */
 public class PlainTry {
     public static void main(String... args) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/TryWithResources/TwrLint.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,55 @@
+/*
+ * @test  /nodynamiccopyright/
+ * @bug 6911256 6964740 6965277 6967065
+ * @author Joseph D. Darcy
+ * @summary Check that -Xlint:twr warnings are generated as expected
+ * @compile/ref=TwrLint.out -Xlint:try,deprecation -XDrawDiagnostics TwrLint.java
+ */
+
+class TwrLint implements AutoCloseable {
+    private static void test1() {
+        try(TwrLint r1 = new TwrLint();
+            TwrLint r2 = new TwrLint();
+            TwrLint r3 = new TwrLint()) {
+            r1.close();   // The resource's close
+            r2.close(42); // *Not* the resource's close
+            // r3 not referenced
+        }
+
+    }
+
+    @SuppressWarnings("try")
+    private static void test2() {
+        try(@SuppressWarnings("deprecation") AutoCloseable r4 =
+            new DeprecatedAutoCloseable()) {
+            // r4 not referenced - but no warning is generated because of @SuppressWarnings
+        } catch(Exception e) {
+            ;
+        }
+    }
+
+    /**
+     * The AutoCloseable method of a resource.
+     */
+    @Override
+    public void close () {
+        return;
+    }
+
+    /**
+     * <em>Not</em> the AutoCloseable method of a resource.
+     */
+    public void close (int arg) {
+        return;
+    }
+}
+
+@Deprecated
+class DeprecatedAutoCloseable implements AutoCloseable {
+    public DeprecatedAutoCloseable(){super();}
+
+    @Override
+    public void close () {
+        return;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/TryWithResources/TwrLint.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,3 @@
+TwrLint.java:14:15: compiler.warn.try.explicit.close.call
+TwrLint.java:13:13: compiler.warn.try.resource.not.referenced: r3
+2 warnings
--- a/test/tools/javac/TryWithResources/TwrOnNonResource.out	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/TryWithResources/TwrOnNonResource.out	Wed Dec 15 13:26:05 2010 +0000
@@ -1,7 +1,7 @@
-TwrOnNonResource.java:12:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
-TwrOnNonResource.java:15:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
-TwrOnNonResource.java:18:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
-TwrOnNonResource.java:24:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
-TwrOnNonResource.java:27:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
-TwrOnNonResource.java:30:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
+TwrOnNonResource.java:12:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
+TwrOnNonResource.java:15:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
+TwrOnNonResource.java:18:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
+TwrOnNonResource.java:24:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
+TwrOnNonResource.java:27:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
+TwrOnNonResource.java:30:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable
 6 errors
--- a/test/tools/javac/TryWithResources/TwrSuppression.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/TryWithResources/TwrSuppression.java	Wed Dec 15 13:26:05 2010 +0000
@@ -36,7 +36,7 @@
                 throw new RuntimeException();
             }
         } catch(RuntimeException e) {
-            Throwable[] suppressedExceptions = e.getSuppressedExceptions();
+            Throwable[] suppressedExceptions = e.getSuppressed();
             int length = suppressedExceptions.length;
             if (length != 2)
                 throw new RuntimeException("Unexpected length " + length);
--- a/test/tools/javac/TryWithResources/TwrTests.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/TryWithResources/TwrTests.java	Wed Dec 15 13:26:05 2010 +0000
@@ -90,7 +90,7 @@
                 } catch (Resource.CreateFailException e) {
                     creationFailuresDetected++;
                     checkCreateFailureId(e.resourceId(), createFailureId);
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     throw new AssertionError("Secondary exception suppression failed");
                 }
@@ -112,7 +112,7 @@
                 } catch (Resource.CreateFailException e) {
                     creationFailuresDetected++;
                     checkCreateFailureId(e.resourceId(), createFailureId);
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     throw new AssertionError("Secondary exception suppression failed");
                 }
@@ -134,7 +134,7 @@
                 } catch (Resource.CreateFailException e) {
                     creationFailuresDetected++;
                     checkCreateFailureId(e.resourceId(), createFailureId);
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     throw new AssertionError("Secondary exception suppression failed:" + e);
                 }
@@ -158,7 +158,7 @@
                 } catch (Resource.CreateFailException e) {
                     creationFailuresDetected++;
                     checkCreateFailureId(e.resourceId(), createFailureId);
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     throw new AssertionError("Secondary exception suppression failed:" + e);
                 }
@@ -181,7 +181,7 @@
                 } catch (Resource.CreateFailException e) {
                     creationFailuresDetected++;
                     checkCreateFailureId(e.resourceId(), createFailureId);
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     throw new AssertionError("Secondary exception suppression failed:" + e);
                 }
@@ -207,7 +207,7 @@
                 } catch (Resource.CreateFailException e) {
                     creationFailuresDetected++;
                     checkCreateFailureId(e.resourceId(), createFailureId);
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     throw new AssertionError("Secondary exception suppression failed:" + e);
                 }
@@ -231,7 +231,7 @@
                 } catch (Resource.CreateFailException e) {
                     creationFailuresDetected++;
                     checkCreateFailureId(e.resourceId(), createFailureId);
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     throw new AssertionError("Secondary exception suppression failed:" + e);
                 }
@@ -259,7 +259,7 @@
                 } catch (Resource.CreateFailException e) {
                     creationFailuresDetected++;
                     checkCreateFailureId(e.resourceId(), createFailureId);
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     throw new AssertionError("Secondary exception suppression failed:" + e);
                 }
@@ -310,7 +310,7 @@
      * Check for proper suppressed exceptions in proper order.
      *
      * @param suppressedExceptions the suppressed exceptions array returned by
-     *        getSuppressedExceptions()
+     *        getSuppressed()
      * @bitmap a bitmap indicating which suppressed exceptions are expected.
      *         Bit i is set iff id should throw a CloseFailException.
      */
@@ -376,7 +376,7 @@
                 } catch (MyKindOfException e) {
                     if (failure == 0)
                         throw new AssertionError("Unexpected MyKindOfException");
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     if (failure == 1)
                         throw new AssertionError("Secondary exception suppression failed");
@@ -388,7 +388,7 @@
                         throw new AssertionError("CloseFailException: got id " + id
                                                  + ", expected lg(" + highestCloseFailBit +")");
                     }
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit);
                 }
                 checkClosedList(closedList, 1);
             }
@@ -409,7 +409,7 @@
                 } catch (MyKindOfException e) {
                     if (failure == 0)
                         throw new AssertionError("Unexpected MyKindOfException");
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     if (failure == 1)
                         throw new AssertionError("Secondary exception suppression failed");
@@ -421,7 +421,7 @@
                         throw new AssertionError("CloseFailException: got id " + id
                                                  + ", expected lg(" + highestCloseFailBit +")");
                     }
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit);
                 }
                 checkClosedList(closedList, 2);
             }
@@ -443,7 +443,7 @@
                 } catch (MyKindOfException e) {
                     if (failure == 0)
                         throw new AssertionError("Unexpected MyKindOfException");
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     if (failure == 1)
                         throw new AssertionError("Secondary exception suppression failed");
@@ -455,7 +455,7 @@
                         throw new AssertionError("CloseFailException: got id " + id
                                                  + ", expected lg(" + highestCloseFailBit +")");
                     }
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit);
                 }
                 checkClosedList(closedList, 2);
             }
@@ -477,7 +477,7 @@
                 } catch (MyKindOfException e) {
                     if (failure == 0)
                         throw new AssertionError("Unexpected MyKindOfException");
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     if (failure == 1)
                         throw new AssertionError("Secondary exception suppression failed");
@@ -489,7 +489,7 @@
                         throw new AssertionError("CloseFailException: got id " + id
                                                  + ", expected lg(" + highestCloseFailBit +")");
                     }
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit);
                 }
                 checkClosedList(closedList, 3);
             }
@@ -513,7 +513,7 @@
                 } catch (MyKindOfException e) {
                     if (failure == 0)
                         throw new AssertionError("Unexpected MyKindOfException");
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     if (failure == 1)
                         throw new AssertionError("Secondary exception suppression failed");
@@ -525,7 +525,7 @@
                         throw new AssertionError("CloseFailException: got id " + id
                                                  + ", expected lg(" + highestCloseFailBit +")");
                     }
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit);
                 }
                 checkClosedList(closedList, 3);
             }
@@ -548,7 +548,7 @@
                 } catch (MyKindOfException e) {
                     if (failure == 0)
                         throw new AssertionError("Unexpected MyKindOfException");
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     if (failure == 1)
                         throw new AssertionError("Secondary exception suppression failed");
@@ -560,7 +560,7 @@
                         throw new AssertionError("CloseFailException: got id " + id
                                                  + ", expected lg(" + highestCloseFailBit +")");
                     }
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit);
                 }
                 checkClosedList(closedList, 4);
             }
@@ -586,7 +586,7 @@
                 } catch (MyKindOfException e) {
                     if (failure == 0)
                         throw new AssertionError("Unexpected MyKindOfException");
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     if (failure == 1)
                         throw new AssertionError("Secondary exception suppression failed");
@@ -598,7 +598,7 @@
                         throw new AssertionError("CloseFailException: got id " + id
                                                  + ", expected lg(" + highestCloseFailBit +")");
                     }
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit);
                 }
                 checkClosedList(closedList, 4);
             }
@@ -621,7 +621,7 @@
                 } catch (MyKindOfException e) {
                     if (failure == 0)
                         throw new AssertionError("Unexpected MyKindOfException");
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     if (failure == 1)
                         throw new AssertionError("Secondary exception suppression failed");
@@ -633,7 +633,7 @@
                         throw new AssertionError("CloseFailException: got id " + id
                                                  + ", expected lg(" + highestCloseFailBit +")");
                     }
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit);
                 }
                 checkClosedList(closedList, 5);
             }
@@ -660,7 +660,7 @@
                 } catch (MyKindOfException e) {
                     if (failure == 0)
                         throw new AssertionError("Unexpected MyKindOfException");
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap);
                 } catch (Resource.CloseFailException e) {
                     if (failure == 1)
                         throw new AssertionError("Secondary exception suppression failed");
@@ -672,7 +672,7 @@
                         throw new AssertionError("CloseFailException: got id " + id
                                                  + ", expected lg(" + highestCloseFailBit +")");
                     }
-                    checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit);
+                    checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit);
                 }
                 checkClosedList(closedList, 5);
             }
--- a/test/tools/javac/annotations/6881115/T6881115.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/annotations/6881115/T6881115.java	Wed Dec 15 13:26:05 2010 +0000
@@ -16,5 +16,5 @@
 }
 @A(b = @B(b2 = 1, b2 = 2),
    b_arr = {@B(), @B(b2 = 1, b2 = 2)})
-class T6881115<@A(b = @B(b2 = 1, b2 = 2),
-                  b_arr = {@B(), @B(b2 = 1, b2 = 2)}) X> {}
+class T6881115</*308 @A(b = @B(b2 = 1, b2 = 2),
+                  b_arr = {@B(), @B(b2 = 1, b2 = 2)})*/ X> {}
--- a/test/tools/javac/annotations/6881115/T6881115.out	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/annotations/6881115/T6881115.out	Wed Dec 15 13:26:05 2010 +0000
@@ -8,9 +8,4 @@
 T6881115.java:18:13: compiler.err.annotation.missing.default.value.1: B, b1,b2
 T6881115.java:18:30: compiler.err.duplicate.annotation.member.value: b2, B
 T6881115.java:18:19: compiler.err.annotation.missing.default.value: B, b1
-T6881115.java:19:34: compiler.err.duplicate.annotation.member.value: b2, B
-T6881115.java:19:23: compiler.err.annotation.missing.default.value: B, b1
-T6881115.java:20:28: compiler.err.annotation.missing.default.value.1: B, b1,b2
-T6881115.java:20:45: compiler.err.duplicate.annotation.member.value: b2, B
-T6881115.java:20:34: compiler.err.annotation.missing.default.value: B, b1
-15 errors
+10 errors
--- a/test/tools/javac/annotations/neg/Dep.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/annotations/neg/Dep.java	Wed Dec 15 13:26:05 2010 +0000
@@ -27,9 +27,9 @@
  * @summary Please add annotation <at>Deprecated to supplant the javadoc tag
  * @author gafter
  *
- * @compile      -source 1.4 -Xlint:dep-ann -Werror Dep.java
- * @compile/fail             -Xlint:dep-ann -Werror Dep.java
- * @compile                  -Xlint:dep-ann         Dep.java
+ * @compile      -source 1.4 -Xlint:-options -Xlint:dep-ann -Werror Dep.java
+ * @compile/fail                             -Xlint:dep-ann -Werror Dep.java
+ * @compile                                  -Xlint:dep-ann         Dep.java
  */
 
 /** @deprecated */
--- a/test/tools/javac/api/6406133/Erroneous.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/api/6406133/Erroneous.java	Wed Dec 15 13:26:05 2010 +0000
@@ -1,4 +1,26 @@
+/*
+ * Copyright (c) 2008, 2010, 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.
+ */
+
 @Deprecated
-class A {
-    class A {}
+class A extends Missing {
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/api/6598108/T6598108.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2010, 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     6598108
+ * @summary com.sun.source.util.Trees.isAccessible incorrect
+ * @author  Jan Lahoda
+ */
+
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.tree.Scope;
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.TreePath;
+import com.sun.source.util.Trees;
+import java.net.URI;
+import java.util.Arrays;
+import javax.lang.model.element.TypeElement;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class T6598108 {
+    public static void main(String[] args) throws Exception {
+        final String bootPath = System.getProperty("sun.boot.class.path"); //NOI18N
+        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+        assert tool != null;
+        final JavacTask ct = (JavacTask)tool.getTask(null, null, null, Arrays.asList("-bootclasspath",  bootPath), null, Arrays.asList(new MyFileObject()));
+
+        CompilationUnitTree cut = ct.parse().iterator().next();
+        TreePath tp = new TreePath(new TreePath(cut), cut.getTypeDecls().get(0));
+        Scope s = Trees.instance(ct).getScope(tp);
+        TypeElement type = ct.getElements().getTypeElement("com.sun.java.util.jar.pack.Package.File");
+
+        if (Trees.instance(ct).isAccessible(s, type)) {
+            //com.sun.java.util.jar.pack.Package.File is a public innerclass inside a non-accessible class, so
+            //"false" would be expected here.
+            throw new IllegalStateException("");
+        }
+    }
+
+    static class MyFileObject extends SimpleJavaFileObject {
+        public MyFileObject() {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+        }
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return "public class Test<TTT> { public void test() {TTT ttt;}}";
+        }
+    }
+}
--- a/test/tools/javac/api/T6412669.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/api/T6412669.java	Wed Dec 15 13:26:05 2010 +0000
@@ -23,11 +23,12 @@
 
 /*
  * @test
- * @bug 6412669
+ * @bug 6412669 6997958
  * @summary Should be able to get SourcePositions from 269 world
  */
 
 import java.io.*;
+import java.net.*;
 import java.util.*;
 import javax.annotation.*;
 import javax.annotation.processing.*;
@@ -39,28 +40,59 @@
 
 @SupportedAnnotationTypes("*")
 public class T6412669 extends AbstractProcessor {
-    public static void main(String... args) throws IOException {
-        String testSrc = System.getProperty("test.src", ".");
-        String testClasses = System.getProperty("test.classes", ".");
+    public static void main(String... args) throws Exception {
+        File testSrc = new File(System.getProperty("test.src", "."));
+        File testClasses = new File(System.getProperty("test.classes", "."));
+
+        // Determine location of necessary tools classes. Assume all in one place.
+        // Likely candidates are typically tools.jar (when testing JDK build)
+        // or build/classes or dist/javac.jar (when testing langtools, using -Xbootclasspath/p:)
+        File toolsClasses;
+        URL u = T6412669.class.getClassLoader().getResource("com/sun/source/util/JavacTask.class");
+        switch (u.getProtocol()) {
+            case "file":
+                toolsClasses = new File(u.toURI());
+                break;
+            case "jar":
+                String s = u.getFile(); // will be file:path!/entry
+                int sep = s.indexOf("!");
+                toolsClasses = new File(new URI(s.substring(0, sep)));
+                break;
+            default:
+                throw new AssertionError("Cannot locate tools classes");
+        }
+        //System.err.println("toolsClasses: " + toolsClasses);
 
         JavacTool tool = JavacTool.create();
         StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
-        fm.setLocation(StandardLocation.CLASS_PATH, Arrays.asList(new File(testClasses)));
+        fm.setLocation(StandardLocation.CLASS_PATH, Arrays.asList(testClasses, toolsClasses));
         Iterable<? extends JavaFileObject> files =
             fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(testSrc, T6412669.class.getName()+".java")));
-        String[] opts = { "-proc:only", "-processor", T6412669.class.getName(),
-                          "-classpath", new File(testClasses).getPath() };
-        JavacTask task = tool.getTask(null, fm, null, Arrays.asList(opts), null, files);
-        if (!task.call())
-            throw new AssertionError("test failed");
+        String[] opts = { "-proc:only", "-processor", T6412669.class.getName()};
+        StringWriter sw = new StringWriter();
+        JavacTask task = tool.getTask(sw, fm, null, Arrays.asList(opts), null, files);
+        boolean ok = task.call();
+        String out = sw.toString();
+        if (!out.isEmpty())
+            System.err.println(out);
+        if (!ok)
+            throw new AssertionError("compilation of test program failed");
+        // verify we found an annotated element to exercise the SourcePositions API
+        if (!out.contains("processing element"))
+            throw new AssertionError("expected text not found in compilation output");
     }
 
     public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
         Trees trees = Trees.instance(processingEnv);
         SourcePositions sp = trees.getSourcePositions();
         Messager m = processingEnv.getMessager();
+        m.printMessage(Diagnostic.Kind.NOTE, "processing annotations");
+        int count = 0;
         for (TypeElement anno: annotations) {
+            count++;
+            m.printMessage(Diagnostic.Kind.NOTE, "  processing annotation " + anno);
             for (Element e: roundEnv.getElementsAnnotatedWith(anno)) {
+                m.printMessage(Diagnostic.Kind.NOTE, "    processing element " + e);
                 TreePath p = trees.getPath(e);
                 long start = sp.getStartPosition(p.getCompilationUnit(), p.getLeaf());
                 long end = sp.getEndPosition(p.getCompilationUnit(), p.getLeaf());
@@ -69,6 +101,8 @@
                 m.printMessage(k, "test [" + start + "," + end + "]", e);
             }
         }
+        if (count == 0)
+            m.printMessage(Diagnostic.Kind.NOTE, "no annotations found");
         return true;
     }
 
--- a/test/tools/javac/cast/6467183/T6467183a.out	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/cast/6467183/T6467183a.out	Wed Dec 15 13:26:05 2010 +0000
@@ -1,6 +1,4 @@
 T6467183a.java:16:26: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.B, T6467183a<T>.A<T>
-T6467183a.java:24:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.A<java.lang.Integer>, T6467183a<T>.C<? extends java.lang.Number>
-T6467183a.java:28:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.A<java.lang.Integer>, T6467183a<T>.C<? extends java.lang.Integer>
 - compiler.err.warnings.and.werror
 1 error
-3 warnings
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/cast/6714835/T6714835.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,21 @@
+/*
+ * @test /nodynamiccopyright/
+ * @author mcimadamore
+ * @bug     6714835
+ * @summary Safe cast is rejected (with warning) by javac
+ * @compile/fail/ref=T6714835.out -Xlint:unchecked -Werror -XDrawDiagnostics T6714835.java
+ */
+
+import java.util.*;
+
+class T6714835 {
+    void cast1(Iterable<? extends Integer> x) {
+        Collection<? extends Number> x1 = (Collection<? extends Number>)x; //ok
+        Collection<? super Integer> x2 = (Collection<? super Integer>)x; //warn
+    }
+
+    void cast2(Iterable<? super Number> x) {
+        Collection<? super Integer> x1 = (Collection<? super Integer>)x; //ok
+        Collection<? extends Number> x2 = (Collection<? extends Number>)x; //warn
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/cast/6714835/T6714835.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,5 @@
+T6714835.java:14:71: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.lang.Iterable<compiler.misc.type.captureof: 1, ? extends java.lang.Integer>, java.util.Collection<? super java.lang.Integer>
+T6714835.java:19:73: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.lang.Iterable<compiler.misc.type.captureof: 1, ? super java.lang.Number>, java.util.Collection<? extends java.lang.Number>
+- compiler.err.warnings.and.werror
+1 error
+2 warnings
--- a/test/tools/javac/diags/CheckExamples.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/CheckExamples.java	Wed Dec 15 13:26:05 2010 +0000
@@ -40,7 +40,7 @@
  *      compiler.properties bundle. A list of exceptions may be given in the
  *      not-yet.txt file. Entries on the not-yet.txt list should not be
  *      covered by examples.
- * When new keys are added to the resource buncle, it is strongly recommended
+ * When new keys are added to the resource bundle, it is strongly recommended
  * that corresponding new examples be added here, if at all practical, instead
  * of simply and lazily being added to the not-yet.txt list.
  */
--- a/test/tools/javac/diags/FileManager.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/FileManager.java	Wed Dec 15 13:26:05 2010 +0000
@@ -177,12 +177,14 @@
         }
 
         void checkRead() throws IOException {
-            if (cantRead != null && cantRead.matcher(getName()).matches())
+            String canonName = getName().replace(File.separatorChar, '/');
+            if (cantRead != null && cantRead.matcher(canonName).matches())
                 throw new IOException("FileManager: Can't read");
         }
 
         void checkWrite() throws IOException {
-            if (cantWrite != null && cantWrite.matcher(getName()).matches())
+            String canonName = getName().replace(File.separatorChar, '/');
+            if (cantWrite != null && cantWrite.matcher(canonName).matches())
                 throw new IOException("FileManager: Can't write");
         }
 
--- a/test/tools/javac/diags/examples/AnnotationsNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/AnnotationsNotSupported.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.annotations.not.supported.in.source
-// options: -source 1.4
+// options: -source 1.4 -Xlint:-options
 
 @Deprecated
 class AnnotationsNotSupported { }
--- a/test/tools/javac/diags/examples/AssertAsIdentifier.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/AssertAsIdentifier.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.warn.assert.as.identifier
-// options: -source 1.3
+// options: -source 1.3 -Xlint:-options
 
 class AssertAsIdentifier {
     int assert;
--- a/test/tools/javac/diags/examples/DiamondNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/DiamondNotSupported.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.diamond.not.supported.in.source
-// options: -source 6
+// options: -source 6 -Xlint:-options
 
 import java.util.*;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/DiamondRedundantArgs.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+// key: compiler.warn.diamond.redundant.args
+// options: -XDfindDiamond
+
+class Foo<X> {
+   Foo<String> fs = new Foo<String>();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/DiamondRedundantArgs1.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+// key: compiler.warn.diamond.redundant.args.1
+// options: -XDfindDiamond
+
+class Foo<X> {
+   Foo<?> fs = new Foo<String>();
+}
--- a/test/tools/javac/diags/examples/EmptyBytecodeIdent.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2010, 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.
- */
-
-// key: compiler.err.empty.bytecode.ident
-
-class EmptyBytecodeIdent {
-    int #"" = 3;
-}
--- a/test/tools/javac/diags/examples/EnumAsIdentifier.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/EnumAsIdentifier.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.warn.enum.as.identifier
-// options: -source 1.3
+// options: -source 1.3 -Xlint:-options
 
 class EnumAsIdentifier {
     int enum;
--- a/test/tools/javac/diags/examples/EnumsNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/EnumsNotSupported.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,6 +22,6 @@
  */
 
 // key: compiler.err.enums.not.supported.in.source
-// options: -source 1.4
+// options: -source 1.4 -Xlint:-options
 
 enum EnumsNotSupported { A, B, C }
--- a/test/tools/javac/diags/examples/Expected2.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/Expected2.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,6 +22,6 @@
  */
 
 // key: compiler.err.expected2
-// options: -source 1.4
+// options: -source 1.4 -Xlint:-options
 
 int Expected2;
--- a/test/tools/javac/diags/examples/ForeachNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/ForeachNotSupported.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.foreach.not.supported.in.source
-// options: -source 1.4
+// options: -source 1.4 -Xlint:-options
 
 class ForeachNotSupported {
     void m(String[] args) {
--- a/test/tools/javac/diags/examples/GenericsNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/GenericsNotSupported.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,6 +22,6 @@
  */
 
 // key: compiler.err.generics.not.supported.in.source
-// options: -source 1.4
+// options: -source 1.4 -Xlint:-options
 
 class GenericsNotSupported<T> { }
--- a/test/tools/javac/diags/examples/IllegalBytecodeIdentChar.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2010, 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.
- */
-
-// key: compiler.err.illegal.bytecode.ident.char
-
-class IllegalBytecodeIdentChar {
-    int #"abc/def" = 3;
-}
--- a/test/tools/javac/diags/examples/MulticatchMustBeFinal.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2010, 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.
- */
-
-// key: compiler.err.multicatch.param.must.be.final
-
-class MulticatchMustBeFinal {
-    void e1() throws NullPointerException { }
-    void e2() throws IllegalArgumentException { }
-
-    void m() {
-        try {
-            e1();
-            e2();
-        } catch (NullPointerException | IllegalArgumentException e) {
-            e.printStackTrace();
-        }
-    }
-}
--- a/test/tools/javac/diags/examples/MulticatchNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/MulticatchNotSupported.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.multicatch.not.supported.in.source
-// options: -source 1.6
+// options: -source 1.6 -Xlint:-options
 
 class MulticatchNotSupported {
     class E1 extends Exception { }
--- a/test/tools/javac/diags/examples/NeitherConditionalSubtype.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/NeitherConditionalSubtype.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.neither.conditional.subtype
-// options: -source 1.4
+// options: -source 1.4 -Xlint:-options
 
 class X {
     Object m(boolean b) {
--- a/test/tools/javac/diags/examples/ResourceClosed.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/ResourceClosed.java	Wed Dec 15 13:26:05 2010 +0000
@@ -21,8 +21,8 @@
  * questions.
  */
 
-// key: compiler.warn.twr.explicit.close.call
-// options: -Xlint:arm
+// key: compiler.warn.try.explicit.close.call
+// options: -Xlint:try
 
 import java.io.*;
 
--- a/test/tools/javac/diags/examples/ResourceMayNotBeAssigned.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/ResourceMayNotBeAssigned.java	Wed Dec 15 13:26:05 2010 +0000
@@ -21,7 +21,7 @@
  * questions.
  */
 
-// key: compiler.err.twr.resource.may.not.be.assigned
+// key: compiler.err.try.resource.may.not.be.assigned
 
 import java.io.*;
 
--- a/test/tools/javac/diags/examples/ResourceNotApplicableToType.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/ResourceNotApplicableToType.java	Wed Dec 15 13:26:05 2010 +0000
@@ -21,7 +21,7 @@
  * questions.
  */
 
-// key: compiler.misc.twr.not.applicable.to.type
+// key: compiler.misc.try.not.applicable.to.type
 // key: compiler.err.prob.found.req
 
 class ResourceNotApplicableToType {
--- a/test/tools/javac/diags/examples/ResourceNotReferenced.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/ResourceNotReferenced.java	Wed Dec 15 13:26:05 2010 +0000
@@ -21,8 +21,8 @@
  * questions.
  */
 
-// key: compiler.warn.automatic.resource.not.referenced
-// options: -Xlint:arm
+// key: compiler.warn.try.resource.not.referenced
+// options: -Xlint:try
 
 import java.io.*;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/SourceNoBootclasspath.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+// key: compiler.warn.source.no.bootclasspath
+// options: -source 6
+
+class SourceNoBootclasspath { }
--- a/test/tools/javac/diags/examples/StaticImportNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/StaticImportNotSupported.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.static.import.not.supported.in.source
-// options: -source 1.4
+// options: -source 1.4 -Xlint:-options
 
 import static java.util.regex.Pattern.*;
 
--- a/test/tools/javac/diags/examples/StringSwitchNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/StringSwitchNotSupported.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.string.switch.not.supported.in.source
-// options: -source 6
+// options: -source 6 -Xlint:-options
 
 class StringSwitchNotSupported {
     int m(String s) {
--- a/test/tools/javac/diags/examples/TryResourceNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/TryResourceNotSupported.java	Wed Dec 15 13:26:05 2010 +0000
@@ -21,8 +21,8 @@
  * questions.
  */
 
-// key: compiler.err.automatic.resource.management.not.supported.in.source
-// options: -source 1.6
+// key: compiler.err.try.with.resources.not.supported.in.source
+// options: -source 1.6 -Xlint:-options
 
 import java.io.*;
 
--- a/test/tools/javac/diags/examples/TryWithoutCatchOrFinally.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/TryWithoutCatchOrFinally.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.try.without.catch.or.finally
-// options: -source 1.6
+// options: -source 1.6 -Xlint:-options
 
 class TryWithoutCatchOrFinally {
     void m() {
--- a/test/tools/javac/diags/examples/TypeAnnotationsNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2010, 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.
- */
-
-// key: compiler.err.type.annotations.not.supported.in.source
-// options: -source 6
-
-@interface Anno { }
-
-class TypeAnnotationsNotSupported {
-    void m() {
-        int i = (@Anno int) 3.14;
-    }
-}
--- a/test/tools/javac/diags/examples/UnclosedBytecodeIdent.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2010, 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.
- */
-
-// key: compiler.err.unclosed.bytecode.ident
-
-class UnclosedBytecodeIdent {
-    int #"abc
-}
--- a/test/tools/javac/diags/examples/UnsupportedBinaryLiteral.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/UnsupportedBinaryLiteral.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.unsupported.binary.lit
-// options: -source 6
+// options: -source 6 -Xlint:-options
 
 class UnsupportedBinaryLiteral {
     int i = 0b01000010;
--- a/test/tools/javac/diags/examples/UnsupportedExoticID.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2010, 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.
- */
-
-// key: compiler.err.unsupported.exotic.id
-// options: -source 6
-
-class UnsupportedExoticID {
-    void m() {
-        Object #"Hello!" = null;
-    }
-}
--- a/test/tools/javac/diags/examples/UnsupportedFpLit.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/UnsupportedFpLit.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.unsupported.fp.lit
-// options: -source 1.4
+// options: -source 1.4 -Xlint:-options
 
 class UnsupportedFpLit {
     float f = 0xCafe.BabeP1;
--- a/test/tools/javac/diags/examples/UnsupportedUnderscoreLiteral.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/UnsupportedUnderscoreLiteral.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.unsupported.underscore.lit
-// options: -source 6
+// options: -source 6 -Xlint:-options
 
 class UnsupportedUnderscoreLiteral {
     int i = 123_456_789;
--- a/test/tools/javac/diags/examples/VarargsNotSupported.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/diags/examples/VarargsNotSupported.java	Wed Dec 15 13:26:05 2010 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.varargs.not.supported.in.source
-// options: -source 1.4
+// options: -source 1.4 -Xlint:-options
 
 class VarargsNotSupported {
     void m(String... args) { }
--- a/test/tools/javac/enum/6384542/T6384542.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/enum/6384542/T6384542.java	Wed Dec 15 13:26:05 2010 +0000
@@ -3,8 +3,8 @@
  * @bug     6384542
  * @summary crash: test/tools/javac/versions/check.sh
  * @author  Peter von der Ah\u00e9
- * @compile/fail -source 1.4 T6384542.java
- * @compile/fail/ref=T6384542.out -source 1.4 -XDrawDiagnostics T6384542.java
+ * @compile/fail -source 1.4 -Xlint:-options T6384542.java
+ * @compile/fail/ref=T6384542.out -source 1.4 -Xlint:-options -XDrawDiagnostics T6384542.java
  */
 
 import static java.lang.Math.sin;
--- a/test/tools/javac/enum/6384542/T6384542a.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/enum/6384542/T6384542a.java	Wed Dec 15 13:26:05 2010 +0000
@@ -5,8 +5,8 @@
  * @author  Peter von der Ah\u00e9
  * @compile/fail -source 5   T6384542a.java
  * @compile      -source 1.4 T6384542a.java
- * @compile/fail/ref=T6384542a_5.out -source 5   -XDrawDiagnostics T6384542a.java
- * @compile/ref=T6384542a_1_4.out    -source 1.4 -XDrawDiagnostics T6384542a.java
+ * @compile/fail/ref=T6384542a_5.out -source 5   -Xlint:-options -XDrawDiagnostics T6384542a.java
+ * @compile/ref=T6384542a_1_4.out    -source 1.4 -Xlint:-options -XDrawDiagnostics T6384542a.java
  */
 
 public class T6384542a {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719a.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,15 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6985719
+ * @summary Alike methods in interfaces (Inheritance and Overriding)
+ * @author  mcimadamore
+ * @compile/fail/ref=T6985719a.out -XDrawDiagnostics T6985719a.java
+ */
+
+import java.util.List;
+
+class T6985719a {
+    interface A { void f(List<String> ls); }
+    interface B { void f(List<Integer> ls); }
+    interface C extends A,B {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719a.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+T6985719a.java:14:5: compiler.err.name.clash.same.erasure.no.override: f(java.util.List<java.lang.Integer>), T6985719a.B, f(java.util.List<java.lang.String>), T6985719a.A
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719b.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,15 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6985719
+ * @summary Alike methods in interfaces (Inheritance and Overriding)
+ * @author  mcimadamore
+ * @compile/fail/ref=T6985719b.out -XDrawDiagnostics T6985719b.java
+ */
+
+import java.util.List;
+
+class T6985719b {
+    abstract class A { abstract void f(List<String> ls); }
+    interface B { void f(List<Integer> ls); }
+    abstract class C extends A implements B {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719b.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+T6985719b.java:14:14: compiler.err.name.clash.same.erasure.no.override: f(java.util.List<java.lang.Integer>), T6985719b.B, f(java.util.List<java.lang.String>), T6985719b.A
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719c.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,15 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6985719
+ * @summary Alike methods in interfaces (Inheritance and Overriding)
+ * @author  mcimadamore
+ * @compile/fail/ref=T6985719c.out -XDrawDiagnostics T6985719c.java
+ */
+
+import java.util.List;
+
+class T6985719c {
+    interface A { void f(List<String> ls); }
+    interface B<X> { void f(List<X> ls); }
+    interface C extends A,B<Integer> {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719c.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+T6985719c.java:14:5: compiler.err.name.clash.same.erasure.no.override: f(java.util.List<X>), T6985719c.B, f(java.util.List<java.lang.String>), T6985719c.A
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719d.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,15 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6985719
+ * @summary Alike methods in interfaces (Inheritance and Overriding)
+ * @author  mcimadamore
+ * @compile/fail/ref=T6985719d.out -XDrawDiagnostics T6985719d.java
+ */
+
+import java.util.List;
+
+class T6985719d {
+    abstract class A { abstract void f(List<String> ls); }
+    interface B<X> { void f(List<X> ls); }
+    abstract class C extends A implements B<Integer> {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719d.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+T6985719d.java:14:14: compiler.err.name.clash.same.erasure.no.override: f(java.util.List<X>), T6985719d.B, f(java.util.List<java.lang.String>), T6985719d.A
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719e.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6985719
+ * @summary Alike methods in interfaces (Inheritance and Overriding)
+ * @author  mcimadamore
+ * @compile/fail/ref=T6985719e.out -XDrawDiagnostics T6985719e.java
+ */
+
+import java.util.List;
+
+class T6985719e {
+    interface A { void f(List<String> ls); }
+    interface B extends A { void f(List<Integer> ls); }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719e.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+T6985719e.java:13:34: compiler.err.name.clash.same.erasure.no.override: f(java.util.List<java.lang.Integer>), T6985719e.B, f(java.util.List<java.lang.String>), T6985719e.A
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719f.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6985719
+ * @summary Alike methods in interfaces (Inheritance and Overriding)
+ * @author  mcimadamore
+ * @compile/fail/ref=T6985719f.out -XDrawDiagnostics T6985719f.java
+ */
+
+import java.util.List;
+
+class T6985719f {
+    abstract class A { abstract void f(List<String> ls); }
+    abstract class B extends A { void f(List<Integer> ls); }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719f.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+T6985719f.java:13:39: compiler.err.name.clash.same.erasure.no.override: f(java.util.List<java.lang.Integer>), T6985719f.B, f(java.util.List<java.lang.String>), T6985719f.A
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719g.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6985719
+ * @summary Alike methods in interfaces (Inheritance and Overriding)
+ * @author  mcimadamore
+ * @compile/fail/ref=T6985719g.out -XDrawDiagnostics T6985719g.java
+ */
+
+import java.util.List;
+
+class T6985719g {
+    interface A<X> { void f(List<X> ls); }
+    interface B extends A<String> { void f(List<Integer> ls); }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719g.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+T6985719g.java:13:42: compiler.err.name.clash.same.erasure.no.override: f(java.util.List<java.lang.Integer>), T6985719g.B, f(java.util.List<X>), T6985719g.A
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719h.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6985719
+ * @summary Alike methods in interfaces (Inheritance and Overriding)
+ * @author  mcimadamore
+ * @compile/fail/ref=T6985719h.out -XDrawDiagnostics T6985719h.java
+ */
+
+import java.util.List;
+
+class T6985719h {
+    abstract class A<X> { abstract void f(List<X> ls); }
+    abstract class B extends A<String> { abstract void f(List<Integer> ls); }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/6985719/T6985719h.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+T6985719h.java:13:56: compiler.err.name.clash.same.erasure.no.override: f(java.util.List<java.lang.Integer>), T6985719h.B, f(java.util.List<X>), T6985719h.A
+1 error
--- a/test/tools/javac/generics/OverrideBridge.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/generics/OverrideBridge.java	Wed Dec 15 13:26:05 2010 +0000
@@ -23,7 +23,8 @@
 
 /*
  * @test
- * @bug 6337171
+ * @bug 6337171 6996415
+ * @ignore fix has been disabled as a consequence of 6996415
  * @summary  javac should create bridge methods when type variable bounds restricted
  * @run main OverrideBridge
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/diamond/6996914/T6996914a.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2010, 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 6996914
+ * @summary  Diamond inference: problem when accessing protected constructor
+ * @run main T6996914a
+ */
+
+import com.sun.source.util.JavacTask;
+import java.net.URI;
+import java.util.Arrays;
+import javax.tools.Diagnostic;
+import javax.tools.DiagnosticListener;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class T6996914a {
+
+    enum PackageKind {
+        DEFAULT("", ""),
+        A("package a;", "import a.*;");
+
+        String pkgDecl;
+        String importDecl;
+
+        PackageKind(String pkgDecl, String importDecl) {
+            this.pkgDecl = pkgDecl;
+            this.importDecl = importDecl;
+        }
+    }
+
+    enum DiamondKind {
+        STANDARD("new Foo<>();"),
+        ANON("new Foo<>() {};");
+
+        String expr;
+
+        DiamondKind(String expr) {
+            this.expr = expr;
+        }
+    }
+
+    enum ConstructorKind {
+        PACKAGE(""),
+        PROTECTED("protected"),
+        PRIVATE("private"),
+        PUBLIC("public");
+
+        String mod;
+
+        ConstructorKind(String mod) {
+            this.mod = mod;
+        }
+    }
+
+    static class FooClass extends SimpleJavaFileObject {
+
+        final static String sourceStub =
+                        "#P\n" +
+                        "public class Foo<X> {\n" +
+                        "  #M Foo() {}\n" +
+                        "}\n";
+
+        String source;
+
+        public FooClass(PackageKind pk, ConstructorKind ck) {
+            super(URI.create("myfo:/" + (pk != PackageKind.DEFAULT ? "a/Foo.java" : "Foo.java")),
+                    JavaFileObject.Kind.SOURCE);
+            source = sourceStub.replace("#P", pk.pkgDecl).replace("#M", ck.mod);
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+
+    static class ClientClass extends SimpleJavaFileObject {
+
+        final static String sourceStub =
+                        "#I\n" +
+                        "class Test {\n" +
+                        "  Foo<String> fs = #D\n" +
+                        "}\n";
+
+        String source;
+
+        public ClientClass(PackageKind pk, DiamondKind dk) {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            source = sourceStub.replace("#I", pk.importDecl).replace("#D", dk.expr);
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+
+    public static void main(String... args) throws Exception {
+        for (PackageKind pk : PackageKind.values()) {
+            for (ConstructorKind ck : ConstructorKind.values()) {
+                for (DiamondKind dk : DiamondKind.values()) {
+                    compileAndCheck(pk, ck, dk);
+                }
+            }
+        }
+    }
+
+    static void compileAndCheck(PackageKind pk, ConstructorKind ck, DiamondKind dk) throws Exception {
+        FooClass foo = new FooClass(pk, ck);
+        ClientClass client = new ClientClass(pk, dk);
+        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+        ErrorListener el = new ErrorListener();
+        JavacTask ct = (JavacTask)tool.getTask(null, null, el,
+                null, null, Arrays.asList(foo, client));
+        ct.analyze();
+        if (el.errors > 0 == check(pk, ck, dk)) {
+            String msg = el.errors > 0 ?
+                "Error compiling files" :
+                "No error when compiling files";
+            throw new AssertionError(msg + ": \n" + foo.source + "\n" + client.source);
+        }
+    }
+
+    static boolean check(PackageKind pk, ConstructorKind ck, DiamondKind dk) {
+        switch (pk) {
+            case A: return ck == ConstructorKind.PUBLIC ||
+                    (ck  == ConstructorKind.PROTECTED && dk == DiamondKind.ANON);
+            case DEFAULT: return ck != ConstructorKind.PRIVATE;
+            default: throw new AssertionError("Unknown package kind");
+        }
+    }
+
+    /**
+     * DiagnosticListener to count any errors that occur
+     */
+    private static class ErrorListener implements DiagnosticListener<JavaFileObject> {
+
+        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
+            switch (diagnostic.getKind()) {
+                case ERROR:
+                    errors++;
+            }
+        }
+        int errors;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/diamond/6996914/T6996914b.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2010, 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 6996914
+ * @summary  Diamond inference: problem when accessing protected constructor
+ * @compile T6996914b.java
+ */
+
+class Super<X,Y> {
+    private Super(Integer i, Y y, X x) {}
+    public Super(Number n, X x, Y y) {}
+}
+
+class Test {
+    Super<String,Integer> ssi1 = new Super<>(1, "", 2);
+    Super<String,Integer> ssi2 = new Super<>(1, "", 2) {};
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/diamond/T6939780.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,25 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6939780
+ *
+ * @summary  add a warning to detect diamond sites
+ * @author mcimadamore
+ * @compile/ref=T6939780.out T6939780.java -XDrawDiagnostics -XDfindDiamond
+ *
+ */
+
+class T6939780 {
+
+    void test() {
+        class Foo<X extends Number> {
+            Foo() {}
+            Foo(X x) {}
+        }
+        Foo<Number> f1 = new Foo<Number>(1);
+        Foo<?> f2 = new Foo<Number>();
+        Foo<?> f3 = new Foo<Integer>();
+        Foo<Number> f4 = new Foo<Number>(1) {};
+        Foo<?> f5 = new Foo<Number>() {};
+        Foo<?> f6 = new Foo<Integer>() {};
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/diamond/T6939780.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,5 @@
+T6939780.java:19:28: compiler.warn.diamond.redundant.args: Foo<java.lang.Number>, Foo<java.lang.Number>
+T6939780.java:20:28: compiler.warn.diamond.redundant.args.1: Foo<java.lang.Integer>, Foo<java.lang.Number>
+T6939780.java:22:28: compiler.warn.diamond.redundant.args: Foo<java.lang.Number>, Foo<java.lang.Number>
+T6939780.java:23:28: compiler.warn.diamond.redundant.args.1: Foo<java.lang.Integer>, Foo<java.lang.Number>
+4 warnings
--- a/test/tools/javac/generics/inference/6638712/T6638712a.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/generics/inference/6638712/T6638712a.java	Wed Dec 15 13:26:05 2010 +0000
@@ -10,7 +10,7 @@
 
 class T6638712a {
 
-    <T> Comparator<T> compound(Iterable<? extends Comparator<? super T>> it) {}
+    <T> Comparator<T> compound(Iterable<? extends Comparator<? super T>> it) { return null; }
 
     public void test(List<Comparator<?>> x) {
         Comparator<String> c3 = compound(x);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/inference/6995200/T6995200.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2010, 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 6995200
+ *
+ * @summary JDK 7 compiler crashes when type-variable is inferred from expected primitive type
+ * @author mcimadamore
+ * @compile T6995200.java
+ *
+ */
+
+import java.util.List;
+
+class T6995200 {
+    static <T> T getValue() {
+        return null;
+    }
+
+    <X> void test() {
+        byte v1 = getValue();
+        short v2 = getValue();
+        int v3 = getValue();
+        long v4 = getValue();
+        float v5 = getValue();
+        double v6 = getValue();
+        String v7 = getValue();
+        String[] v8 = getValue();
+        List<String> v9 = getValue();
+        List<String>[] v10 = getValue();
+        List<? extends String> v11 = getValue();
+        List<? extends String>[] v12 = getValue();
+        List<? super String> v13 = getValue();
+        List<? super String>[] v14 = getValue();
+        List<?> v15 = getValue();
+        List<?>[] v16 = getValue();
+        X v17 = getValue();
+        X[] v18 = getValue();
+        List<X> v19 = getValue();
+        List<X>[] v20 = getValue();
+        List<? extends X> v21 = getValue();
+        List<? extends X>[] v22 = getValue();
+        List<? super X> v23 = getValue();
+        List<? super X>[] v24 = getValue();
+    }
+}
--- a/test/tools/javac/literals/BadBinaryLiterals.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/literals/BadBinaryLiterals.java	Wed Dec 15 13:26:05 2010 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 6860965
  * @summary Project Coin: binary literals
- * @compile/fail/ref=BadBinaryLiterals.6.out -XDrawDiagnostics -source 6 BadBinaryLiterals.java
+ * @compile/fail/ref=BadBinaryLiterals.6.out -XDrawDiagnostics -source 6 -Xlint:-options BadBinaryLiterals.java
  * @compile/fail/ref=BadBinaryLiterals.7.out -XDrawDiagnostics BadBinaryLiterals.java
  */
 
--- a/test/tools/javac/literals/BadUnderscoreLiterals.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/literals/BadUnderscoreLiterals.java	Wed Dec 15 13:26:05 2010 +0000
@@ -7,7 +7,7 @@
  * @compile/fail/ref=BadUnderscoreLiterals.7.out -XDrawDiagnostics BadUnderscoreLiterals.java
  *
  * @compile/fail -source 6 BadUnderscoreLiterals.java
- * @compile/fail/ref=BadUnderscoreLiterals.6.out -XDrawDiagnostics -source 6 BadUnderscoreLiterals.java
+ * @compile/fail/ref=BadUnderscoreLiterals.6.out -XDrawDiagnostics -source 6 -Xlint:-options BadUnderscoreLiterals.java
  */
 
 public class BadUnderscoreLiterals {
--- a/test/tools/javac/meth/InvokeDyn.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/meth/InvokeDyn.java	Wed Dec 15 13:26:05 2010 +0000
@@ -58,7 +58,7 @@
         ojunk = InvokeDynamic.greet(x, "mundus", 456);
         ojunk = InvokeDynamic.greet(x, "kosmos", 789);
         ojunk = (String) InvokeDynamic.cogitate(10.11121, 3.14);
-        InvokeDynamic.#"yow: what I mean to say is, please treat this one specially"(null);
+        //InvokeDynamic.#"yow: what I mean to say is, please treat this one specially"(null);
         ijunk = (int) InvokeDynamic.invoke("goodbye");
     }
 }
--- a/test/tools/javac/meth/InvokeDynTrans.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/meth/InvokeDynTrans.java	Wed Dec 15 13:26:05 2010 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008-2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2010, 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
@@ -53,7 +53,7 @@
         InvokeDynamic.greet(x, "mundus", 456);
         InvokeDynamic.greet(x, "kosmos", 789);
         InvokeDynamic.<String>cogitate(10.11121, 3.14);
-        InvokeDynamic.<void>#"yow: what I mean to say is, please treat this one specially"(null);
+        //InvokeDynamic.<void>#"yow: what I mean to say is, please treat this one specially"(null);
         InvokeDynamic.<int>invoke("goodbye");
     }
 }
--- a/test/tools/javac/meth/InvokeDynTrans.out	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/meth/InvokeDynTrans.out	Wed Dec 15 13:26:05 2010 +0000
@@ -1,6 +1,5 @@
 InvokeDynTrans.java:55:39: compiler.warn.type.parameter.on.polymorphic.signature
-InvokeDynTrans.java:56:91: compiler.warn.type.parameter.on.polymorphic.signature
 InvokeDynTrans.java:57:34: compiler.warn.type.parameter.on.polymorphic.signature
 - compiler.err.warnings.and.werror
 1 error
-3 warnings
+2 warnings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/meth/TestCP.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2010, 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 6991980
+ * @summary  polymorphic signature calls don't share the same CP entries
+ * @run main TestCP
+ */
+
+import com.sun.tools.classfile.Instruction;
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.ConstantPool.*;
+import com.sun.tools.classfile.Method;
+
+import java.dyn.*;
+import java.io.*;
+
+public class TestCP {
+
+    static class TestClass {
+        void test(MethodHandle mh) throws Throwable {
+            Number n = mh.<Number>invokeExact("daddy",1,'n');
+            n = (Number)mh.invokeExact("bunny",1,'d');
+        }
+    }
+
+    static final String PS_TYPE = "(Ljava/lang/String;IC)Ljava/lang/Number;";
+    static final int PS_CALLS_COUNT = 2;
+    static final String SUBTEST_NAME = TestClass.class.getName() + ".class";
+    static final String TEST_METHOD_NAME = "test";
+
+    public static void main(String... args) throws Exception {
+        new TestCP().run();
+    }
+
+    public void run() throws Exception {
+        String workDir = System.getProperty("test.classes");
+        File compiledTest = new File(workDir, SUBTEST_NAME);
+        verifyMethodHandleInvocationDescriptors(compiledTest);
+    }
+
+    void verifyMethodHandleInvocationDescriptors(File f) {
+        System.err.println("verify: " + f);
+        try {
+            int count = 0;
+            ClassFile cf = ClassFile.read(f);
+            Method testMethod = null;
+            for (Method m : cf.methods) {
+                if (m.getName(cf.constant_pool).equals(TEST_METHOD_NAME)) {
+                    testMethod = m;
+                    break;
+                }
+            }
+            if (testMethod == null) {
+                throw new Error("Test method not found");
+            }
+            Code_attribute ea = (Code_attribute)testMethod.attributes.get(Attribute.Code);
+            if (testMethod == null) {
+                throw new Error("Code attribute for test() method not found");
+            }
+            int instr_count = 0;
+            int cp_entry = -1;
+
+            for (Instruction i : ea.getInstructions()) {
+                if (i.getMnemonic().equals("invokevirtual")) {
+                    instr_count++;
+                    if (cp_entry == -1) {
+                        cp_entry = i.getUnsignedShort(1);
+                    } else if (cp_entry != i.getUnsignedShort(1)) {
+                        throw new Error("Unexpected CP entry in polymorphic signature call");
+                    }
+                    CONSTANT_Methodref_info methRef =
+                            (CONSTANT_Methodref_info)cf.constant_pool.get(cp_entry);
+                    String type = methRef.getNameAndTypeInfo().getType();
+                    if (!type.equals(PS_TYPE)) {
+                        throw new Error("Unexpected type in polymorphic signature call: " + type);
+                    }
+                }
+            }
+            if (instr_count != PS_CALLS_COUNT) {
+                throw new Error("Wrong number of polymorphic signature call found: " + instr_count);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Error("error reading " + f +": " + e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/meth/XlintWarn.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2008, 2010, 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 6999067
+ * @summary cast for invokeExact call gets redundant cast to <type> warnings
+ * @author mcimadamore
+ *
+ * @compile -Werror -Xlint:cast XlintWarn.java
+ */
+
+import java.dyn.*;
+
+class XlintWarn {
+    void test(MethodHandle mh) throws Throwable {
+        int i1 = (int)mh.invoke();
+        int i2 = (int)mh.invokeExact();
+        int i3 = (int)mh.invokeVarargs();
+        int i4 = (int)InvokeDynamic.test();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Neg01eff_final.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,28 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6943289
+ *
+ * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch')
+ * @author darcy
+ * @compile/fail/ref=Neg01eff_final.out -XDrawDiagnostics Neg01eff_final.java
+ * @compile -source 6 -XDrawDiagnostics Neg01eff_final.java
+ *
+ */
+
+class Neg01eff_final {
+    static class A extends Exception {}
+    static class B1 extends A {}
+    static class B2 extends A {}
+
+    class Test {
+        void m() throws A {
+            try {
+                throw new B1();
+            } catch (A ex1) {
+                try {
+                    throw ex1; // used to throw A, now throws B1!
+                } catch (B2 ex2) { }//unreachable
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Neg01eff_final.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+Neg01eff_final.java:24:19: compiler.err.except.never.thrown.in.try: Neg01eff_final.B2
+1 error
--- a/test/tools/javac/multicatch/Neg02.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/multicatch/Neg02.java	Wed Dec 15 13:26:05 2010 +0000
@@ -20,6 +20,8 @@
             else {
                 throw new B();
             }
-        } catch (A | B ex) {  }
+        } catch (final A | B ex) {
+            ex = new B();
+        }
     }
 }
--- a/test/tools/javac/multicatch/Neg02.out	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/multicatch/Neg02.out	Wed Dec 15 13:26:05 2010 +0000
@@ -1,2 +1,2 @@
-Neg02.java:23:24: compiler.err.multicatch.param.must.be.final: ex
+Neg02.java:24:13: compiler.err.multicatch.parameter.may.not.be.assigned: ex
 1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Neg02eff_final.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,27 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6943289 6993963
+ *
+ * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch')
+ * @author mcimadamore
+ * @compile/fail/ref=Neg02eff_final.out -XDrawDiagnostics Neg02eff_final.java
+ *
+ */
+
+class Neg02eff_final {
+    static class A extends Exception {}
+    static class B extends Exception {}
+
+    void m() {
+        try {
+            if (true) {
+                throw new A();
+            }
+            else {
+                throw new B();
+            }
+        } catch (A | B ex) {
+            ex = new B();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Neg02eff_final.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+Neg02eff_final.java:24:13: compiler.err.multicatch.parameter.may.not.be.assigned: ex
+1 error
--- a/test/tools/javac/multicatch/Neg03.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/multicatch/Neg03.java	Wed Dec 15 13:26:05 2010 +0000
@@ -9,19 +9,22 @@
  */
 
 class Neg03 {
-    static class A extends Exception {}
-    static class B extends Exception {}
 
-    void m() {
+    static class A extends Exception { public void m() {}; public Object f;}
+    static class B1 extends A {}
+    static class B2 extends A {}
+
+    void m() throws B1, B2 {
         try {
             if (true) {
-                throw new A();
+                throw new B1();
             }
             else {
-                throw new B();
+                throw new B2();
             }
-        } catch (final A | B ex) {
-            ex = new B();
+        } catch (Exception ex) {
+            ex = new B2(); //effectively final analysis disabled!
+            throw ex;
         }
     }
 }
--- a/test/tools/javac/multicatch/Neg03.out	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/multicatch/Neg03.out	Wed Dec 15 13:26:05 2010 +0000
@@ -1,2 +1,2 @@
-Neg03.java:24:13: compiler.err.multicatch.parameter.may.not.be.assigned: ex
+Neg03.java:27:13: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
 1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Neg04eff_final.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,31 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6943289
+ *
+ * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch')
+ * @author mcimadamore
+ * @compile/fail/ref=Neg04eff_final.out -XDrawDiagnostics Neg04eff_final.java
+ *
+ */
+
+class Neg04eff_final {
+    static class A extends Exception {}
+    static class B extends Exception {}
+
+    void test() throws B {
+        try {
+            if (true) {
+                throw new A();
+            } else if (false) {
+                throw new B();
+            } else {
+                throw (Throwable)new Exception();
+            }
+        }
+        catch (A e) {}
+        catch (Exception e) {
+            throw e;
+        }
+        catch (Throwable t) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Neg04eff_final.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+Neg04eff_final.java:27:13: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Neg05.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,33 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6943289
+ *
+ * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch')
+ * @author mcimadamore
+ * @compile/fail/ref=Neg05.out -XDrawDiagnostics Neg05.java
+ *
+ */
+
+class Neg02 {
+
+    static class Foo<X> {
+       Foo(X x) {}
+    }
+
+    static interface Base<X> {}
+    static class A extends Exception implements Base<String> {}
+    static class B extends Exception implements Base<Integer> {}
+
+    void m() {
+        try {
+            if (true) {
+                throw new A();
+            }
+            else {
+                throw new B();
+            }
+        } catch (A | B ex) {
+            Foo<?> f = new Foo<>(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Neg05.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+Neg05.java:30:31: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: Neg02.Foo), (compiler.misc.diamond.invalid.arg: Neg02.B|Neg02.A, (compiler.misc.diamond: Neg02.Foo))
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Pos06.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,27 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6993963
+ *
+ * @summary Project Coin: Use precise exception analysis for effectively final catch parameters
+ * @author mcimadamore
+ * @compile Pos06.java
+ *
+ */
+
+class Pos06 {
+    static class A extends Exception {}
+    static class B extends Exception {}
+
+    void m() {
+        try {
+            if (true) {
+                throw new A();
+            }
+            else {
+                throw new B();
+            }
+        } catch (A | B ex) {
+            System.out.println(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Pos07.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010, 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 6993963
+ * @summary Project Coin: Use precise exception analysis for effectively final catch parameters
+ * @compile Pos07.java
+ */
+
+class Pos07 {
+
+    static class A extends Exception { public void m() {}; public Object f;}
+    static class B1 extends A {}
+    static class B2 extends A {}
+
+    void m() throws B1, B2 {
+        try {
+            if (true) {
+                throw new B1();
+            }
+            else {
+                throw new B2();
+            }
+        } catch (Exception ex) { //effectively final analysis
+            throw ex;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Pos08.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010, 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 6993963
+ * @summary Multicatch: crash while compiling simple code with a multicatch parameter
+ * @compile Pos08.java
+ */
+
+class Pos08 {
+
+    interface Foo {}
+    static class X1 extends Exception implements Foo {}
+    static class X2 extends Exception implements Foo {}
+
+    void m(boolean cond) {
+        try {
+            if (cond)
+                throw new X1();
+            else
+                throw new X2();
+        }
+        catch (final X1 | X2 ex) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/Pos08eff_final.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010, 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 6993963
+ * @summary Multicatch: crash while compiling simple code with a multicatch parameter
+ * @compile Pos08eff_final.java
+ */
+
+class Pos08eff_final {
+
+    interface Foo {}
+    static class X1 extends Exception implements Foo {}
+    static class X2 extends Exception implements Foo {}
+
+    void m(boolean cond) {
+        try {
+            if (cond)
+                throw new X1();
+            else
+                throw new X2();
+        }
+        catch (X1 | X2 ex) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/model/Check.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+/**
+ * Annotation used by ModelChecker to mark the class whose model is to be checked
+ */
+@interface Check {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/model/Member.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+import javax.lang.model.element.ElementKind;
+
+/**
+ * Annotation used by ModelChecker to mark a member that is to be checked
+ */
+@interface Member {
+   ElementKind value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/model/Model01.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+import javax.lang.model.element.ElementKind;
+
+@Check
+class Test {
+
+    class A extends Exception {
+        @Member(ElementKind.METHOD)
+        public void m() {};
+        @Member(ElementKind.FIELD)
+        public Object f;
+    }
+
+    class B1 extends A {}
+    class B2 extends A {}
+
+    void test(){
+        try {
+            if (true)
+                throw new B1();
+            else
+                throw new B2();
+        }
+        catch(B1 | B2 ex) { }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/multicatch/model/ModelChecker.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2010, 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 6993963
+ * @summary Project Coin: Use precise exception analysis for effectively final catch parameters
+ * @library ../../lib
+ * @build JavacTestingAbstractProcessor ModelChecker
+ * @compile -processor ModelChecker Model01.java
+ */
+
+import com.sun.source.tree.VariableTree;
+import com.sun.source.util.TreePathScanner;
+import com.sun.source.util.Trees;
+import com.sun.source.util.TreePath;
+
+import java.util.Set;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.TypeElement;
+
+@SupportedAnnotationTypes("Check")
+public class ModelChecker extends JavacTestingAbstractProcessor {
+
+    @Override
+    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+        if (roundEnv.processingOver())
+            return true;
+
+        Trees trees = Trees.instance(processingEnv);
+
+        TypeElement testAnno = elements.getTypeElement("Check");
+        for (Element elem: roundEnv.getElementsAnnotatedWith(testAnno)) {
+            TreePath p = trees.getPath(elem);
+            new MulticatchParamTester(trees).scan(p, null);
+        }
+        return true;
+    }
+
+    class MulticatchParamTester extends TreePathScanner<Void, Void> {
+        Trees trees;
+
+        public MulticatchParamTester(Trees trees) {
+            super();
+            this.trees = trees;
+        }
+
+        @Override
+        public Void visitVariable(VariableTree node, Void p) {
+            Element ex = trees.getElement(getCurrentPath());
+            if (ex.getSimpleName().contentEquals("ex")) {
+                assertTrue(ex.getKind() == ElementKind.EXCEPTION_PARAMETER, "Expected EXCEPTION_PARAMETER - found " + ex.getKind());
+                for (Element e : types.asElement(ex.asType()).getEnclosedElements()) {
+                    Member m = e.getAnnotation(Member.class);
+                    if (m != null) {
+                        assertTrue(e.getKind() == m.value(), "Expected " + m.value() + " - found " + e.getKind());
+                    }
+                }
+                assertTrue(assertionCount == 3, "Expected 3 assertions - found " + assertionCount);
+            }
+            return super.visitVariable(node, p);
+        }
+    }
+
+    private static void assertTrue(boolean cond, String msg) {
+        assertionCount++;
+        if (!cond)
+            throw new AssertionError(msg);
+    }
+
+    static int assertionCount = 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/processing/6994946/SemanticErrorTest.1.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+SemanticErrorTest.java:11:46: compiler.err.repeated.interface
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/processing/6994946/SemanticErrorTest.2.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,4 @@
+SemanticErrorTest.java:11:46: compiler.err.repeated.interface
+- compiler.err.proc.messager: Deliberate Error
+SemanticErrorTest.java:11:46: compiler.err.repeated.interface
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/processing/6994946/SemanticErrorTest.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,13 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6994946
+ * @summary option to specify only syntax errors as unrecoverable
+ * @library ../../lib
+ * @build JavacTestingAbstractProcessor TestProcessor
+ * @compile/fail/ref=SemanticErrorTest.1.out -XDrawDiagnostics                                  -processor TestProcessor SemanticErrorTest.java
+ * @compile/fail/ref=SemanticErrorTest.2.out -XDrawDiagnostics -XDonlySyntaxErrorsUnrecoverable -processor TestProcessor SemanticErrorTest.java
+ */
+
+class SemanticErrorTest implements Runnable, Runnable {
+    public void run() { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/processing/6994946/SyntaxErrorTest.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,13 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6994946
+ * @summary option to specify only syntax errors as unrecoverable
+ * @library ../../lib
+ * @build JavacTestingAbstractProcessor TestProcessor
+ * @compile/fail/ref=SyntaxErrorTest.out -XDrawDiagnostics                                  -processor TestProcessor SyntaxErrorTest.java
+ * @compile/fail/ref=SyntaxErrorTest.out -XDrawDiagnostics -XDonlySyntaxErrorsUnrecoverable -processor TestProcessor SyntaxErrorTest.java
+ */
+
+class SyntaxErrorTest {
+    int i
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/processing/6994946/SyntaxErrorTest.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,2 @@
+SyntaxErrorTest.java:12:10: compiler.err.expected: ';'
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/processing/6994946/TestProcessor.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+import java.util.*;
+import javax.annotation.processing.*;
+import javax.lang.model.*;
+import javax.lang.model.element.*;
+import static javax.tools.Diagnostic.Kind.*;
+
+public class TestProcessor extends JavacTestingAbstractProcessor {
+   private int round = 0;
+
+   public boolean process(Set<? extends TypeElement> annotations,
+                  RoundEnvironment roundEnv) {
+        if (++round == 1)
+            messager.printMessage(ERROR, "Deliberate Error");
+        return false;
+   }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/processing/environment/round/TestContext.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2010, 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 6988836
+ * @summary A new JavacElements is created for each round of annotation processing
+ * @library ../../../lib
+ * @build JavacTestingAbstractProcessor TestContext
+ * @compile/process -processor TestContext -XprintRounds TestContext
+ */
+
+import java.io.*;
+import java.util.*;
+import javax.annotation.processing.*;
+import javax.lang.model.element.*;
+import javax.tools.*;
+import static javax.tools.Diagnostic.Kind.*;
+
+import com.sun.source.util.Trees;
+import com.sun.tools.javac.api.JavacTrees;
+import com.sun.tools.javac.model.JavacElements;
+import com.sun.tools.javac.model.JavacTypes;
+import com.sun.tools.javac.processing.JavacProcessingEnvironment;
+import com.sun.tools.javac.util.Context;
+
+public class TestContext extends JavacTestingAbstractProcessor {
+
+    Trees treeUtils;
+    int round = 0;
+
+    @Override
+    public void init(ProcessingEnvironment pEnv) {
+        super.init(pEnv);
+        treeUtils = Trees.instance(processingEnv);
+    }
+
+    @Override
+    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+        round++;
+
+        JavacProcessingEnvironment jpe = (JavacProcessingEnvironment) processingEnv;
+        Context c = jpe.getContext();
+        check(c.get(JavacElements.class), eltUtils);
+        check(c.get(JavacTypes.class), typeUtils);
+        check(c.get(JavacTrees.class), treeUtils);
+
+        final int MAXROUNDS = 3;
+        if (round < MAXROUNDS)
+            generateSource("Gen" + round);
+
+        return true;
+    }
+
+    <T> void check(T actual, T expected) {
+//        messager.printMessage(NOTE, "expect: " + expected);
+//        messager.printMessage(NOTE, "actual: " + actual);
+
+        if (actual != expected) {
+            messager.printMessage(ERROR,
+                "round " + round + " unexpected value for " + expected.getClass().getName() + ": " + actual);
+        }
+    }
+
+    void generateSource(String name) {
+        String text = "class " + name + " { }\n";
+
+        try (Writer out = filer.createSourceFile(name).openWriter()) {
+                out.write(text);
+        } catch (IOException e) {
+            throw new Error(e);
+        }
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/processing/errors/TestParseErrors/ParseErrors.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+import java.util.List;
+import java.util.Vector;
+
+class test {
+
+    public String m(List<? extends String> v, String s ) {
+        return null;
+    }
+
+    public String m2(Vector<String> vs, String s) {
+        return null;
+    }
+
+    public void m3(testclass<String>,
+}
+
+class testclass<T> {
+    T t;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010, 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 6988407
+ * @summary javac crashes running processor on errant code; it used to print error message
+ * @library ../../../lib
+ * @build JavacTestingAbstractProcessor TestParseErrors
+ * @compile/fail/ref=TestParseErrors.out -XDrawDiagnostics -proc:only -processor TestParseErrors ParseErrors.java
+ */
+
+import java.util.*;
+import javax.annotation.processing.*;
+import javax.lang.model.element.*;
+
+public class TestParseErrors extends JavacTestingAbstractProcessor {
+
+    public boolean process(Set<? extends TypeElement> annotations,
+                           RoundEnvironment roundEnvironment) {
+        throw new Error("Should not be called");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,8 @@
+ParseErrors.java:37:37: compiler.err.expected: token.identifier
+ParseErrors.java:38:1: compiler.err.illegal.start.of.type
+ParseErrors.java:38:2: compiler.err.expected: ')'
+ParseErrors.java:40:6: compiler.err.expected: ';'
+ParseErrors.java:40:20: compiler.err.illegal.start.of.type
+ParseErrors.java:41:5: compiler.err.expected: '('
+ParseErrors.java:41:8: compiler.err.expected: token.identifier
+7 errors
--- a/test/tools/javac/processing/model/element/TestAnonClassNames.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/processing/model/element/TestAnonClassNames.java	Wed Dec 15 13:26:05 2010 +0000
@@ -78,7 +78,7 @@
         @Nesting(LOCAL)
         class LocalClass{};
 
-        Object o =  new @Nesting(ANONYMOUS) Object() { // An anonymous annotated class
+        Object o =  new /*@Nesting(ANONYMOUS)*/ Object() { // An anonymous annotated class
                 public String toString() {
                     return "I have no name!";
                 }
@@ -95,9 +95,10 @@
 
         for(Class<?> clazz : classes) {
             String name = clazz.getName();
+            Nesting anno = clazz.getAnnotation(Nesting.class);
             System.out.format("%s is %s%n",
                               clazz.getName(),
-                              clazz.getAnnotation(Nesting.class).value());
+                              anno == null ? "(unset/ANONYMOUS)" : anno.value());
             testClassName(name);
         }
     }
@@ -161,8 +162,8 @@
                                   typeElt.getQualifiedName().toString(),
                                   typeElt.getKind().toString(),
                                   nestingKind.toString());
-
-                if (typeElt.getAnnotation(Nesting.class).value() != nestingKind) {
+                Nesting anno = typeElt.getAnnotation(Nesting.class);
+                if ((anno == null ? NestingKind.ANONYMOUS : anno.value()) != nestingKind) {
                     throw new RuntimeException("Mismatch of expected and reported nesting kind.");
                 }
             }
--- a/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java	Wed Dec 15 13:26:05 2010 +0000
@@ -27,15 +27,15 @@
  * @summary Test that warnings about source versions are output as expected.
  * @author  Joseph D. Darcy
  * @compile TestSourceVersionWarnings.java
- * @compile/ref=gold_0.out             -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only                           -source 1.5 HelloWorld.java
- * @compile/ref=gold_sv_warn_0_2.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_0 -source 1.2 HelloWorld.java
- * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.2 HelloWorld.java
- * @compile/ref=gold_sv_warn_2_3.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.3 HelloWorld.java
- * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.5 HelloWorld.java
- * @compile/ref=gold_sv_warn_5_6.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.6 HelloWorld.java
- * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 HelloWorld.java
- * @compile/ref=gold_unsp_warn.out     -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Aunsupported HelloWorld.java
- * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7 HelloWorld.java
+ * @compile/ref=gold_0.out             -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only                           -source 1.5 -Xlint:-options HelloWorld.java
+ * @compile/ref=gold_sv_warn_0_2.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_0 -source 1.2 -Xlint:-options HelloWorld.java
+ * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.2 -Xlint:-options HelloWorld.java
+ * @compile/ref=gold_sv_warn_2_3.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.3 -Xlint:-options HelloWorld.java
+ * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.5 -Xlint:-options HelloWorld.java
+ * @compile/ref=gold_sv_warn_5_6.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.6 -Xlint:-options HelloWorld.java
+ * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options HelloWorld.java
+ * @compile/ref=gold_unsp_warn.out     -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options -Aunsupported HelloWorld.java
+ * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7                 HelloWorld.java
  */
 
 import java.util.Set;
--- a/test/tools/javac/quid/QuotedIdent.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2008, 2010, 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 6746458
- * @summary Verify correct lexing of quoted identifiers.
- * @author jrose
- * @ignore 6877225 test fails on Windows:
- *      QuotedIdent.java:81: error while writing QuotedIdent.*86: PATH\QuotedIdent$*86.class
- *      (The filename, directory name, or volume label syntax is incorrect)
- *
- * @library ..
- * @compile -source 7 -target 7 -XDinvokedynamic QuotedIdent.java
- * @run main quid.QuotedIdent
- */
-
-/*
- * Standalone testing:
- * <code>
- * $ cd $MY_REPO_DIR/langtools
- * $ (cd make; make)
- * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent.java
- * $ java -version  # should print 1.6 or later
- * $ java -cp dist quid.QuotedIdent
- * </code>
- */
-
-package quid;
-
-public class QuotedIdent {
-    static void check(int testid, String have, String expect)
-                throws RuntimeException {
-        if ((have == null && have != expect) ||
-                (have != null && !have.equals(expect))) {
-            String msg =
-                "TEST " + testid + ": HAVE \"" +
-                have + "\" EXPECT \"" + expect + "\"";
-            System.out.println("StringConversion: " + msg);
-            throw new RuntimeException(msg);
-        }
-    }
-
-    // negative tests:
-    //static class #"" { } //BAD empty ident name
-    //static class #"<foo>" { } //BAD bad char in ident name
-    /*static class /*(//BAD ident name interrupted by newline) #"jump:
-    " { } /* uncomment previous line to attempt class w/ bad name */
-
-    static class #"int" extends Number {
-        final int #"int";
-        #"int"(int #"int") {
-            this.#"int" = #"int";
-        }
-        static #"int" valueOf(int #"int") {
-            return new #"int"(#"int");
-        }
-        public int intValue() { return #"int"; }
-        public long longValue() { return #"int"; }
-        public float floatValue() { return #"int"; }
-        public double doubleValue() { return #"int"; }
-        public String toString() { return String.valueOf(#"int"); }
-    }
-
-    class #"*86" {
-        String #"555-1212"() { return "[*86.555-1212]"; }
-    }
-    static#"*86"#"MAKE-*86"() {   // note close spacing
-        return new QuotedIdent().new#"*86"();
-    }
-
-    static String bar() { return "[bar]"; }
-
-    public static void main(String[] args) throws Exception {
-        String s;
-
-        String #"sticky \' wicket" = "wicked ' stick";
-        s = #"sticky ' wicket";
-        check(11, s, "wicked \' stick");
-        check(12, #"s", s);
-        check(13, #"\163", s);
-
-        s = #"QuotedIdent".bar();
-        check(21, s, "[bar]");
-
-        s = #"int".valueOf(123).toString();
-        check(22, s, "123");
-
-        s = #"MAKE-*86"().#"555-1212"();
-        check(23, s, "[*86.555-1212]");
-
-        class#"{{{inmost}}}" { }
-        s = new#"{{{inmost}}}"().getClass().getName();
-        if (!s.endsWith("{{{inmost}}}"))
-            check(24, s, "should end with \"{{{inmost}}}\"");
-
-        s = #"Yog-Shoggoth".#"(nameless ululation)";
-        check(25, s, "Tekeli-li!");
-
-        s = #"int".class.getName();
-        check(31, s, QuotedIdent.class.getName()+"$int");
-
-        Class<?> x86 = Class.forName(QuotedIdent.class.getName()+"$*86");
-        if (x86 != #"*86".class)
-            check(32, "reflected "+x86, "static "+#"*86".class);
-
-        s = (String) x86.getDeclaredMethod("555-1212").invoke(#"MAKE-*86"());
-        check(31, s, "[*86.555-1212]");
-
-        System.out.println("OK");
-    }
-}
-
-interface #"Yog-Shoggoth" {
-    final String #"(nameless ululation)" = "Tekeli-li!";
-}
--- a/test/tools/javac/quid/QuotedIdent2.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2008, 2010, 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 6746458
- * @summary Verify correct separate compilation of classes with extended identifiers.
- * @author jrose
- * @ignore 6877225 test fails on Windows:
- *      QuotedIdent.java:81: error while writing QuotedIdent.*86: PATH\QuotedIdent$*86.class
- *      (The filename, directory name, or volume label syntax is incorrect)
- *
- * @library ..
- * @compile -source 7 -target 7 -XDinvokedynamic QuotedIdent.java
- * @run main quid.QuotedIdent2
- */
-/*
- * Standalone testing:
- * <code>
- * $ cd $MY_REPO_DIR/langtools
- * $ (cd make; make)
- * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent.java
- * $ ./dist/bootstrap/bin/javac -d dist -cp dist test/tools/javac/quid/QuotedIdent2.java
- * $ java -version  # should print 1.6 or later
- * $ java -cp dist QuotedIdent2
- * </code>
- */
-
-package quid;
-
-import quid.QuotedIdent.*;
-import quid.QuotedIdent.#"*86";
-import static quid.QuotedIdent.#"MAKE-*86";
-
-public class QuotedIdent2 {
-    static void check(int testid, String have, String expect)
-                throws RuntimeException {
-        QuotedIdent.check(testid, have, expect);
-    }
-
-    public static void main(String[] args) throws Exception {
-        String s;
-
-        s = #"int".valueOf(123).toString();
-        check(22, s, "123");
-
-        s = #"MAKE-*86"().#"555-1212"();
-        check(23, s, "[*86.555-1212]");
-
-        s = #"Yog-Shoggoth".#"(nameless ululation)";
-        check(25, s, "Tekeli-li!");
-
-        s = QuotedIdent.#"int".class.getName();
-        check(31, s, QuotedIdent.class.getName()+"$int");
-
-        Class<?> x86 = Class.forName(QuotedIdent.class.getName()+"$*86");
-        if (x86 != #"*86".class)
-            check(32, "reflected "+x86, "static "+#"*86".class);
-
-        s = (String) x86.getDeclaredMethod("555-1212").invoke(QuotedIdent.#"MAKE-*86"());
-        check(31, s, "[*86.555-1212]");
-
-        System.out.println("OK");
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/quid/T6999438.java	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,9 @@
+/* @test /nodynamiccopyright/
+ * @bug 6999438
+ * @summary remove support for exotic identifiers from JDK 7
+ * @compile/fail/ref=T6999438.out -XDrawDiagnostics -source 7 T6999438.java
+ */
+
+class Test {
+    int #"not supported";
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/quid/T6999438.out	Wed Dec 15 13:26:05 2010 +0000
@@ -0,0 +1,6 @@
+T6999438.java:8:8: compiler.err.expected: token.identifier
+T6999438.java:8:10: compiler.err.illegal.start.of.type
+T6999438.java:8:25: compiler.err.expected: token.identifier
+T6999438.java:8:26: compiler.err.expected: ';'
+T6999438.java:9:2: compiler.err.premature.eof
+5 errors
--- a/test/tools/javac/tree/TreePosTest.java	Thu Dec 02 10:35:09 2010 +0000
+++ b/test/tools/javac/tree/TreePosTest.java	Wed Dec 15 13:26:05 2010 +0000
@@ -357,7 +357,9 @@
                     check("encl.start <= start", encl, self, encl.start <= self.start);
                     check("start <= pos", encl, self, self.start <= self.pos);
                     if (!(self.tag == JCTree.TYPEARRAY
-                            && (encl.tag == JCTree.VARDEF || encl.tag == JCTree.TYPEARRAY))) {
+                            && (encl.tag == JCTree.VARDEF ||
+                                encl.tag == JCTree.METHODDEF ||
+                                encl.tag == JCTree.TYPEARRAY))) {
                         check("encl.pos <= start || end <= encl.pos",
                                 encl, self, encl.pos <= self.start || self.end <= encl.pos);
                     }
--- a/test/tools/javac/treeannotests/AnnoTreeTests.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2010, 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
- * @build DA TA Test TestProcessor
- * @compile -proc:only -processor TestProcessor AnnoTreeTests.java
- */
-
-@Test(6)
-class AnnoTreeTests {
-    // primitive types
-    @DA("int") int i1;
-    int i2 = (@TA("int") int) 0;
-
-    // simple array types
-    @DA("int[]") int[] a1;
-    int @TA("int") [] a2;
-    int[] a3 = (@TA("int[]") int[]) a1;
-    int[] a4 = (int @TA("int") []) a1;
-
-    // multi-dimensional array types
-    // (still to come)
-}
--- a/test/tools/javac/typeAnnotations/6967002/T6967002.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2010, 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 6967002
- * @summary JDK7 b99 javac compilation error (java.lang.AssertionError)
- * @author Maurizio Cimadamore
- * @compile/fail/ref=T6967002.out -XDrawDiagnostics T6967002.java
- */
-class Test {
-   private static void m(byte[] octets) {
-      return m(octets..., ?);
-   }
-}
--- a/test/tools/javac/typeAnnotations/6967002/T6967002.out	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-T6967002.java:33:22: compiler.err.expected: ')'
-T6967002.java:33:25: compiler.err.illegal.start.of.expr
-T6967002.java:33:28: compiler.err.illegal.start.of.expr
-T6967002.java:33:29: compiler.err.illegal.start.of.expr
-T6967002.java:33:27: compiler.err.not.stmt
-T6967002.java:33:30: compiler.err.expected: ';'
-T6967002.java:35:2: compiler.err.premature.eof
-7 errors
--- a/test/tools/javac/typeAnnotations/InnerClass.java	Thu Dec 02 10:35:09 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2009, 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 6843077
- * @summary compiler crashes when visiting inner classes
- * @author Mahmood Ali
- * @compile -source 1.7 InnerClass.java
- */
-
-class InnerClass {
-
-    InnerClass() {}
-    InnerClass(Object o) {}
-
-    private void a() {
-        new Object() {
-            public <R> void method() { }
-        };
-    }
-
-    Object f1 = new InnerClass() {
-            <R> void method() { }
-        };
-
-    Object f2 = new InnerClass() {
-            <@A R> void method() { }
-        };