Merge
authorlana
Fri, 05 Jul 2013 11:06:24 -0700
changeset 18673 d3db5fb3d72f
parent 18672 1d6d1be0a94f (diff)
parent 18642 f9cbd4f2a90d (current diff)
child 18674 30f258c90062
Merge
--- a/langtools/make/build.properties	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/make/build.properties	Fri Jul 05 11:06:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
 target.java = ${target.java.home}/bin/java
 
 # Version info -- override as needed
-jdk.version = 1.7.0
+jdk.version = 1.8.0
 build.number = b00
 milestone = internal
 
@@ -60,8 +60,8 @@
 bootstrap.full.version = ${bootstrap.release}-${build.number}
 
 # options for the <javac> tasks used to compile the tools
-javac.source = 7
-javac.target = 7
+javac.source = 8
+javac.target = 8
 javac.debug = true
 javac.debuglevel = source,lines
 javac.no.jdk.warnings = -XDignore.symbol.file=true
--- a/langtools/src/share/classes/com/sun/source/util/TreePath.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/source/util/TreePath.java	Fri Jul 05 11:06:24 2013 -0700
@@ -125,18 +125,25 @@
         return parent;
     }
 
+    /**
+     *  Iterates from leaves to root.
+     */
+    @Override
     public Iterator<Tree> iterator() {
         return new Iterator<Tree>() {
+            @Override
             public boolean hasNext() {
                 return next != null;
             }
 
+            @Override
             public Tree next() {
                 Tree t = next.leaf;
                 next = next.parent;
                 return t;
             }
 
+            @Override
             public void remove() {
                 throw new UnsupportedOperationException();
             }
--- a/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java	Fri Jul 05 11:06:24 2013 -0700
@@ -77,10 +77,12 @@
 
         public Attribute createAttribute(ClassReader cr, int name_index, byte[] data)
                 throws IOException {
-            if (standardAttributes == null)
+            if (standardAttributes == null) {
                 init();
+            }
 
             ConstantPool cp = cr.getConstantPool();
+            String reasonForDefaultAttr;
             try {
                 String name = cp.getUTF8Value(name_index);
                 Class<? extends Attribute> attrClass = standardAttributes.get(name);
@@ -90,14 +92,18 @@
                         Constructor<? extends Attribute> constr = attrClass.getDeclaredConstructor(constrArgTypes);
                         return constr.newInstance(new Object[] { cr, name_index, data.length });
                     } catch (Throwable t) {
+                        reasonForDefaultAttr = t.toString();
                         // fall through and use DefaultAttribute
                         // t.printStackTrace();
                     }
+                } else {
+                    reasonForDefaultAttr = "unknown attribute";
                 }
             } catch (ConstantPoolException e) {
+                reasonForDefaultAttr = e.toString();
                 // fall through and use DefaultAttribute
             }
-            return new DefaultAttribute(cr, name_index, data);
+            return new DefaultAttribute(cr, name_index, data, reasonForDefaultAttr);
         }
 
         protected void init() {
--- a/langtools/src/share/classes/com/sun/tools/classfile/ClassFile.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassFile.java	Fri Jul 05 11:06:24 2013 -0700
@@ -26,9 +26,9 @@
 package com.sun.tools.classfile;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Files;
 import java.nio.file.Path;
 
 import static com.sun.tools.classfile.AccessFlags.*;
@@ -44,26 +44,24 @@
 public class ClassFile {
     public static ClassFile read(File file)
             throws IOException, ConstantPoolException {
-        return read(file, new Attribute.Factory());
+        return read(file.toPath(), new Attribute.Factory());
     }
 
-    public static ClassFile read(Path path)
+    public static ClassFile read(Path input)
             throws IOException, ConstantPoolException {
-        return read(path.toFile(), new Attribute.Factory());
+        return read(input, new Attribute.Factory());
+    }
+
+    public static ClassFile read(Path input, Attribute.Factory attributeFactory)
+            throws IOException, ConstantPoolException {
+        try (InputStream in = Files.newInputStream(input)) {
+            return new ClassFile(in, attributeFactory);
+        }
     }
 
     public static ClassFile read(File file, Attribute.Factory attributeFactory)
             throws IOException, ConstantPoolException {
-        FileInputStream in = new FileInputStream(file);
-        try {
-            return new ClassFile(in, attributeFactory);
-        } finally {
-            try {
-                in.close();
-            } catch (IOException e) {
-                // ignore
-            }
-        }
+        return read(file.toPath(), attributeFactory);
     }
 
     public static ClassFile read(InputStream in)
--- a/langtools/src/share/classes/com/sun/tools/classfile/DefaultAttribute.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/DefaultAttribute.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,13 +33,24 @@
  */
 public class DefaultAttribute extends Attribute {
     DefaultAttribute(ClassReader cr, int name_index, byte[] data) {
+        this(cr, name_index, data, null);
+    }
+
+    DefaultAttribute(ClassReader cr, int name_index, byte[] data, String reason) {
         super(name_index, data.length);
         info = data;
+        this.reason = reason;
     }
 
     public DefaultAttribute(ConstantPool constant_pool, int name_index, byte[] info) {
+        this(constant_pool, name_index, info, null);
+    }
+
+    public DefaultAttribute(ConstantPool constant_pool, int name_index,
+            byte[] info, String reason) {
         super(name_index, info.length);
         this.info = info;
+        this.reason = reason;
     }
 
     public <R, P> R accept(Visitor<R, P> visitor, P p) {
@@ -47,4 +58,7 @@
     }
 
     public final byte[] info;
+    /** Why did we need to generate a DefaultAttribute
+     */
+    public final String reason;
 }
--- a/langtools/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.DataInputStream;
 import java.io.IOException;
+import java.nio.charset.Charset;
 
 /**
  * See JVMS, section 4.8.15.
@@ -38,6 +39,8 @@
  *  deletion without notice.</b>
  */
 public class SourceDebugExtension_attribute extends Attribute {
+    private static final Charset UTF8 = Charset.forName("UTF-8");
+
     SourceDebugExtension_attribute(ClassReader cr, int name_index, int length) throws IOException {
         super(name_index, length);
         debug_extension = new byte[attribute_length];
@@ -55,12 +58,7 @@
     }
 
     public String getValue() {
-        DataInputStream d  = new DataInputStream(new ByteArrayInputStream(debug_extension));
-        try {
-            return d.readUTF();
-        } catch (IOException e) {
-            return null;
-        }
+        return new String(debug_extension, UTF8);
     }
 
     public <R, D> R accept(Visitor<R, D> visitor, D data) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Fri Jul 05 11:06:24 2013 -0700
@@ -289,7 +289,8 @@
      * @param classInfoTree the content tree to which the documentation will be added
      */
     public void buildClassSignature(XMLNode node, Content classInfoTree) {
-        StringBuilder modifiers = new StringBuilder(classDoc.modifiers() + " ");
+        StringBuilder modifiers = new StringBuilder(classDoc.modifiers());
+        modifiers.append(modifiers.length() == 0 ? "" : " ");
         if (isEnum) {
             modifiers.append("enum ");
             int index;
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Fri Jul 05 11:06:24 2013 -0700
@@ -385,15 +385,21 @@
         }
         commentTextBuilder.append(propertyDoc.commentText());
 
-        Tag[] tags = propertyDoc.tags("@defaultValue");
-        if (tags != null) {
-            for (Tag tag: tags) {
-                commentTextBuilder.append("\n")
-                                  .append(tag.name())
-                                  .append(" ")
-                                  .append(tag.text());
+        // copy certain tags
+        List<Tag> allTags = new LinkedList<Tag>();
+        String[] tagNames = {"@defaultValue", "@since"};
+        for (String tagName: tagNames) {
+            Tag[] tags = propertyDoc.tags(tagName);
+            if (tags != null) {
+                allTags.addAll(Arrays.asList(tags));
             }
         }
+        for (Tag tag: allTags) {
+            commentTextBuilder.append("\n")
+                                .append(tag.name())
+                                .append(" ")
+                                .append(tag.text());
+        }
 
         //add @see tags
         if (!isGetter && !isSetter) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Fri Jul 05 11:06:24 2013 -0700
@@ -371,6 +371,7 @@
     overflow:hidden;
     padding:0px;
     margin:0px;
+    white-space:pre;
 }
 caption a:link, caption a:hover, caption a:active, caption a:visited {
     color:#FFFFFF;
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java	Fri Jul 05 11:06:24 2013 -0700
@@ -631,6 +631,10 @@
      * Initialize standard Javadoc tags for ordering purposes.
      */
     private void initStandardTaglets() {
+        if (javafx) {
+            initJavaFXTaglets();
+        }
+
         Taglet temp;
         addStandardTaglet(new ParamTaglet());
         addStandardTaglet(new ReturnTaglet());
@@ -664,10 +668,6 @@
         standardTags.add("serial");
         standardTags.add("serialField");
         standardTags.add("Text");
-
-        if (javafx) {
-            initJavaFXTaglets();
-        }
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Fri Jul 05 11:06:24 2013 -0700
@@ -69,6 +69,7 @@
 import com.sun.tools.javac.code.Type.ErrorType;
 import com.sun.tools.javac.code.Type.UnionClassType;
 import com.sun.tools.javac.code.Types;
+import com.sun.tools.javac.code.TypeTag;
 import com.sun.tools.javac.code.Types.TypeRelation;
 import com.sun.tools.javac.comp.Attr;
 import com.sun.tools.javac.comp.AttrContext;
@@ -653,8 +654,7 @@
             switch (t.getTag()) {
             case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT:
             case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE:
-                return t.getTag() == s.getTag();
-
+                return t.hasTag(s.getTag());
             default:
                 throw new AssertionError("fuzzyMatcher " + t.getTag());
             }
@@ -668,7 +668,7 @@
             if (s.isPartial())
                 return visit(s, t);
 
-            return s.getTag() == ARRAY
+            return s.hasTag(ARRAY)
                 && visit(t.elemtype, types.elemtype(s));
         }
 
@@ -685,7 +685,7 @@
 
         @Override
         public Boolean visitErrorType(ErrorType t, Type s) {
-            return s.getTag() == CLASS
+            return s.hasTag(CLASS)
                     && t.tsym.name == ((ClassType) s).tsym.name;
         }
     };
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java	Fri Jul 05 11:06:24 2013 -0700
@@ -83,7 +83,7 @@
                 return v.visitString((String) value, p);
             if (value instanceof Integer) {
                 int i = (Integer) value;
-                switch (type.tag) {
+                switch (type.getTag()) {
                 case BOOLEAN:   return v.visitBoolean(i != 0, p);
                 case CHAR:      return v.visitChar((char) i, p);
                 case BYTE:      return v.visitByte((byte) i, p);
@@ -91,7 +91,7 @@
                 case INT:       return v.visitInt(i, p);
                 }
             }
-            switch (type.tag) {
+            switch (type.getTag()) {
             case LONG:          return v.visitLong((Long) value, p);
             case FLOAT:         return v.visitFloat((Float) value, p);
             case DOUBLE:        return v.visitDouble((Double) value, p);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,9 +73,13 @@
      */
     public final static int MTH = 1 << 4;
 
+    /** Poly kind, for deferred types.
+     */
+    public final static int POLY = 1 << 5;
+
     /** The error kind, which includes all other kinds.
      */
-    public final static int ERR = (1 << 5) - 1;
+    public final static int ERR = (1 << 6) - 1;
 
     /** The set of all kinds.
      */
@@ -83,7 +87,7 @@
 
     /** Kinds for erroneous symbols that complement the above
      */
-    public static final int ERRONEOUS = 1 << 6;
+    public static final int ERRONEOUS = 1 << 7;
     public static final int AMBIGUOUS    = ERRONEOUS+1; // ambiguous reference
     public static final int HIDDEN       = ERRONEOUS+2; // hidden method or field
     public static final int STATICERR    = ERRONEOUS+3; // nonstatic member from static context
@@ -214,10 +218,10 @@
     /** A KindName representing the kind of a given class/interface type.
      */
     public static KindName typeKindName(Type t) {
-        if (t.tag == TYPEVAR ||
-            t.tag == CLASS && (t.tsym.flags() & COMPOUND) != 0)
+        if (t.hasTag(TYPEVAR) ||
+            t.hasTag(CLASS) && (t.tsym.flags() & COMPOUND) != 0)
             return KindName.BOUND;
-        else if (t.tag == PACKAGE)
+        else if (t.hasTag(PACKAGE))
             return KindName.PACKAGE;
         else if ((t.tsym.flags_field & ANNOTATION) != 0)
             return KindName.ANNOTATION;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java	Fri Jul 05 11:06:24 2013 -0700
@@ -215,7 +215,7 @@
     @Override
     public String visitClassType(ClassType t, Locale locale) {
         StringBuilder buf = new StringBuilder();
-        if (t.getEnclosingType().tag == CLASS && t.tsym.owner.kind == Kinds.TYP) {
+        if (t.getEnclosingType().hasTag(CLASS) && t.tsym.owner.kind == Kinds.TYP) {
             buf.append(visit(t.getEnclosingType(), locale));
             buf.append('.');
             buf.append(className(t, false, locale));
@@ -379,7 +379,7 @@
                     ? s.owner.name.toString()
                     : s.name.toString();
             if (s.type != null) {
-                if (s.type.tag == FORALL) {
+                if (s.type.hasTag(FORALL)) {
                     ms = "<" + visitTypes(s.type.getTypeArguments(), locale) + ">" + ms;
                 }
                 ms += "(" + printMethodArgs(
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Fri Jul 05 11:06:24 2013 -0700
@@ -699,17 +699,17 @@
         public final boolean precedes(TypeSymbol that, Types types) {
             if (this == that)
                 return false;
-            if (this.type.tag == that.type.tag) {
-                if (this.type.hasTag(CLASS)) {
+            if (type.hasTag(that.type.getTag())) {
+                if (type.hasTag(CLASS)) {
                     return
                         types.rank(that.type) < types.rank(this.type) ||
                         types.rank(that.type) == types.rank(this.type) &&
                         that.getQualifiedName().compareTo(this.getQualifiedName()) < 0;
-                } else if (this.type.hasTag(TYPEVAR)) {
+                } else if (type.hasTag(TYPEVAR)) {
                     return types.isSubtype(this.type, that.type);
                 }
             }
-            return this.type.hasTag(TYPEVAR);
+            return type.hasTag(TYPEVAR);
         }
 
         @Override
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Fri Jul 05 11:06:24 2013 -0700
@@ -28,7 +28,6 @@
 import java.util.*;
 
 import javax.lang.model.element.ElementVisitor;
-import javax.lang.model.type.TypeVisitor;
 
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type.*;
@@ -65,16 +64,16 @@
 
     /** Builtin types.
      */
-    public final Type byteType = new Type(BYTE, null);
-    public final Type charType = new Type(CHAR, null);
-    public final Type shortType = new Type(SHORT, null);
-    public final Type intType = new Type(INT, null);
-    public final Type longType = new Type(LONG, null);
-    public final Type floatType = new Type(FLOAT, null);
-    public final Type doubleType = new Type(DOUBLE, null);
-    public final Type booleanType = new Type(BOOLEAN, null);
+    public final JCPrimitiveType byteType = new JCPrimitiveType(BYTE, null);
+    public final JCPrimitiveType charType = new JCPrimitiveType(CHAR, null);
+    public final JCPrimitiveType shortType = new JCPrimitiveType(SHORT, null);
+    public final JCPrimitiveType intType = new JCPrimitiveType(INT, null);
+    public final JCPrimitiveType longType = new JCPrimitiveType(LONG, null);
+    public final JCPrimitiveType floatType = new JCPrimitiveType(FLOAT, null);
+    public final JCPrimitiveType doubleType = new JCPrimitiveType(DOUBLE, null);
+    public final JCPrimitiveType booleanType = new JCPrimitiveType(BOOLEAN, null);
     public final Type botType = new BottomType();
-    public final JCNoType voidType = new JCNoType(VOID);
+    public final JCVoidType voidType = new JCVoidType();
 
     private final Names names;
     private final ClassReader reader;
@@ -208,7 +207,7 @@
 
     public void initType(Type type, ClassSymbol c) {
         type.tsym = c;
-        typeOfTag[type.tag.ordinal()] = type;
+        typeOfTag[type.getTag().ordinal()] = type;
     }
 
     public void initType(Type type, String name) {
@@ -220,7 +219,7 @@
 
     public void initType(Type type, String name, String bname) {
         initType(type, name);
-            boxedName[type.tag.ordinal()] = names.fromString("java.lang." + bname);
+            boxedName[type.getTag().ordinal()] = names.fromString("java.lang." + bname);
     }
 
     /** The class symbol that owns all predefined symbols.
@@ -330,7 +329,7 @@
     }
 
     public void synthesizeBoxTypeIfMissing(final Type type) {
-        ClassSymbol sym = reader.enterClass(boxedName[type.tag.ordinal()]);
+        ClassSymbol sym = reader.enterClass(boxedName[type.getTag().ordinal()]);
         final Completer completer = sym.completer;
         if (completer != null) {
             sym.completer = new Completer() {
@@ -388,12 +387,7 @@
         target = Target.instance(context);
 
         // Create the unknown type
-        unknownType = new Type(UNKNOWN, null) {
-            @Override
-            public <R, P> R accept(TypeVisitor<R, P> v, P p) {
-                return v.visitUnknown(this, p);
-            }
-        };
+        unknownType = new UnknownType();
 
         // create the basic builtin symbols
         rootPackage = new PackageSymbol(names.empty, null);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Fri Jul 05 11:06:24 2013 -0700
@@ -70,25 +70,19 @@
  *
  *  @see TypeTag
  */
-public class Type implements PrimitiveType {
+public abstract class Type implements TypeMirror {
 
     /** Constant type: no type at all. */
-    public static final JCNoType noType = new JCNoType(NONE);
+    public static final JCNoType noType = new JCNoType();
 
     /** Constant type: special type to be used during recovery of deferred expressions. */
-    public static final JCNoType recoveryType = new JCNoType(NONE);
+    public static final JCNoType recoveryType = new JCNoType();
 
     /** If this switch is turned on, the names of type variables
      *  and anonymous classes are printed with hashcodes appended.
      */
     public static boolean moreInfo = false;
 
-    /** The tag of this type.
-     *
-     *  @see TypeTag
-     */
-    protected TypeTag tag;
-
     /** The defining class / interface / package / type variable.
      */
     public TypeSymbol tsym;
@@ -98,39 +92,37 @@
      * @return true if tag is equal to the current type tag.
      */
     public boolean hasTag(TypeTag tag) {
-        return this.tag == tag;
+        return tag == getTag();
     }
 
     /**
      * Returns the current type tag.
      * @return the value of the current type tag.
      */
-    public TypeTag getTag() {
-        return tag;
-    }
+    public abstract TypeTag getTag();
 
     public boolean isNumeric() {
-        return tag.isNumeric;
+        return false;
     }
 
     public boolean isPrimitive() {
-        return tag.isPrimitive;
+        return false;
     }
 
     public boolean isPrimitiveOrVoid() {
-        return tag.isPrimitiveOrVoid;
+        return false;
     }
 
     public boolean isReference() {
-        return tag.isReference;
+        return false;
     }
 
     public boolean isNullOrReference() {
-        return (tag.isReference || tag == BOT);
+        return false;
     }
 
     public boolean isPartial() {
-        return tag.isPartial;
+        return false;
     }
 
     /**
@@ -143,6 +135,18 @@
         return null;
     }
 
+    /** Is this a constant type whose value is false?
+     */
+    public boolean isFalse() {
+        return false;
+    }
+
+    /** Is this a constant type whose value is true?
+     */
+    public boolean isTrue() {
+        return false;
+    }
+
     /**
      * Get the representation of this type used for modelling purposes.
      * By default, this is itself. For ErrorType, a different value
@@ -153,7 +157,7 @@
     }
 
     public static List<Type> getModelTypes(List<Type> ts) {
-        ListBuffer<Type> lb = new ListBuffer<Type>();
+        ListBuffer<Type> lb = new ListBuffer<>();
         for (Type t: ts)
             lb.append(t.getModelType());
         return lb.toList();
@@ -163,8 +167,7 @@
 
     /** Define a type given its tag and type symbol
      */
-    public Type(TypeTag tag, TypeSymbol tsym) {
-        this.tag = tag;
+    public Type(TypeSymbol tsym) {
         this.tsym = tsym;
     }
 
@@ -203,18 +206,7 @@
      *  and with given constant value
      */
     public Type constType(Object constValue) {
-        final Object value = constValue;
-        Assert.check(isPrimitive());
-        return new Type(tag, tsym) {
-                @Override
-                public Object constValue() {
-                    return value;
-                }
-                @Override
-                public Type baseType() {
-                    return tsym.type;
-                }
-            };
+        throw new AssertionError();
     }
 
     /**
@@ -272,7 +264,9 @@
         String s = (tsym == null || tsym.name == null)
             ? "<none>"
             : tsym.name.toString();
-        if (moreInfo && tag == TYPEVAR) s = s + hashCode();
+        if (moreInfo && hasTag(TYPEVAR)) {
+            s = s + hashCode();
+        }
         return s;
     }
 
@@ -298,12 +292,7 @@
      */
     public String stringValue() {
         Object cv = Assert.checkNonNull(constValue());
-        if (tag == BOOLEAN)
-            return ((Integer) cv).intValue() == 0 ? "false" : "true";
-        else if (tag == CHAR)
-            return String.valueOf((char) ((Integer) cv).intValue());
-        else
-            return cv.toString();
+        return cv.toString();
     }
 
     /**
@@ -321,24 +310,6 @@
         return super.hashCode();
     }
 
-    /** Is this a constant type whose value is false?
-     */
-    public boolean isFalse() {
-        return
-            tag == BOOLEAN &&
-            constValue() != null &&
-            ((Integer)constValue()).intValue() == 0;
-    }
-
-    /** Is this a constant type whose value is true?
-     */
-    public boolean isTrue() {
-        return
-            tag == BOOLEAN &&
-            constValue() != null &&
-            ((Integer)constValue()).intValue() != 0;
-    }
-
     public String argtypes(boolean varargs) {
         List<Type> args = getParameterTypes();
         if (!varargs) return args.toString();
@@ -348,7 +319,7 @@
             args = args.tail;
             buf.append(',');
         }
-        if (args.head.unannotatedType().tag == ARRAY) {
+        if (args.head.unannotatedType().hasTag(ARRAY)) {
             buf.append(((ArrayType)args.head.unannotatedType()).elemtype);
             if (args.head.getAnnotationMirrors().nonEmpty()) {
                 buf.append(args.head.getAnnotationMirrors());
@@ -485,28 +456,122 @@
         return tsym;
     }
 
+    @Override
     public TypeKind getKind() {
-        switch (tag) {
-        case BYTE:      return TypeKind.BYTE;
-        case CHAR:      return TypeKind.CHAR;
-        case SHORT:     return TypeKind.SHORT;
-        case INT:       return TypeKind.INT;
-        case LONG:      return TypeKind.LONG;
-        case FLOAT:     return TypeKind.FLOAT;
-        case DOUBLE:    return TypeKind.DOUBLE;
-        case BOOLEAN:   return TypeKind.BOOLEAN;
-        case VOID:      return TypeKind.VOID;
-        case BOT:       return TypeKind.NULL;
-        case NONE:      return TypeKind.NONE;
-        default:        return TypeKind.OTHER;
-        }
+        return TypeKind.OTHER;
+    }
+
+    @Override
+    public <R, P> R accept(TypeVisitor<R, P> v, P p) {
+        throw new AssertionError();
     }
 
-    public <R, P> R accept(TypeVisitor<R, P> v, P p) {
-        if (isPrimitive())
+    public static class JCPrimitiveType extends Type
+            implements javax.lang.model.type.PrimitiveType {
+
+        TypeTag tag;
+
+        public JCPrimitiveType(TypeTag tag, TypeSymbol tsym) {
+            super(tsym);
+            this.tag = tag;
+            Assert.check(tag.isPrimitive);
+        }
+
+        @Override
+        public boolean isNumeric() {
+            return tag != BOOLEAN;
+        }
+
+        @Override
+        public boolean isPrimitive() {
+            return true;
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return tag;
+        }
+
+        @Override
+        public boolean isPrimitiveOrVoid() {
+            return true;
+        }
+
+        /** Define a constant type, of the same kind as this type
+         *  and with given constant value
+         */
+        @Override
+        public Type constType(Object constValue) {
+            final Object value = constValue;
+            return new JCPrimitiveType(tag, tsym) {
+                    @Override
+                    public Object constValue() {
+                        return value;
+                    }
+                    @Override
+                    public Type baseType() {
+                        return tsym.type;
+                    }
+                };
+        }
+
+        /**
+         * The constant value of this type, converted to String
+         */
+        @Override
+        public String stringValue() {
+            Object cv = Assert.checkNonNull(constValue());
+            if (tag == BOOLEAN) {
+                return ((Integer) cv).intValue() == 0 ? "false" : "true";
+            }
+            else if (tag == CHAR) {
+                return String.valueOf((char) ((Integer) cv).intValue());
+            }
+            else {
+                return cv.toString();
+            }
+        }
+
+        /** Is this a constant type whose value is false?
+         */
+        @Override
+        public boolean isFalse() {
+            return
+                tag == BOOLEAN &&
+                constValue() != null &&
+                ((Integer)constValue()).intValue() == 0;
+        }
+
+        /** Is this a constant type whose value is true?
+         */
+        @Override
+        public boolean isTrue() {
+            return
+                tag == BOOLEAN &&
+                constValue() != null &&
+                ((Integer)constValue()).intValue() != 0;
+        }
+
+        @Override
+        public <R, P> R accept(TypeVisitor<R, P> v, P p) {
             return v.visitPrimitive(this, p);
-        else
+        }
+
+        @Override
+        public TypeKind getKind() {
+            switch (tag) {
+                case BYTE:      return TypeKind.BYTE;
+                case CHAR:      return TypeKind.CHAR;
+                case SHORT:     return TypeKind.SHORT;
+                case INT:       return TypeKind.INT;
+                case LONG:      return TypeKind.LONG;
+                case FLOAT:     return TypeKind.FLOAT;
+                case DOUBLE:    return TypeKind.DOUBLE;
+                case BOOLEAN:   return TypeKind.BOOLEAN;
+            }
             throw new AssertionError();
+        }
+
     }
 
     public static class WildcardType extends Type
@@ -522,7 +587,7 @@
         }
 
         public WildcardType(Type type, BoundKind kind, TypeSymbol tsym) {
-            super(WILDCARD, tsym);
+            super(tsym);
             this.type = Assert.checkNonNull(type);
             this.kind = kind;
         }
@@ -535,6 +600,12 @@
             this.bound = bound;
         }
 
+        @Override
+        public TypeTag getTag() {
+            return WILDCARD;
+        }
+
+        @Override
         public boolean contains(Type t) {
             return kind != UNBOUND && type.contains(t);
         }
@@ -551,6 +622,17 @@
             return kind == UNBOUND;
         }
 
+        @Override
+        public boolean isReference() {
+            return true;
+        }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
+        @Override
         public Type withTypeVar(Type t) {
             //-System.err.println(this+".withTypeVar("+t+");");//DEBUG
             if (bound == t)
@@ -640,7 +722,7 @@
         public List<Type> all_interfaces_field;
 
         public ClassType(Type outer, List<Type> typarams, TypeSymbol tsym) {
-            super(CLASS, tsym);
+            super(tsym);
             this.outer_field = outer;
             this.typarams_field = typarams;
             this.allparams_field = null;
@@ -658,6 +740,11 @@
         }
 
         @Override
+        public TypeTag getTag() {
+            return CLASS;
+        }
+
+        @Override
         public <R,S> R accept(Type.Visitor<R,S> v, S s) {
             return v.visitClassType(this, s);
         }
@@ -680,7 +767,7 @@
          */
         public String toString() {
             StringBuilder buf = new StringBuilder();
-            if (getEnclosingType().tag == CLASS && tsym.owner.kind == TYP) {
+            if (getEnclosingType().hasTag(CLASS) && tsym.owner.kind == TYP) {
                 buf.append(getEnclosingType().toString());
                 buf.append(".");
                 buf.append(className(tsym, false));
@@ -765,6 +852,16 @@
             // optimization, was: allparams().nonEmpty();
         }
 
+        @Override
+        public boolean isReference() {
+            return true;
+        }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
         /** A cache for the rank. */
         int rank_field = -1;
 
@@ -909,11 +1006,15 @@
         public Type elemtype;
 
         public ArrayType(Type elemtype, TypeSymbol arrayClass) {
-            super(ARRAY, arrayClass);
+            super(arrayClass);
             this.elemtype = elemtype;
         }
 
         @Override
+        public TypeTag getTag() {
+            return ARRAY;
+        }
+
         public <R,S> R accept(Type.Visitor<R,S> v, S s) {
             return v.visitArrayType(this, s);
         }
@@ -947,6 +1048,16 @@
             return elemtype.isParameterized();
         }
 
+        @Override
+        public boolean isReference() {
+            return true;
+        }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
         public boolean isRaw() {
             return elemtype.isRaw();
         }
@@ -1001,13 +1112,17 @@
                           Type restype,
                           List<Type> thrown,
                           TypeSymbol methodClass) {
-            super(METHOD, methodClass);
+            super(methodClass);
             this.argtypes = argtypes;
             this.restype = restype;
             this.thrown = thrown;
         }
 
         @Override
+        public TypeTag getTag() {
+            return METHOD;
+        }
+
         public <R,S> R accept(Type.Visitor<R,S> v, S s) {
             return v.visitMethodType(this, s);
         }
@@ -1077,7 +1192,12 @@
     public static class PackageType extends Type implements NoType {
 
         PackageType(TypeSymbol tsym) {
-            super(PACKAGE, tsym);
+            super(tsym);
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return PACKAGE;
         }
 
         @Override
@@ -1120,26 +1240,32 @@
         public Type lower;
 
         public TypeVar(Name name, Symbol owner, Type lower) {
-            super(TYPEVAR, null);
+            super(null);
             tsym = new TypeVariableSymbol(0, name, this, owner);
             this.lower = lower;
         }
 
         public TypeVar(TypeSymbol tsym, Type bound, Type lower) {
-            super(TYPEVAR, tsym);
+            super(tsym);
             this.bound = bound;
             this.lower = lower;
         }
 
         @Override
+        public TypeTag getTag() {
+            return TYPEVAR;
+        }
+
+        @Override
         public <R,S> R accept(Type.Visitor<R,S> v, S s) {
             return v.visitTypeVar(this, s);
         }
 
         @Override
         public Type getUpperBound() {
-            if ((bound == null || bound.tag == NONE) && this != tsym.type)
+            if ((bound == null || bound.hasTag(NONE)) && this != tsym.type) {
                 bound = tsym.type.getUpperBound();
+            }
             return bound;
         }
 
@@ -1158,6 +1284,17 @@
             return false;
         }
 
+        @Override
+        public boolean isReference() {
+            return true;
+        }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
+        @Override
         public <R, P> R accept(TypeVisitor<R, P> v, P p) {
             return v.visitTypeVariable(this, p);
         }
@@ -1203,10 +1340,13 @@
 
     public static abstract class DelegatedType extends Type {
         public Type qtype;
+        public TypeTag tag;
         public DelegatedType(TypeTag tag, Type qtype) {
-            super(tag, qtype.tsym);
+            super(qtype.tsym);
+            this.tag = tag;
             this.qtype = qtype;
         }
+        public TypeTag getTag() { return tag; }
         public String toString() { return qtype.toString(); }
         public List<Type> getTypeArguments() { return qtype.getTypeArguments(); }
         public Type getEnclosingType() { return qtype.getEnclosingType(); }
@@ -1340,6 +1480,12 @@
             else return qtype + "?";
         }
 
+        @Override
+        public boolean isPartial() {
+            return true;
+        }
+
+        @Override
         public Type baseType() {
             if (inst != null) return inst.baseType();
             else return this;
@@ -1439,21 +1585,21 @@
         }
     }
 
-    /** Represents VOID or NONE.
+    /** Represents NONE.
      */
-    static class JCNoType extends Type implements NoType {
-        public JCNoType(TypeTag tag) {
-            super(tag, null);
+    public static class JCNoType extends Type implements NoType {
+        public JCNoType() {
+            super(null);
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return NONE;
         }
 
         @Override
         public TypeKind getKind() {
-            switch (tag) {
-            case VOID:  return TypeKind.VOID;
-            case NONE:  return TypeKind.NONE;
-            default:
-                throw new AssertionError("Unexpected tag: " + tag);
-            }
+            return TypeKind.NONE;
         }
 
         @Override
@@ -1462,9 +1608,43 @@
         }
     }
 
+    /** Represents VOID.
+     */
+    public static class JCVoidType extends Type implements NoType {
+
+        public JCVoidType() {
+            super(null);
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return VOID;
+        }
+
+        @Override
+        public TypeKind getKind() {
+            return TypeKind.VOID;
+        }
+
+        @Override
+        public <R, P> R accept(TypeVisitor<R, P> v, P p) {
+            return v.visitNoType(this, p);
+        }
+
+        @Override
+        public boolean isPrimitiveOrVoid() {
+            return true;
+        }
+    }
+
     static class BottomType extends Type implements NullType {
         public BottomType() {
-            super(BOT, null);
+            super(null);
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return BOT;
         }
 
         @Override
@@ -1486,6 +1666,12 @@
         public String stringValue() {
             return "null";
         }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
     }
 
     public static class ErrorType extends ClassType
@@ -1495,7 +1681,6 @@
 
         public ErrorType(Type originalType, TypeSymbol tsym) {
             super(noType, List.<Type>nil(), null);
-            tag = ERROR;
             this.tsym = tsym;
             this.originalType = (originalType == null ? noType : originalType);
         }
@@ -1507,6 +1692,26 @@
             c.members_field = new Scope.ErrorScope(c);
         }
 
+        @Override
+        public TypeTag getTag() {
+            return ERROR;
+        }
+
+        @Override
+        public boolean isPartial() {
+            return true;
+        }
+
+        @Override
+        public boolean isReference() {
+            return true;
+        }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
         public ErrorType(Name name, TypeSymbol container, Type originalType) {
             this(new ClassSymbol(PUBLIC|STATIC|ACYCLIC, name, null, container), originalType);
         }
@@ -1559,7 +1764,7 @@
         public Type underlyingType;
 
         public AnnotatedType(Type underlyingType) {
-            super(underlyingType.tag, underlyingType.tsym);
+            super(underlyingType.tsym);
             this.typeAnnotations = List.nil();
             this.underlyingType = underlyingType;
             Assert.check(!underlyingType.isAnnotated(),
@@ -1568,7 +1773,7 @@
 
         public AnnotatedType(List<Attribute.TypeCompound> typeAnnotations,
                 Type underlyingType) {
-            super(underlyingType.tag, underlyingType.tsym);
+            super(underlyingType.tsym);
             this.typeAnnotations = typeAnnotations;
             this.underlyingType = underlyingType;
             Assert.check(!underlyingType.isAnnotated(),
@@ -1577,6 +1782,11 @@
         }
 
         @Override
+        public TypeTag getTag() {
+            return underlyingType.getTag();
+        }
+
+        @Override
         public boolean isAnnotated() {
             return true;
         }
@@ -1651,10 +1861,18 @@
         @Override
         public List<Type> allparams()            { return underlyingType.allparams(); }
         @Override
+        public boolean isPrimitive()             { return underlyingType.isPrimitive(); }
+        @Override
+        public boolean isPrimitiveOrVoid()       { return underlyingType.isPrimitiveOrVoid(); }
+        @Override
         public boolean isNumeric()               { return underlyingType.isNumeric(); }
         @Override
         public boolean isReference()             { return underlyingType.isReference(); }
         @Override
+        public boolean isNullOrReference()       { return underlyingType.isNullOrReference(); }
+        @Override
+        public boolean isPartial()               { return underlyingType.isPartial(); }
+        @Override
         public boolean isParameterized()         { return underlyingType.isParameterized(); }
         @Override
         public boolean isRaw()                   { return underlyingType.isRaw(); }
@@ -1719,6 +1937,28 @@
         public TypeMirror getSuperBound()        { return ((WildcardType)underlyingType).getSuperBound(); }
     }
 
+    public static class UnknownType extends Type {
+
+        public UnknownType() {
+            super(null);
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return UNKNOWN;
+        }
+
+        @Override
+        public <R, P> R accept(TypeVisitor<R, P> v, P p) {
+            return v.visitUnknown(this, p);
+        }
+
+        @Override
+        public boolean isPartial() {
+            return true;
+        }
+    }
+
     /**
      * A visitor for types.  A visitor is used to implement operations
      * (or relations) on types.  Most common operations on types are
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java	Fri Jul 05 11:06:24 2013 -0700
@@ -42,132 +42,107 @@
 public enum TypeTag {
     /** The tag of the basic type `byte'.
      */
-    BYTE(BYTE_CLASS, BYTE_SUPERCLASSES,
-            TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
+    BYTE(BYTE_CLASS, BYTE_SUPERCLASSES, true),
 
     /** The tag of the basic type `char'.
      */
-    CHAR(CHAR_CLASS, CHAR_SUPERCLASSES,
-            TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
+    CHAR(CHAR_CLASS, CHAR_SUPERCLASSES, true),
 
     /** The tag of the basic type `short'.
      */
-    SHORT(SHORT_CLASS, SHORT_SUPERCLASSES,
-            TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
-
-    /** The tag of the basic type `int'.
-     */
-    INT(INT_CLASS, INT_SUPERCLASSES,
-            TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
+    SHORT(SHORT_CLASS, SHORT_SUPERCLASSES, true),
 
     /** The tag of the basic type `long'.
      */
-    LONG(LONG_CLASS, LONG_SUPERCLASSES, TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
+    LONG(LONG_CLASS, LONG_SUPERCLASSES, true),
 
     /** The tag of the basic type `float'.
      */
-    FLOAT(FLOAT_CLASS, FLOAT_SUPERCLASSES, TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
-
+    FLOAT(FLOAT_CLASS, FLOAT_SUPERCLASSES, true),
+    /** The tag of the basic type `int'.
+     */
+    INT(INT_CLASS, INT_SUPERCLASSES, true),
     /** The tag of the basic type `double'.
      */
-    DOUBLE(DOUBLE_CLASS, DOUBLE_CLASS, TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
-
+    DOUBLE(DOUBLE_CLASS, DOUBLE_CLASS, true),
     /** The tag of the basic type `boolean'.
      */
-    BOOLEAN(TypeTagKind.PRIMITIVE),
+    BOOLEAN(0, 0, true),
 
     /** The tag of the type `void'.
      */
-    VOID(TypeTagKind.VOID),
+    VOID,
 
     /** The tag of all class and interface types.
      */
-    CLASS(TypeTagKind.REFERENCE),
+    CLASS,
 
     /** The tag of all array types.
      */
-    ARRAY(TypeTagKind.REFERENCE),
+    ARRAY,
 
     /** The tag of all (monomorphic) method types.
      */
-    METHOD(TypeTagKind.OTHER),
+    METHOD,
 
     /** The tag of all package "types".
      */
-    PACKAGE(TypeTagKind.OTHER),
+    PACKAGE,
 
     /** The tag of all (source-level) type variables.
      */
-    TYPEVAR(TypeTagKind.REFERENCE),
+    TYPEVAR,
 
     /** The tag of all type arguments.
      */
-    WILDCARD(TypeTagKind.REFERENCE),
+    WILDCARD,
 
     /** The tag of all polymorphic (method-) types.
      */
-    FORALL(TypeTagKind.OTHER),
+    FORALL,
 
     /** The tag of deferred expression types in method context
      */
-    DEFERRED(TypeTagKind.OTHER),
+    DEFERRED,
 
     /** The tag of the bottom type {@code <null>}.
      */
-    BOT(TypeTagKind.OTHER),
+    BOT,
 
     /** The tag of a missing type.
      */
-    NONE(TypeTagKind.OTHER),
+    NONE,
 
     /** The tag of the error type.
      */
-    ERROR(TypeTagKind.REFERENCE | TypeTagKind.PARTIAL),
+    ERROR,
 
     /** The tag of an unknown type
      */
-    UNKNOWN(TypeTagKind.PARTIAL),
+    UNKNOWN,
 
     /** The tag of all instantiatable type variables.
      */
-    UNDETVAR(TypeTagKind.PARTIAL),
+    UNDETVAR,
 
     /** Pseudo-types, these are special tags
      */
-    UNINITIALIZED_THIS(TypeTagKind.OTHER),
-
-    UNINITIALIZED_OBJECT(TypeTagKind.OTHER);
+    UNINITIALIZED_THIS,
 
-    final boolean isPrimitive;
-    final boolean isNumeric;
-    final boolean isPartial;
-    final boolean isReference;
-    final boolean isPrimitiveOrVoid;
+    UNINITIALIZED_OBJECT;
+
     final int superClasses;
     final int numericClass;
+    final boolean isPrimitive;
 
-    private TypeTag(int kind) {
-        this(0, 0, kind);
+    private TypeTag() {
+        this(0, 0, false);
     }
 
-    private TypeTag(int numericClass, int superClasses, int kind) {
-         isPrimitive = (kind & TypeTagKind.PRIMITIVE) != 0;
-         isNumeric = (kind & TypeTagKind.NUMERIC) != 0;
-         isPartial = (kind & TypeTagKind.PARTIAL) != 0;
-         isReference = (kind & TypeTagKind.REFERENCE) != 0;
-         isPrimitiveOrVoid = ((kind & TypeTagKind.PRIMITIVE) != 0) ||
-                 ((kind & TypeTagKind.VOID) != 0);
-         this.superClasses = superClasses;
-         this.numericClass = numericClass;
-     }
-
-    static class TypeTagKind {
-        static final int PRIMITIVE = 1;
-        static final int NUMERIC = 2;
-        static final int REFERENCE = 4;
-        static final int PARTIAL = 8;
-        static final int OTHER = 16;
-        static final int VOID = 32;
+    private TypeTag(int numericClass, int superClasses, boolean isPrimitive) {
+        this.superClasses = superClasses;
+        this.numericClass = numericClass;
+        this.isPrimitive = isPrimitive;
     }
 
     public static class NumericClasses {
@@ -261,4 +236,5 @@
             throw new AssertionError("unknown primitive type " + this);
         }
     }
+
 }
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Jul 05 11:06:24 2013 -0700
@@ -286,8 +286,9 @@
      * conversion to s?
      */
     public boolean isConvertible(Type t, Type s, Warner warn) {
-        if (t.tag == ERROR)
+        if (t.hasTag(ERROR)) {
             return true;
+        }
         boolean tPrimitive = t.isPrimitive();
         boolean sPrimitive = s.isPrimitive();
         if (tPrimitive == sPrimitive) {
@@ -396,7 +397,8 @@
         /**
          * Compute the function descriptor associated with a given functional interface
          */
-        public FunctionDescriptor findDescriptorInternal(TypeSymbol origin, CompoundScope membersCache) throws FunctionDescriptorLookupError {
+        public FunctionDescriptor findDescriptorInternal(TypeSymbol origin,
+                CompoundScope membersCache) throws FunctionDescriptorLookupError {
             if (!origin.isInterface() || (origin.flags() & ANNOTATION) != 0) {
                 //t must be an interface
                 throw failure("not.a.functional.intf", origin);
@@ -655,17 +657,16 @@
                 }
             } else if (isSubtype(t, s)) {
                 return true;
-            }
-            else if (t.tag == TYPEVAR) {
+            } else if (t.hasTag(TYPEVAR)) {
                 return isSubtypeUnchecked(t.getUpperBound(), s, warn);
-            }
-            else if (!s.isRaw()) {
+            } else if (!s.isRaw()) {
                 Type t2 = asSuper(t, s.tsym);
                 if (t2 != null && t2.isRaw()) {
-                    if (isReifiable(s))
+                    if (isReifiable(s)) {
                         warn.silentWarn(LintCategory.UNCHECKED);
-                    else
+                    } else {
                         warn.warn(LintCategory.UNCHECKED);
+                    }
                     return true;
                 }
             }
@@ -673,13 +674,14 @@
         }
 
         private void checkUnsafeVarargsConversion(Type t, Type s, Warner warn) {
-            if (t.tag != ARRAY || isReifiable(t))
+            if (!t.hasTag(ARRAY) || isReifiable(t)) {
                 return;
+            }
             t = t.unannotatedType();
             s = s.unannotatedType();
             ArrayType from = (ArrayType)t;
             boolean shouldWarn = false;
-            switch (s.tag) {
+            switch (s.getTag()) {
                 case ARRAY:
                     ArrayType to = (ArrayType)s;
                     shouldWarn = from.isVarargs() &&
@@ -735,8 +737,9 @@
     // where
         private TypeRelation isSubtype = new TypeRelation()
         {
+            @Override
             public Boolean visitType(Type t, Type s) {
-                switch (t.tag) {
+                switch (t.getTag()) {
                  case BYTE:
                      return (!s.hasTag(CHAR) && t.getTag().isSubRangeOf(s.getTag()));
                  case CHAR:
@@ -756,7 +759,7 @@
                  case NONE:
                      return false;
                  default:
-                     throw new AssertionError("isSubtype " + t.tag);
+                     throw new AssertionError("isSubtype " + t.getTag());
                  }
             }
 
@@ -826,14 +829,14 @@
 
             @Override
             public Boolean visitArrayType(ArrayType t, Type s) {
-                if (s.tag == ARRAY) {
+                if (s.hasTag(ARRAY)) {
                     if (t.elemtype.isPrimitive())
                         return isSameType(t.elemtype, elemtype(s));
                     else
                         return isSubtypeNoCapture(t.elemtype, elemtype(s));
                 }
 
-                if (s.tag == CLASS) {
+                if (s.hasTag(CLASS)) {
                     Name sname = s.tsym.getQualifiedName();
                     return sname == names.java_lang_Object
                         || sname == names.java_lang_Cloneable
@@ -846,9 +849,9 @@
             @Override
             public Boolean visitUndetVar(UndetVar t, Type s) {
                 //todo: test against origin needed? or replace with substitution?
-                if (t == s || t.qtype == s || s.tag == ERROR || s.tag == UNKNOWN) {
+                if (t == s || t.qtype == s || s.hasTag(ERROR) || s.hasTag(UNKNOWN)) {
                     return true;
-                } else if (s.tag == BOT) {
+                } else if (s.hasTag(BOT)) {
                     //if 's' is 'null' there's no instantiated type U for which
                     //U <: s (but 'null' itself, which is not a valid type)
                     return false;
@@ -913,15 +916,17 @@
      * Is t a supertype of s?
      */
     public boolean isSuperType(Type t, Type s) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case ERROR:
             return true;
         case UNDETVAR: {
             UndetVar undet = (UndetVar)t;
             if (t == s ||
                 undet.qtype == s ||
-                s.tag == ERROR ||
-                s.tag == BOT) return true;
+                s.hasTag(ERROR) ||
+                s.hasTag(BOT)) {
+                return true;
+            }
             undet.addBound(InferenceBound.LOWER, s, this);
             return true;
         }
@@ -990,12 +995,12 @@
                 if (s.isPartial())
                     return visit(s, t);
 
-                switch (t.tag) {
+                switch (t.getTag()) {
                 case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT:
                 case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE:
-                    return t.tag == s.tag;
+                    return t.hasTag(s.getTag());
                 case TYPEVAR: {
-                    if (s.tag == TYPEVAR) {
+                    if (s.hasTag(TYPEVAR)) {
                         //type-substitution does not preserve type-var types
                         //check that type var symbols and bounds are indeed the same
                         return sameTypeVars((TypeVar)t.unannotatedType(), (TypeVar)s.unannotatedType());
@@ -1009,7 +1014,7 @@
                     }
                 }
                 default:
-                    throw new AssertionError("isSameType " + t.tag);
+                    throw new AssertionError("isSameType " + t.getTag());
                 }
             }
 
@@ -1080,8 +1085,9 @@
 
             @Override
             public Boolean visitForAll(ForAll t, Type s) {
-                if (s.tag != FORALL)
+                if (!s.hasTag(FORALL)) {
                     return false;
+                }
 
                 ForAll forAll = (ForAll)s;
                 return hasSameBounds(t, forAll)
@@ -1090,12 +1096,14 @@
 
             @Override
             public Boolean visitUndetVar(UndetVar t, Type s) {
-                if (s.tag == WILDCARD)
+                if (s.hasTag(WILDCARD)) {
                     // FIXME, this might be leftovers from before capture conversion
                     return false;
-
-                if (t == s || t.qtype == s || s.tag == ERROR || s.tag == UNKNOWN)
+                }
+
+                if (t == s || t.qtype == s || s.hasTag(ERROR) || s.hasTag(UNKNOWN)) {
                     return true;
+                }
 
                 t.addBound(InferenceBound.EQ, s, Types.this);
 
@@ -1171,9 +1179,9 @@
 
     // <editor-fold defaultstate="collapsed" desc="Contains Type">
     public boolean containedBy(Type t, Type s) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case UNDETVAR:
-            if (s.tag == WILDCARD) {
+            if (s.hasTag(WILDCARD)) {
                 UndetVar undetvar = (UndetVar)t;
                 WildcardType wt = (WildcardType)s.unannotatedType();
                 switch(wt.kind) {
@@ -1241,7 +1249,7 @@
         private TypeRelation containsType = new TypeRelation() {
 
             private Type U(Type t) {
-                while (t.tag == WILDCARD) {
+                while (t.hasTag(WILDCARD)) {
                     WildcardType w = (WildcardType)t.unannotatedType();
                     if (w.isSuperBound())
                         return w.bound == null ? syms.objectType : w.bound.bound;
@@ -1252,7 +1260,7 @@
             }
 
             private Type L(Type t) {
-                while (t.tag == WILDCARD) {
+                while (t.hasTag(WILDCARD)) {
                     WildcardType w = (WildcardType)t.unannotatedType();
                     if (w.isExtendsBound())
                         return syms.botType;
@@ -1298,10 +1306,11 @@
 
             @Override
             public Boolean visitUndetVar(UndetVar t, Type s) {
-                if (s.tag != WILDCARD)
+                if (!s.hasTag(WILDCARD)) {
                     return isSameType(t, s);
-                else
+                } else {
                     return false;
+                }
             }
 
             @Override
@@ -1311,13 +1320,13 @@
         };
 
     public boolean isCaptureOf(Type s, WildcardType t) {
-        if (s.tag != TYPEVAR || !((TypeVar)s.unannotatedType()).isCaptured())
+        if (!s.hasTag(TYPEVAR) || !((TypeVar)s.unannotatedType()).isCaptured())
             return false;
         return isSameWildcard(t, ((CapturedType)s.unannotatedType()).wildcard);
     }
 
     public boolean isSameWildcard(WildcardType t, Type s) {
-        if (s.tag != WILDCARD)
+        if (!s.hasTag(WILDCARD))
             return false;
         WildcardType w = (WildcardType)s.unannotatedType();
         return w.kind == t.kind && w.type == t.type;
@@ -1333,6 +1342,26 @@
     }
     // </editor-fold>
 
+    /**
+     * Can t and s be compared for equality?  Any primitive ==
+     * primitive or primitive == object comparisons here are an error.
+     * Unboxing and correct primitive == primitive comparisons are
+     * already dealt with in Attr.visitBinary.
+     *
+     */
+    public boolean isEqualityComparable(Type s, Type t, Warner warn) {
+        if (t.isNumeric() && s.isNumeric())
+            return true;
+
+        boolean tPrimitive = t.isPrimitive();
+        boolean sPrimitive = s.isPrimitive();
+        if (!tPrimitive && !sPrimitive) {
+            return isCastable(s, t, warn) || isCastable(t, s, warn);
+        } else {
+            return false;
+        }
+    }
+
     // <editor-fold defaultstate="collapsed" desc="isCastable">
     public boolean isCastable(Type t, Type s) {
         return isCastable(t, s, noWarnings);
@@ -1369,15 +1398,15 @@
         private TypeRelation isCastable = new TypeRelation() {
 
             public Boolean visitType(Type t, Type s) {
-                if (s.tag == ERROR)
+                if (s.hasTag(ERROR))
                     return true;
 
-                switch (t.tag) {
+                switch (t.getTag()) {
                 case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT:
                 case DOUBLE:
                     return s.isNumeric();
                 case BOOLEAN:
-                    return s.tag == BOOLEAN;
+                    return s.hasTag(BOOLEAN);
                 case VOID:
                     return false;
                 case BOT:
@@ -1394,10 +1423,10 @@
 
             @Override
             public Boolean visitClassType(ClassType t, Type s) {
-                if (s.tag == ERROR || s.tag == BOT)
+                if (s.hasTag(ERROR) || s.hasTag(BOT))
                     return true;
 
-                if (s.tag == TYPEVAR) {
+                if (s.hasTag(TYPEVAR)) {
                     if (isCastable(t, s.getUpperBound(), noWarnings)) {
                         warnStack.head.warn(LintCategory.UNCHECKED);
                         return true;
@@ -1412,11 +1441,11 @@
                             visitIntersectionType((IntersectionClassType)t.unannotatedType(), s, false);
                 }
 
-                if (s.tag == CLASS || s.tag == ARRAY) {
+                if (s.hasTag(CLASS) || s.hasTag(ARRAY)) {
                     boolean upcast;
                     if ((upcast = isSubtype(erasure(t), erasure(s)))
                         || isSubtype(erasure(s), erasure(t))) {
-                        if (!upcast && s.tag == ARRAY) {
+                        if (!upcast && s.hasTag(ARRAY)) {
                             if (!isReifiable(s))
                                 warnStack.head.warn(LintCategory.UNCHECKED);
                             return true;
@@ -1469,7 +1498,7 @@
                     }
 
                     // Sidecast
-                    if (s.tag == CLASS) {
+                    if (s.hasTag(CLASS)) {
                         if ((s.tsym.flags() & INTERFACE) != 0) {
                             return ((t.tsym.flags() & FINAL) == 0)
                                 ? sideCast(t, s, warnStack.head)
@@ -1501,7 +1530,7 @@
 
             @Override
             public Boolean visitArrayType(ArrayType t, Type s) {
-                switch (s.tag) {
+                switch (s.getTag()) {
                 case ERROR:
                 case BOT:
                     return true;
@@ -1516,7 +1545,7 @@
                     return isSubtype(t, s);
                 case ARRAY:
                     if (elemtype(t).isPrimitive() || elemtype(s).isPrimitive()) {
-                        return elemtype(t).tag == elemtype(s).tag;
+                        return elemtype(t).hasTag(elemtype(s).getTag());
                     } else {
                         return visit(elemtype(t), elemtype(s));
                     }
@@ -1527,7 +1556,7 @@
 
             @Override
             public Boolean visitTypeVar(TypeVar t, Type s) {
-                switch (s.tag) {
+                switch (s.getTag()) {
                 case ERROR:
                 case BOT:
                     return true;
@@ -1579,8 +1608,9 @@
 
             private Set<TypePair> cache = new HashSet<TypePair>();
 
+            @Override
             public Boolean visitType(Type t, Type s) {
-                if (s.tag == WILDCARD)
+                if (s.hasTag(WILDCARD))
                     return visit(s, t);
                 else
                     return notSoftSubtypeRecursive(t, s) || notSoftSubtypeRecursive(s, t);
@@ -1617,10 +1647,10 @@
                 if (t.isUnbound())
                     return false;
 
-                if (s.tag != WILDCARD) {
+                if (!s.hasTag(WILDCARD)) {
                     if (t.isExtendsBound())
                         return notSoftSubtypeRecursive(s, t.type);
-                    else // isSuperBound()
+                    else
                         return notSoftSubtypeRecursive(t.type, s);
                 }
 
@@ -1669,21 +1699,21 @@
      */
     public boolean notSoftSubtype(Type t, Type s) {
         if (t == s) return false;
-        if (t.tag == TYPEVAR) {
+        if (t.hasTag(TYPEVAR)) {
             TypeVar tv = (TypeVar) t;
             return !isCastable(tv.bound,
                                relaxBound(s),
                                noWarnings);
         }
-        if (s.tag != WILDCARD)
+        if (!s.hasTag(WILDCARD))
             s = upperBound(s);
 
         return !isSubtype(t, relaxBound(s));
     }
 
     private Type relaxBound(Type t) {
-        if (t.tag == TYPEVAR) {
-            while (t.tag == TYPEVAR)
+        if (t.hasTag(TYPEVAR)) {
+            while (t.hasTag(TYPEVAR))
                 t = t.getUpperBound();
             t = rewriteQuantifiers(t, true, true);
         }
@@ -1732,16 +1762,16 @@
 
     // <editor-fold defaultstate="collapsed" desc="Array Utils">
     public boolean isArray(Type t) {
-        while (t.tag == WILDCARD)
+        while (t.hasTag(WILDCARD))
             t = upperBound(t);
-        return t.tag == ARRAY;
+        return t.hasTag(ARRAY);
     }
 
     /**
      * The element type of an array.
      */
     public Type elemtype(Type t) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case WILDCARD:
             return elemtype(upperBound(t));
         case ARRAY:
@@ -1775,7 +1805,7 @@
      */
     public int dimensions(Type t) {
         int result = 0;
-        while (t.tag == ARRAY) {
+        while (t.hasTag(ARRAY)) {
             result++;
             t = elemtype(t);
         }
@@ -1789,8 +1819,7 @@
      * @return the ArrayType for the given component
      */
     public ArrayType makeArrayType(Type t) {
-        if (t.tag == VOID ||
-            t.tag == PACKAGE) {
+        if (t.hasTag(VOID) || t.hasTag(PACKAGE)) {
             Assert.error("Type t must not be a VOID or PACKAGE type, " + t.toString());
         }
         return new ArrayType(t, syms.arrayClass);
@@ -1821,7 +1850,7 @@
                     return t;
 
                 Type st = supertype(t);
-                if (st.tag == CLASS || st.tag == TYPEVAR || st.tag == ERROR) {
+                if (st.hasTag(CLASS) || st.hasTag(TYPEVAR) || st.hasTag(ERROR)) {
                     Type x = asSuper(st, sym);
                     if (x != null)
                         return x;
@@ -1863,13 +1892,13 @@
      * @param sym a symbol
      */
     public Type asOuterSuper(Type t, Symbol sym) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case CLASS:
             do {
                 Type s = asSuper(t, sym);
                 if (s != null) return s;
                 t = t.getEnclosingType();
-            } while (t.tag == CLASS);
+            } while (t.hasTag(CLASS));
             return null;
         case ARRAY:
             return isSubtype(t, sym.type) ? sym.type : null;
@@ -1890,16 +1919,16 @@
      * @param sym a symbol
      */
     public Type asEnclosingSuper(Type t, Symbol sym) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case CLASS:
             do {
                 Type s = asSuper(t, sym);
                 if (s != null) return s;
                 Type outer = t.getEnclosingType();
-                t = (outer.tag == CLASS) ? outer :
+                t = (outer.hasTag(CLASS)) ? outer :
                     (t.tsym.owner.enclClass() != null) ? t.tsym.owner.enclClass().type :
                     Type.noType;
-            } while (t.tag == CLASS);
+            } while (t.hasTag(CLASS));
             return null;
         case ARRAY:
             return isSubtype(t, sym.type) ? sym.type : null;
@@ -1987,11 +2016,11 @@
      * (not defined for Method and ForAll types)
      */
     public boolean isAssignable(Type t, Type s, Warner warn) {
-        if (t.tag == ERROR)
+        if (t.hasTag(ERROR))
             return true;
-        if (t.tag.isSubRangeOf(INT) && t.constValue() != null) {
+        if (t.getTag().isSubRangeOf(INT) && t.constValue() != null) {
             int value = ((Number)t.constValue()).intValue();
-            switch (s.tag) {
+            switch (s.getTag()) {
             case BYTE:
                 if (Byte.MIN_VALUE <= value && value <= Byte.MAX_VALUE)
                     return true;
@@ -2007,7 +2036,7 @@
             case INT:
                 return true;
             case CLASS:
-                switch (unboxedType(s).tag) {
+                switch (unboxedType(s).getTag()) {
                 case BYTE:
                 case CHAR:
                 case SHORT:
@@ -2135,7 +2164,7 @@
                             null,
                             syms.noSymbol);
         bc.type = new IntersectionClassType(bounds, bc, allInterfaces);
-        bc.erasure_field = (bounds.head.tag == TYPEVAR) ?
+        bc.erasure_field = (bounds.head.hasTag(TYPEVAR)) ?
                 syms.objectType : // error condition, recover
                 erasure(firstExplicitBound);
         bc.members_field = new Scope(bc);
@@ -2198,7 +2227,7 @@
              */
             @Override
             public Type visitTypeVar(TypeVar t, Void ignored) {
-                if (t.bound.tag == TYPEVAR ||
+                if (t.bound.hasTag(TYPEVAR) ||
                     (!t.bound.isCompound() && !t.bound.isInterface())) {
                     return t.bound;
                 } else {
@@ -2502,8 +2531,8 @@
         }
 
         private MethodSymbol implementationInternal(MethodSymbol ms, TypeSymbol origin, boolean checkResult, Filter<Symbol> implFilter) {
-            for (Type t = origin.type; t.tag == CLASS || t.tag == TYPEVAR; t = supertype(t)) {
-                while (t.tag == TYPEVAR)
+            for (Type t = origin.type; t.hasTag(CLASS) || t.hasTag(TYPEVAR); t = supertype(t)) {
+                while (t.hasTag(TYPEVAR))
                     t = t.getUpperBound();
                 TypeSymbol c = t.tsym;
                 for (Scope.Entry e = c.members().lookup(ms.name, implFilter);
@@ -2684,13 +2713,13 @@
 
             @Override
             public Boolean visitMethodType(MethodType t, Type s) {
-                return s.tag == METHOD
+                return s.hasTag(METHOD)
                     && containsTypeEquivalent(t.argtypes, s.getParameterTypes());
             }
 
             @Override
             public Boolean visitForAll(ForAll t, Type s) {
-                if (s.tag != FORALL)
+                if (!s.hasTag(FORALL))
                     return strict ? false : visitMethodType(t.asMethodType(), s);
 
                 ForAll forAll = (ForAll)s;
@@ -3025,7 +3054,7 @@
      */
     public int rank(Type t) {
         t = t.unannotatedType();
-        switch(t.tag) {
+        switch(t.getTag()) {
         case CLASS: {
             ClassType cls = (ClassType)t;
             if (cls.rank_field < 0) {
@@ -3091,7 +3120,7 @@
      */
     @Deprecated
     public String toString(Type t) {
-        if (t.tag == FORALL) {
+        if (t.hasTag(FORALL)) {
             ForAll forAll = (ForAll)t;
             return typaramsString(forAll.tvars) + forAll.qtype;
         }
@@ -3157,9 +3186,9 @@
         if (cl == null) {
             Type st = supertype(t);
             if (!t.isCompound()) {
-                if (st.tag == CLASS) {
+                if (st.hasTag(CLASS)) {
                     cl = insert(closure(st), t);
-                } else if (st.tag == TYPEVAR) {
+                } else if (st.hasTag(TYPEVAR)) {
                     cl = closure(st).prepend(t);
                 } else {
                     cl = List.of(t);
@@ -3219,7 +3248,7 @@
         if (isSameType(cl1.head, cl2.head))
             return intersect(cl1.tail, cl2.tail).prepend(cl1.head);
         if (cl1.head.tsym == cl2.head.tsym &&
-            cl1.head.tag == CLASS && cl2.head.tag == CLASS) {
+            cl1.head.hasTag(CLASS) && cl2.head.hasTag(CLASS)) {
             if (cl1.head.isParameterized() && cl2.head.isParameterized()) {
                 Type merge = merge(cl1.head,cl2.head);
                 return intersect(cl1.tail, cl2.tail).prepend(merge);
@@ -3343,7 +3372,7 @@
         final int CLASS_BOUND = 2;
         int boundkind = 0;
         for (Type t : ts) {
-            switch (t.tag) {
+            switch (t.getTag()) {
             case CLASS:
                 boundkind |= CLASS_BOUND;
                 break;
@@ -3353,8 +3382,8 @@
             case  TYPEVAR:
                 do {
                     t = t.getUpperBound();
-                } while (t.tag == TYPEVAR);
-                if (t.tag == ARRAY) {
+                } while (t.hasTag(TYPEVAR));
+                if (t.hasTag(ARRAY)) {
                     boundkind |= ARRAY_BOUND;
                 } else {
                     boundkind |= CLASS_BOUND;
@@ -3394,13 +3423,14 @@
 
         case CLASS_BOUND:
             // calculate lub(A, B)
-            while (ts.head.tag != CLASS && ts.head.tag != TYPEVAR)
+            while (!ts.head.hasTag(CLASS) && !ts.head.hasTag(TYPEVAR)) {
                 ts = ts.tail;
+            }
             Assert.check(!ts.isEmpty());
             //step 1 - compute erased candidate set (EC)
             List<Type> cl = erasedSupertypes(ts.head);
             for (Type t : ts.tail) {
-                if (t.tag == CLASS || t.tag == TYPEVAR)
+                if (t.hasTag(CLASS) || t.hasTag(TYPEVAR))
                     cl = intersect(cl, erasedSupertypes(t));
             }
             //step 2 - compute minimal erased candidate set (MEC)
@@ -3422,7 +3452,7 @@
             // calculate lub(A, B[])
             List<Type> classes = List.of(arraySuperType());
             for (Type t : ts) {
-                if (t.tag != ARRAY) // Filter out any arrays
+                if (!t.hasTag(ARRAY)) // Filter out any arrays
                     classes = classes.prepend(t);
             }
             // lub(A, B[]) is lub(A, arraySuperType)
@@ -3433,7 +3463,7 @@
         List<Type> erasedSupertypes(Type t) {
             ListBuffer<Type> buf = lb();
             for (Type sup : closure(t)) {
-                if (sup.tag == TYPEVAR) {
+                if (sup.hasTag(TYPEVAR)) {
                     buf.append(sup);
                 } else {
                     buf.append(erasure(sup));
@@ -3509,7 +3539,7 @@
         private static final UnaryVisitor<Integer> hashCode = new UnaryVisitor<Integer>() {
 
             public Integer visitType(Type t, Void ignored) {
-                return t.tag.ordinal();
+                return t.getTag().ordinal();
             }
 
             @Override
@@ -3635,7 +3665,7 @@
      * Return the class that boxes the given primitive.
      */
     public ClassSymbol boxedClass(Type t) {
-        return reader.enterClass(syms.boxedName[t.tag.ordinal()]);
+        return reader.enterClass(syms.boxedName[t.getTag().ordinal()]);
     }
 
     /**
@@ -3667,7 +3697,7 @@
      */
     public Type unboxedTypeOrType(Type t) {
         Type unboxedType = unboxedType(t);
-        return unboxedType.tag == NONE ? t : unboxedType;
+        return unboxedType.hasTag(NONE) ? t : unboxedType;
     }
     // </editor-fold>
 
@@ -3717,7 +3747,7 @@
         return buf.reverse();
     }
     public Type capture(Type t) {
-        if (t.tag != CLASS)
+        if (!t.hasTag(CLASS))
             return t;
         if (t.getEnclosingType() != Type.noType) {
             Type capturedEncl = capture(t.getEnclosingType());
@@ -3783,7 +3813,7 @@
         public List<Type> freshTypeVariables(List<Type> types) {
             ListBuffer<Type> result = lb();
             for (Type t : types) {
-                if (t.tag == WILDCARD) {
+                if (t.hasTag(WILDCARD)) {
                     t = t.unannotatedType();
                     Type bound = ((WildcardType)t).getExtendsBound();
                     if (bound == null)
@@ -3953,14 +3983,14 @@
 
         @Override
         public Void visitClassType(ClassType source, Type target) throws AdaptFailure {
-            if (target.tag == CLASS)
+            if (target.hasTag(CLASS))
                 adaptRecursive(source.allparams(), target.allparams());
             return null;
         }
 
         @Override
         public Void visitArrayType(ArrayType source, Type target) throws AdaptFailure {
-            if (target.tag == ARRAY)
+            if (target.hasTag(ARRAY))
                 adaptRecursive(elemtype(source), elemtype(target));
             return null;
         }
@@ -4142,7 +4172,7 @@
         }
 
         Type B(Type t) {
-            while (t.tag == WILDCARD) {
+            while (t.hasTag(WILDCARD)) {
                 WildcardType w = (WildcardType)t.unannotatedType();
                 t = high ?
                     w.getExtendsBound() :
@@ -4187,7 +4217,7 @@
      * substituted by the wildcard
      */
     private WildcardType makeSuperWildcard(Type bound, TypeVar formal) {
-        if (bound.tag == BOT) {
+        if (bound.hasTag(BOT)) {
             return new WildcardType(syms.objectType,
                                     BoundKind.UNBOUND,
                                     syms.boundClass,
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Jul 05 11:06:24 2013 -0700
@@ -134,6 +134,7 @@
         allowAnonOuterThis = source.allowAnonOuterThis();
         allowStringsInSwitch = source.allowStringsInSwitch();
         allowPoly = source.allowPoly();
+        allowTypeAnnos = source.allowTypeAnnotations();
         allowLambda = source.allowLambda();
         allowDefaultMethods = source.allowDefaultMethods();
         sourceName = source.name;
@@ -147,6 +148,7 @@
         statInfo = new ResultInfo(NIL, Type.noType);
         varInfo = new ResultInfo(VAR, Type.noType);
         unknownExprInfo = new ResultInfo(VAL, Type.noType);
+        unknownAnyPolyInfo = new ResultInfo(VAL, Infer.anyPoly);
         unknownTypeInfo = new ResultInfo(TYP, Type.noType);
         unknownTypeExprInfo = new ResultInfo(Kinds.TYP | Kinds.VAL, Type.noType);
         recoveryInfo = new RecoveryInfo(deferredAttr.emptyDeferredAttrContext);
@@ -160,6 +162,10 @@
      */
     boolean allowPoly;
 
+    /** Switch: support type annotations.
+     */
+    boolean allowTypeAnnos;
+
     /** Switch: support generics?
      */
     boolean allowGenerics;
@@ -240,7 +246,7 @@
         InferenceContext inferenceContext = resultInfo.checkContext.inferenceContext();
         Type owntype = found;
         if (!owntype.hasTag(ERROR) && !resultInfo.pt.hasTag(METHOD) && !resultInfo.pt.hasTag(FORALL)) {
-            if (inferenceContext.free(found)) {
+            if (allowPoly && inferenceContext.free(found)) {
                 inferenceContext.addFreeTypeListener(List.of(found, resultInfo.pt), new FreeTypeListener() {
                     @Override
                     public void typesInferred(InferenceContext inferenceContext) {
@@ -558,6 +564,7 @@
 
     final ResultInfo statInfo;
     final ResultInfo varInfo;
+    final ResultInfo unknownAnyPolyInfo;
     final ResultInfo unknownExprInfo;
     final ResultInfo unknownTypeInfo;
     final ResultInfo unknownTypeExprInfo;
@@ -664,17 +671,21 @@
             attribStat(l.head, env);
     }
 
-    /** Attribute the arguments in a method call, returning a list of types.
+    /** Attribute the arguments in a method call, returning the method kind.
      */
-    List<Type> attribArgs(List<JCExpression> trees, Env<AttrContext> env) {
-        ListBuffer<Type> argtypes = new ListBuffer<Type>();
+    int attribArgs(List<JCExpression> trees, Env<AttrContext> env, ListBuffer<Type> argtypes) {
+        int kind = VAL;
         for (JCExpression arg : trees) {
-            Type argtype = allowPoly && deferredAttr.isDeferred(env, arg) ?
-                    deferredAttr.new DeferredType(arg, env) :
-                    chk.checkNonVoid(arg, attribExpr(arg, env, Infer.anyPoly));
+            Type argtype;
+            if (allowPoly && deferredAttr.isDeferred(env, arg)) {
+                argtype = deferredAttr.new DeferredType(arg, env);
+                kind |= POLY;
+            } else {
+                argtype = chk.checkNonVoid(arg, attribTree(arg, env, unknownAnyPolyInfo));
+            }
             argtypes.append(argtype);
         }
-        return argtypes.toList();
+        return kind;
     }
 
     /** Attribute a type argument list, returning a list of types.
@@ -745,25 +756,15 @@
                                       JCTree.JCExpression initializer,
                                       Type type) {
 
-        // in case no lint value has been set up for this env, scan up
-        // env stack looking for smallest enclosing env for which it is set.
-        Env<AttrContext> lintEnv = env;
-        while (lintEnv.info.lint == null)
-            lintEnv = lintEnv.next;
-
-        // Having found the enclosing lint value, we can initialize the lint value for this class
-        // ... but ...
-        // There's a problem with evaluating annotations in the right order, such that
-        // env.info.enclVar.attributes_field might not yet have been evaluated, and so might be
-        // null. In that case, calling augment will throw an NPE. To avoid this, for now we
-        // revert to the jdk 6 behavior and ignore the (unevaluated) attributes.
-        if (env.info.enclVar.annotationsPendingCompletion()) {
-            env.info.lint = lintEnv.info.lint;
-        } else {
-            env.info.lint = lintEnv.info.lint.augment(env.info.enclVar);
-        }
-
-        Lint prevLint = chk.setLint(env.info.lint);
+        /*  When this env was created, it didn't have the correct lint nor had
+         *  annotations has been processed.
+         *  But now at this phase we have already processed annotations and the
+         *  correct lint must have been set in chk, so we should use that one to
+         *  attribute the initializer.
+         */
+        Lint prevLint = env.info.lint;
+        env.info.lint = chk.getLint();
+
         JavaFileObject prevSource = log.useSource(env.toplevel.sourcefile);
 
         try {
@@ -775,10 +776,11 @@
             memberEnter.typeAnnotate(initializer, env, null);
             annotate.flush();
             Type itype = attribExpr(initializer, env, type);
-            if (itype.constValue() != null)
+            if (itype.constValue() != null) {
                 return coerce(itype, type).constValue();
-            else
+            } else {
                 return null;
+            }
         } finally {
             env.info.lint = prevLint;
             log.useSource(prevSource);
@@ -1739,6 +1741,7 @@
         boolean isConstructorCall =
             methName == names._this || methName == names._super;
 
+        ListBuffer<Type> argtypesBuf = ListBuffer.lb();
         if (isConstructorCall) {
             // We are seeing a ...this(...) or ...super(...) call.
             // Check that this is the first statement in a constructor.
@@ -1749,7 +1752,8 @@
                 localEnv.info.isSelfCall = true;
 
                 // Attribute arguments, yielding list of argument types.
-                argtypes = attribArgs(tree.args, localEnv);
+                attribArgs(tree.args, localEnv, argtypesBuf);
+                argtypes = argtypesBuf.toList();
                 typeargtypes = attribTypes(tree.typeargs, localEnv);
 
                 // Variable `site' points to the class in which the called
@@ -1821,7 +1825,8 @@
         } else {
             // Otherwise, we are seeing a regular method call.
             // Attribute the arguments, yielding list of argument types, ...
-            argtypes = attribArgs(tree.args, localEnv);
+            int kind = attribArgs(tree.args, localEnv, argtypesBuf);
+            argtypes = argtypesBuf.toList();
             typeargtypes = attribAnyTypes(tree.typeargs, localEnv);
 
             // ... and attribute the method using as a prototype a methodtype
@@ -1829,7 +1834,7 @@
             // arguments (this will also set the method symbol).
             Type mpt = newMethodTemplate(resultInfo.pt, argtypes, typeargtypes);
             localEnv.info.pendingResolutionPhase = null;
-            Type mtype = attribTree(tree.meth, localEnv, new ResultInfo(VAL, mpt, resultInfo.checkContext));
+            Type mtype = attribTree(tree.meth, localEnv, new ResultInfo(kind, mpt, resultInfo.checkContext));
 
             // Compute the result type.
             Type restype = mtype.getReturnType();
@@ -1999,7 +2004,9 @@
         }
 
         // Attribute constructor arguments.
-        List<Type> argtypes = attribArgs(tree.args, localEnv);
+        ListBuffer<Type> argtypesBuf = ListBuffer.lb();
+        int pkind = attribArgs(tree.args, localEnv, argtypesBuf);
+        List<Type> argtypes = argtypesBuf.toList();
         List<Type> typeargtypes = attribTypes(tree.typeargs, localEnv);
 
         // If we have made no mistakes in the class type...
@@ -2086,11 +2093,16 @@
                             clazztype,
                             tree.constructor,
                             rsEnv,
-                            new ResultInfo(MTH, newMethodTemplate(syms.voidType, argtypes, typeargtypes)));
+                            new ResultInfo(pkind, newMethodTemplate(syms.voidType, argtypes, typeargtypes)));
                     if (rsEnv.info.lastResolveVarargs())
                         Assert.check(tree.constructorType.isErroneous() || tree.varargsElement != null);
                 }
-                findDiamondIfNeeded(localEnv, tree, clazztype);
+                if (cdef == null &&
+                        !clazztype.isErroneous() &&
+                        clazztype.getTypeArguments().nonEmpty() &&
+                        findDiamonds) {
+                    findDiamond(localEnv, tree, clazztype);
+                }
             }
 
             if (cdef != null) {
@@ -2157,7 +2169,7 @@
                     clazztype,
                     tree.constructor,
                     localEnv,
-                    new ResultInfo(VAL, newMethodTemplate(syms.voidType, argtypes, typeargtypes)));
+                    new ResultInfo(pkind, newMethodTemplate(syms.voidType, argtypes, typeargtypes)));
             } else {
                 if (tree.clazz.hasTag(ANNOTATED_TYPE)) {
                     checkForDeclarationAnnotations(((JCAnnotatedType) tree.clazz).annotations,
@@ -2172,32 +2184,27 @@
         chk.validate(tree.typeargs, localEnv);
     }
     //where
-        void findDiamondIfNeeded(Env<AttrContext> env, JCNewClass tree, Type clazztype) {
-            if (tree.def == null &&
-                    !clazztype.isErroneous() &&
-                    clazztype.getTypeArguments().nonEmpty() &&
-                    findDiamonds) {
-                JCTypeApply ta = (JCTypeApply)tree.clazz;
-                List<JCExpression> prevTypeargs = ta.arguments;
-                try {
-                    //create a 'fake' diamond AST node by removing type-argument trees
-                    ta.arguments = List.nil();
-                    ResultInfo findDiamondResult = new ResultInfo(VAL,
-                            resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt());
-                    Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
-                    Type polyPt = allowPoly ?
-                            syms.objectType :
-                            clazztype;
-                    if (!inferred.isErroneous() &&
-                        types.isAssignable(inferred, pt().hasTag(NONE) ? polyPt : pt(), types.noWarnings)) {
-                        String key = types.isSameType(clazztype, inferred) ?
-                            "diamond.redundant.args" :
-                            "diamond.redundant.args.1";
-                        log.warning(tree.clazz.pos(), key, clazztype, inferred);
-                    }
-                } finally {
-                    ta.arguments = prevTypeargs;
+        void findDiamond(Env<AttrContext> env, JCNewClass tree, Type clazztype) {
+            JCTypeApply ta = (JCTypeApply)tree.clazz;
+            List<JCExpression> prevTypeargs = ta.arguments;
+            try {
+                //create a 'fake' diamond AST node by removing type-argument trees
+                ta.arguments = List.nil();
+                ResultInfo findDiamondResult = new ResultInfo(VAL,
+                        resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt());
+                Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
+                Type polyPt = allowPoly ?
+                        syms.objectType :
+                        clazztype;
+                if (!inferred.isErroneous() &&
+                    types.isAssignable(inferred, pt().hasTag(NONE) ? polyPt : pt(), types.noWarnings)) {
+                    String key = types.isSameType(clazztype, inferred) ?
+                        "diamond.redundant.args" :
+                        "diamond.redundant.args.1";
+                    log.warning(tree.clazz.pos(), key, clazztype, inferred);
                 }
+            } finally {
+                ta.arguments = prevTypeargs;
             }
         }
 
@@ -3003,6 +3010,8 @@
                 !left.isErroneous() &&
                 !right.isErroneous()) {
             owntype = operator.type.getReturnType();
+            // This will figure out when unboxing can happen and
+            // choose the right comparison operator.
             int opc = chk.checkOperator(tree.lhs.pos(),
                                         (OperatorSymbol)operator,
                                         tree.getTag(),
@@ -3030,9 +3039,11 @@
             }
 
             // Check that argument types of a reference ==, != are
-            // castable to each other, (JLS???).
+            // castable to each other, (JLS 15.21).  Note: unboxing
+            // comparisons will not have an acmp* opc at this point.
             if ((opc == ByteCodes.if_acmpeq || opc == ByteCodes.if_acmpne)) {
-                if (!types.isCastable(left, right, new Warner(tree.pos()))) {
+                if (!types.isEqualityComparable(left, right,
+                                                new Warner(tree.pos()))) {
                     log.error(tree.pos(), "incomparable.types", left, right);
                 }
             }
@@ -3051,7 +3062,7 @@
         //should we propagate the target type?
         final ResultInfo castInfo;
         JCExpression expr = TreeInfo.skipParens(tree.expr);
-        boolean isPoly = expr.hasTag(LAMBDA) || expr.hasTag(REFERENCE);
+        boolean isPoly = allowPoly && (expr.hasTag(LAMBDA) || expr.hasTag(REFERENCE));
         if (isPoly) {
             //expression is a poly - we need to propagate target type info
             castInfo = new ResultInfo(VAL, clazztype, new Check.NestedCheckContext(resultInfo.checkContext) {
@@ -3190,7 +3201,7 @@
         if (skind == TYP) {
             Type elt = site;
             while (elt.hasTag(ARRAY))
-                elt = ((ArrayType)elt).elemtype;
+                elt = ((ArrayType)elt.unannotatedType()).elemtype;
             if (elt.hasTag(TYPEVAR)) {
                 log.error(tree.pos(), "type.var.cant.be.deref");
                 result = types.createErrorType(tree.type);
@@ -3440,10 +3451,14 @@
                      Symbol sym,
                      Env<AttrContext> env,
                      ResultInfo resultInfo) {
-            Type pt = resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, sym, env.info.pendingResolutionPhase));
-            Type owntype = checkIdInternal(tree, site, sym, pt, env, resultInfo);
-            resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.CHECK, sym, env.info.pendingResolutionPhase));
-            return owntype;
+            if ((resultInfo.pkind & POLY) != 0) {
+                Type pt = resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, sym, env.info.pendingResolutionPhase));
+                Type owntype = checkIdInternal(tree, site, sym, pt, env, resultInfo);
+                resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.CHECK, sym, env.info.pendingResolutionPhase));
+                return owntype;
+            } else {
+                return checkIdInternal(tree, site, sym, resultInfo.pt, env, resultInfo);
+            }
         }
 
         Type checkIdInternal(JCTree tree,
@@ -3541,7 +3556,7 @@
                 break;
             case MTH: {
                 owntype = checkMethod(site, sym,
-                        new ResultInfo(VAL, resultInfo.pt.getReturnType(), resultInfo.checkContext),
+                        new ResultInfo(resultInfo.pkind, resultInfo.pt.getReturnType(), resultInfo.checkContext),
                         env, TreeInfo.args(env.tree), resultInfo.pt.getParameterTypes(),
                         resultInfo.pt.getTypeArguments());
                 break;
@@ -4289,12 +4304,13 @@
             (c.flags() & ABSTRACT) == 0) {
             checkSerialVersionUID(tree, c);
         }
-
-        // Correctly organize the postions of the type annotations
-        TypeAnnotations.organizeTypeAnnotationsBodies(this.syms, this.names, this.log, tree);
-
-        // Check type annotations applicability rules
-        validateTypeAnnotations(tree);
+        if (allowTypeAnnos) {
+            // Correctly organize the postions of the type annotations
+            TypeAnnotations.organizeTypeAnnotationsBodies(this.syms, this.names, this.log, tree);
+
+            // Check type annotations applicability rules
+            validateTypeAnnotations(tree);
+        }
     }
         // where
         /** get a diagnostic position for an attribute of Type t, or null if attribute missing */
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Fri Jul 05 11:06:24 2013 -0700
@@ -218,6 +218,14 @@
         return prev;
     }
 
+    /*  This idiom should be used only in cases when it is needed to set the lint
+     *  of an environment that has been created in a phase previous to annotations
+     *  processing.
+     */
+    Lint getLint() {
+        return lint;
+    }
+
     DeferredLintHandler setDeferredLintHandler(DeferredLintHandler newDeferredLintHandler) {
         DeferredLintHandler prev = deferredLintHandler;
         deferredLintHandler = newDeferredLintHandler;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Fri Jul 05 11:06:24 2013 -0700
@@ -115,12 +115,17 @@
         SpeculativeCache speculativeCache;
 
         DeferredType(JCExpression tree, Env<AttrContext> env) {
-            super(DEFERRED, null);
+            super(null);
             this.tree = tree;
             this.env = env.dup(tree, env.info.dup());
             this.speculativeCache = new SpeculativeCache();
         }
 
+        @Override
+        public TypeTag getTag() {
+            return DEFERRED;
+        }
+
         /**
          * A speculative cache is used to keep track of all overload resolution rounds
          * that triggered speculative attribution on a given deferred type. Each entry
@@ -959,10 +964,8 @@
             if (sym.kind == Kinds.AMBIGUOUS) {
                 Resolve.AmbiguityError err = (Resolve.AmbiguityError)sym.baseSymbol();
                 result = ArgumentExpressionKind.PRIMITIVE;
-                for (List<Symbol> ambigousSyms = err.ambiguousSyms ;
-                        ambigousSyms.nonEmpty() && !result.isPoly() ;
-                        ambigousSyms = ambigousSyms.tail) {
-                    Symbol s = ambigousSyms.head;
+                for (Symbol s : err.ambiguousSyms) {
+                    if (result.isPoly()) break;
                     if (s.kind == Kinds.MTH) {
                         result = reduce(ArgumentExpressionKind.methodKind(s, types));
                     }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1945,10 +1945,17 @@
                 }
             }
 
+            /*  The analysis of each catch should be independent.
+             *  Each one should have the same initial values of inits and
+             *  uninits.
+             */
+            final Bits initsCatchPrev = new Bits(initsTry);
+            final Bits uninitsCatchPrev = new Bits(uninitsTry);
+
             for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
                 JCVariableDecl param = l.head.param;
-                inits.assign(initsTry);
-                uninits.assign(uninitsTry);
+                inits.assign(initsCatchPrev);
+                uninits.assign(uninitsCatchPrev);
                 scan(param);
                 inits.incl(param.sym.adr);
                 uninits.excl(param.sym.adr);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Fri Jul 05 11:06:24 2013 -0700
@@ -96,7 +96,7 @@
     }
 
     /** A value for prototypes that admit any type, including polymorphic ones. */
-    public static final Type anyPoly = new Type(NONE, null);
+    public static final Type anyPoly = new JCNoType();
 
    /**
     * This exception class is design to store a list of diagnostics corresponding
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Fri Jul 05 11:06:24 2013 -0700
@@ -109,15 +109,20 @@
         source = Source.instance(context);
         target = Target.instance(context);
         deferredLintHandler = DeferredLintHandler.instance(context);
+        allowTypeAnnos = source.allowTypeAnnotations();
     }
 
+    /** Switch: support type annotations.
+     */
+    boolean allowTypeAnnos;
+
     /** A queue for classes whose members still need to be entered into the
      *  symbol table.
      */
     ListBuffer<Env<AttrContext>> halfcompleted = new ListBuffer<Env<AttrContext>>();
 
     /** Set to true only when the first of a set of classes is
-     *  processed from the halfcompleted queue.
+     *  processed from the half completed queue.
      */
     boolean isFirst = true;
 
@@ -1072,7 +1077,9 @@
                 isFirst = true;
             }
         }
-        TypeAnnotations.organizeTypeAnnotationsSignatures(syms, names, log, tree, annotate);
+        if (allowTypeAnnos) {
+            TypeAnnotations.organizeTypeAnnotationsSignatures(syms, names, log, tree, annotate);
+        }
     }
 
     /*
@@ -1117,7 +1124,9 @@
     }
 
     public void typeAnnotate(final JCTree tree, final Env<AttrContext> env, final Symbol sym) {
-        tree.accept(new TypeAnnotate(env, sym));
+        if (allowTypeAnnos) {
+            tree.accept(new TypeAnnotate(env, sym));
+        }
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1573,7 +1573,6 @@
                           allowBoxing,
                           useVarargs,
                           operator);
-        reportVerboseResolutionDiagnostic(env.tree.pos(), name, site, argtypes, typeargtypes, bestSoFar);
         return bestSoFar;
     }
     // where
@@ -2224,7 +2223,7 @@
         return lookupMethod(env, pos, env.enclClass.sym, resolveMethodCheck,
                 new BasicLookupHelper(name, env.enclClass.sym.type, argtypes, typeargtypes) {
                     @Override
-                    Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                    Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                         return findFun(env, name, argtypes, typeargtypes,
                                 phase.isBoxingRequired(),
                                 phase.isVarargsRequired());
@@ -2256,7 +2255,7 @@
                                   List<Type> typeargtypes) {
         return lookupMethod(env, pos, location, resolveContext, new BasicLookupHelper(name, site, argtypes, typeargtypes) {
             @Override
-            Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+            Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                 return findMethod(env, site, name, argtypes, typeargtypes,
                         phase.isBoxingRequired(),
                         phase.isVarargsRequired(), false);
@@ -2355,7 +2354,7 @@
                               List<Type> typeargtypes) {
         return lookupMethod(env, pos, site.tsym, resolveContext, new BasicLookupHelper(names.init, site, argtypes, typeargtypes) {
             @Override
-            Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+            Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                 return findConstructor(pos, env, site, argtypes, typeargtypes,
                         phase.isBoxingRequired(),
                         phase.isVarargsRequired());
@@ -2413,7 +2412,7 @@
         return lookupMethod(env, pos, site.tsym, resolveMethodCheck,
                 new BasicLookupHelper(names.init, site, argtypes, typeargtypes) {
                     @Override
-                    Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                    Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                         return findDiamond(env, site, argtypes, typeargtypes,
                                 phase.isBoxingRequired(),
                                 phase.isVarargsRequired());
@@ -2503,7 +2502,7 @@
             return lookupMethod(env, pos, syms.predefClass, currentResolutionContext,
                     new BasicLookupHelper(name, syms.predefClass.type, argtypes, null, BOX) {
                 @Override
-                Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                     return findMethod(env, site, name, argtypes, typeargtypes,
                             phase.isBoxingRequired(),
                             phase.isVarargsRequired(), true);
@@ -2669,6 +2668,13 @@
         abstract Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase);
 
         /**
+         * Dump overload resolution info
+         */
+        void debug(DiagnosticPosition pos, Symbol sym) {
+            //do nothing
+        }
+
+        /**
          * Validate the result of the lookup
          */
         abstract Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym);
@@ -2685,17 +2691,30 @@
         }
 
         @Override
-        Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
+        final Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+            Symbol sym = doLookup(env, phase);
             if (sym.kind == AMBIGUOUS) {
                 AmbiguityError a_err = (AmbiguityError)sym;
                 sym = a_err.mergeAbstracts(site);
             }
+            return sym;
+        }
+
+        abstract Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase);
+
+        @Override
+        Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
             if (sym.kind >= AMBIGUOUS) {
                 //if nothing is found return the 'first' error
                 sym = accessMethod(sym, pos, location, site, name, true, argtypes, typeargtypes);
             }
             return sym;
         }
+
+        @Override
+        void debug(DiagnosticPosition pos, Symbol sym) {
+            reportVerboseResolutionDiagnostic(pos, name, site, argtypes, typeargtypes, sym);
+        }
     }
 
     /**
@@ -2843,7 +2862,7 @@
         protected Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
             Scope sc = new Scope(syms.arrayClass);
             MethodSymbol arrayConstr = new MethodSymbol(PUBLIC, name, null, site.tsym);
-            arrayConstr.type = new MethodType(List.of(syms.intType), site, List.<Type>nil(), syms.methodClass);
+            arrayConstr.type = new MethodType(List.<Type>of(syms.intType), site, List.<Type>nil(), syms.methodClass);
             sc.enter(arrayConstr);
             return findMethodInScope(env, site, name, argtypes, typeargtypes, sc, methodNotFound, phase.isBoxingRequired(), phase.isVarargsRequired(), false, false);
         }
@@ -2924,7 +2943,9 @@
                 MethodResolutionPhase prevPhase = currentResolutionContext.step;
                 Symbol prevBest = bestSoFar;
                 currentResolutionContext.step = phase;
-                bestSoFar = phase.mergeResults(bestSoFar, lookupHelper.lookup(env, phase));
+                Symbol sym = lookupHelper.lookup(env, phase);
+                lookupHelper.debug(pos, sym);
+                bestSoFar = phase.mergeResults(bestSoFar, sym);
                 env.info.pendingResolutionPhase = (prevBest == bestSoFar) ? prevPhase : phase;
             }
             return lookupHelper.access(env, pos, location, bestSoFar);
@@ -3630,35 +3651,39 @@
          * is more specific than the others, attempt to merge their signatures.
          */
         Symbol mergeAbstracts(Type site) {
-            Symbol fst = ambiguousSyms.last();
-            Symbol res = fst;
-            for (Symbol s : ambiguousSyms.reverse()) {
-                Type mt1 = types.memberType(site, res);
-                Type mt2 = types.memberType(site, s);
-                if ((s.flags() & ABSTRACT) == 0 ||
-                        !types.overrideEquivalent(mt1, mt2) ||
-                        !types.isSameTypes(fst.erasure(types).getParameterTypes(),
-                                       s.erasure(types).getParameterTypes())) {
-                    //ambiguity cannot be resolved
-                    return this;
-                } else {
-                    Type mst = mostSpecificReturnType(mt1, mt2);
-                    if (mst == null) {
-                        // Theoretically, this can't happen, but it is possible
-                        // due to error recovery or mixing incompatible class files
+            List<Symbol> ambiguousInOrder = ambiguousSyms.reverse();
+            for (Symbol s : ambiguousInOrder) {
+                Type mt = types.memberType(site, s);
+                boolean found = true;
+                List<Type> allThrown = mt.getThrownTypes();
+                for (Symbol s2 : ambiguousInOrder) {
+                    Type mt2 = types.memberType(site, s2);
+                    if ((s2.flags() & ABSTRACT) == 0 ||
+                        !types.overrideEquivalent(mt, mt2) ||
+                        !types.isSameTypes(s.erasure(types).getParameterTypes(),
+                                       s2.erasure(types).getParameterTypes())) {
+                        //ambiguity cannot be resolved
                         return this;
                     }
-                    Symbol mostSpecific = mst == mt1 ? res : s;
-                    List<Type> allThrown = chk.intersect(mt1.getThrownTypes(), mt2.getThrownTypes());
-                    Type newSig = types.createMethodTypeWithThrown(mostSpecific.type, allThrown);
-                    res = new MethodSymbol(
-                            mostSpecific.flags(),
-                            mostSpecific.name,
-                            newSig,
-                            mostSpecific.owner);
+                    Type mst = mostSpecificReturnType(mt, mt2);
+                    if (mst == null || mst != mt) {
+                        found = false;
+                        break;
+                    }
+                    allThrown = chk.intersect(allThrown, mt2.getThrownTypes());
+                }
+                if (found) {
+                    //all ambiguous methods were abstract and one method had
+                    //most specific return type then others
+                    return (allThrown == mt.getThrownTypes()) ?
+                            s : new MethodSymbol(
+                                s.flags(),
+                                s.name,
+                                types.createMethodTypeWithThrown(mt, allThrown),
+                                s.owner);
                 }
             }
-            return res;
+            return this;
         }
 
         @Override
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java	Fri Jul 05 11:06:24 2013 -0700
@@ -919,11 +919,15 @@
         if (o instanceof Long) return syms.longType;
         if (o instanceof Double) return syms.doubleType;
         if (o instanceof ClassSymbol) return syms.classType;
-        if (o instanceof Type.ArrayType) return syms.classType;
-        if (o instanceof Type.MethodType) return syms.methodTypeType;
+        if (o instanceof Pool.MethodHandle) return syms.methodHandleType;
         if (o instanceof UniqueType) return typeForPool(((UniqueType)o).type);
-        if (o instanceof Pool.MethodHandle) return syms.methodHandleType;
-        throw new AssertionError(o);
+        if (o instanceof Type) {
+            Type ty = ((Type)o).unannotatedType();
+
+            if (ty instanceof Type.ArrayType) return syms.classType;
+            if (ty instanceof Type.MethodType) return syms.methodTypeType;
+        }
+        throw new AssertionError("Invalid type of constant pool entry: " + o.getClass());
     }
 
     /** Emit an opcode with a one-byte operand field;
@@ -1855,7 +1859,7 @@
         }
     }
 
-    static final Type jsrReturnValue = new Type(INT, null);
+    static final Type jsrReturnValue = new JCPrimitiveType(INT, null);
 
 
 /* **************************************************************************
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Fri Jul 05 11:06:24 2013 -0700
@@ -991,9 +991,19 @@
          */
         void genMethod(JCMethodDecl tree, Env<GenContext> env, boolean fatcode) {
             MethodSymbol meth = tree.sym;
-//      System.err.println("Generating " + meth + " in " + meth.owner); //DEBUG
-            if (Code.width(types.erasure(env.enclMethod.sym.type).getParameterTypes())  +
-                (((tree.mods.flags & STATIC) == 0 || meth.isConstructor()) ? 1 : 0) >
+            int extras = 0;
+            // Count up extra parameters
+            if (meth.isConstructor()) {
+                extras++;
+                if (meth.enclClass().isInner() &&
+                    !meth.enclClass().isStatic()) {
+                    extras++;
+                }
+            } else if ((tree.mods.flags & STATIC) == 0) {
+                extras++;
+            }
+            //      System.err.println("Generating " + meth + " in " + meth.owner); //DEBUG
+            if (Code.width(types.erasure(env.enclMethod.sym.type).getParameterTypes()) + extras >
                 ClassFile.MAX_PARAMETERS) {
                 log.error(tree.pos(), "limit.parameters");
                 nerrs++;
@@ -1773,7 +1783,16 @@
             r.load();
             code.emitop0(ireturn + Code.truncate(Code.typecode(pt)));
         } else {
+            /*  If we have a statement like:
+             *
+             *  return;
+             *
+             *  we need to store the code.pendingStatPos value before generating
+             *  the finalizer.
+             */
+            int tmpPos = code.pendingStatPos;
             targetEnv = unwind(env.enclMethod, env);
+            code.pendingStatPos = tmpPos;
             code.emitop0(return_);
         }
         endFinalizerGaps(env, targetEnv);
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Fri Jul 05 11:06:24 2013 -0700
@@ -377,10 +377,10 @@
     }
 
     public Result compile(String[] args,
-                       String[] classNames,
-                       Context context,
-                       List<JavaFileObject> fileObjects,
-                       Iterable<? extends Processor> processors)
+                          String[] classNames,
+                          Context context,
+                          List<JavaFileObject> fileObjects,
+                          Iterable<? extends Processor> processors)
     {
         context.put(Log.outKey, out);
         log = Log.instance(context);
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Fri Jul 05 11:06:24 2013 -0700
@@ -139,7 +139,7 @@
         Type unboxed = types.unboxedType((Type) t);
         if (! unboxed.isPrimitive())    // only true primitives, not void
             throw new IllegalArgumentException(t.toString());
-        return unboxed;
+        return (PrimitiveType)unboxed;
     }
 
     public TypeMirror capture(TypeMirror t) {
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Fri Jul 05 11:06:24 2013 -0700
@@ -2914,7 +2914,9 @@
             pos = token.pos;
             accept(LBRACE);
             ListBuffer<JCExpression> buf = new ListBuffer<JCExpression>();
-            if (token.kind != RBRACE) {
+            if (token.kind == COMMA) {
+                nextToken();
+            } else if (token.kind != RBRACE) {
                 buf.append(annotationValue());
                 while (token.kind == COMMA) {
                     nextToken();
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Fri Jul 05 11:06:24 2013 -0700
@@ -36,10 +36,7 @@
 
 import javax.annotation.processing.*;
 import javax.lang.model.SourceVersion;
-import javax.lang.model.element.AnnotationMirror;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.PackageElement;
-import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.*;
 import javax.lang.model.util.*;
 import javax.tools.DiagnosticListener;
 import javax.tools.JavaFileManager;
@@ -762,12 +759,30 @@
         }
 
         @Override
-        public Set<TypeElement> scan(Element e, Set<TypeElement> p) {
+        public Set<TypeElement> visitType(TypeElement e, Set<TypeElement> p) {
+            // Type parameters are not considered to be enclosed by a type
+            scan(e.getTypeParameters(), p);
+            return scan(e.getEnclosedElements(), p);
+        }
+
+        @Override
+        public Set<TypeElement> visitExecutable(ExecutableElement e, Set<TypeElement> p) {
+            // Type parameters are not considered to be enclosed by an executable
+            scan(e.getTypeParameters(), p);
+            return scan(e.getEnclosedElements(), p);
+        }
+
+        void addAnnotations(Element e, Set<TypeElement> p) {
             for (AnnotationMirror annotationMirror :
                      elements.getAllAnnotationMirrors(e) ) {
                 Element e2 = annotationMirror.getAnnotationType().asElement();
                 p.add((TypeElement) e2);
             }
+        }
+
+        @Override
+        public Set<TypeElement> scan(Element e, Set<TypeElement> p) {
+            addAnnotations(e, p);
             return super.scan(e, p);
         }
     }
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java	Fri Jul 05 11:06:24 2013 -0700
@@ -147,6 +147,20 @@
         }
 
         @Override
+        public Set<Element> visitType(TypeElement e, DeclaredType p) {
+            // Type parameters are not considered to be enclosed by a type
+            scan(e.getTypeParameters(), p);
+            return scan(e.getEnclosedElements(), p);
+        }
+
+        @Override
+        public Set<Element> visitExecutable(ExecutableElement e, DeclaredType p) {
+            // Type parameters are not considered to be enclosed by an executable
+            scan(e.getTypeParameters(), p);
+            return scan(e.getEnclosedElements(), p);
+        }
+
+        @Override
         public Set<Element> scan(Element e, DeclaredType p) {
             java.util.List<? extends AnnotationMirror> annotationMirrors =
                 processingEnv.getElementUtils().getAllAnnotationMirrors(e);
@@ -157,7 +171,6 @@
             e.accept(this, p);
             return annotatedElements;
         }
-
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -220,12 +220,6 @@
             }
         },
 
-        new HiddenOption(false, "-old") {
-            void process(JavahTask task, String opt, String arg) {
-                task.old = true;
-            }
-        },
-
         new HiddenOption(false, "-llni", "-Xllni") {
             void process(JavahTask task, String opt, String arg) {
                 task.llni = true;
@@ -663,7 +657,6 @@
     boolean llni;
     boolean doubleAlign;
     boolean force;
-    boolean old;
     Set<String> javac_extras = new LinkedHashSet<String>();
 
     PrintWriter log;
--- a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Fri Jul 05 11:06:24 2013 -0700
@@ -114,6 +114,9 @@
     }
 
     public Void visitDefault(DefaultAttribute attr, Void ignore) {
+        if (attr.reason != null) {
+            report(attr.reason);
+        }
         byte[] data = attr.info;
         int i = 0;
         int j = 0;
@@ -365,8 +368,7 @@
         indent(+1);
         println("Start  Length  Slot  Name   Signature");
         for (LocalVariableTable_attribute.Entry entry : attr.local_variable_table) {
-            Formatter formatter = new Formatter();
-            println(formatter.format("%8d %7d %5d %5s   %s",
+            println(String.format("%5d %7d %5d %5s   %s",
                     entry.start_pc, entry.length, entry.index,
                     constantWriter.stringValue(entry.name_index),
                     constantWriter.stringValue(entry.descriptor_index)));
@@ -511,7 +513,12 @@
     }
 
     public Void visitSourceDebugExtension(SourceDebugExtension_attribute attr, Void ignore) {
-        println("SourceDebugExtension: " + attr.getValue());
+        println("SourceDebugExtension:");
+        indent(+1);
+        for (String s: attr.getValue().split("[\r\n]+")) {
+            println(s);
+        }
+        indent(-1);
         return null;
     }
 
@@ -609,7 +616,8 @@
         public Void visit_append_frame(StackMapTable_attribute.append_frame frame, Void p) {
             printHeader(frame);
             println(" /* append */");
-            println("     offset_delta = " + frame.offset_delta);
+            indent(+1);
+            println("offset_delta = " + frame.offset_delta);
             printMap("locals", frame.locals);
             return null;
         }
--- a/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java	Fri Jul 05 11:06:24 2013 -0700
@@ -136,7 +136,8 @@
         // for each compile.....
         int kbPerFile = 175;
         String osarch = System.getProperty("os.arch");
-        if (osarch.equals("i386")) {
+        String dataModel = System.getProperty("sun.arch.data.model");
+        if ("32".equals(dataModel)) {
             // For 32 bit platforms, assume it is slightly smaller
             // because of smaller object headers and pointers.
             kbPerFile = 119;
--- a/langtools/src/share/classes/javax/annotation/processing/AbstractProcessor.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/javax/annotation/processing/AbstractProcessor.java	Fri Jul 05 11:06:24 2013 -0700
@@ -38,7 +38,7 @@
  * superclass for most concrete annotation processors.  This class
  * examines annotation values to compute the {@linkplain
  * #getSupportedOptions options}, {@linkplain
- * #getSupportedAnnotationTypes annotations}, and {@linkplain
+ * #getSupportedAnnotationTypes annotation types}, and {@linkplain
  * #getSupportedSourceVersion source version} supported by its
  * subtypes.
  *
--- a/langtools/src/share/classes/javax/annotation/processing/Processor.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/javax/annotation/processing/Processor.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
 package javax.annotation.processing;
 
 import java.util.Set;
+import javax.lang.model.util.Elements;
+import javax.lang.model.AnnotatedConstruct;
 import javax.lang.model.element.*;
 import javax.lang.model.SourceVersion;
 
@@ -88,23 +90,52 @@
  * configuration mechanisms, such as command line options; for
  * details, refer to the particular tool's documentation.  Which
  * processors the tool asks to {@linkplain #process run} is a function
- * of what annotations are present on the {@linkplain
+ * of the types of the annotations <em>{@linkplain AnnotatedConstruct present}</em>
+ * on the {@linkplain
  * RoundEnvironment#getRootElements root elements}, what {@linkplain
  * #getSupportedAnnotationTypes annotation types a processor
- * processes}, and whether or not a processor {@linkplain #process
- * claims the annotations it processes}.  A processor will be asked to
+ * supports}, and whether or not a processor {@linkplain #process
+ * claims the annotation types it processes}.  A processor will be asked to
  * process a subset of the annotation types it supports, possibly an
  * empty set.
  *
- * For a given round, the tool computes the set of annotation types on
- * the root elements.  If there is at least one annotation type
- * present, as processors claim annotation types, they are removed
- * from the set of unmatched annotations.  When the set is empty or no
- * more processors are available, the round has run to completion.  If
+ * For a given round, the tool computes the set of annotation types
+ * that are present on the elements enclosed within the root elements.
+ * If there is at least one annotation type present, then as
+ * processors claim annotation types, they are removed from the set of
+ * unmatched annotation types.  When the set is empty or no more
+ * processors are available, the round has run to completion.  If
  * there are no annotation types present, annotation processing still
  * occurs but only <i>universal processors</i> which support
- * processing {@code "*"} can claim the (empty) set of annotation
- * types.
+ * processing all annotation types, {@code "*"}, can claim the (empty)
+ * set of annotation types.
+ *
+ * <p>An annotation type is considered present if there is at least
+ * one annotation of that type present on an element enclosed within
+ * the root elements of a round. For this purpose, a type parameter is
+ * considered to be enclosed by its {@linkplain
+ * TypeParameterElement#getGenericElement generic
+ * element}. Annotations on {@linkplain
+ * java.lang.annotation.ElementType#TYPE_USE type uses}, as opposed to
+ * annotations on elements, are ignored when computing whether or not
+ * an annotation type is present.
+ *
+ * <p>An annotation is present if it meets the definition of being
+ * present given in {@link AnnotatedConstruct}. In brief, an
+ * annotation is considered present for the purposes of discovery if
+ * it is directly present or present via inheritance. An annotation is
+ * <em>not</em> considered present by virtue of being wrapped by a
+ * container annotation. Operationally, this is equivalent to an
+ * annotation being present on an element if and only if it would be
+ * included in the results of {@link
+ * Elements#getAllAnnotationMirrors(Element)} called on that element. Since
+ * annotations inside container annotations are not considered
+ * present, to properly process {@linkplain
+ * java.lang.annotation.Repeatable repeatable annotation types},
+ * processors are advised to include both the repeatable annotation
+ * type and its containing annotation type in the set of {@linkplain
+ * #getSupportedAnnotationTypes() supported annotation types} of a
+ * processor.
  *
  * <p>Note that if a processor supports {@code "*"} and returns {@code
  * true}, all annotations are claimed.  Therefore, a universal
@@ -257,10 +288,10 @@
     /**
      * Processes a set of annotation types on type elements
      * originating from the prior round and returns whether or not
-     * these annotations are claimed by this processor.  If {@code
-     * true} is returned, the annotations are claimed and subsequent
+     * these annotation types are claimed by this processor.  If {@code
+     * true} is returned, the annotation types are claimed and subsequent
      * processors will not be asked to process them; if {@code false}
-     * is returned, the annotations are unclaimed and subsequent
+     * is returned, the annotation types are unclaimed and subsequent
      * processors may be asked to process them.  A processor may
      * always return the same boolean value or may vary the result
      * based on chosen criteria.
@@ -271,7 +302,7 @@
      *
      * @param annotations the annotation types requested to be processed
      * @param roundEnv  environment for information about the current and prior round
-     * @return whether or not the set of annotations are claimed by this processor
+     * @return whether or not the set of annotation types are claimed by this processor
      */
     boolean process(Set<? extends TypeElement> annotations,
                     RoundEnvironment roundEnv);
--- a/langtools/src/share/classes/javax/lang/model/SourceVersion.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/src/share/classes/javax/lang/model/SourceVersion.java	Fri Jul 05 11:06:24 2013 -0700
@@ -53,6 +53,8 @@
      * 1.4: assert
      * 1.5: annotations, generics, autoboxing, var-args...
      * 1.6: no changes
+     * 1.7: diamond syntax, try-with-resources, etc.
+     * 1.8: lambda expressions and default methods
      */
 
     /**
@@ -122,6 +124,9 @@
      * The version recognized by the Java Platform, Standard Edition
      * 7.
      *
+     * Additions in this release include, diamond syntax for
+     * constructors, {@code try}-with-resources, strings in switch,
+     * binary literals, and multi-catch.
      * @since 1.7
      */
     RELEASE_7,
@@ -130,6 +135,7 @@
      * The version recognized by the Java Platform, Standard Edition
      * 8.
      *
+     * Additions in this release include lambda expressions and default methods.
      * @since 1.8
      */
     RELEASE_8;
--- a/langtools/test/com/sun/javadoc/testJavaFX/C.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/com/sun/javadoc/testJavaFX/C.java	Fri Jul 05 11:06:24 2013 -0700
@@ -57,6 +57,7 @@
      * Defines the direction/speed at which the {@code Timeline} is expected to
      * be played.
      * @defaultValue 11
+     * @since JavaFX 8.0
      */
     private DoubleProperty rate;
 
--- a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java	Fri Jul 05 11:06:24 2013 -0700
@@ -55,6 +55,8 @@
             {"./" + BUG_ID + "/C.html",
                 "<span class=\"strong\">Default value:</span>"},
             {"./" + BUG_ID + "/C.html",
+                "<span class=\"strong\">Since:</span></dt>" + NL + "<dd>JavaFX 8.0</dd>" },
+            {"./" + BUG_ID + "/C.html",
                 "<p>Sets the value of the property <code>Property</code>"},
             {"./" + BUG_ID + "/C.html",
                 "<p>Gets the value of the property <code>Property</code>"},
@@ -78,7 +80,7 @@
 
 
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "-javafx",
+        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-javafx",
         SRC_DIR + FS + "C.java", SRC_DIR + FS + "D.java"
     };
 
--- a/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,10 +21,8 @@
  * questions.
  */
 
-/**
- * This should be green, underlined and bold (Class): {@underline {@bold {@green My test}}} .
+/*
  * @test
- * @bug 0000000
  * @summary Test for nested inline tags. *
  * @author jamieh
  * @library ../lib/
@@ -36,6 +34,9 @@
  * @run main TestNestedInlineTag
  */
 
+/**
+ * This should be green, underlined and bold (Class): {@underline {@bold {@green My test}}} .
+ */
 public class TestNestedInlineTag extends JavadocTester {
 
     /**
--- a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4780441 4874845 4978816
+ * @bug      4780441 4874845 4978816 8014017
  * @summary  Make sure that when the -private flag is not used, members
  *           inherited from package private class are documented in the child.
  *
@@ -33,17 +33,19 @@
  *
  *           Make sure that when a private interface method with generic parameters
  *           is implemented, the comments can be inherited properly.
+ *
+ *           Make sure when no modifier appear in the class signature, the
+ *           signature is displayed correctly without extra space at the beginning.
  * @author   jamieh
  * @library  ../lib/
- * @build    JavadocTester
- * @build    TestPrivateClasses
+ * @build    JavadocTester TestPrivateClasses
  * @run main TestPrivateClasses
  */
 
 public class TestPrivateClasses extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4780441-4874845-4978816";
+    private static final String BUG_ID = "4780441-4874845-4978816-8014017";
 
     //Javadoc arguments.
     private static final String[] ARGS1 = new String[] {
@@ -234,8 +236,19 @@
             "&nbsp;in interface&nbsp;<code>" +
             "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" +
             "&lt;java.lang.String&gt;</code></dd>"},
+
+      //Make sure when no modifier appear in the class signature, the
+      //signature is displayed correctly without extra space at the beginning.
+      {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
+            "<pre>class <span class=\"strong\">PrivateParent</span>"},
+
+      {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
+            "<pre>public class <span class=\"strong\">PublicChild</span>"},
     };
-    private static final String[][] NEGATED_TEST2 = NO_TEST;
+    private static final String[][] NEGATED_TEST2 = {
+        {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
+            "<pre> class <span class=\"strong\">PrivateParent</span>"},
+    };
 
     /**
      * The entry point of the test.
--- a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4494033 7028815 7052425
+ * @bug      4494033 7028815 7052425 8007338
  * @summary  Run tests on doclet stylesheet.
  * @author   jamieh
  * @library  ../lib/
@@ -34,7 +34,7 @@
 public class TestStylesheet extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4494033-7028815-7052425";
+    private static final String BUG_ID = "4494033-7028815-7052425-8007338";
 
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
@@ -44,29 +44,45 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "stylesheet.css",
-                "/* Javadoc style sheet */"},
+            "/* Javadoc style sheet */"},
+        {BUG_ID + FS + "stylesheet.css",
+            "/*" + NL + "Overall document style" + NL + "*/"},
+        {BUG_ID + FS + "stylesheet.css",
+            "/*" + NL + "Heading styles" + NL + "*/"},
         {BUG_ID + FS + "stylesheet.css",
-                "/*" + NL + "Overall document style" + NL + "*/"},
+            "/*" + NL + "Navigation bar styles" + NL + "*/"},
         {BUG_ID + FS + "stylesheet.css",
-                "/*" + NL + "Heading styles" + NL + "*/"},
+            "body {" + NL + "    background-color:#ffffff;" + NL +
+            "    color:#353833;" + NL +
+            "    font-family:Arial, Helvetica, sans-serif;" + NL +
+            "    font-size:76%;" + NL + "    margin:0;" + NL + "}"},
+        {BUG_ID + FS + "stylesheet.css",
+            "ul {" + NL + "    list-style-type:disc;" + NL + "}"},
         {BUG_ID + FS + "stylesheet.css",
-                "/*" + NL + "Navigation bar styles" + NL + "*/"},
-        {BUG_ID + FS + "stylesheet.css",
-                "body {" + NL + "    background-color:#ffffff;" + NL +
-                "    color:#353833;" + NL +
-                "    font-family:Arial, Helvetica, sans-serif;" + NL +
-                "    font-size:76%;" + NL + "    margin:0;" + NL + "}"},
-        {BUG_ID + FS + "stylesheet.css",
-                "ul {" + NL + "    list-style-type:disc;" + NL + "}"},
+            ".overviewSummary caption, .packageSummary caption, " +
+            ".contentContainer ul.blockList li.blockList caption, " +
+            ".summary caption, .classUseContainer caption, " +
+            ".constantValuesContainer caption {" + NL +
+            "    position:relative;" + NL +
+            "    text-align:left;" + NL +
+            "    background-repeat:no-repeat;" + NL +
+            "    color:#FFFFFF;" + NL +
+            "    font-weight:bold;" + NL +
+            "    clear:none;" + NL +
+            "    overflow:hidden;" + NL +
+            "    padding:0px;" + NL +
+            "    margin:0px;" + NL +
+            "    white-space:pre;" + NL +
+            "}"},
         // Test whether a link to the stylesheet file is inserted properly
         // in the class documentation.
         {BUG_ID + FS + "pkg" + FS + "A.html",
-                "<link rel=\"stylesheet\" type=\"text/css\" " +
-                "href=\"../stylesheet.css\" title=\"Style\">"}
+            "<link rel=\"stylesheet\" type=\"text/css\" " +
+            "href=\"../stylesheet.css\" title=\"Style\">"}
     };
     private static final String[][] NEGATED_TEST = {
         {BUG_ID + FS + "stylesheet.css",
-                "* {" + NL + "    margin:0;" + NL + "    padding:0;" + NL + "}"}
+            "* {" + NL + "    margin:0;" + NL + "    padding:0;" + NL + "}"}
     };
 
     /**
--- a/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java	Fri Jul 05 11:06:24 2013 -0700
@@ -21,9 +21,8 @@
  * questions.
  */
 
-/**
+/*
  * @test
- * @bug 0000000
  * @summary Determine if proper warning messages are printed when know.
  * @author jamieh
  * @library ../lib/
--- a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java	Fri Jul 05 11:06:24 2013 -0700
@@ -78,7 +78,7 @@
             "typeannos\">@ClassParamA</a> java.lang.String&gt;</span>"
         },
         {BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html",
-            "<pre> class <span class=\"strong\">ExtendsGeneric&lt;K extends " +
+            "<pre>class <span class=\"strong\">ExtendsGeneric&lt;K extends " +
             "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
             "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " +
             "title=\"class in typeannos\">Unannotated</a>&lt;<a href=\"" +
@@ -86,7 +86,7 @@
             "@ClassParamB</a> java.lang.String&gt;&gt;</span>"
         },
         {BUG_ID + FS + "typeannos" + FS + "TwoBounds.html",
-            "<pre> class <span class=\"strong\">TwoBounds&lt;K extends <a href=\"" +
+            "<pre>class <span class=\"strong\">TwoBounds&lt;K extends <a href=\"" +
             "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
             "@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/" +
             "ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB" +
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6356530
+ * @summary -Xlint:serial does not flag abstract classes with concrete methods/members
+ * @compile/fail/ref=FinalVariableAssignedToInCatchBlockTest.out -XDrawDiagnostics FinalVariableAssignedToInCatchBlockTest.java
+ */
+
+import java.io.IOException;
+
+public class FinalVariableAssignedToInCatchBlockTest {
+    public void m1(int o)
+    {
+        final int i;
+        try {
+            if (o == 1) {
+                throw new IOException();
+            } else if (o == 2) {
+                throw new InterruptedException();
+            } else {
+                throw new Exception();
+            }
+        } catch (IOException e) {
+            i = 1;
+        } catch (InterruptedException ie) {
+            i = 2;
+        } catch (Exception e) {
+            i = 3;
+        } finally {
+            i = 4;
+        }
+    }
+
+    public void m2(int o)
+    {
+        final int i;
+        try {
+            if (o == 1) {
+                throw new IOException();
+            } else if (o == 2) {
+                throw new InterruptedException();
+            } else {
+                throw new Exception();
+            }
+        } catch (IOException e) {
+            i = 1;
+        } catch (InterruptedException ie) {
+            i = 2;
+        } catch (Exception e) {
+            i = 3;
+        }
+    }
+
+    public void m3(int o) throws Exception
+    {
+        final int i;
+        try {
+            if (o == 1) {
+                throw new IOException();
+            } else if (o == 2) {
+                throw new InterruptedException();
+            } else {
+                throw new Exception();
+            }
+        } catch (IOException e) {
+            i = 1;
+        } catch (InterruptedException ie) {
+            i = 2;
+        }
+        i = 3;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.out	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,3 @@
+FinalVariableAssignedToInCatchBlockTest.java:52:13: compiler.err.var.might.already.be.assigned: i
+FinalVariableAssignedToInCatchBlockTest.java:92:9: compiler.err.var.might.already.be.assigned: i
+2 errors
--- a/langtools/test/tools/javac/T6725036.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/T6725036.java	Fri Jul 05 11:06:24 2013 -0700
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 6725036
+ * @ignore 8016760: failure of regression test langtools/tools/javac/T6725036.java
  * @summary javac returns incorrect value for lastModifiedTime() when
  *          source is a zip file archive
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7008643
+ * @summary inlined finally clauses confuse debuggers
+ * @library /tools/javac/lib
+ * @build ToolBox
+ * @run main InlinedFinallyConfuseDebuggersTest
+ */
+
+import java.io.File;
+import java.nio.file.Paths;
+
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.LineNumberTable_attribute;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.javac.util.Assert;
+
+public class InlinedFinallyConfuseDebuggersTest {
+
+    static final String testSource =
+    /* 01 */        "public class InlinedFinallyTest {\n" +
+    /* 02 */        "    void lookForThisMethod(int value) {\n" +
+    /* 03 */        "        try {\n" +
+    /* 04 */        "            if (value > 0) {\n" +
+    /* 05 */        "                System.out.println(\"if\");\n" +
+    /* 06 */        "                return;\n" +
+    /* 07 */        "            }\n" +
+    /* 08 */        "        } finally {\n" +
+    /* 09 */        "            System.out.println(\"finally\");\n" +
+    /* 10 */        "        }\n" +
+    /* 11 */        "    }\n" +
+    /* 12 */        "}";
+
+    static final int[][] expectedLNT = {
+    //  {line-number, start-pc},
+        {4,           0},       //if (value > 0) {
+        {5,           4},       //    System.out.println("if");
+        {9,           12},      //System.out.println("finally");
+        {6,           20},      //    return;
+        {9,           21},      //System.out.println("finally");
+        {10,          29},
+        {9,           32},      //System.out.println("finally");
+        {11,          43},
+    };
+
+    static final String methodToLookFor = "lookForThisMethod";
+
+    public static void main(String[] args) throws Exception {
+        new InlinedFinallyConfuseDebuggersTest().run();
+    }
+
+    void run() throws Exception {
+        compileTestClass();
+        checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
+                "InlinedFinallyTest.class").toUri()), methodToLookFor);
+    }
+
+    void compileTestClass() throws Exception {
+        ToolBox.JavaToolArgs javacSuccessArgs =
+                new ToolBox.JavaToolArgs().setSources(testSource);
+        ToolBox.javac(javacSuccessArgs);
+    }
+
+    void checkClassFile(final File cfile, String methodToFind) throws Exception {
+        ClassFile classFile = ClassFile.read(cfile);
+        boolean methodFound = false;
+        for (Method method : classFile.methods) {
+            if (method.getName(classFile.constant_pool).equals(methodToFind)) {
+                methodFound = true;
+                Code_attribute code = (Code_attribute) method.attributes.get("Code");
+                LineNumberTable_attribute lnt =
+                        (LineNumberTable_attribute) code.attributes.get("LineNumberTable");
+                Assert.check(lnt.line_number_table_length == expectedLNT.length,
+                        "The LineNumberTable found has a length different to the expected one");
+                int i = 0;
+                for (LineNumberTable_attribute.Entry entry: lnt.line_number_table) {
+                    Assert.check(entry.line_number == expectedLNT[i][0] &&
+                            entry.start_pc == expectedLNT[i][1],
+                            "LNT entry at pos " + i + " differ from expected." +
+                            "Found " + entry.line_number + ":" + entry.start_pc +
+                            ". Expected " + expectedLNT[i][0] + ":" + expectedLNT[i][1]);
+                    i++;
+                }
+            }
+        }
+        Assert.check(methodFound, "The seek method was not found");
+    }
+
+    void error(String msg) {
+        throw new AssertionError(msg);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8016099/UncheckedWarningRegressionTest.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,32 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     8016099
+ * @summary Some SuppressWarnings annotations ignored ( unchecked, rawtypes )
+ * @compile UncheckedWarningRegressionTest.java
+ * @compile/fail/ref=UncheckedWarningRegressionTest.out -XDrawDiagnostics -Werror -Xlint:unchecked UncheckedWarningRegressionTest.java
+ */
+
+public class UncheckedWarningRegressionTest {
+    <T> void suppressedWarningsFinalInitializer() {
+        @SuppressWarnings("unchecked")
+        T[] tt = (T[]) FINAL_EMPTY_ARRAY;
+    }
+
+    final Object[] FINAL_EMPTY_ARRAY = {};
+
+    <T> void finalInitializer() {
+        T[] tt = (T[]) FINAL_EMPTY_ARRAY;
+    }
+
+    <T> void suppressedWarningsNonFinalInitializer() {
+        @SuppressWarnings("unchecked")
+        T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY;
+    }
+
+    Object[] NON_FINAL_EMPTY_ARRAY = {};
+
+    <T> void nonFinalInitializer() {
+        T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8016099/UncheckedWarningRegressionTest.out	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,5 @@
+UncheckedWarningRegressionTest.java:18:24: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.lang.Object[], T[]
+UncheckedWarningRegressionTest.java:29:24: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.lang.Object[], T[]
+- compiler.err.warnings.and.werror
+1 error
+2 warnings
--- a/langtools/test/tools/javac/api/6437999/T6437999.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/api/6437999/T6437999.java	Fri Jul 05 11:06:24 2013 -0700
@@ -33,11 +33,28 @@
  */
 
 import java.io.File;
+import java.io.IOException;
 import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.List;
 import javax.tools.*;
+import static java.nio.file.StandardOpenOption.*;
 
 public class T6437999 extends ToolTester {
+    final File testFile = new File("Utf8.java");
+    T6437999() throws IOException {
+        createTestFile();
+    }
+    final void createTestFile() throws IOException {
+        List<String> scratch = new ArrayList<>();
+        scratch.add("// @author Peter von der Ah" + (char) 0xe9);
+        scratch.add("class Utf8{}");
+        Files.write(testFile.toPath(), scratch, Charset.forName("UTF-8"),
+                CREATE, TRUNCATE_EXISTING);
+    }
+
     static class MyDiagnosticListener implements DiagnosticListener<JavaFileObject> {
         boolean error = false;
         public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
@@ -55,7 +72,7 @@
         dl.error = false;
         fm = getFileManager(tool, dl, Charset.forName("ASCII"));
         fm.handleOption("-source", sourceLevel.iterator());
-        files = fm.getJavaFileObjects(new File(test_src, "Utf8.java"));
+        files = fm.getJavaFileObjects(testFile);
         tool.getTask(null, fm, null, null, null, files).call();
         if (!dl.error)
             throw new AssertionError("No error in ASCII mode");
@@ -63,12 +80,12 @@
         dl.error = false;
         fm = getFileManager(tool, dl, Charset.forName("UTF-8"));
         fm.handleOption("-source", sourceLevel.iterator());
-        files = fm.getJavaFileObjects(new File(test_src, "Utf8.java"));
+        files = fm.getJavaFileObjects(testFile);
         task = tool.getTask(null, fm, null, null, null, files);
         if (dl.error)
             throw new AssertionError("Error in UTF-8 mode");
     }
-    public static void main(String... args) {
+    public static void main(String... args) throws IOException {
         new T6437999().test(args);
     }
 }
--- a/langtools/test/tools/javac/api/6437999/Utf8.java	Thu Jul 04 01:01:07 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * @author Peter von der Ah\u00e9
- */
-class Utf8 {}
--- a/langtools/test/tools/javac/api/T6306137.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/api/T6306137.java	Fri Jul 05 11:06:24 2013 -0700
@@ -31,8 +31,14 @@
  */
 
 import java.io.File;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 import javax.tools.*;
+import static java.nio.file.StandardOpenOption.*;
 
 public class T6306137 {
     boolean error;
@@ -40,8 +46,9 @@
     final JavaCompiler compiler;
     Iterable<? extends JavaFileObject> files;
     DiagnosticListener<JavaFileObject> dl;
+    final File testFile = new File("Utf8.java");
 
-    T6306137() {
+    T6306137() throws IOException {
         dl = new DiagnosticListener<JavaFileObject>() {
                 public void report(Diagnostic<? extends JavaFileObject> message) {
                     if (message.getKind() == Diagnostic.Kind.ERROR)
@@ -56,11 +63,17 @@
         };
         compiler = ToolProvider.getSystemJavaCompiler();
         fm = compiler.getStandardFileManager(dl, null, null);
-        String srcdir = System.getProperty("test.src");
         files =
-            fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(srcdir, "T6306137.java")));
+            fm.getJavaFileObjectsFromFiles(Arrays.asList(testFile));
+        createTestFile();
     }
-
+    final void createTestFile() throws IOException {
+        List<String> scratch = new ArrayList<>();
+        scratch.add("// @author Peter von der Ah" + (char)0xe9);
+        scratch.add("class Utf8{}");
+        Files.write(testFile.toPath(), scratch, Charset.forName("UTF-8"),
+                CREATE, TRUNCATE_EXISTING);
+    }
     void test(String encoding, boolean good) {
         error = false;
         Iterable<String> args = Arrays.asList("-source", "6", "-encoding", encoding, "-d", ".");
@@ -74,7 +87,7 @@
         }
     }
 
-    public static void main(String[] args) {
+    public static void main(String[] args) throws IOException {
         T6306137 self = new T6306137();
         self.test("utf-8", true);
         self.test("ascii", false);
--- a/langtools/test/tools/javac/lambda/LambdaConv01.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/lambda/LambdaConv01.java	Fri Jul 05 11:06:24 2013 -0700
@@ -67,7 +67,7 @@
         assertTrue(3 == f1.foo());
         //Covariant returns:
         TU<Number, Integer> f2 = (Integer x) -> x;
-        assertTrue(3 == f2.foo(3));
+        assertTrue(3 == f2.foo(3).intValue());
         //Method resolution with boxing:
         int res = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == res);
@@ -86,7 +86,7 @@
         assertTrue(3 == f1.foo());
         //Covariant returns:
         TU<Number, Integer> f2 = (Integer x) -> x;
-        assertTrue(3 == f2.foo(3));
+        assertTrue(3 == f2.foo(3).intValue());
         //Method resolution with boxing:
         int res = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == res);
@@ -105,7 +105,7 @@
         assertTrue(3 == f1.foo());
         //Covariant returns:
         TU<Number, Integer> f2 = (Integer x) -> x;
-        assertTrue(3 == f2.foo(3));
+        assertTrue(3 == f2.foo(3).intValue());
         //Method resolution with boxing:
         int res = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == res);
@@ -124,7 +124,7 @@
         assertTrue(3 == f1.foo());
         //Covariant returns:
         TU<Number, Integer> f2 = (Integer x) -> x;
-        assertTrue(3 == f2.foo(3));
+        assertTrue(3 == f2.foo(3).intValue());
         //Method resolution with boxing:
         int res = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == res);
--- a/langtools/test/tools/javac/lambda/LambdaExpr15.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/lambda/LambdaExpr15.java	Fri Jul 05 11:06:24 2013 -0700
@@ -48,7 +48,7 @@
             new Object() {
                 String get() { return ""; }
             };
-            assertTrue(t == 1);
+            assertTrue((Integer)t == 1);
         };
         ba1.apply(1);
 
@@ -58,7 +58,7 @@
                 String get() { return ""; }
             };
             new A();
-            assertTrue(t == 2);
+            assertTrue((Integer)t == 2);
         };
         ba2.apply(2);
         assertTrue(assertionCount == 2);
--- a/langtools/test/tools/javac/lambda/typeInference/InferenceTest2b.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/lambda/typeInference/InferenceTest2b.java	Fri Jul 05 11:06:24 2013 -0700
@@ -64,7 +64,7 @@
 
     void m2(SAM6<? super Integer> s) {
         System.out.println("m2()");
-        assertTrue(s.m6(1, 2) == 1);
+        assertTrue(s.m6(1, 2).equals(Integer.valueOf(1)));
     }
 
     void m3(SAM6<? super Calendar> s) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/limits/NestedClassConstructorArgs.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014230
+ * @summary Compiler silently generates bytecode that exceeds VM limits
+ * @compile NumArgsTest.java
+ * @run main NestedClassConstructorArgs
+ */
+
+public class NestedClassConstructorArgs extends NumArgsTest {
+    private static final NumArgsTest.NestingDef[] nesting = {
+        classNesting("Inner")
+    };
+
+    private NestedClassConstructorArgs() {
+        super(253, "NestedClassConstructorArgs", "Inner", nesting);
+    }
+
+    public static void main(String... args) throws Exception {
+        new NestedClassConstructorArgs().runTest();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/limits/NestedClassMethodArgs.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014230
+ * @summary Compiler silently generates bytecode that exceeds VM limits
+ * @compile NumArgsTest.java
+ * @run main NestedClassMethodArgs
+ */
+
+public class NestedClassMethodArgs extends NumArgsTest {
+    private static final NumArgsTest.NestingDef[] nesting = {
+        classNesting("Inner")
+    };
+
+    private NestedClassMethodArgs() {
+        super(254, "void", "test", "NestedClassMethodArgs", nesting);
+    }
+
+    public static void main(String... args) throws Exception {
+        new NestedClassMethodArgs().runTest();
+    }
+}
+
--- a/langtools/test/tools/javac/limits/NumArgs1.java	Thu Jul 04 01:01:07 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,552 +0,0 @@
-/*
- * Copyright (c) 2002, 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 4309152
- * @summary Compiler silently generates bytecode that exceeds VM limits
- * @author gafter
- *
- * @compile/fail NumArgs1.java
- */
-
-class NumArgs1 {
-    void f(
-           // T1 this,
-           int x2,
-           int x3,
-           int x4,
-           int x5,
-           int x6,
-           int x7,
-           int x8,
-           int x9,
-           int x10,
-           int x11,
-           int x12,
-           int x13,
-           int x14,
-           int x15,
-           int x16,
-           int x17,
-           int x18,
-           int x19,
-           int x20,
-           int x21,
-           int x22,
-           int x23,
-           int x24,
-           int x25,
-           int x26,
-           int x27,
-           int x28,
-           int x29,
-           int x30,
-           int x31,
-           int x32,
-           int x33,
-           int x34,
-           int x35,
-           int x36,
-           int x37,
-           int x38,
-           int x39,
-           int x40,
-           int x41,
-           int x42,
-           int x43,
-           int x44,
-           int x45,
-           int x46,
-           int x47,
-           int x48,
-           int x49,
-           int x50,
-           int x51,
-           int x52,
-           int x53,
-           int x54,
-           int x55,
-           int x56,
-           int x57,
-           int x58,
-           int x59,
-           int x60,
-           int x61,
-           int x62,
-           int x63,
-           int x64,
-           int x65,
-           int x66,
-           int x67,
-           int x68,
-           int x69,
-           int x70,
-           int x71,
-           int x72,
-           int x73,
-           int x74,
-           int x75,
-           int x76,
-           int x77,
-           int x78,
-           int x79,
-           int x80,
-           int x81,
-           int x82,
-           int x83,
-           int x84,
-           int x85,
-           int x86,
-           int x87,
-           int x88,
-           int x89,
-           int x90,
-           int x91,
-           int x92,
-           int x93,
-           int x94,
-           int x95,
-           int x96,
-           int x97,
-           int x98,
-           int x99,
-           int x100,
-           int x101,
-           int x102,
-           int x103,
-           int x104,
-           int x105,
-           int x106,
-           int x107,
-           int x108,
-           int x109,
-           int x110,
-           int x111,
-           int x112,
-           int x113,
-           int x114,
-           int x115,
-           int x116,
-           int x117,
-           int x118,
-           int x119,
-           int x120,
-           int x121,
-           int x122,
-           int x123,
-           int x124,
-           int x125,
-           int x126,
-           int x127,
-           int x128,
-           int x129,
-           int x130,
-           int x131,
-           int x132,
-           int x133,
-           int x134,
-           int x135,
-           int x136,
-           int x137,
-           int x138,
-           int x139,
-           int x140,
-           int x141,
-           int x142,
-           int x143,
-           int x144,
-           int x145,
-           int x146,
-           int x147,
-           int x148,
-           int x149,
-           int x150,
-           int x151,
-           int x152,
-           int x153,
-           int x154,
-           int x155,
-           int x156,
-           int x157,
-           int x158,
-           int x159,
-           int x160,
-           int x161,
-           int x162,
-           int x163,
-           int x164,
-           int x165,
-           int x166,
-           int x167,
-           int x168,
-           int x169,
-           int x170,
-           int x171,
-           int x172,
-           int x173,
-           int x174,
-           int x175,
-           int x176,
-           int x177,
-           int x178,
-           int x179,
-           int x180,
-           int x181,
-           int x182,
-           int x183,
-           int x184,
-           int x185,
-           int x186,
-           int x187,
-           int x188,
-           int x189,
-           int x190,
-           int x191,
-           int x192,
-           int x193,
-           int x194,
-           int x195,
-           int x196,
-           int x197,
-           int x198,
-           int x199,
-           int x200,
-           int x201,
-           int x202,
-           int x203,
-           int x204,
-           int x205,
-           int x206,
-           int x207,
-           int x208,
-           int x209,
-           int x210,
-           int x211,
-           int x212,
-           int x213,
-           int x214,
-           int x215,
-           int x216,
-           int x217,
-           int x218,
-           int x219,
-           int x220,
-           int x221,
-           int x222,
-           int x223,
-           int x224,
-           int x225,
-           int x226,
-           int x227,
-           int x228,
-           int x229,
-           int x230,
-           int x231,
-           int x232,
-           int x233,
-           int x234,
-           int x235,
-           int x236,
-           int x237,
-           int x238,
-           int x239,
-           int x240,
-           int x241,
-           int x242,
-           int x243,
-           int x244,
-           int x245,
-           int x246,
-           int x247,
-           int x248,
-           int x249,
-           int x250,
-           int x251,
-           int x252,
-           int x253,
-           int x254,
-           int x255,
-           int x256
-    ) {}
-
-    static
-    void g(
-           int x1,
-           int x2,
-           int x3,
-           int x4,
-           int x5,
-           int x6,
-           int x7,
-           int x8,
-           int x9,
-           int x10,
-           int x11,
-           int x12,
-           int x13,
-           int x14,
-           int x15,
-           int x16,
-           int x17,
-           int x18,
-           int x19,
-           int x20,
-           int x21,
-           int x22,
-           int x23,
-           int x24,
-           int x25,
-           int x26,
-           int x27,
-           int x28,
-           int x29,
-           int x30,
-           int x31,
-           int x32,
-           int x33,
-           int x34,
-           int x35,
-           int x36,
-           int x37,
-           int x38,
-           int x39,
-           int x40,
-           int x41,
-           int x42,
-           int x43,
-           int x44,
-           int x45,
-           int x46,
-           int x47,
-           int x48,
-           int x49,
-           int x50,
-           int x51,
-           int x52,
-           int x53,
-           int x54,
-           int x55,
-           int x56,
-           int x57,
-           int x58,
-           int x59,
-           int x60,
-           int x61,
-           int x62,
-           int x63,
-           int x64,
-           int x65,
-           int x66,
-           int x67,
-           int x68,
-           int x69,
-           int x70,
-           int x71,
-           int x72,
-           int x73,
-           int x74,
-           int x75,
-           int x76,
-           int x77,
-           int x78,
-           int x79,
-           int x80,
-           int x81,
-           int x82,
-           int x83,
-           int x84,
-           int x85,
-           int x86,
-           int x87,
-           int x88,
-           int x89,
-           int x90,
-           int x91,
-           int x92,
-           int x93,
-           int x94,
-           int x95,
-           int x96,
-           int x97,
-           int x98,
-           int x99,
-           int x100,
-           int x101,
-           int x102,
-           int x103,
-           int x104,
-           int x105,
-           int x106,
-           int x107,
-           int x108,
-           int x109,
-           int x110,
-           int x111,
-           int x112,
-           int x113,
-           int x114,
-           int x115,
-           int x116,
-           int x117,
-           int x118,
-           int x119,
-           int x120,
-           int x121,
-           int x122,
-           int x123,
-           int x124,
-           int x125,
-           int x126,
-           int x127,
-           int x128,
-           int x129,
-           int x130,
-           int x131,
-           int x132,
-           int x133,
-           int x134,
-           int x135,
-           int x136,
-           int x137,
-           int x138,
-           int x139,
-           int x140,
-           int x141,
-           int x142,
-           int x143,
-           int x144,
-           int x145,
-           int x146,
-           int x147,
-           int x148,
-           int x149,
-           int x150,
-           int x151,
-           int x152,
-           int x153,
-           int x154,
-           int x155,
-           int x156,
-           int x157,
-           int x158,
-           int x159,
-           int x160,
-           int x161,
-           int x162,
-           int x163,
-           int x164,
-           int x165,
-           int x166,
-           int x167,
-           int x168,
-           int x169,
-           int x170,
-           int x171,
-           int x172,
-           int x173,
-           int x174,
-           int x175,
-           int x176,
-           int x177,
-           int x178,
-           int x179,
-           int x180,
-           int x181,
-           int x182,
-           int x183,
-           int x184,
-           int x185,
-           int x186,
-           int x187,
-           int x188,
-           int x189,
-           int x190,
-           int x191,
-           int x192,
-           int x193,
-           int x194,
-           int x195,
-           int x196,
-           int x197,
-           int x198,
-           int x199,
-           int x200,
-           int x201,
-           int x202,
-           int x203,
-           int x204,
-           int x205,
-           int x206,
-           int x207,
-           int x208,
-           int x209,
-           int x210,
-           int x211,
-           int x212,
-           int x213,
-           int x214,
-           int x215,
-           int x216,
-           int x217,
-           int x218,
-           int x219,
-           int x220,
-           int x221,
-           int x222,
-           int x223,
-           int x224,
-           int x225,
-           int x226,
-           int x227,
-           int x228,
-           int x229,
-           int x230,
-           int x231,
-           int x232,
-           int x233,
-           int x234,
-           int x235,
-           int x236,
-           int x237,
-           int x238,
-           int x239,
-           int x240,
-           int x241,
-           int x242,
-           int x243,
-           int x244,
-           int x245,
-           int x246,
-           int x247,
-           int x248,
-           int x249,
-           int x250,
-           int x251,
-           int x252,
-           int x253,
-           int x254,
-           int x255,
-           int x256
-    ) {}
-}
--- a/langtools/test/tools/javac/limits/NumArgs2.java	Thu Jul 04 01:01:07 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,550 +0,0 @@
-/*
- * Copyright (c) 2002, 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 4309152
- * @summary Compiler silently generates bytecode that exceeds VM limits
- * @author gafter
- *
- * @compile NumArgs2.java
- */
-
-class NumArgs2 {
-    void f(
-           // This this,
-           int x2,
-           int x3,
-           int x4,
-           int x5,
-           int x6,
-           int x7,
-           int x8,
-           int x9,
-           int x10,
-           int x11,
-           int x12,
-           int x13,
-           int x14,
-           int x15,
-           int x16,
-           int x17,
-           int x18,
-           int x19,
-           int x20,
-           int x21,
-           int x22,
-           int x23,
-           int x24,
-           int x25,
-           int x26,
-           int x27,
-           int x28,
-           int x29,
-           int x30,
-           int x31,
-           int x32,
-           int x33,
-           int x34,
-           int x35,
-           int x36,
-           int x37,
-           int x38,
-           int x39,
-           int x40,
-           int x41,
-           int x42,
-           int x43,
-           int x44,
-           int x45,
-           int x46,
-           int x47,
-           int x48,
-           int x49,
-           int x50,
-           int x51,
-           int x52,
-           int x53,
-           int x54,
-           int x55,
-           int x56,
-           int x57,
-           int x58,
-           int x59,
-           int x60,
-           int x61,
-           int x62,
-           int x63,
-           int x64,
-           int x65,
-           int x66,
-           int x67,
-           int x68,
-           int x69,
-           int x70,
-           int x71,
-           int x72,
-           int x73,
-           int x74,
-           int x75,
-           int x76,
-           int x77,
-           int x78,
-           int x79,
-           int x80,
-           int x81,
-           int x82,
-           int x83,
-           int x84,
-           int x85,
-           int x86,
-           int x87,
-           int x88,
-           int x89,
-           int x90,
-           int x91,
-           int x92,
-           int x93,
-           int x94,
-           int x95,
-           int x96,
-           int x97,
-           int x98,
-           int x99,
-           int x100,
-           int x101,
-           int x102,
-           int x103,
-           int x104,
-           int x105,
-           int x106,
-           int x107,
-           int x108,
-           int x109,
-           int x110,
-           int x111,
-           int x112,
-           int x113,
-           int x114,
-           int x115,
-           int x116,
-           int x117,
-           int x118,
-           int x119,
-           int x120,
-           int x121,
-           int x122,
-           int x123,
-           int x124,
-           int x125,
-           int x126,
-           int x127,
-           int x128,
-           int x129,
-           int x130,
-           int x131,
-           int x132,
-           int x133,
-           int x134,
-           int x135,
-           int x136,
-           int x137,
-           int x138,
-           int x139,
-           int x140,
-           int x141,
-           int x142,
-           int x143,
-           int x144,
-           int x145,
-           int x146,
-           int x147,
-           int x148,
-           int x149,
-           int x150,
-           int x151,
-           int x152,
-           int x153,
-           int x154,
-           int x155,
-           int x156,
-           int x157,
-           int x158,
-           int x159,
-           int x160,
-           int x161,
-           int x162,
-           int x163,
-           int x164,
-           int x165,
-           int x166,
-           int x167,
-           int x168,
-           int x169,
-           int x170,
-           int x171,
-           int x172,
-           int x173,
-           int x174,
-           int x175,
-           int x176,
-           int x177,
-           int x178,
-           int x179,
-           int x180,
-           int x181,
-           int x182,
-           int x183,
-           int x184,
-           int x185,
-           int x186,
-           int x187,
-           int x188,
-           int x189,
-           int x190,
-           int x191,
-           int x192,
-           int x193,
-           int x194,
-           int x195,
-           int x196,
-           int x197,
-           int x198,
-           int x199,
-           int x200,
-           int x201,
-           int x202,
-           int x203,
-           int x204,
-           int x205,
-           int x206,
-           int x207,
-           int x208,
-           int x209,
-           int x210,
-           int x211,
-           int x212,
-           int x213,
-           int x214,
-           int x215,
-           int x216,
-           int x217,
-           int x218,
-           int x219,
-           int x220,
-           int x221,
-           int x222,
-           int x223,
-           int x224,
-           int x225,
-           int x226,
-           int x227,
-           int x228,
-           int x229,
-           int x230,
-           int x231,
-           int x232,
-           int x233,
-           int x234,
-           int x235,
-           int x236,
-           int x237,
-           int x238,
-           int x239,
-           int x240,
-           int x241,
-           int x242,
-           int x243,
-           int x244,
-           int x245,
-           int x246,
-           int x247,
-           int x248,
-           int x249,
-           int x250,
-           int x251,
-           int x252,
-           int x253,
-           int x254,
-           int x255
-    ) {}
-
-    static
-    void g(
-           int x1,
-           int x2,
-           int x3,
-           int x4,
-           int x5,
-           int x6,
-           int x7,
-           int x8,
-           int x9,
-           int x10,
-           int x11,
-           int x12,
-           int x13,
-           int x14,
-           int x15,
-           int x16,
-           int x17,
-           int x18,
-           int x19,
-           int x20,
-           int x21,
-           int x22,
-           int x23,
-           int x24,
-           int x25,
-           int x26,
-           int x27,
-           int x28,
-           int x29,
-           int x30,
-           int x31,
-           int x32,
-           int x33,
-           int x34,
-           int x35,
-           int x36,
-           int x37,
-           int x38,
-           int x39,
-           int x40,
-           int x41,
-           int x42,
-           int x43,
-           int x44,
-           int x45,
-           int x46,
-           int x47,
-           int x48,
-           int x49,
-           int x50,
-           int x51,
-           int x52,
-           int x53,
-           int x54,
-           int x55,
-           int x56,
-           int x57,
-           int x58,
-           int x59,
-           int x60,
-           int x61,
-           int x62,
-           int x63,
-           int x64,
-           int x65,
-           int x66,
-           int x67,
-           int x68,
-           int x69,
-           int x70,
-           int x71,
-           int x72,
-           int x73,
-           int x74,
-           int x75,
-           int x76,
-           int x77,
-           int x78,
-           int x79,
-           int x80,
-           int x81,
-           int x82,
-           int x83,
-           int x84,
-           int x85,
-           int x86,
-           int x87,
-           int x88,
-           int x89,
-           int x90,
-           int x91,
-           int x92,
-           int x93,
-           int x94,
-           int x95,
-           int x96,
-           int x97,
-           int x98,
-           int x99,
-           int x100,
-           int x101,
-           int x102,
-           int x103,
-           int x104,
-           int x105,
-           int x106,
-           int x107,
-           int x108,
-           int x109,
-           int x110,
-           int x111,
-           int x112,
-           int x113,
-           int x114,
-           int x115,
-           int x116,
-           int x117,
-           int x118,
-           int x119,
-           int x120,
-           int x121,
-           int x122,
-           int x123,
-           int x124,
-           int x125,
-           int x126,
-           int x127,
-           int x128,
-           int x129,
-           int x130,
-           int x131,
-           int x132,
-           int x133,
-           int x134,
-           int x135,
-           int x136,
-           int x137,
-           int x138,
-           int x139,
-           int x140,
-           int x141,
-           int x142,
-           int x143,
-           int x144,
-           int x145,
-           int x146,
-           int x147,
-           int x148,
-           int x149,
-           int x150,
-           int x151,
-           int x152,
-           int x153,
-           int x154,
-           int x155,
-           int x156,
-           int x157,
-           int x158,
-           int x159,
-           int x160,
-           int x161,
-           int x162,
-           int x163,
-           int x164,
-           int x165,
-           int x166,
-           int x167,
-           int x168,
-           int x169,
-           int x170,
-           int x171,
-           int x172,
-           int x173,
-           int x174,
-           int x175,
-           int x176,
-           int x177,
-           int x178,
-           int x179,
-           int x180,
-           int x181,
-           int x182,
-           int x183,
-           int x184,
-           int x185,
-           int x186,
-           int x187,
-           int x188,
-           int x189,
-           int x190,
-           int x191,
-           int x192,
-           int x193,
-           int x194,
-           int x195,
-           int x196,
-           int x197,
-           int x198,
-           int x199,
-           int x200,
-           int x201,
-           int x202,
-           int x203,
-           int x204,
-           int x205,
-           int x206,
-           int x207,
-           int x208,
-           int x209,
-           int x210,
-           int x211,
-           int x212,
-           int x213,
-           int x214,
-           int x215,
-           int x216,
-           int x217,
-           int x218,
-           int x219,
-           int x220,
-           int x221,
-           int x222,
-           int x223,
-           int x224,
-           int x225,
-           int x226,
-           int x227,
-           int x228,
-           int x229,
-           int x230,
-           int x231,
-           int x232,
-           int x233,
-           int x234,
-           int x235,
-           int x236,
-           int x237,
-           int x238,
-           int x239,
-           int x240,
-           int x241,
-           int x242,
-           int x243,
-           int x244,
-           int x245,
-           int x246,
-           int x247,
-           int x248,
-           int x249,
-           int x250,
-           int x251,
-           int x252,
-           int x253,
-           int x254,
-           int x255
-    ) {}
-}
--- a/langtools/test/tools/javac/limits/NumArgs3.java	Thu Jul 04 01:01:07 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,292 +0,0 @@
-/*
- * Copyright (c) 2002, 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 4309152
- * @summary Compiler silently generates bytecode that exceeds VM limits
- * @author gafter
- *
- * @compile/fail NumArgs3.java
- */
-
-class NumArgs3 {
-    void NumArgs3(
-           // T1 this,
-           int x2,
-           int x3,
-           int x4,
-           int x5,
-           int x6,
-           int x7,
-           int x8,
-           int x9,
-           int x10,
-           int x11,
-           int x12,
-           int x13,
-           int x14,
-           int x15,
-           int x16,
-           int x17,
-           int x18,
-           int x19,
-           int x20,
-           int x21,
-           int x22,
-           int x23,
-           int x24,
-           int x25,
-           int x26,
-           int x27,
-           int x28,
-           int x29,
-           int x30,
-           int x31,
-           int x32,
-           int x33,
-           int x34,
-           int x35,
-           int x36,
-           int x37,
-           int x38,
-           int x39,
-           int x40,
-           int x41,
-           int x42,
-           int x43,
-           int x44,
-           int x45,
-           int x46,
-           int x47,
-           int x48,
-           int x49,
-           int x50,
-           int x51,
-           int x52,
-           int x53,
-           int x54,
-           int x55,
-           int x56,
-           int x57,
-           int x58,
-           int x59,
-           int x60,
-           int x61,
-           int x62,
-           int x63,
-           int x64,
-           int x65,
-           int x66,
-           int x67,
-           int x68,
-           int x69,
-           int x70,
-           int x71,
-           int x72,
-           int x73,
-           int x74,
-           int x75,
-           int x76,
-           int x77,
-           int x78,
-           int x79,
-           int x80,
-           int x81,
-           int x82,
-           int x83,
-           int x84,
-           int x85,
-           int x86,
-           int x87,
-           int x88,
-           int x89,
-           int x90,
-           int x91,
-           int x92,
-           int x93,
-           int x94,
-           int x95,
-           int x96,
-           int x97,
-           int x98,
-           int x99,
-           int x100,
-           int x101,
-           int x102,
-           int x103,
-           int x104,
-           int x105,
-           int x106,
-           int x107,
-           int x108,
-           int x109,
-           int x110,
-           int x111,
-           int x112,
-           int x113,
-           int x114,
-           int x115,
-           int x116,
-           int x117,
-           int x118,
-           int x119,
-           int x120,
-           int x121,
-           int x122,
-           int x123,
-           int x124,
-           int x125,
-           int x126,
-           int x127,
-           int x128,
-           int x129,
-           int x130,
-           int x131,
-           int x132,
-           int x133,
-           int x134,
-           int x135,
-           int x136,
-           int x137,
-           int x138,
-           int x139,
-           int x140,
-           int x141,
-           int x142,
-           int x143,
-           int x144,
-           int x145,
-           int x146,
-           int x147,
-           int x148,
-           int x149,
-           int x150,
-           int x151,
-           int x152,
-           int x153,
-           int x154,
-           int x155,
-           int x156,
-           int x157,
-           int x158,
-           int x159,
-           int x160,
-           int x161,
-           int x162,
-           int x163,
-           int x164,
-           int x165,
-           int x166,
-           int x167,
-           int x168,
-           int x169,
-           int x170,
-           int x171,
-           int x172,
-           int x173,
-           int x174,
-           int x175,
-           int x176,
-           int x177,
-           int x178,
-           int x179,
-           int x180,
-           int x181,
-           int x182,
-           int x183,
-           int x184,
-           int x185,
-           int x186,
-           int x187,
-           int x188,
-           int x189,
-           int x190,
-           int x191,
-           int x192,
-           int x193,
-           int x194,
-           int x195,
-           int x196,
-           int x197,
-           int x198,
-           int x199,
-           int x200,
-           int x201,
-           int x202,
-           int x203,
-           int x204,
-           int x205,
-           int x206,
-           int x207,
-           int x208,
-           int x209,
-           int x210,
-           int x211,
-           int x212,
-           int x213,
-           int x214,
-           int x215,
-           int x216,
-           int x217,
-           int x218,
-           int x219,
-           int x220,
-           int x221,
-           int x222,
-           int x223,
-           int x224,
-           int x225,
-           int x226,
-           int x227,
-           int x228,
-           int x229,
-           int x230,
-           int x231,
-           int x232,
-           int x233,
-           int x234,
-           int x235,
-           int x236,
-           int x237,
-           int x238,
-           int x239,
-           int x240,
-           int x241,
-           int x242,
-           int x243,
-           int x244,
-           int x245,
-           int x246,
-           int x247,
-           int x248,
-           int x249,
-           int x250,
-           int x251,
-           int x252,
-           int x253,
-           int x254,
-           int x255,
-           int x256
-    ) {}
-}
--- a/langtools/test/tools/javac/limits/NumArgs4.java	Thu Jul 04 01:01:07 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,291 +0,0 @@
-/*
- * Copyright (c) 2002, 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 4309152
- * @summary Compiler silently generates bytecode that exceeds VM limits
- * @author gafter
- *
- * @compile NumArgs4.java
- */
-
-class NumArgs4 {
-    void NumArgs4(
-           // T1 this,
-           int x2,
-           int x3,
-           int x4,
-           int x5,
-           int x6,
-           int x7,
-           int x8,
-           int x9,
-           int x10,
-           int x11,
-           int x12,
-           int x13,
-           int x14,
-           int x15,
-           int x16,
-           int x17,
-           int x18,
-           int x19,
-           int x20,
-           int x21,
-           int x22,
-           int x23,
-           int x24,
-           int x25,
-           int x26,
-           int x27,
-           int x28,
-           int x29,
-           int x30,
-           int x31,
-           int x32,
-           int x33,
-           int x34,
-           int x35,
-           int x36,
-           int x37,
-           int x38,
-           int x39,
-           int x40,
-           int x41,
-           int x42,
-           int x43,
-           int x44,
-           int x45,
-           int x46,
-           int x47,
-           int x48,
-           int x49,
-           int x50,
-           int x51,
-           int x52,
-           int x53,
-           int x54,
-           int x55,
-           int x56,
-           int x57,
-           int x58,
-           int x59,
-           int x60,
-           int x61,
-           int x62,
-           int x63,
-           int x64,
-           int x65,
-           int x66,
-           int x67,
-           int x68,
-           int x69,
-           int x70,
-           int x71,
-           int x72,
-           int x73,
-           int x74,
-           int x75,
-           int x76,
-           int x77,
-           int x78,
-           int x79,
-           int x80,
-           int x81,
-           int x82,
-           int x83,
-           int x84,
-           int x85,
-           int x86,
-           int x87,
-           int x88,
-           int x89,
-           int x90,
-           int x91,
-           int x92,
-           int x93,
-           int x94,
-           int x95,
-           int x96,
-           int x97,
-           int x98,
-           int x99,
-           int x100,
-           int x101,
-           int x102,
-           int x103,
-           int x104,
-           int x105,
-           int x106,
-           int x107,
-           int x108,
-           int x109,
-           int x110,
-           int x111,
-           int x112,
-           int x113,
-           int x114,
-           int x115,
-           int x116,
-           int x117,
-           int x118,
-           int x119,
-           int x120,
-           int x121,
-           int x122,
-           int x123,
-           int x124,
-           int x125,
-           int x126,
-           int x127,
-           int x128,
-           int x129,
-           int x130,
-           int x131,
-           int x132,
-           int x133,
-           int x134,
-           int x135,
-           int x136,
-           int x137,
-           int x138,
-           int x139,
-           int x140,
-           int x141,
-           int x142,
-           int x143,
-           int x144,
-           int x145,
-           int x146,
-           int x147,
-           int x148,
-           int x149,
-           int x150,
-           int x151,
-           int x152,
-           int x153,
-           int x154,
-           int x155,
-           int x156,
-           int x157,
-           int x158,
-           int x159,
-           int x160,
-           int x161,
-           int x162,
-           int x163,
-           int x164,
-           int x165,
-           int x166,
-           int x167,
-           int x168,
-           int x169,
-           int x170,
-           int x171,
-           int x172,
-           int x173,
-           int x174,
-           int x175,
-           int x176,
-           int x177,
-           int x178,
-           int x179,
-           int x180,
-           int x181,
-           int x182,
-           int x183,
-           int x184,
-           int x185,
-           int x186,
-           int x187,
-           int x188,
-           int x189,
-           int x190,
-           int x191,
-           int x192,
-           int x193,
-           int x194,
-           int x195,
-           int x196,
-           int x197,
-           int x198,
-           int x199,
-           int x200,
-           int x201,
-           int x202,
-           int x203,
-           int x204,
-           int x205,
-           int x206,
-           int x207,
-           int x208,
-           int x209,
-           int x210,
-           int x211,
-           int x212,
-           int x213,
-           int x214,
-           int x215,
-           int x216,
-           int x217,
-           int x218,
-           int x219,
-           int x220,
-           int x221,
-           int x222,
-           int x223,
-           int x224,
-           int x225,
-           int x226,
-           int x227,
-           int x228,
-           int x229,
-           int x230,
-           int x231,
-           int x232,
-           int x233,
-           int x234,
-           int x235,
-           int x236,
-           int x237,
-           int x238,
-           int x239,
-           int x240,
-           int x241,
-           int x242,
-           int x243,
-           int x244,
-           int x245,
-           int x246,
-           int x247,
-           int x248,
-           int x249,
-           int x250,
-           int x251,
-           int x252,
-           int x253,
-           int x254,
-           int x255
-    ) {}
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/limits/NumArgsTest.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.api.*;
+import com.sun.tools.javac.file.*;
+import java.io.*;
+import java.util.*;
+import javax.tools.*;
+
+// More general parameter limit testing framework, and designed so
+// that it could be expanded into a general limits-testing framework
+// in the future.
+public class NumArgsTest {
+
+    private static final NumArgsTest.NestingDef[] NO_NESTING = {};
+
+    // threshold is named as such because "threshold" args is expected
+    // to pass, and "threshold" + 1 args is expected to fail.
+    private final int threshold;
+    private final boolean isStaticMethod;
+    private final String result;
+    private final String testName;
+    private final String methodName;
+    private final NestingDef[] nesting;
+    private final File testdir;
+    private final JavacTool tool = JavacTool.create();
+    private final JavacFileManager fm =
+        tool.getStandardFileManager(null, null, null);
+    private int errors = 0;
+
+    public NumArgsTest(final int threshold,
+                       final boolean isStaticMethod,
+                       final String result,
+                       final String methodName,
+                       final String testName,
+                       final NestingDef[] nesting) {
+        this.threshold = threshold;
+        this.isStaticMethod = isStaticMethod;
+        this.result = result;
+        this.methodName = methodName;
+        this.testName = testName;
+        this.nesting = nesting;
+        testdir = new File(testName);
+        testdir.mkdir();
+    }
+
+    public NumArgsTest(final int threshold,
+                       final boolean isStaticMethod,
+                       final String result,
+                       final String methodName,
+                       final String testName) {
+        this(threshold, isStaticMethod, result, methodName,
+             testName, NO_NESTING);
+    }
+
+    public NumArgsTest(final int threshold,
+                       final String result,
+                       final String methodName,
+                       final String testName,
+                       final NestingDef[] nesting) {
+        this(threshold, false, result, methodName, testName, nesting);
+    }
+
+    public NumArgsTest(final int threshold,
+                       final String result,
+                       final String methodName,
+                       final String testName) {
+        this(threshold, false, result, methodName, testName, NO_NESTING);
+    }
+
+    public NumArgsTest(final int threshold,
+                       final String testName,
+                       final NestingDef[] nesting) {
+        this(threshold, null, null, testName, nesting);
+    }
+
+    public NumArgsTest(final int threshold,
+                       final String testName) {
+        this(threshold, null, null, testName, NO_NESTING);
+    }
+
+    public NumArgsTest(final int threshold,
+                       final String testName,
+                       final String constructorName,
+                       final NestingDef[] nesting) {
+        this(threshold, null, constructorName, testName, nesting);
+    }
+
+    protected void writeArgs(final int num, final PrintWriter stream)
+        throws IOException {
+        stream.print("int x1");
+        for(int i = 1; i < num; i++)
+            stream.print(", int x" + (i + 1));
+    }
+
+    protected void writeMethod(final int num,
+                               final String name,
+                               final PrintWriter stream)
+        throws IOException {
+        stream.write("public ");
+        if (isStaticMethod) stream.write("static ");
+        if (result == null)
+            stream.write("");
+        else {
+            stream.write(result);
+            stream.write(" ");
+        }
+        stream.write(name);
+        stream.write("(");
+        writeArgs(num, stream);
+        stream.write(") {}\n");
+    }
+
+    protected void writeJavaFile(final int num,
+                                 final boolean pass,
+                                 final PrintWriter stream)
+        throws IOException {
+        final String fullName = testName + (pass ? "Pass" : "Fail");
+        stream.write("public class ");
+        stream.write(fullName);
+        stream.write(" {\n");
+        for(int i = 0; i < nesting.length; i++)
+            nesting[i].writeBefore(stream);
+        if (null == methodName)
+            writeMethod(num, fullName, stream);
+        else
+            writeMethod(num, methodName, stream);
+        for(int i = nesting.length - 1; i >= 0; i--)
+            nesting[i].writeAfter(stream);
+        stream.write("}\n");
+    }
+
+    public void runTest() throws Exception {
+        // Run the pass test
+        final String passTestName = testName + "Pass.java";
+        final StringWriter passBody = new StringWriter();
+        final PrintWriter passStream = new PrintWriter(passBody);
+        final File passFile = new File(testdir, passTestName);
+        final FileWriter passWriter = new FileWriter(passFile);
+
+        writeJavaFile(threshold, true, passStream);
+        passStream.close();
+        passWriter.write(passBody.toString());
+        passWriter.close();
+
+        final StringWriter passSW = new StringWriter();
+        final String[] passArgs = { passFile.toString() };
+        final Iterable<? extends JavaFileObject> passFiles =
+            fm.getJavaFileObjectsFromFiles(Arrays.asList(passFile));
+        final JavaCompiler.CompilationTask passTask =
+            tool.getTask(passSW, fm, null, null, null, passFiles);
+
+        if (!passTask.call()) {
+            errors++;
+            System.err.println("Compilation unexpectedly failed. Body:\n" +
+                               passBody);
+            System.err.println("Output:\n" + passSW.toString());
+        }
+
+        // Run the fail test
+        final String failTestName = testName + "Fail.java";
+        final StringWriter failBody = new StringWriter();
+        final PrintWriter failStream = new PrintWriter(failBody);
+        final File failFile = new File(testdir, failTestName);
+        final FileWriter failWriter = new FileWriter(failFile);
+
+        writeJavaFile(threshold + 1, false, failStream);
+        failStream.close();
+        failWriter.write(failBody.toString());
+        failWriter.close();
+
+        final StringWriter failSW = new StringWriter();
+        final TestDiagnosticHandler failDiag =
+            new TestDiagnosticHandler("compiler.err.limit.parameters");
+        final Iterable<? extends JavaFileObject> failFiles =
+            fm.getJavaFileObjectsFromFiles(Arrays.asList(failFile));
+        final JavaCompiler.CompilationTask failTask =
+            tool.getTask(failSW,
+                         tool.getStandardFileManager(null, null, null),
+                         failDiag,
+                         null,
+                         null,
+                         failFiles);
+
+        if (failTask.call()) {
+            errors++;
+            System.err.println("Compilation unexpectedly succeeded.");
+            System.err.println("Input:\n" + failBody);
+        }
+
+        if (!failDiag.sawError) {
+            errors++;
+            System.err.println("Did not see expected compile error.");
+        }
+
+        if (errors != 0)
+            throw new RuntimeException("Test failed with " +
+                                       errors + " errors");
+    }
+
+    public static NestingDef classNesting(final String name) {
+        return new NestedClassBuilder(name, false);
+    }
+
+    public static NestingDef classNesting(final String name,
+                                          final boolean isStatic) {
+        return new NestedClassBuilder(name, isStatic);
+    }
+
+    protected interface NestingDef {
+        public abstract void writeBefore(final PrintWriter stream);
+        public abstract void writeAfter(final PrintWriter stream);
+    }
+
+    private static class NestedClassBuilder implements NestingDef {
+        private final String name;
+        private final boolean isStatic;
+        public NestedClassBuilder(final String name, final boolean isStatic) {
+            this.name = name;
+            this.isStatic = isStatic;
+        }
+        public void writeBefore(final PrintWriter stream) {
+            stream.write("public ");
+            if (isStatic) stream.write("static");
+            stream.write(" class ");
+            stream.write(name);
+            stream.write(" {\n");
+        }
+        public void writeAfter(final PrintWriter stream) {
+            stream.write("}\n");
+        }
+    }
+
+    public class TestDiagnosticHandler<T> implements DiagnosticListener<T> {
+        public boolean sawError;
+        public final String target;
+
+        public TestDiagnosticHandler(final String target) {
+            this.target = target;
+        }
+
+        public void report(final Diagnostic<? extends T> diag) {
+            if (diag.getCode().equals(target))
+                sawError = true;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/limits/StaticNestedClassConstructorArgs.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014230
+ * @summary Compiler silently generates bytecode that exceeds VM limits
+ * @compile NumArgsTest.java
+ * @run main StaticNestedClassConstructorArgs
+ */
+
+public class StaticNestedClassConstructorArgs extends NumArgsTest {
+    private static final NumArgsTest.NestingDef[] nesting = {
+        classNesting("StaticInner", true)
+    };
+
+    private StaticNestedClassConstructorArgs() {
+        super(254, "StaticNestedClassConstructorArgs", "StaticInner", nesting);
+    }
+
+    public static void main(String... args) throws Exception {
+        new StaticNestedClassConstructorArgs().runTest();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/limits/TopLevelClassConstructorArgs.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4309152
+ * @summary Compiler silently generates bytecode that exceeds VM limits
+ * @compile NumArgsTest.java
+ * @run main TopLevelClassConstructorArgs
+ */
+
+public class TopLevelClassConstructorArgs extends NumArgsTest {
+    private TopLevelClassConstructorArgs() {
+        super(254, "TopLevelClassConstructorArgs");
+    }
+
+    public static void main(String... args) throws Exception {
+        new TopLevelClassConstructorArgs().runTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/limits/TopLevelClassMethodArgs.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4309152
+ * @summary Compiler silently generates bytecode that exceeds VM limits
+ * @compile NumArgsTest.java
+ * @run main TopLevelClassMethodArgs
+ */
+
+public class TopLevelClassMethodArgs extends NumArgsTest {
+    private TopLevelClassMethodArgs() {
+        super(254, "void", "test", "TopLevelClassMethodArgs");
+    }
+
+    public static void main(String... args) throws Exception {
+        new TopLevelClassMethodArgs().runTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/limits/TopLevelClassStaticMethodArgs.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4309152
+ * @summary Compiler silently generates bytecode that exceeds VM limits
+ * @compile NumArgsTest.java
+ * @run main TopLevelClassStaticMethodArgs
+ */
+
+public class TopLevelClassStaticMethodArgs extends NumArgsTest {
+    private TopLevelClassStaticMethodArgs() {
+        super(255, true, "void", "test", "TopLevelClassStaticMethodArgs");
+    }
+
+    public static void main(String... args) throws Exception {
+        new TopLevelClassStaticMethodArgs().runTest();
+    }
+}
--- a/langtools/test/tools/javac/literals/UnderscoreLiterals.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/literals/UnderscoreLiterals.java	Fri Jul 05 11:06:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,12 @@
         test(1_0_0, 100);
         test(1__0__0, 100);
         test(123_456_789, 123456789);
+        test(2_147_483_647, Integer.MAX_VALUE);
+        test(-2_147_483_648, Integer.MIN_VALUE);
+        test(32_767, Short.MAX_VALUE);
+        test(-32_768, Short.MIN_VALUE);
+        test(1_2_7, Byte.MAX_VALUE);
+        test(-1_2_8, Byte.MIN_VALUE);
 
         // long
         test(1l, 1l);
@@ -51,6 +57,8 @@
         test(1_0_0l, 100l);
         test(1__0__0l, 100l);
         test(123_456_789l, 123456789l);
+        test(9_223_372_036_854_775_807l, Long.MAX_VALUE);
+        test(-9_223_372_036_854_775_808l, Long.MIN_VALUE);
 
         // float
         test(.1f, .1f);
@@ -80,6 +88,8 @@
         test(1_1.1_0_0f, 1_1.100f);
         test(1_1.1__0__0f, 1_1.100f);
         test(1_1.123_456_789f, 1_1.123456789f);
+        test(3.4_028_235E38f, Float.MAX_VALUE);
+        test(1.4E-4_5f, Float.MIN_VALUE);
 
         // double
         test(.1d, .1d);
@@ -109,6 +119,8 @@
         test(1_1.1_0_0d, 1_1.100d);
         test(1_1.1__0__0d, 1_1.100d);
         test(1_1.123_456_789d, 1_1.123456789d);
+        test(1.797_6_9_3_1_348_623_157E3_08, Double.MAX_VALUE);
+        test(4.9E-3_24, Double.MIN_VALUE);
 
         // binary
         test(0b1, 1);
@@ -118,6 +130,14 @@
         test(0b1_0_0, 4);
         test(0b1__0__0, 4);
         test(0b0001_0010_0011, 0x123);
+        test(0b111_1111_1111_1111_1111_1111_1111_1111, Integer.MAX_VALUE);
+        test(0b1000_0000_0000_0000_0000_0000_0000_0000, Integer.MIN_VALUE);
+        test(0b111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111l, Long.MAX_VALUE);
+        test(0b1000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000l, Long.MIN_VALUE);
+        test(0b111_1111_1111_1111, Short.MAX_VALUE);
+        test((short)-0b1000_0000_0000_0000, Short.MIN_VALUE);
+        test(0b111_1111, Byte.MAX_VALUE);
+        test((byte)-0b1000_0000, Byte.MIN_VALUE);
 
         // octal
         test(01, 1);
@@ -133,6 +153,14 @@
         test(0_1_0_0, 64);
         test(0_1__0__0, 64);
         test(0_001_002_003, 01002003);
+        test(0177_7777_7777, Integer.MAX_VALUE);
+        test(-0200_0000_0000, Integer.MIN_VALUE);
+        test(077_77_77_77_77_7_77_77_77_77_77l, Long.MAX_VALUE);
+        test(-010_00_00_00_00_00_00_00_00_00_00l, Long.MIN_VALUE);
+        test((short)07_77_77, Short.MAX_VALUE);
+        test((short)-010_00_00, Short.MIN_VALUE);
+        test(01_77, Byte.MAX_VALUE);
+        test((byte)-02_00, Byte.MIN_VALUE);
 
         // hexadecimal
         test(0x1, 1);
@@ -142,6 +170,18 @@
         test(0x1_0_0, 256);
         test(0x1__0__0, 256);
         test(0x01_02_03_04, 0x1020304);
+        test(0x7f_ff_ff_ff, Integer.MAX_VALUE);
+        test(0x80_00_00_00, Integer.MIN_VALUE);
+        test(0x1.f_ff_ffep127f, Float.MAX_VALUE);
+        test(0x0.00_00_02p-126f, Float.MIN_VALUE);
+        test(0x1.f__ff_ff_ff_ff_ff_ffp1_023, Double.MAX_VALUE);
+        test(0x0.000_000_000_000_1p-1_022, Double.MIN_VALUE);
+        test(0x7f_ff_ff_ff_ff_ff_ff_ffl, Long.MAX_VALUE);
+        test(0x80_00_00_00_00_00_00_00l, Long.MIN_VALUE);
+        test(0x7f_ff, Short.MAX_VALUE);
+        test((short)0x80_00, Short.MIN_VALUE);
+        test(0x7_f, Byte.MAX_VALUE);
+        test((byte)0x8_0, Byte.MIN_VALUE);
 
         // misc
         long creditCardNumber = 1234_5678_9012_3456L;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/parser/SingleCommaAnnotationValue.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8012722
+ * @summary Single comma in array initializer should parse
+ * @compile SingleCommaAnnotationValue.java
+ */
+
+public class SingleCommaAnnotationValue {
+    @Foo({}) void a() { }
+    @Foo({,}) void b() { }
+    @Foo({0}) void c() { }
+    @Foo({0,}) void d() { }
+    @Foo({0,0}) void e() { }
+    @Foo({0,0,}) void f() { }
+}
+@interface Foo { int[] value(); }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/parser/SingleCommaAnnotationValueFail.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8012722
+ * @summary Single comma in array initializer should parse
+ * @compile/fail/ref=SingleCommaAnnotationValueFail.out -XDrawDiagnostics
+ * SingleCommaAnnotationValueFail.java
+ */
+
+public class SingleCommaAnnotationValueFail {
+    // Non-example
+    @Foo({,0}) void a() { }
+}
+@interface Foo { int[] value(); }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/parser/SingleCommaAnnotationValueFail.out	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,6 @@
+SingleCommaAnnotationValueFail.java:34:12: compiler.err.expected: '}'
+SingleCommaAnnotationValueFail.java:34:13: compiler.err.illegal.start.of.type
+SingleCommaAnnotationValueFail.java:34:14: compiler.err.expected: token.identifier
+SingleCommaAnnotationValueFail.java:34:15: compiler.err.expected: ';'
+SingleCommaAnnotationValueFail.java:34:21: compiler.err.invalid.meth.decl.ret.type.req
+5 errors
--- a/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java	Fri Jul 05 11:06:24 2013 -0700
@@ -30,11 +30,13 @@
  * @build   JavacTestingAbstractProcessor
  * @compile TestElementsAnnotatedWith.java
  * @compile InheritedAnnotation.java
+ * @compile TpAnno.java
  * @compile -processor TestElementsAnnotatedWith -proc:only SurfaceAnnotations.java
  * @compile -processor TestElementsAnnotatedWith -proc:only BuriedAnnotations.java
  * @compile -processor TestElementsAnnotatedWith -proc:only Part1.java Part2.java
  * @compile -processor TestElementsAnnotatedWith -proc:only C2.java
  * @compile -processor TestElementsAnnotatedWith -proc:only Foo.java
+ * @compile -processor TestElementsAnnotatedWith -proc:only TypeParameterAnnotations.java
  * @compile Foo.java
  * @compile/process -processor TestElementsAnnotatedWith -proc:only Foo
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/environment/round/TpAnno.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.annotation.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+@Retention(RUNTIME)
+@Target(ElementType.TYPE_PARAMETER)
+public @interface TpAnno {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/environment/round/TypeParameterAnnotations.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Class to hold annotations for ElementsAnnotatedWithTest.
+ */
+
+@AnnotatedElementInfo(annotationName="TpAnno",
+                      expectedSize=4,
+                      names={"T", "A", "B", "C"})
+public class TypeParameterAnnotations<@TpAnno T>  {
+    private <@TpAnno A> TypeParameterAnnotations(A a) {;}
+
+    public <@TpAnno B> void foo(B b) {return;}
+
+    public static <@TpAnno C> void bar(C b) {return;}
+}
--- a/langtools/test/tools/javac/resolve/ResolveHarness.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/resolve/ResolveHarness.java	Fri Jul 05 11:06:24 2013 -0700
@@ -32,6 +32,8 @@
 
 import com.sun.source.util.JavacTask;
 import com.sun.tools.javac.api.ClientCodeWrapper.DiagnosticSourceUnwrapper;
+import com.sun.tools.javac.code.Flags;
+import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Type.MethodType;
 import com.sun.tools.javac.util.JCDiagnostic;
 
@@ -154,7 +156,7 @@
         //check all candidates have been used up
         for (Map.Entry<ElementKey, Candidate> entry : candidatesMap.entrySet()) {
             if (!seenCandidates.contains(entry.getKey())) {
-                error("Redundant @Candidate annotation on method " + entry.getKey().elem);
+                error("Redundant @Candidate annotation on method " + entry.getKey().elem + " sig = " + entry.getKey().elem.asType());
             }
         }
     }
@@ -250,7 +252,7 @@
         void process(Diagnostic<? extends JavaFileObject> diagnostic) {
             Element siteSym = getSiteSym(diagnostic);
             if (siteSym.getSimpleName().length() != 0 &&
-                    siteSym.getAnnotation(TraceResolve.class) == null) {
+                    ((Symbol)siteSym).outermostClass().getAnnotation(TraceResolve.class) == null) {
                 return;
             }
             int candidateIdx = 0;
@@ -308,7 +310,11 @@
 
         @Override
         void process(Diagnostic<? extends JavaFileObject> diagnostic) {
-            Element methodSym = methodSym(diagnostic);
+            Symbol methodSym = (Symbol)methodSym(diagnostic);
+            if ((methodSym.flags() & Flags.GENERATEDCONSTR) != 0) {
+                //skip resolution of default constructor (put there by javac)
+                return;
+            }
             Candidate c = getCandidateAtPos(methodSym,
                     asJCDiagnostic(diagnostic).getLineNumber(),
                     asJCDiagnostic(diagnostic).getColumnNumber());
@@ -470,23 +476,10 @@
         }
 
         String computeKey(Element e) {
-            StringBuilder buf = new StringBuilder();
-            if (predefTranslationMap.containsKey(e.getSimpleName().toString())) {
-                //predef element
-                buf.append("<predef>.");
-                String replacedName = predefTranslationMap.get(e.getSimpleName().toString());
-                buf.append(e.toString().replace(e.getSimpleName().toString(), replacedName));
-            } else if (e.getSimpleName().toString().startsWith("_")) {
-                buf.append("<predef>.");
-                buf.append(e.toString());
-            } else {
-                while (e != null) {
-                    buf.append(e.toString());
-                    e = e.getEnclosingElement();
-                }
-                buf.append(jfo.getName());
-            }
-            return buf.toString();
+            String simpleName = e.getSimpleName().toString();
+            String opName = predefTranslationMap.get(simpleName);
+            String name = opName != null ? opName : simpleName;
+            return name + e.asType();
         }
 
         @Override
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/resolve/tests/AbstractMerge.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+@TraceResolve
+class AbstractMerge {
+
+    interface A {
+        @Candidate(applicable=Phase.BASIC)
+        java.io.Serializable m1();
+        @Candidate(applicable=Phase.BASIC)
+        java.io.Serializable m2();
+        @Candidate(applicable=Phase.BASIC)
+        java.io.Serializable m3();
+        @Candidate(applicable=Phase.BASIC)
+        java.io.Serializable m4();
+        @Candidate(applicable=Phase.BASIC)
+        java.io.Serializable m5();
+        @Candidate(applicable=Phase.BASIC)
+        java.io.Serializable m6();
+    }
+
+    interface B {
+        @Candidate(applicable=Phase.BASIC)
+        Cloneable m1();
+        @Candidate(applicable=Phase.BASIC)
+        Cloneable m2();
+        @Candidate(applicable=Phase.BASIC)
+        Cloneable m3();
+        @Candidate(applicable=Phase.BASIC)
+        Cloneable m4();
+        @Candidate(applicable=Phase.BASIC)
+        Cloneable m5();
+        @Candidate(applicable=Phase.BASIC)
+        Cloneable m6();
+    }
+
+    interface C {
+        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
+        Object[] m1();
+        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
+        Object[] m2();
+        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
+        Object[] m3();
+        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
+        Object[] m4();
+        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
+        Object[] m5();
+        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
+        Object[] m6();
+    }
+
+    interface ABC extends A, B, C { }
+    interface ACB extends A, C, B { }
+    interface BAC extends B, A, C { }
+    interface BCA extends B, C, A { }
+    interface CAB extends C, A, B { }
+    interface CBA extends C, B, A { }
+
+    {
+        ABC abc = null;
+        abc.m1();
+    }
+
+    {
+        ACB acb = null;
+        acb.m2();
+    }
+
+    {
+        BAC bac = null;
+        bac.m3();
+    }
+
+    {
+        BCA bca = null;
+        bca.m4();
+    }
+
+    {
+        CAB cab = null;
+        cab.m5();
+    }
+
+    {
+        CBA cba = null;
+        cba.m6();
+    }
+}
--- a/langtools/test/tools/javac/resolve/tests/InnerOverOuter.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/resolve/tests/InnerOverOuter.java	Fri Jul 05 11:06:24 2013 -0700
@@ -21,7 +21,7 @@
  * questions.
  */
 
-@TraceResolve
+@TraceResolve(keys={"compiler.err.cant.apply.symbol"})
 class Test {
 
     //no annotation here - this should NOT even be considered!
@@ -30,7 +30,6 @@
     //no annotation here - this should NOT even be considered!
     void m(Object... o) { }
 
-    @TraceResolve(keys={"compiler.err.cant.apply.symbol"})
     class Inner {
         @Candidate
         void m(String s) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/types/TestComparisons.java	Fri Jul 05 11:06:24 2013 -0700
@@ -0,0 +1,362 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8013357
+ * @summary javac should correctly enforce binary comparison rules.
+ */
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.code.Symbol.*;
+import java.io.*;
+import java.lang.reflect.Array;
+import java.util.EnumSet;
+
+public class TestComparisons {
+
+    private int errors = 0;
+    private int testnum = 0;
+
+    static final File testdir = new File("8013357");
+
+    private enum CompareType {
+        BYTE_PRIM("byte"),
+        SHORT_PRIM("short"),
+        CHAR_PRIM("char"),
+        INTEGER_PRIM("int"),
+        LONG_PRIM("long"),
+        FLOAT_PRIM("float"),
+        DOUBLE_PRIM("double"),
+        BOOLEAN_PRIM("boolean"),
+
+        BYTE("Byte"),
+        SHORT("Short"),
+        CHAR("Character"),
+        INTEGER("Integer"),
+        LONG("Long"),
+        FLOAT("Float"),
+        DOUBLE("Double"),
+        BOOLEAN("Boolean"),
+
+        BYTE_SUPER("List<? super Byte>", true),
+        SHORT_SUPER("List<? super Short>", true),
+        CHAR_SUPER("List<? super Character>", true),
+        INTEGER_SUPER("List<? super Integer>", true),
+        LONG_SUPER("List<? super Long>", true),
+        FLOAT_SUPER("List<? super Float>", true),
+        DOUBLE_SUPER("List<? super Double>", true),
+        BOOLEAN_SUPER("List<? super Boolean>", true),
+
+        OBJECT("Object"),
+        NUMBER("Number"),
+        STRING("String");
+
+        public final boolean isList;
+        public final String name;
+
+        private CompareType(final String name, final boolean isList) {
+            this.isList = isList;
+            this.name = name;
+        }
+
+        private CompareType(final String name) {
+            this(name, false);
+        }
+    }
+
+    // The integers here refer to which subsection of JLS 15.21 is in
+    // effect.  0 means no comparison is allowed.
+    private static final int truthtab[][] = {
+        // byte, comparable to itself, any numeric type, or any boxed
+        // numeric type.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
+          0, 0, 0, 0, 0, 0, 0, 0, // Captures
+          0, 0, 0                 // Reference types
+        },
+        // short, comparable to itself, any numeric type, or any boxed
+        // numeric type.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
+          0, 0, 0, 0, 0, 0, 0, 0, // Captures
+          0, 0, 0                 // Reference types
+        },
+        // char, comparable to itself, any numeric type, or any boxed
+        // numeric type.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
+          0, 0, 0, 0, 0, 0, 0, 0, // Captures
+          0, 0, 0                 // Reference types
+        },
+        // int, comparable to itself, any numeric type, or any boxed
+        // numeric type.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
+          0, 0, 0, 0, 0, 0, 0, 0, // Captures
+          0, 0, 0                 // Reference types
+        },
+        // long, comparable to itself, any numeric type, or any boxed
+        // numeric type.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
+          0, 0, 0, 0, 0, 0, 0, 0, // Captures
+          0, 0, 0                 // Reference types
+        },
+        // float, comparable to itself, any numeric type, or any boxed
+        // numeric type.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
+          0, 0, 0, 0, 0, 0, 0, 0, // Captures
+          0, 0, 0                 // Reference types
+        },
+        // double, comparable to itself, any numeric type, or any boxed
+        // numeric type.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
+          0, 0, 0, 0, 0, 0, 0, 0, // Captures
+          0, 0, 0                 // Reference types
+        },
+        // boolean, comparable only to itself and Boolean.
+        { 0, 0, 0, 0, 0, 0, 0, 2, // Primitives
+          0, 0, 0, 0, 0, 0, 0, 2, // Boxed primitives
+          0, 0, 0, 0, 0, 0, 0, 0, // Captures
+          0, 0, 0                 // Reference types
+        },
+        // Byte, comparable to itself, Number, Object, any numeric primitive,
+        // and any captures.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          3, 0, 0, 0, 0, 0, 0, 0, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 0                 // Reference types
+        },
+        // Short, comparable to itself, Number, Object, any numeric primitive,
+        // and any captures.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          0, 3, 0, 0, 0, 0, 0, 0, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 0                 // Reference types
+        },
+        // Character, comparable to itself, Object, any numeric primitive,
+        // and any captures.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          0, 0, 3, 0, 0, 0, 0, 0, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 0, 0                 // Reference types
+        },
+        // Int, comparable to itself, Number, Object, any numeric primitive,
+        // and any captures.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          0, 0, 0, 3, 0, 0, 0, 0, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 0                 // Reference types
+        },
+        // Long, comparable to itself, Number, Object, any numeric primitive,
+        // and any captures.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          0, 0, 0, 0, 3, 0, 0, 0, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 0                 // Reference types
+        },
+        // Float, comparable to itself, Number, Object, any numeric primitive,
+        // and any captures.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          0, 0, 0, 0, 0, 3, 0, 0, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 0                 // Reference types
+        },
+        // Double, comparable to itself, Number, Object, any numeric primitive,
+        // and any captures.
+        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
+          0, 0, 0, 0, 0, 0, 3, 0, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 0                 // Reference types
+        },
+        // Boolean, to itself, any capture, Object, and boolean.
+        { 0, 0, 0, 0, 0, 0, 0, 2, // Primitives
+          0, 0, 0, 0, 0, 0, 0, 2, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 0, 0                 // Reference types
+        },
+        // Byte supertype wildcard, comparable to any reference type.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 3                 // Reference types
+        },
+        // Short supertype wildcard, comparable to any reference type.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 3                 // Reference types
+        },
+        // Character supertype wildcard, comparable to any reference type.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 3                 // Reference types
+        },
+        // Integer supertype wildcard, comparable to any reference type.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 3                 // Reference types
+        },
+        // Long supertype wildcard, comparable to any reference type.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 3                 // Reference types
+        },
+        // Float supertype wildcard, comparable to any reference type.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 3                 // Reference types
+        },
+        // Double supertype wildcard, comparable to any reference type.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 3                 // Reference types
+        },
+        // Boolean supertype wildcard, comparable to any reference type.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 3                 // Reference types
+        },
+        // Object, comparable to any reference type.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 3                 // Reference types
+        },
+        // Number, comparable to Object, any of its subclasses.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          3, 3, 0, 3, 3, 3, 3, 0, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 3, 0                 // Reference types
+        },
+        // String supertype wildcard, comparable to any reference type.
+        // and any captures.
+        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
+          0, 0, 0, 0, 0, 0, 0, 0, // Boxed primitives
+          3, 3, 3, 3, 3, 3, 3, 3, // Captures
+          3, 0, 3                 // Reference types
+        }
+    };
+
+    private void assert_compile_fail(final File file, final String body) {
+        final String filename = file.getPath();
+        final String[] args = { filename };
+        final StringWriter sw = new StringWriter();
+        final PrintWriter pw = new PrintWriter(sw);
+        final int rc = com.sun.tools.javac.Main.compile(args, pw);
+        pw.close();
+        if (rc == 0) {
+            System.err.println("Compilation of " + file.getName() +
+                               " didn't fail as expected.\nFile:\n" +
+                               body + "\nOutput:\n" + sw.toString());
+            errors++;
+        }
+    }
+
+    private void assert_compile_succeed(final File file, final String body) {
+        final String filename = file.getPath();
+        final String[] args = { filename };
+        final StringWriter sw = new StringWriter();
+        final PrintWriter pw = new PrintWriter(sw);
+        final int rc = com.sun.tools.javac.Main.compile(args, pw);
+        pw.close();
+        if (rc != 0) {
+            System.err.println("Compilation of " + file.getName() +
+                               " didn't succeed as expected.\nFile:\n" +
+                               body + "\nOutput:\n" +
+                               sw.toString());
+            errors++;
+        }
+    }
+
+    private String makeBody(final int num,
+                            final CompareType left,
+                            final CompareType right) {
+        return "import java.util.List;\n" +
+            "public class Test" + num + " {\n" +
+            "    public boolean test(" + left.name +
+            " left, " + right.name + " right) {\n" +
+            "        return left" + (left.isList ? ".get(0)" : "") +
+            " == right" + (right.isList ? ".get(0)" : "") + ";\n" +
+            "    }\n" +
+            "}\n";
+    }
+
+    private File writeFile(final String filename,
+                           final String body)
+        throws IOException {
+        final File f = new File(testdir, filename);
+        f.getParentFile().mkdirs();
+        final FileWriter out = new FileWriter(f);
+        out.write(body);
+        out.close();
+        return f;
+    }
+
+    private void test(final CompareType left, final CompareType right)
+        throws IOException {
+        final int num = testnum++;
+        final String filename = "Test" + num + ".java";
+        final String body = makeBody(num, left, right);
+        final File file = writeFile(filename, body);
+        if (truthtab[left.ordinal()][right.ordinal()] != 0)
+            assert_compile_succeed(file, body);
+        else
+            assert_compile_fail(file, body);
+    }
+
+    void run() throws Exception {
+        testdir.mkdir();
+
+        for(CompareType left : CompareType.values())
+            for(CompareType right : CompareType.values())
+                test(left, right);
+
+        if (errors != 0)
+            throw new Exception("ObjectZeroCompare test failed with " +
+                                errors + " errors.");
+    }
+
+    public static void main(String... args) throws Exception {
+        new TestComparisons().run();
+    }
+}
--- a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.java	Fri Jul 05 11:06:24 2013 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @bug 7153951
  * @compile ClassUsingAnotherAuxiliary.java NotAClassName.java
  * @compile -Xlint:auxiliaryclass ClassUsingAnotherAuxiliary.java NotAClassName.java
  * @compile/fail/ref=ClassUsingAnotherAuxiliary.out -XDrawDiagnostics -Werror -Xlint:auxiliaryclass ClassUsingAnotherAuxiliary.java NotAClassName.java
--- a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.out	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.out	Fri Jul 05 11:06:24 2013 -0700
@@ -1,4 +1,4 @@
-ClassUsingAnotherAuxiliary.java:32:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AnAuxiliaryClass, NotAClassName.java
+ClassUsingAnotherAuxiliary.java:33:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AnAuxiliaryClass, NotAClassName.java
 - compiler.err.warnings.and.werror
 1 error
 1 warning
--- a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary.java	Fri Jul 05 11:06:24 2013 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @bug 7153951
  * @clean ClassUsingAuxiliary ClassWithAuxiliary AuxiliaryClass ClassWithAuxiliary$NotAnAuxiliaryClass ClassWithAuxiliary$NotAnAuxiliaryClassEither
  * @run compile ClassUsingAuxiliary.java ClassWithAuxiliary.java
  * @run compile/fail/ref=ClassUsingAuxiliary1.out -XDrawDiagnostics -Werror -Xlint:auxiliaryclass ClassUsingAuxiliary.java ClassWithAuxiliary.java
--- a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary1.out	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary1.out	Fri Jul 05 11:06:24 2013 -0700
@@ -1,4 +1,4 @@
-ClassUsingAuxiliary.java:33:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AuxiliaryClass, ClassWithAuxiliary.java
+ClassUsingAuxiliary.java:34:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AuxiliaryClass, ClassWithAuxiliary.java
 - compiler.err.warnings.and.werror
 1 error
 1 warning
--- a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary2.out	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary2.out	Fri Jul 05 11:06:24 2013 -0700
@@ -1,4 +1,4 @@
-ClassUsingAuxiliary.java:33:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AuxiliaryClass, ClassWithAuxiliary.java
+ClassUsingAuxiliary.java:34:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AuxiliaryClass, ClassWithAuxiliary.java
 - compiler.err.warnings.and.werror
 1 error
 1 warning
--- a/langtools/test/tools/javac/warnings/AuxiliaryClass/SelfClassWithAux.java	Thu Jul 04 01:01:07 2013 -0700
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/SelfClassWithAux.java	Fri Jul 05 11:06:24 2013 -0700
@@ -29,16 +29,17 @@
 
 /*
  * @test
+ * @bug 7153951
  * @run compile -Werror -Xlint:auxiliaryclass SelfClassWithAux.java ClassWithAuxiliary.java
  * @run compile -Werror -Xlint:auxiliaryclass SelfClassWithAux.java
  */
 
 class SelfClassWithAux {
-    Aux aux;
+    AuxClass aux;
     ClassWithAuxiliary.NotAnAuxiliaryClass alfa;
     ClassWithAuxiliary.NotAnAuxiliaryClassEither beta;
 }
 
-class Aux {
-    Aux aux;
+class AuxClass {
+    AuxClass aux;
 }