changeset 2947:2e29011b30ee

Merge
author jjg
date Thu, 26 Mar 2015 15:47:59 -0700
parents 1f4198a7d9da eb24478436c7
children 2a0d51d22cec 8685802eef11
files src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java test/com/sun/javadoc/testNonFrameWarning/pkg/C.java
diffstat 50 files changed, 1207 insertions(+), 455 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Mar 26 15:21:23 2015 -0700
+++ b/.hgtags	Thu Mar 26 15:47:59 2015 -0700
@@ -296,3 +296,5 @@
 7c44d9a33bbea75f5d91625df9bbccea360aea2a jdk9-b51
 ee20efe0255d7ac6e06e88e06f7c72f6c6da7bf9 jdk9-b52
 99ff00581f3633c1787bec21f2a8f3a2ffe57665 jdk9-b53
+ed34864f3b43a7df394fce6c3f0bc86b70a5d686 jdk9-b54
+32a2e724988499e6f68611a65168c5f2fde0f6b9 jdk9-b55
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java	Thu Mar 26 15:47:59 2015 -0700
@@ -144,6 +144,7 @@
     }
 
     public Void scan(DocCommentTree tree, TreePath p) {
+        env.initTypes();
         env.setCurrent(p, tree);
 
         boolean isOverridingMethod = !env.currOverriddenMethods.isEmpty();
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java	Thu Mar 26 15:47:59 2015 -0700
@@ -32,6 +32,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Queue;
+import java.util.regex.Pattern;
 
 import javax.lang.model.element.Name;
 import javax.tools.StandardLocation;
@@ -79,7 +80,8 @@
     private static final String STATS = "-stats";
     public static final String XIMPLICIT_HEADERS = "-XimplicitHeaders:";
     public static final String XCUSTOM_TAGS_PREFIX = "-XcustomTags:";
-    public static final String TAGS_SEPARATOR = ",";
+    public static final String XCHECK_PACKAGE = "-XcheckPackage:";
+    public static final String SEPARATOR = ",";
 
     // <editor-fold defaultstate="collapsed" desc="Command-line entry point">
     public static void main(String... args) {
@@ -156,7 +158,7 @@
         env.init(task);
         checker = new Checker(env);
 
-        DeclScanner ds = new DeclScanner() {
+        DeclScanner ds = new DeclScanner(env) {
             @Override
             void visitDecl(Tree tree, Name name) {
                 TreePath p = getCurrentPath();
@@ -272,6 +274,8 @@
                 env.setImplicitHeaders(Character.digit(ch, 10));
             } else if (arg.startsWith(XCUSTOM_TAGS_PREFIX)) {
                 env.setCustomTags(arg.substring(arg.indexOf(":") + 1));
+            } else if (arg.startsWith(XCHECK_PACKAGE)) {
+                env.setCheckPackages(arg.substring(arg.indexOf(":") + 1));
             } else
                 throw new IllegalArgumentException(arg);
         }
@@ -280,7 +284,7 @@
         checker = new Checker(env);
 
         if (addTaskListener) {
-            final DeclScanner ds = new DeclScanner() {
+            final DeclScanner ds = new DeclScanner(env) {
                 @Override
                 void visitDecl(Tree tree, Name name) {
                     TreePath p = getCurrentPath();
@@ -337,6 +341,9 @@
            return true;
         if (opt.startsWith(XMSGS_CUSTOM_PREFIX))
            return Messages.Options.isValidOptions(opt.substring(XMSGS_CUSTOM_PREFIX.length()));
+        if (opt.startsWith(XCHECK_PACKAGE)) {
+            return Env.validatePackages(opt.substring(opt.indexOf(":") + 1));
+        }
         return false;
     }
 
@@ -348,6 +355,12 @@
     // <editor-fold defaultstate="collapsed" desc="DeclScanner">
 
     static abstract class DeclScanner extends TreePathScanner<Void, Void> {
+        final Env env;
+
+        public DeclScanner(Env env) {
+            this.env = env;
+        }
+
         abstract void visitDecl(Tree tree, Name name);
 
         @Override @DefinedBy(Api.COMPILER_TREE)
@@ -373,6 +386,33 @@
             visitDecl(tree, tree.getName());
             return super.visitVariable(tree, ignore);
         }
+
+        @Override @DefinedBy(Api.COMPILER_TREE)
+        public Void visitCompilationUnit(CompilationUnitTree node, Void p) {
+            if (env.includePackages != null) {
+                String packageName =   node.getPackageName() != null
+                                     ? node.getPackageName().toString()
+                                     : "";
+                if (!env.includePackages.isEmpty()) {
+                    boolean included = false;
+                    for (Pattern pack : env.includePackages) {
+                        if (pack.matcher(packageName).matches()) {
+                            included = true;
+                            break;
+                        }
+                    }
+                    if (!included)
+                        return null;
+                }
+                for (Pattern pack : env.excludePackages) {
+                    if (pack.matcher(packageName).matches()) {
+                        return null;
+                    }
+                }
+            }
+            return super.visitCompilationUnit(node, p);
+        }
+
     }
 
     // </editor-fold>
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java	Thu Mar 26 15:47:59 2015 -0700
@@ -26,8 +26,12 @@
 package com.sun.tools.doclint;
 
 
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Set;
-import java.util.LinkedHashSet;
+import java.util.regex.Pattern;
 
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ElementKind;
@@ -36,6 +40,7 @@
 import javax.lang.model.type.TypeMirror;
 import javax.lang.model.util.Elements;
 import javax.lang.model.util.Types;
+import javax.tools.Diagnostic.Kind;
 
 import com.sun.source.doctree.DocCommentTree;
 import com.sun.source.util.DocTrees;
@@ -44,6 +49,7 @@
 import com.sun.source.util.TreePath;
 import com.sun.tools.javac.model.JavacTypes;
 import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.util.MatchingUtils;
 import com.sun.tools.javac.util.StringUtils;
 
 /**
@@ -90,6 +96,9 @@
 
     Set<String> customTags;
 
+    Set<Pattern> includePackages;
+    Set<Pattern> excludePackages;
+
     // Utility classes
     DocTrees trees;
     Elements elements;
@@ -129,6 +138,12 @@
         this.trees = trees;
         this.elements = elements;
         this.types = types;
+    }
+
+    void initTypes() {
+        if (java_lang_Error != null)
+            return ;
+
         java_lang_Error = elements.getTypeElement("java.lang.Error").asType();
         java_lang_RuntimeException = elements.getTypeElement("java.lang.RuntimeException").asType();
         java_lang_Throwable = elements.getTypeElement("java.lang.Throwable").asType();
@@ -141,12 +156,43 @@
 
     void setCustomTags(String cTags) {
         customTags = new LinkedHashSet<>();
-        for (String s : cTags.split(DocLint.TAGS_SEPARATOR)) {
+        for (String s : cTags.split(DocLint.SEPARATOR)) {
             if (!s.isEmpty())
                 customTags.add(s);
         }
     }
 
+    void setCheckPackages(String packages) {
+        includePackages = new HashSet<>();
+        excludePackages = new HashSet<>();
+        for (String pack : packages.split(DocLint.SEPARATOR)) {
+            boolean excluded = false;
+            if (pack.startsWith("-")) {
+                pack = pack.substring(1);
+                excluded = true;
+            }
+            if (pack.isEmpty())
+                continue;
+            Pattern pattern = MatchingUtils.validImportStringToPattern(pack);
+            if (excluded) {
+                excludePackages.add(pattern);
+            } else {
+                includePackages.add(pattern);
+            }
+        }
+    }
+
+    static boolean validatePackages(String packages) {
+        for (String pack : packages.split(DocLint.SEPARATOR)) {
+            if (pack.startsWith("-")) {
+                pack = pack.substring(1);
+            }
+            if (!pack.isEmpty() && !MatchingUtils.isValidImportString(pack))
+                return false;
+        }
+        return true;
+    }
+
     /** Set the current declaration and its doc comment. */
     void setCurrent(TreePath path, DocCommentTree comment) {
         currPath = path;
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint.properties	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint.properties	Thu Mar 26 15:47:59 2015 -0700
@@ -107,6 +107,13 @@
 \    equivalent to -Xmsgs:all/protected, meaning that\n\
 \    all messages are reported for protected and public\n\
 \    declarations only. \n\
+\  -XcheckPackage:<packages>\n\
+\    Enable or disable checks in specific packages.\n\
+\    <packages> is a comma separated list of package specifiers.\n\
+\    Package specifier is either a qualified name of a package\n\
+\    or a package name prefix followed by ''.*'', which expands to\n\
+\    all sub-packages of the given package. Prefix the package specifier\n\
+\    with ''-'' to disable checks for the specified packages.\n\
 \  -stats\n\
 \    Report statistics on the reported issues.\n\
 \  -h -help --help -usage -?\n\
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Thu Mar 26 15:47:59 2015 -0700
@@ -31,10 +31,12 @@
 import java.util.EnumSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Function;
 
 import javax.lang.model.type.*;
 
 import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.Types.MapVisitor;
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.DefinedBy.Api;
 import static com.sun.tools.javac.code.BoundKind.*;
@@ -218,33 +220,81 @@
 
     /** An abstract class for mappings from types to types
      */
-    public static abstract class Mapping {
-        private String name;
-        public Mapping(String name) {
-            this.name = name;
+    public static abstract class TypeMapping<S> extends Types.MapVisitor<S> implements Function<Type, Type> {
+
+        @Override
+        public Type apply(Type type) {
+            return visit(type);
         }
-        public abstract Type apply(Type t);
-        public String toString() {
-            return name;
+
+        List<Type> visit(List<Type> ts, S s) {
+            return ts.map(t -> visit(t, s));
+        }
+
+        @Override
+        public Type visitClassType(ClassType t, S s) {
+            Type outer = t.getEnclosingType();
+            Type outer1 = visit(outer, s);
+            List<Type> typarams = t.getTypeArguments();
+            List<Type> typarams1 = visit(typarams, s);
+            if (outer1 == outer && typarams1 == typarams) return t;
+            else return new ClassType(outer1, typarams1, t.tsym, t.metadata);
+        }
+
+        @Override
+        public Type visitWildcardType(WildcardType wt, S s) {
+            Type t = wt.type;
+            if (t != null)
+                t = visit(t, s);
+            if (t == wt.type)
+                return wt;
+            else
+                return new WildcardType(t, wt.kind, wt.tsym, wt.bound, wt.metadata);
+        }
+
+        @Override
+        public Type visitArrayType(ArrayType t, S s) {
+            Type elemtype = t.elemtype;
+            Type elemtype1 = visit(elemtype, s);
+            if (elemtype1 == elemtype) return t;
+            else return new ArrayType(elemtype1, t.tsym, t.metadata);
+        }
+
+        @Override
+        public Type visitMethodType(MethodType t, S s) {
+            List<Type> argtypes = t.argtypes;
+            Type restype = t.restype;
+            List<Type> thrown = t.thrown;
+            List<Type> argtypes1 = visit(argtypes, s);
+            Type restype1 = visit(restype, s);
+            List<Type> thrown1 = visit(thrown, s);
+            if (argtypes1 == argtypes &&
+                restype1 == restype &&
+                thrown1 == thrown) return t;
+            else return new MethodType(argtypes1, restype1, thrown1, t.tsym);
+        }
+
+        @Override
+        public Type visitCapturedType(CapturedType t, S s) {
+            return visitTypeVar(t, s);
+        }
+
+        @Override
+        public Type visitForAll(ForAll t, S s) {
+            return visit(t.qtype, s);
         }
     }
 
     /** map a type function over all immediate descendants of this type
      */
-    public Type map(Mapping f) {
-        return this;
+    public <Z> Type map(TypeMapping<Z> mapping, Z arg) {
+        return mapping.visit(this, arg);
     }
 
-    /** map a type function over a list of types
+    /** map a type function over all immediate descendants of this type (no arg version)
      */
-    public static List<Type> map(List<Type> ts, Mapping f) {
-        if (ts.nonEmpty()) {
-            List<Type> tail1 = map(ts.tail, f);
-            Type t = f.apply(ts.head);
-            if (tail1 != ts.tail || t != ts.head)
-                return tail1.prepend(t);
-        }
-        return ts;
+    public <Z> Type map(TypeMapping<Z> mapping) {
+        return mapping.visit(this, null);
     }
 
     /** Define a constant type, of the same kind as this type
@@ -775,17 +825,6 @@
             return s.toString();
         }
 
-        public Type map(Mapping f) {
-            //- System.err.println("   (" + this + ").map(" + f + ")");//DEBUG
-            Type t = type;
-            if (t != null)
-                t = f.apply(t);
-            if (t == type)
-                return this;
-            else
-                return new WildcardType(t, kind, tsym, bound, metadata);
-        }
-
         @DefinedBy(Api.LANGUAGE_MODEL)
         public Type getExtendsBound() {
             if (kind == EXTENDS)
@@ -1009,15 +1048,6 @@
                 allparams().isEmpty();
         }
 
-        public Type map(Mapping f) {
-            Type outer = getEnclosingType();
-            Type outer1 = f.apply(outer);
-            List<Type> typarams = getTypeArguments();
-            List<Type> typarams1 = map(typarams, f);
-            if (outer1 == outer && typarams1 == typarams) return this;
-            else return new ClassType(outer1, typarams1, tsym, metadata);
-        }
-
         public boolean contains(Type elem) {
             return
                 elem == this
@@ -1248,12 +1278,6 @@
             };
         }
 
-        public Type map(Mapping f) {
-            Type elemtype1 = f.apply(elemtype);
-            if (elemtype1 == elemtype) return this;
-            else return new ArrayType(elemtype1, tsym, metadata);
-        }
-
         public boolean contains(Type elem) {
             return elem == this || elemtype.contains(elem);
         }
@@ -1345,16 +1369,6 @@
                 restype != null && restype.isErroneous();
         }
 
-        public Type map(Mapping f) {
-            List<Type> argtypes1 = map(argtypes, f);
-            Type restype1 = f.apply(restype);
-            List<Type> thrown1 = map(thrown, f);
-            if (argtypes1 == argtypes &&
-                restype1 == restype &&
-                thrown1 == thrown) return this;
-            else return new MethodType(argtypes1, restype1, thrown1, tsym);
-        }
-
         public boolean contains(Type elem) {
             return elem == this || contains(argtypes, elem) || restype.contains(elem) || contains(thrown, elem);
         }
@@ -1691,10 +1705,6 @@
             return qtype.isErroneous();
         }
 
-        public Type map(Mapping f) {
-            return f.apply(qtype);
-        }
-
         public boolean contains(Type elem) {
             return qtype.contains(elem);
         }
@@ -1864,7 +1874,7 @@
         }
 
         protected void addBound(InferenceBound ib, Type bound, Types types, boolean update) {
-            Type bound2 = toTypeVarMap.apply(bound).baseType();
+            Type bound2 = bound.map(toTypeVarMap).baseType();
             List<Type> prevBounds = bounds.get(ib);
             for (Type b : prevBounds) {
                 //check for redundancy - use strict version of isSameType on tvars
@@ -1875,15 +1885,10 @@
             notifyChange(EnumSet.of(ib));
         }
         //where
-            Type.Mapping toTypeVarMap = new Mapping("toTypeVarMap") {
+            TypeMapping<Void> toTypeVarMap = new TypeMapping<Void>() {
                 @Override
-                public Type apply(Type t) {
-                    if (t.hasTag(UNDETVAR)) {
-                        UndetVar uv = (UndetVar)t;
-                        return uv.inst != null ? uv.inst : uv.qtype;
-                    } else {
-                        return t.map(this);
-                    }
+                public Type visitUndetVar(UndetVar uv, Void _unused) {
+                    return uv.inst != null ? uv.inst : uv.qtype;
                 }
             };
 
@@ -2154,7 +2159,6 @@
         public Type getEnclosingType()           { return this; }
         public Type getReturnType()              { return this; }
         public Type asSub(Symbol sym)            { return this; }
-        public Type map(Mapping f)               { return this; }
 
         public boolean isGenType(Type t)         { return true; }
         public boolean isErroneous()             { return true; }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Thu Mar 26 15:47:59 2015 -0700
@@ -32,6 +32,8 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.WeakHashMap;
+import java.util.function.BiPredicate;
+import java.util.stream.Collector;
 
 import javax.tools.JavaFileObject;
 
@@ -1766,10 +1768,11 @@
 
     // <editor-fold defaultstate="collapsed" desc="cvarLowerBounds">
     public List<Type> cvarLowerBounds(List<Type> ts) {
-        return map(ts, cvarLowerBoundMapping);
+        return ts.map(cvarLowerBoundMapping);
     }
-    private final Mapping cvarLowerBoundMapping = new Mapping("cvarLowerBound") {
-            public Type apply(Type t) {
+        private final TypeMapping<Void> cvarLowerBoundMapping = new TypeMapping<Void>() {
+            @Override
+            public Type visitCapturedType(CapturedType t, Void _unused) {
                 return cvarLowerBound(t);
             }
         };
@@ -1879,9 +1882,15 @@
     /**
      * Mapping to take element type of an arraytype
      */
-    private Mapping elemTypeFun = new Mapping ("elemTypeFun") {
-        public Type apply(Type t) {
-            return elemtype(skipTypeVars(t, false));
+    private TypeMapping<Void> elemTypeFun = new TypeMapping<Void>() {
+        @Override
+        public Type visitArrayType(ArrayType t, Void _unused) {
+            return t.elemtype;
+        }
+
+        @Override
+        public Type visitTypeVar(TypeVar t, Void _unused) {
+            return visit(skipTypeVars(t, false));
         }
     };
 
@@ -2177,7 +2186,7 @@
         }
         }
     // where
-        private SimpleVisitor<Type, Boolean> erasure = new SimpleVisitor<Type, Boolean>() {
+        private TypeMapping<Boolean> erasure = new TypeMapping<Boolean>() {
             private Type combineMetadata(final Type ty,
                                          final TypeMetadata md) {
                 if (!md.isEmpty()) {
@@ -2202,8 +2211,8 @@
                 if (t.isPrimitive())
                     return t; /*fast special case*/
                 else {
-                    Type erased = t.map(recurse ? erasureRecFun : erasureFun);
-                    return combineMetadata(erased, t.getMetadata());
+                    //other cases already handled
+                    return combineMetadata(t, t.getMetadata());
                 }
             }
 
@@ -2223,23 +2232,10 @@
                 Type erased = erasure(t.bound, recurse);
                 return combineMetadata(erased, t.getMetadata());
             }
-
-            @Override
-            public Type visitErrorType(ErrorType t, Boolean recurse) {
-                return t;
-            }
         };
 
-    private Mapping erasureFun = new Mapping ("erasure") {
-            public Type apply(Type t) { return erasure(t); }
-        };
-
-    private Mapping erasureRecFun = new Mapping ("erasureRecursive") {
-        public Type apply(Type t) { return erasureRecursive(t); }
-    };
-
     public List<Type> erasure(List<Type> ts) {
-        return Type.map(ts, erasureFun);
+        return erasure.visit(ts, false);
     }
 
     public Type erasureRecursive(Type t) {
@@ -2247,7 +2243,7 @@
     }
 
     public List<Type> erasureRecursive(List<Type> ts) {
-        return Type.map(ts, erasureRecFun);
+        return erasure.visit(ts, true);
     }
     // </editor-fold>
 
@@ -3177,15 +3173,18 @@
      *  changing all recursive bounds from old to new list.
      */
     public List<Type> newInstances(List<Type> tvars) {
-        List<Type> tvars1 = Type.map(tvars, newInstanceFun);
+        List<Type> tvars1 = tvars.map(newInstanceFun);
         for (List<Type> l = tvars1; l.nonEmpty(); l = l.tail) {
             TypeVar tv = (TypeVar) l.head;
             tv.bound = subst(tv.bound, tvars, tvars1);
         }
         return tvars1;
     }
-    private static final Mapping newInstanceFun = new Mapping("newInstanceFun") {
-            public Type apply(Type t) { return new TypeVar(t.tsym, t.getUpperBound(), t.getLowerBound(), t.getMetadata()); }
+        private static final TypeMapping<Void> newInstanceFun = new TypeMapping<Void>() {
+            @Override
+            public TypeVar visitTypeVar(TypeVar t, Void _unused) {
+                return new TypeVar(t.tsym, t.getUpperBound(), t.getLowerBound(), t.getMetadata());
+            }
         };
     // </editor-fold>
 
@@ -3409,41 +3408,86 @@
     }
 
     /**
+     * Collect types into a new closure (using a @code{ClosureHolder})
+     */
+    public Collector<Type, ClosureHolder, List<Type>> closureCollector(boolean minClosure, BiPredicate<Type, Type> shouldSkip) {
+        return Collector.of(() -> new ClosureHolder(minClosure, shouldSkip),
+                ClosureHolder::add,
+                ClosureHolder::merge,
+                ClosureHolder::closure);
+    }
+    //where
+        class ClosureHolder {
+            List<Type> closure;
+            final boolean minClosure;
+            final BiPredicate<Type, Type> shouldSkip;
+
+            ClosureHolder(boolean minClosure, BiPredicate<Type, Type> shouldSkip) {
+                this.closure = List.nil();
+                this.minClosure = minClosure;
+                this.shouldSkip = shouldSkip;
+            }
+
+            void add(Type type) {
+                closure = insert(closure, type, shouldSkip);
+            }
+
+            ClosureHolder merge(ClosureHolder other) {
+                closure = union(closure, other.closure, shouldSkip);
+                return this;
+            }
+
+            List<Type> closure() {
+                return minClosure ? closureMin(closure) : closure;
+            }
+        }
+
+    BiPredicate<Type, Type> basicClosureSkip = (t1, t2) -> t1.tsym == t2.tsym;
+
+    /**
      * Insert a type in a closure
      */
-    public List<Type> insert(List<Type> cl, Type t) {
+    public List<Type> insert(List<Type> cl, Type t, BiPredicate<Type, Type> shouldSkip) {
         if (cl.isEmpty()) {
             return cl.prepend(t);
-        } else if (t.tsym == cl.head.tsym) {
+        } else if (shouldSkip.test(t, cl.head)) {
             return cl;
         } else if (t.tsym.precedes(cl.head.tsym, this)) {
             return cl.prepend(t);
         } else {
             // t comes after head, or the two are unrelated
-            return insert(cl.tail, t).prepend(cl.head);
+            return insert(cl.tail, t, shouldSkip).prepend(cl.head);
         }
     }
 
+    public List<Type> insert(List<Type> cl, Type t) {
+        return insert(cl, t, basicClosureSkip);
+    }
+
     /**
      * Form the union of two closures
      */
-    public List<Type> union(List<Type> cl1, List<Type> cl2) {
+    public List<Type> union(List<Type> cl1, List<Type> cl2, BiPredicate<Type, Type> shouldSkip) {
         if (cl1.isEmpty()) {
             return cl2;
         } else if (cl2.isEmpty()) {
             return cl1;
-        } else if (cl1.head.tsym == cl2.head.tsym) {
-            return union(cl1.tail, cl2.tail).prepend(cl1.head);
+        } else if (shouldSkip.test(cl1.head, cl2.head)) {
+            return union(cl1.tail, cl2.tail, shouldSkip).prepend(cl1.head);
         } else if (cl1.head.tsym.precedes(cl2.head.tsym, this)) {
-            return union(cl1.tail, cl2).prepend(cl1.head);
+            return union(cl1.tail, cl2, shouldSkip).prepend(cl1.head);
         } else if (cl2.head.tsym.precedes(cl1.head.tsym, this)) {
-            return union(cl1, cl2.tail).prepend(cl2.head);
+            return union(cl1, cl2.tail, shouldSkip).prepend(cl2.head);
         } else {
             // unrelated types
-            return union(cl1.tail, cl2).prepend(cl1.head);
+            return union(cl1.tail, cl2, shouldSkip).prepend(cl1.head);
         }
     }
 
+    public List<Type> union(List<Type> cl1, List<Type> cl2) {
+        return union(cl1, cl2, basicClosureSkip);
+    }
+
     /**
      * Intersect two closures
      */
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Mar 26 15:47:59 2015 -0700
@@ -41,11 +41,13 @@
 import com.sun.tools.javac.code.Scope.WriteableScope;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.code.Types.FunctionDescriptorLookupError;
 import com.sun.tools.javac.comp.Check.CheckContext;
 import com.sun.tools.javac.comp.DeferredAttr.AttrMode;
 import com.sun.tools.javac.comp.Infer.InferenceContext;
 import com.sun.tools.javac.comp.Infer.FreeTypeListener;
 import com.sun.tools.javac.jvm.*;
+import com.sun.tools.javac.resources.CompilerProperties.Fragments;
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.tree.JCTree.*;
 import com.sun.tools.javac.tree.JCTree.JCPolyExpression.*;
@@ -1213,10 +1215,8 @@
                             if (pattype.constValue() == null) {
                                 log.error(c.pat.pos(),
                                           (stringSwitch ? "string.const.req" : "const.expr.req"));
-                            } else if (labels.contains(pattype.constValue())) {
+                            } else if (!labels.add(pattype.constValue())) {
                                 log.error(c.pos(), "duplicate.case.label");
-                            } else {
-                                labels.add(pattype.constValue());
                             }
                         }
                     }
@@ -1253,19 +1253,17 @@
     // where
     /** Return the selected enumeration constant symbol, or null. */
     private Symbol enumConstant(JCTree tree, Type enumType) {
-        if (!tree.hasTag(IDENT)) {
-            log.error(tree.pos(), "enum.label.must.be.unqualified.enum");
-            return syms.errSymbol;
-        }
-        JCIdent ident = (JCIdent)tree;
-        Name name = ident.name;
-        for (Symbol sym : enumType.tsym.members().getSymbolsByName(name)) {
-            if (sym.kind == VAR) {
-                Symbol s = ident.sym = sym;
-                ((VarSymbol)s).getConstValue(); // ensure initializer is evaluated
-                ident.type = s.type;
-                return ((s.flags_field & Flags.ENUM) == 0)
-                    ? null : s;
+        if (tree.hasTag(IDENT)) {
+            JCIdent ident = (JCIdent)tree;
+            Name name = ident.name;
+            for (Symbol sym : enumType.tsym.members().getSymbolsByName(name)) {
+                if (sym.kind == VAR) {
+                    Symbol s = ident.sym = sym;
+                    ((VarSymbol)s).getConstValue(); // ensure initializer is evaluated
+                    ident.type = s.type;
+                    return ((s.flags_field & Flags.ENUM) == 0)
+                        ? null : s;
+                }
             }
         }
         return null;
@@ -2877,6 +2875,16 @@
                             names.empty, List.of(fExpr.targets.head), ABSTRACT);
                     if (csym != null) {
                         chk.checkImplementations(env.tree, csym, csym);
+                        try {
+                            //perform an additional functional interface check on the synthetic class,
+                            //as there may be spurious errors for raw targets - because of existing issues
+                            //with membership and inheritance (see JDK-8074570).
+                            csym.flags_field |= INTERFACE;
+                            types.findDescriptorType(csym.type);
+                        } catch (FunctionDescriptorLookupError err) {
+                            resultInfo.checkContext.report(fExpr,
+                                    diags.fragment(Fragments.NoSuitableFunctionalIntfInst(fExpr.targets.head)));
+                        }
                     }
                 } catch (Types.FunctionDescriptorLookupError ex) {
                     JCDiagnostic cause = ex.getDiagnostic();
@@ -2948,7 +2956,7 @@
     public void visitBinary(JCBinary tree) {
         // Attribute arguments.
         Type left = chk.checkNonVoid(tree.lhs.pos(), attribExpr(tree.lhs, env));
-        Type right = chk.checkNonVoid(tree.lhs.pos(), attribExpr(tree.rhs, env));
+        Type right = chk.checkNonVoid(tree.rhs.pos(), attribExpr(tree.rhs, env));
         // Find operator.
         Symbol operator = tree.operator = operators.resolveBinary(tree, tree.getTag(), left, right);
         Type owntype = types.createErrorType(tree.type);
@@ -3728,7 +3736,7 @@
             DeferredAttr.DeferredTypeMap checkDeferredMap =
                 deferredAttr.new DeferredTypeMap(DeferredAttr.AttrMode.CHECK, sym, env.info.pendingResolutionPhase);
 
-            argtypes = Type.map(argtypes, checkDeferredMap);
+            argtypes = argtypes.map(checkDeferredMap);
 
             if (noteWarner.hasNonSilentLint(LintCategory.UNCHECKED)) {
                 chk.warnUnchecked(env.tree.pos(),
@@ -3736,7 +3744,7 @@
                         kindName(sym),
                         sym.name,
                         rs.methodArguments(sym.type.getParameterTypes()),
-                        rs.methodArguments(Type.map(argtypes, checkDeferredMap)),
+                        rs.methodArguments(argtypes.map(checkDeferredMap)),
                         kindName(sym.location()),
                         sym.location());
                owntype = new MethodType(owntype.getParameterTypes(),
@@ -3760,7 +3768,7 @@
                     return new Pair<>(sym, diag);
                 }
             };
-            List<Type> argtypes2 = Type.map(argtypes,
+            List<Type> argtypes2 = argtypes.map(
                     rs.new ResolveDeferredRecoveryMap(AttrMode.CHECK, sym, env.info.pendingResolutionPhase));
             JCDiagnostic errDiag = errSym.getDiagnostic(JCDiagnostic.DiagnosticType.ERROR,
                     env.tree, sym, site, sym.name, argtypes2, typeargtypes);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Thu Mar 26 15:47:59 2015 -0700
@@ -27,6 +27,7 @@
 
 import com.sun.source.tree.LambdaExpressionTree.BodyKind;
 import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.code.Type.TypeMapping;
 import com.sun.tools.javac.comp.Resolve.ResolveError;
 import com.sun.tools.javac.resources.CompilerProperties.Fragments;
 import com.sun.tools.javac.tree.*;
@@ -44,7 +45,6 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.EnumMap;
 import java.util.EnumSet;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
@@ -300,13 +300,6 @@
         }
     };
 
-    DeferredTypeCompleter dummyCompleter = new DeferredTypeCompleter() {
-        public Type complete(DeferredType dt, ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
-            Assert.check(deferredAttrContext.mode == AttrMode.CHECK);
-            return dt.tree.type = Type.stuckType;
-        }
-    };
-
     /**
      * Policy for detecting stuck expressions. Different criteria might cause
      * an expression to be judged as stuck, depending on whether the check
@@ -849,33 +842,24 @@
     /** an empty deferred attribution context - all methods throw exceptions */
     final DeferredAttrContext emptyDeferredAttrContext;
 
-    /** The AttrMode to descriptive name mapping */
-    private static final EnumMap<AttrMode, String> deferredTypeMapDescriptions;
-    static {
-        deferredTypeMapDescriptions = new EnumMap<>(AttrMode.class);
-        deferredTypeMapDescriptions.put(AttrMode.CHECK, "deferredTypeMap[CHECK]");
-        deferredTypeMapDescriptions.put(AttrMode.SPECULATIVE, "deferredTypeMap[SPECULATIVE]");
-    }
-
     /**
      * Map a list of types possibly containing one or more deferred types
      * into a list of ordinary types. Each deferred type D is mapped into a type T,
      * where T is computed by retrieving the type that has already been
      * computed for D during a previous deferred attribution round of the given kind.
      */
-    class DeferredTypeMap extends Type.Mapping {
+    class DeferredTypeMap extends TypeMapping<Void> {
         DeferredAttrContext deferredAttrContext;
 
         protected DeferredTypeMap(AttrMode mode, Symbol msym, MethodResolutionPhase phase) {
-            super(deferredTypeMapDescriptions.get(mode));
             this.deferredAttrContext = new DeferredAttrContext(mode, msym, phase,
                     infer.emptyContext, emptyDeferredAttrContext, types.noWarnings);
         }
 
         @Override
-        public Type apply(Type t) {
+        public Type visitType(Type t, Void _unused) {
             if (!t.hasTag(DEFERRED)) {
-                return t.map(this);
+                return super.visitType(t, null);
             } else {
                 DeferredType dt = (DeferredType)t;
                 return typeOf(dt);
@@ -928,7 +912,7 @@
                     return chk.checkNonVoid(pos, super.check(pos, found));
                 }
             });
-            return super.apply(dt);
+            return super.visit(dt);
         }
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Mar 26 15:47:59 2015 -0700
@@ -25,6 +25,7 @@
 
 package com.sun.tools.javac.comp;
 
+import com.sun.tools.javac.code.Type.TypeMapping;
 import com.sun.tools.javac.tree.JCTree;
 import com.sun.tools.javac.tree.JCTree.JCTypeCast;
 import com.sun.tools.javac.tree.TreeInfo;
@@ -477,7 +478,7 @@
                 restype = syms.objectType;
         }
 
-        List<Type> paramtypes = Type.map(argtypes, new ImplicitArgType(spMethod, resolveContext.step));
+        List<Type> paramtypes = argtypes.map(new ImplicitArgType(spMethod, resolveContext.step));
         List<Type> exType = spMethod != null ?
             spMethod.getThrownTypes() :
             List.of(syms.throwableType); // make it throw all exceptions
@@ -495,9 +496,16 @@
                 (rs.deferredAttr).super(AttrMode.SPECULATIVE, msym, phase);
             }
 
-            public Type apply(Type t) {
-                t = types.erasure(super.apply(t));
-                if (t.hasTag(BOT))
+            @Override
+            public Type visitClassType(ClassType t, Void aVoid) {
+                return types.erasure(t);
+            }
+
+            @Override
+            public Type visitType(Type t, Void _unused) {
+                if (t.hasTag(DEFERRED)) {
+                    return visit(super.visitType(t, null));
+                } else if (t.hasTag(BOT))
                     // nulls type as the marker type Null (which has no instances)
                     // infer as java.lang.Void for now
                     t = types.boxedClass(syms.voidType).type;
@@ -865,7 +873,8 @@
             @Override
             public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {
                 Infer infer = inferenceContext.infer();
-                List<Type> boundList = uv.getBounds(InferenceBound.UPPER);
+                List<Type> boundList = uv.getBounds(InferenceBound.UPPER).stream()
+                        .collect(infer.types.closureCollector(true, infer.types::isSameType));
                 List<Type> boundListTail = boundList.tail;
                 while (boundList.nonEmpty()) {
                     List<Type> tmpTail = boundListTail;
@@ -2046,23 +2055,19 @@
         List<FreeTypeListener> freetypeListeners = List.nil();
 
         public InferenceContext(List<Type> inferencevars) {
-            this.undetvars = Type.map(inferencevars, fromTypeVarFun);
+            this.undetvars = inferencevars.map(fromTypeVarFun);
             this.inferencevars = inferencevars;
         }
         //where
-            Mapping fromTypeVarFun = new Mapping("fromTypeVarFunWithBounds") {
-                // mapping that turns inference variables into undet vars
-                public Type apply(Type t) {
-                    if (t.hasTag(TYPEVAR)) {
-                        TypeVar tv = (TypeVar)t;
-                        if (tv.isCaptured()) {
-                            return new CapturedUndetVar((CapturedType)tv, types);
-                        } else {
-                            return new UndetVar(tv, types);
-                        }
-                    } else {
-                        return t.map(this);
-                    }
+            TypeMapping<Void> fromTypeVarFun = new TypeMapping<Void>() {
+                @Override
+                public Type visitTypeVar(TypeVar tv, Void aVoid) {
+                    return new UndetVar(tv, types);
+                }
+
+                @Override
+                public Type visitCapturedType(CapturedType t, Void aVoid) {
+                    return new CapturedUndetVar(t, types);
                 }
             };
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Mar 26 15:47:59 2015 -0700
@@ -241,8 +241,7 @@
             }
         }
         String key = success ? "verbose.resolve.multi" : "verbose.resolve.multi.1";
-        List<Type> argtypes2 = Type.map(argtypes,
-                    deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, bestSoFar, currentResolutionContext.step));
+        List<Type> argtypes2 = argtypes.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, bestSoFar, currentResolutionContext.step));
         JCDiagnostic main = diags.note(log.currentSource(), dpos, key, name,
                 site.tsym, mostSpecificPos, currentResolutionContext.step,
                 methodArguments(argtypes2),
@@ -2277,7 +2276,7 @@
                         (typeargtypes == null || !Type.isErroneous(typeargtypes));
         }
         public List<Type> getArgumentTypes(ResolveError errSym, Symbol accessedSym, Name name, List<Type> argtypes) {
-            return Type.map(argtypes, new ResolveDeferredRecoveryMap(AttrMode.SPECULATIVE, accessedSym, currentResolutionContext.step));
+            return argtypes.map(new ResolveDeferredRecoveryMap(AttrMode.SPECULATIVE, accessedSym, currentResolutionContext.step));
         }
     };
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Thu Mar 26 15:47:59 2015 -0700
@@ -57,6 +57,7 @@
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.Kind.*;
+import static com.sun.tools.javac.code.TypeTag.ARRAY;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
 import static com.sun.tools.javac.jvm.ClassFile.*;
@@ -2101,6 +2102,15 @@
         }
         if (saveParameterNames)
             setParameterNames(m, type);
+
+        if ((flags & VARARGS) != 0) {
+            final Type last = type.getParameterTypes().last();
+            if (last == null || !last.hasTag(ARRAY)) {
+                m.flags_field &= ~VARARGS;
+                throw badClassFile("malformed.vararg.method", m);
+            }
+        }
+
         return m;
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java	Thu Mar 26 15:47:59 2015 -0700
@@ -517,6 +517,14 @@
         if (doclintOpts.equals(Collections.singleton(DocLint.XMSGS_CUSTOM_PREFIX + "none")))
             return List.nil();
 
+        String checkPackages = options.get(Option.XDOCLINT_PACKAGE);
+
+        if (checkPackages != null) {
+            for (String s : checkPackages.split("\\s+")) {
+                doclintOpts.add(s.replace(Option.XDOCLINT_PACKAGE.text, DocLint.XCHECK_PACKAGE));
+            }
+        }
+
         // standard doclet normally generates H1, H2,
         // so for now, allow user comments to assume that
         doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java	Thu Mar 26 15:47:59 2015 -0700
@@ -129,6 +129,22 @@
         }
     },
 
+    XDOCLINT_PACKAGE("-Xdoclint/package:", "opt.Xdoclint.package.args", "opt.Xdoclint.package.desc", EXTENDED, BASIC) {
+        @Override
+        public boolean matches(String option) {
+            return DocLint.isValidOption(
+                    option.replace(XDOCLINT_PACKAGE.text, DocLint.XCHECK_PACKAGE));
+        }
+
+        @Override
+        public boolean process(OptionHelper helper, String option) {
+            String prev = helper.get(XDOCLINT_PACKAGE);
+            String next = (prev == null) ? option : (prev + " " + option);
+            helper.put(XDOCLINT_PACKAGE.text, next);
+            return false;
+        }
+    },
+
     // -nowarn is retained for command-line backward compatibility
     NOWARN("-nowarn", "opt.nowarn", STANDARD, BASIC) {
         @Override
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Thu Mar 26 15:47:59 2015 -0700
@@ -70,6 +70,7 @@
 import com.sun.tools.javac.util.JavacMessages;
 import com.sun.tools.javac.util.List;
 import com.sun.tools.javac.util.Log;
+import com.sun.tools.javac.util.MatchingUtils;
 import com.sun.tools.javac.util.Name;
 import com.sun.tools.javac.util.Names;
 import com.sun.tools.javac.util.Options;
@@ -1431,7 +1432,6 @@
         return specifiedPackages;
     }
 
-    private static final Pattern allMatches = Pattern.compile(".*");
     public static final Pattern noMatches  = Pattern.compile("(\\P{all})+");
 
     /**
@@ -1440,8 +1440,8 @@
      * import-style string, return a regex that won't match anything.
      */
     private static Pattern importStringToPattern(String s, Processor p, Log log) {
-        if (isValidImportString(s)) {
-            return validImportStringToPattern(s);
+        if (MatchingUtils.isValidImportString(s)) {
+            return MatchingUtils.validImportStringToPattern(s);
         } else {
             log.warning("proc.malformed.supported.string", s, p.getClass().getName());
             return noMatches; // won't match any valid identifier
@@ -1449,54 +1449,6 @@
     }
 
     /**
-     * Return true if the argument string is a valid import-style
-     * string specifying claimed annotations; return false otherwise.
-     */
-    public static boolean isValidImportString(String s) {
-        if (s.equals("*"))
-            return true;
-
-        boolean valid = true;
-        String t = s;
-        int index = t.indexOf('*');
-
-        if (index != -1) {
-            // '*' must be last character...
-            if (index == t.length() -1) {
-                // ... any and preceding character must be '.'
-                if ( index-1 >= 0 ) {
-                    valid = t.charAt(index-1) == '.';
-                    // Strip off ".*$" for identifier checks
-                    t = t.substring(0, t.length()-2);
-                }
-            } else
-                return false;
-        }
-
-        // Verify string is off the form (javaId \.)+ or javaId
-        if (valid) {
-            String[] javaIds = t.split("\\.", t.length()+2);
-            for(String javaId: javaIds)
-                valid &= SourceVersion.isIdentifier(javaId);
-        }
-        return valid;
-    }
-
-    public static Pattern validImportStringToPattern(String s) {
-        if (s.equals("*")) {
-            return allMatches;
-        } else {
-            String s_prime = s.replace(".", "\\.");
-
-            if (s_prime.endsWith("*")) {
-                s_prime =  s_prime.substring(0, s_prime.length() - 1) + ".+";
-            }
-
-            return Pattern.compile(s_prime);
-        }
-    }
-
-    /**
      * For internal use only.  This method may be removed without warning.
      */
     public Context getContext() {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Mar 26 15:47:59 2015 -0700
@@ -1849,6 +1849,9 @@
 compiler.misc.undecl.type.var=\
     undeclared type variable: {0}
 
+compiler.misc.malformed.vararg.method=\
+    class file contains malformed variable arity method: {0}
+
 compiler.misc.wrong.version=\
     class file has wrong version {0}.{1}, should be {2}.{3}
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties	Thu Mar 26 15:47:59 2015 -0700
@@ -228,6 +228,17 @@
 \        Enable or disable specific checks for problems in javadoc comments,\n\
 \        where <group> is one of accessibility, html, missing, reference, or syntax,\n\
 \        and <access> is one of public, protected, package, or private.
+
+javac.opt.Xdoclint.package.args = \
+    ([-]<packages>)
+
+javac.opt.Xdoclint.package.desc=\n\
+\        Enable or disable checks in specific packages. <packages> is a comma separated\n\
+\        list of package specifiers. Package specifier is either a qualified name of a package\n\
+\        or a package name prefix followed by '.*', which expands to all sub-packages of\n\
+\        the given package. Prefix the package specifier with '-' to disable checks for\n\
+\        the specified packages.
+
 javac.opt.Xstdout=\
     Redirect standard output
 javac.opt.X=\
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/List.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/List.java	Thu Mar 26 15:47:59 2015 -0700
@@ -33,6 +33,7 @@
 import java.util.AbstractCollection;
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
+import java.util.function.Function;
 import java.util.stream.Collector;
 
 /** A class for generic linked lists. Links are supposed to be
@@ -417,6 +418,17 @@
     }
 
     @SuppressWarnings("unchecked")
+    public <Z> List<Z> map(Function<A, Z> mapper) {
+        if (nonEmpty()) {
+            List<Z> tail1 = tail.map(mapper);
+            Z head1 = mapper.apply(head);
+            if (tail1 != tail || head1 != head)
+                return tail1.prepend(head1);
+        }
+        return (List<Z>)this;
+    }
+
+    @SuppressWarnings("unchecked")
     public static <T> List<T> convert(Class<T> klass, List<?> list) {
         if (list == null)
             return null;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/MatchingUtils.java	Thu Mar 26 15:47:59 2015 -0700
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.javac.util;
+
+import java.util.regex.Pattern;
+import javax.lang.model.SourceVersion;
+
+/**Utilities to convert an import-like string to a regexp.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public class MatchingUtils {
+    private static final Pattern allMatches = Pattern.compile(".*");
+
+    /**
+     * Return true if the argument string is a valid import-style
+     * string specifying claimed annotations; return false otherwise.
+     */
+    public static boolean isValidImportString(String s) {
+        if (s.equals("*"))
+            return true;
+
+        boolean valid = true;
+        String t = s;
+        int index = t.indexOf('*');
+
+        if (index != -1) {
+            // '*' must be last character...
+            if (index == t.length() -1) {
+                // ... any and preceding character must be '.'
+                if ( index-1 >= 0 ) {
+                    valid = t.charAt(index-1) == '.';
+                    // Strip off ".*$" for identifier checks
+                    t = t.substring(0, t.length()-2);
+                }
+            } else
+                return false;
+        }
+
+        // Verify string is off the form (javaId \.)+ or javaId
+        if (valid) {
+            String[] javaIds = t.split("\\.", t.length()+2);
+            for(String javaId: javaIds)
+                valid &= SourceVersion.isIdentifier(javaId);
+        }
+        return valid;
+    }
+
+    public static Pattern validImportStringToPattern(String s) {
+        if (s.equals("*")) {
+            return allMatches;
+        } else {
+            String s_prime = s.replace(".", "\\.");
+
+            if (s_prime.endsWith("*")) {
+                s_prime =  s_prime.substring(0, s_prime.length() - 1) + ".+";
+            }
+
+            return Pattern.compile(s_prime);
+        }
+    }
+
+}
--- a/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -36,6 +36,7 @@
 import java.util.HashSet;
 
 import com.sun.tools.sjavac.Transformer;
+import com.sun.tools.sjavac.Util;
 
 /**
  * Instances of this class represent values for sjavac command line options.
@@ -358,21 +359,25 @@
 
         @Override
         public void exclude(String exclPattern) {
+            exclPattern = Util.normalizeDriveLetter(exclPattern);
             excludes.add(exclPattern);
         }
 
         @Override
         public void include(String inclPattern) {
+            inclPattern = Util.normalizeDriveLetter(inclPattern);
             includes.add(inclPattern);
         }
 
         @Override
         public void excludeFile(String exclFilePattern) {
+            exclFilePattern = Util.normalizeDriveLetter(exclFilePattern);
             excludeFiles.add(exclFilePattern);
         }
 
         @Override
         public void includeFile(String inclFilePattern) {
+            inclFilePattern = Util.normalizeDriveLetter(inclFilePattern);
             includeFiles.add(inclFilePattern);
         }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -55,8 +55,6 @@
      */
     int noOfPackages;
 
-    private final String SCROLL_YES = "yes";
-
     /**
      * Constructor to construct FrameOutputWriter object.
      *
@@ -96,90 +94,73 @@
      * as well as warning if browser is not supporting the Html frames.
      */
     protected void generateFrameFile() throws IOException {
-        Content frameset = getFrameDetails();
+        Content frame = getFrameDetails();
+        HtmlTree body = new HtmlTree(HtmlTag.BODY);
+        body.addContent(frame);
         if (configuration.windowtitle.length() > 0) {
-            printFramesetDocument(configuration.windowtitle, configuration.notimestamp,
-                    frameset);
+            printFramesDocument(configuration.windowtitle, configuration,
+                    body);
         } else {
-            printFramesetDocument(configuration.getText("doclet.Generated_Docs_Untitled"),
-                    configuration.notimestamp, frameset);
+            printFramesDocument(configuration.getText("doclet.Generated_Docs_Untitled"),
+                    configuration, body);
         }
     }
 
     /**
-     * Add the code for issueing the warning for a non-frame capable web
-     * client. Also provide links to the non-frame version documentation.
-     *
-     * @param contentTree the content tree to which the non-frames information will be added
-     */
-    protected void addFrameWarning(Content contentTree) {
-        Content noframes = new HtmlTree(HtmlTag.NOFRAMES);
-        Content noScript = HtmlTree.NOSCRIPT(
-                HtmlTree.DIV(getResource("doclet.No_Script_Message")));
-        noframes.addContent(noScript);
-        Content noframesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
-                getResource("doclet.Frame_Alert"));
-        noframes.addContent(noframesHead);
-        Content p = HtmlTree.P(getResource("doclet.Frame_Warning_Message",
-                getHyperLink(configuration.topFile,
-                configuration.getText("doclet.Non_Frame_Version"))));
-        noframes.addContent(p);
-        contentTree.addContent(noframes);
-    }
-
-    /**
      * Get the frame sizes and their contents.
      *
      * @return a content tree for the frame details
      */
     protected Content getFrameDetails() {
-        HtmlTree frameset = HtmlTree.FRAMESET("20%,80%", null, "Documentation frame",
-                "top.loadFrames()");
+        HtmlTree leftContainerDiv = new HtmlTree(HtmlTag.DIV);
+        HtmlTree rightContainerDiv = new HtmlTree(HtmlTag.DIV);
+        leftContainerDiv.addStyle(HtmlStyle.leftContainer);
+        rightContainerDiv.addStyle(HtmlStyle.rightContainer);
         if (noOfPackages <= 1) {
-            addAllClassesFrameTag(frameset);
+            addAllClassesFrameTag(leftContainerDiv);
         } else if (noOfPackages > 1) {
-            HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames",
-                "top.loadFrames()");
-            addAllPackagesFrameTag(leftFrameset);
-            addAllClassesFrameTag(leftFrameset);
-            frameset.addContent(leftFrameset);
+            addAllPackagesFrameTag(leftContainerDiv);
+            addAllClassesFrameTag(leftContainerDiv);
         }
-        addClassFrameTag(frameset);
-        addFrameWarning(frameset);
-        return frameset;
+        addClassFrameTag(rightContainerDiv);
+        HtmlTree mainContainer = HtmlTree.DIV(HtmlStyle.mainContainer, leftContainerDiv);
+        mainContainer.addContent(rightContainerDiv);
+        return mainContainer;
     }
 
     /**
-     * Add the FRAME tag for the frame that lists all packages.
+     * Add the IFRAME tag for the frame that lists all packages.
      *
      * @param contentTree the content tree to which the information will be added
      */
     private void addAllPackagesFrameTag(Content contentTree) {
-        HtmlTree frame = HtmlTree.FRAME(DocPaths.OVERVIEW_FRAME.getPath(),
+        HtmlTree frame = HtmlTree.IFRAME(DocPaths.OVERVIEW_FRAME.getPath(),
                 "packageListFrame", configuration.getText("doclet.All_Packages"));
-        contentTree.addContent(frame);
+        HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame);
+        contentTree.addContent(leftTop);
     }
 
     /**
-     * Add the FRAME tag for the frame that lists all classes.
+     * Add the IFRAME tag for the frame that lists all classes.
      *
      * @param contentTree the content tree to which the information will be added
      */
     private void addAllClassesFrameTag(Content contentTree) {
-        HtmlTree frame = HtmlTree.FRAME(DocPaths.ALLCLASSES_FRAME.getPath(),
+        HtmlTree frame = HtmlTree.IFRAME(DocPaths.ALLCLASSES_FRAME.getPath(),
                 "packageFrame", configuration.getText("doclet.All_classes_and_interfaces"));
-        contentTree.addContent(frame);
+        HtmlTree leftBottom = HtmlTree.DIV(HtmlStyle.leftBottom, frame);
+        contentTree.addContent(leftBottom);
     }
 
     /**
-     * Add the FRAME tag for the frame that describes the class in detail.
+     * Add the IFRAME tag for the frame that describes the class in detail.
      *
      * @param contentTree the content tree to which the information will be added
      */
     private void addClassFrameTag(Content contentTree) {
-        HtmlTree frame = HtmlTree.FRAME(configuration.topFile.getPath(), "classFrame",
-                configuration.getText("doclet.Package_class_and_interface_descriptions"),
-                SCROLL_YES);
+        HtmlTree frame = HtmlTree.IFRAME(configuration.topFile.getPath(), "classFrame",
+                configuration.getText("doclet.Package_class_and_interface_descriptions"));
+        frame.addStyle(HtmlStyle.rightIframe);
         contentTree.addContent(frame);
     }
 }
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -48,9 +48,6 @@
     public static final DocType TRANSITIONAL =
             new DocType("Transitional", "http://www.w3.org/TR/html4/loose.dtd");
 
-    public static final DocType FRAMESET =
-            new DocType("Frameset", "http://www.w3.org/TR/html4/frameset.dtd");
-
     /**
      * Constructor to construct a DocType object.
      *
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -35,6 +35,7 @@
 import com.sun.tools.doclets.internal.toolkit.util.DocFile;
 import com.sun.tools.doclets.internal.toolkit.util.DocLink;
 import com.sun.tools.doclets.internal.toolkit.util.DocPath;
+import com.sun.tools.doclets.internal.toolkit.util.DocPaths;
 
 
 /**
@@ -56,6 +57,8 @@
 
     public static final String CONTENT_TYPE = "text/html";
 
+    DocPath pathToRoot;
+
     /**
      * Constructor. Initializes the destination file name through the super
      * class HtmlWriter.
@@ -65,6 +68,7 @@
     public HtmlDocWriter(Configuration configuration, DocPath filename)
             throws IOException {
         super(configuration, filename);
+        this.pathToRoot = filename.parent().invert();
         configuration.message.notice("doclet.Generating_0",
             DocFile.createFileForOutput(configuration, filename).getPath());
     }
@@ -298,33 +302,54 @@
     }
 
     /**
-     * Print the frameset version of the Html file header.
-     * Called only when generating an HTML frameset file.
+     * Print the frames version of the Html file header.
+     * Called only when generating an HTML frames file.
      *
      * @param title Title of this HTML document
-     * @param noTimeStamp If true, don't print time stamp in header
-     * @param frameset the frameset to be added to the HTML document
+     * @param configuration the configuration object
+     * @param frame the frame content tree to be added to the HTML document
      */
-    public void printFramesetDocument(String title, boolean noTimeStamp,
-            Content frameset) throws IOException {
-        Content htmlDocType = DocType.FRAMESET;
+    public void printFramesDocument(String title, ConfigurationImpl configuration,
+            HtmlTree body) throws IOException {
+        Content htmlDocType = DocType.TRANSITIONAL;
         Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
         Content head = new HtmlTree(HtmlTag.HEAD);
-        head.addContent(getGeneratedBy(!noTimeStamp));
+        head.addContent(getGeneratedBy(!configuration.notimestamp));
         Content windowTitle = HtmlTree.TITLE(new StringContent(title));
         head.addContent(windowTitle);
         Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE,
                 (configuration.charset.length() > 0) ?
                         configuration.charset : HtmlConstants.HTML_DEFAULT_CHARSET);
         head.addContent(meta);
-        head.addContent(getFramesetJavaScript());
+        head.addContent(getStyleSheetProperties(configuration));
+        head.addContent(getFramesJavaScript());
         Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
-                head, frameset);
+                head, body);
         Content htmlDocument = new HtmlDocument(htmlDocType,
                 htmlComment, htmlTree);
         write(htmlDocument);
     }
 
+    /**
+     * Returns a link to the stylesheet file.
+     *
+     * @return an HtmlTree for the lINK tag which provides the stylesheet location
+     */
+    public HtmlTree getStyleSheetProperties(ConfigurationImpl configuration) {
+        String stylesheetfile = configuration.stylesheetfile;
+        DocPath stylesheet;
+        if (stylesheetfile.isEmpty()) {
+            stylesheet = DocPaths.STYLESHEET;
+        } else {
+            DocFile file = DocFile.createFileForInput(configuration, stylesheetfile);
+            stylesheet = DocPath.create(file.getName());
+        }
+        HtmlTree link = HtmlTree.LINK("stylesheet", "text/css",
+                pathToRoot.resolve(stylesheet).getPath(),
+                "Style");
+        return link;
+    }
+
     protected Comment getGeneratedBy(boolean timestamp) {
         String text = "Generated by javadoc"; // marker string, deliberately not localized
         if (timestamp) {
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -67,7 +67,11 @@
     indexHeader,
     inheritance,
     interfaceName,
+    leftContainer,
+    leftTop,
+    leftBottom,
     legalCopy,
+    mainContainer,
     memberNameLabel,
     memberNameLink,
     memberSummary,
@@ -79,6 +83,8 @@
     packageHierarchyLabel,
     paramLabel,
     returnLabel,
+    rightContainer,
+    rightIframe,
     rowColor,
     seeLabel,
     serializedFormContainer,
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -52,8 +52,6 @@
     DT,
     EM(BlockType.INLINE, EndTag.END),
     FONT(BlockType.INLINE, EndTag.END),
-    FRAME(BlockType.OTHER, EndTag.NOEND),
-    FRAMESET(BlockType.OTHER, EndTag.END),
     H1,
     H2,
     H3,
@@ -64,6 +62,7 @@
     HR(BlockType.BLOCK, EndTag.NOEND),
     HTML(BlockType.OTHER, EndTag.END),
     I(BlockType.INLINE, EndTag.END),
+    IFRAME(BlockType.OTHER, EndTag.END),
     IMG(BlockType.INLINE, EndTag.NOEND),
     LI,
     LISTING,
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -326,53 +326,18 @@
     }
 
     /**
-     * Generates a FRAME tag.
+     * Generates a IFRAME tag.
      *
      * @param src the url of the document to be shown in the frame
      * @param name specifies the name of the frame
      * @param title the title for the frame
-     * @param scrolling specifies whether to display scrollbars in the frame
-     * @return an HtmlTree object for the FRAME tag
+     * @return an HtmlTree object for the IFRAME tag
      */
-    public static HtmlTree FRAME(String src, String name, String title, String scrolling) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.FRAME);
+    public static HtmlTree IFRAME(String src, String name, String title) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.IFRAME);
         htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
         htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
         htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title));
-        if (scrolling != null)
-            htmltree.addAttr(HtmlAttr.SCROLLING, scrolling);
-        return htmltree;
-    }
-
-    /**
-     * Generates a Frame tag.
-     *
-     * @param src the url of the document to be shown in the frame
-     * @param name specifies the name of the frame
-     * @param title the title for the frame
-     * @return an HtmlTree object for the SPAN tag
-     */
-    public static HtmlTree FRAME(String src, String name, String title) {
-        return FRAME(src, name, title, null);
-    }
-
-    /**
-     * Generates a FRAMESET tag.
-     *
-     * @param cols the size of columns in the frameset
-     * @param rows the size of rows in the frameset
-     * @param title the title for the frameset
-     * @param onload the script to run when the document loads
-     * @return an HtmlTree object for the FRAMESET tag
-     */
-    public static HtmlTree FRAMESET(String cols, String rows, String title, String onload) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.FRAMESET);
-        if (cols != null)
-            htmltree.addAttr(HtmlAttr.COLS, cols);
-        if (rows != null)
-            htmltree.addAttr(HtmlAttr.ROWS, rows);
-        htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title));
-        htmltree.addAttr(HtmlAttr.ONLOAD, nullCheck(onload));
         return htmltree;
     }
 
@@ -779,7 +744,7 @@
                 return (hasAttr(HtmlAttr.NAME) || (hasAttr(HtmlAttr.HREF) && hasContent()));
             case BR :
                 return (!hasContent() && (!hasAttrs() || hasAttr(HtmlAttr.CLEAR)));
-            case FRAME :
+            case IFRAME :
                 return (hasAttr(HtmlAttr.SRC) && !hasContent());
             case HR :
                 return (!hasContent());
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -376,7 +376,7 @@
      *
      * @return a content for the SCRIPT tag
      */
-    protected Content getFramesetJavaScript() {
+    protected Content getFramesJavaScript() {
         HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
         script.addAttr(HtmlAttr.TYPE, "text/javascript");
         String scriptCode = DocletConstants.NL +
@@ -425,10 +425,6 @@
                 "            }" + DocletConstants.NL +
                 "        }" + DocletConstants.NL +
                 "        return true;" + DocletConstants.NL +
-                "    }" + DocletConstants.NL +
-                "    function loadFrames() {" + DocletConstants.NL +
-                "        if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
-                "             top.classFrame.location = top.targetPage;" + DocletConstants.NL +
                 "    }" + DocletConstants.NL;
         RawHtml scriptContent = new RawHtml(scriptCode);
         script.addContent(scriptContent);
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Thu Mar 26 15:47:59 2015 -0700
@@ -104,10 +104,7 @@
 doclet.Package_Hierarchies=Package Hierarchies:
 doclet.Hierarchy_For_Package=Hierarchy For Package {0}
 doclet.Hierarchy_For_All_Packages=Hierarchy For All Packages
-doclet.Frame_Alert=Frame Alert
-doclet.Frame_Warning_Message=This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to {0}.
 doclet.No_Script_Message=JavaScript is disabled on your browser.
-doclet.Non_Frame_Version=Non-frame version
 doclet.Description_From_Interface=Description copied from interface:
 doclet.Description_From_Class=Description copied from class:
 doclet.No_Non_Deprecated_Classes_To_Document=No non-deprecated classes found to document.
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Thu Mar 26 15:47:59 2015 -0700
@@ -11,6 +11,17 @@
     font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;
     font-size:14px;
     margin:0;
+    padding:0;
+    height:100%;
+    width:100%;
+}
+iframe {
+    margin:0;
+    padding:0;
+    height:100%;
+    width:100%;
+    overflow-y:scroll;
+    border:none;
 }
 a:link, a:visited {
     text-decoration:none;
@@ -463,7 +474,6 @@
 .useSummary td, .constantsSummary td, .deprecatedSummary td {
     text-align:left;
     padding:0px 0px 12px 10px;
-    width:100%;
 }
 th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th,
 td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{
@@ -488,6 +498,7 @@
     font-size:13px;
 }
 .overviewSummary td.colFirst, .overviewSummary th.colFirst,
+.useSummary td.colFirst, .useSummary th.colFirst,
 .overviewSummary td.colOne, .overviewSummary th.colOne,
 .memberSummary td.colFirst, .memberSummary th.colFirst,
 .memberSummary td.colOne, .memberSummary th.colOne,
@@ -569,6 +580,61 @@
     font-style:normal;
 }
 
-div.contentContainer ul.blockList li.blockList h2{
+div.contentContainer ul.blockList li.blockList h2 {
     padding-bottom:0px;
 }
+/*
+IFRAME specific styles
+*/
+.mainContainer {
+    margin:0 auto; 
+    padding:0; 
+    height:100%; 
+    width:100%; 
+    position:fixed; 
+    top:0; 
+    left:0;
+}
+.leftContainer {
+    height:100%;
+    position:fixed;
+    width:320px;
+}
+.leftTop {
+    position:relative;
+    float:left;
+    width:315px;
+    top:0;
+    left:0;
+    height:30%;
+    border-right:6px solid #ccc;
+    border-bottom:6px solid #ccc;
+}
+.leftBottom {
+    position:relative;
+    float:left;
+    width:315px;
+    bottom:0;
+    left:0;
+    height:70%;
+    border-right:6px solid #ccc;
+    border-top:1px solid #000;
+}
+.rightContainer {
+    position:absolute;
+    left:320px;
+    top:0;
+    bottom:0;
+    height:100%;
+    right:0;
+    border-left:1px solid #000;
+}
+.rightIframe {
+    margin:0;
+    padding:0;
+    height:100%;
+    right:30px;
+    width:100%;
+    overflow:visible;
+    margin-bottom:30px;
+}
--- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/DocEnv.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/DocEnv.java	Thu Mar 26 15:47:59 2015 -0700
@@ -833,7 +833,7 @@
         for (String customTag : customTagNames) {
             customTags.append(sep);
             customTags.append(customTag);
-            sep = DocLint.TAGS_SEPARATOR;
+            sep = DocLint.SEPARATOR;
         }
         doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
 
--- a/test/com/sun/javadoc/ValidHtml/ValidHtml.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/test/com/sun/javadoc/ValidHtml/ValidHtml.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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,11 +23,10 @@
 
 /*
  * @test
- * @bug 4275630 4749453 4625400 4753048 4415270
- * @summary  Generated HTML is invalid with frameset DTD.
+ * @bug 4275630 4749453 4625400 4753048 4415270 8074521
+ * @summary  Generated HTML is invalid with frames.
  *           Displays unnecessary horizontal scroll bars.
  *           Missing whitespace in DOCTYPE declaration
- *           <NOFRAMES> not allowed outside <FRAMESET> element
  *           HTML table tags inserted in wrong place in pakcage use page
  * @author dkramer
  * @library ../lib
@@ -55,7 +54,7 @@
         checkExit(Exit.OK);
 
         // Test the proper DOCTYPE element are present:
-        checkOutput("index.html",              true, FRAMESET);
+        checkOutput("index.html",              true, LOOSE);
         checkOutput("overview-summary.html",   true, LOOSE);
         checkOutput("p1/package-summary.html", true, LOOSE);
         checkOutput("p1/C.html",               true, LOOSE);
@@ -63,10 +62,9 @@
         checkOutput("allclasses-frame.html",   true, LOOSE);
         checkOutput("p1/package-frame.html",   true, LOOSE);
 
-        // Test that <NOFRAMES> is inside <FRAMESET> element:
+        // Test for IFRAME element:
         checkOutput("index.html", true,
-                "</noframes>\n"
-                + "</frameset>");
+                "<iframe");
 
         // Test the table elements are in the correct order:
         checkOutput("p1/package-use.html", true,
@@ -74,8 +72,6 @@
                 + "</tr>");
     }
 
-    private static final String FRAMESET =
-            "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">";
     private static final String LOOSE =
             "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
 }
--- a/test/com/sun/javadoc/testIndex/TestIndex.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/test/com/sun/javadoc/testIndex/TestIndex.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -47,10 +47,9 @@
                 "pkg", testSrc("NoPackage.java"));
         checkExit(Exit.OK);
 
-        //Make sure the horizontal scroll bar does not appear in class frame.
         checkOutput("index.html", true,
-                "<frame src=\"overview-summary.html\" name=\"classFrame\" title=\""
-                + "Package, class and interface descriptions\" scrolling=\"yes\">");
+                "<iframe src=\"overview-summary.html\" name=\"classFrame\" title=\""
+                + "Package, class and interface descriptions\" class=\"rightIframe\">");
 
         //Test index-all.html
         checkOutput("index-all.html", true,
--- a/test/com/sun/javadoc/testJavascript/TestJavascript.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/test/com/sun/javadoc/testJavascript/TestJavascript.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, 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
@@ -99,10 +99,6 @@
                 + "        }\n"
                 + "        return true;\n"
                 + "    }\n"
-                + "    function loadFrames() {\n"
-                + "        if (targetPage != \"\" && targetPage != \"undefined\")\n"
-                + "             top.classFrame.location = top.targetPage;\n"
-                + "    }\n"
                 + "</script>");
 
         //Make sure title javascript only runs if is-external is not true
--- a/test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java	Thu Mar 26 15:21:23 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2011, 2014, 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 7001086
- * @summary Test Non-frame warning.
- * @author Bhavesh Patel
- * @library ../lib
- * @build JavadocTester
- * @run main TestNonFrameWarning
- */
-
-public class TestNonFrameWarning extends JavadocTester {
-
-    public static void main(String... args) throws Exception {
-        TestNonFrameWarning tester = new TestNonFrameWarning();
-        tester.runTests();
-    }
-
-    @Test
-    void test() {
-        javadoc("-d", "out",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("index.html", true,
-                "<p>This document is designed to be viewed using the frames feature. "
-                + "If you see this message, you are using a non-frame-capable web client. "
-                + "Link to <a href=\"pkg/package-summary.html\">Non-frame version</a>.</p>");
-    }
-}
--- a/test/com/sun/javadoc/testNonFrameWarning/pkg/C.java	Thu Mar 26 15:21:23 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package pkg;
-
-/**
- * Source file for C
- */
-public class C {
-}
--- a/test/com/sun/javadoc/testProfiles/TestProfiles.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/test/com/sun/javadoc/testProfiles/TestProfiles.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -112,7 +112,7 @@
                 "<div class=\"subTitle\">compact1, compact2, compact3</div>");
 
         checkOutput("index.html", true,
-                "<frame src=\"overview-frame.html\" name=\"packageListFrame\" "
+                "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" "
                 + "title=\"All Packages\">");
 
         // Test for "overview-summary.html" showing the profile list.
--- a/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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 8007338 8023608 8008164 8016549
+ * @bug      4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461
  * @summary  Run tests on doclet stylesheet.
  * @author   jamieh
  * @library  ../lib
@@ -64,6 +64,17 @@
                 + "    font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;\n"
                 + "    font-size:14px;\n"
                 + "    margin:0;\n"
+                + "    padding:0;\n"
+                + "    height:100%;\n"
+                + "    width:100%;\n"
+                + "}",
+                "iframe {\n"
+                + "    margin:0;\n"
+                + "    padding:0;\n"
+                + "    height:100%;\n"
+                + "    width:100%;\n"
+                + "    overflow-y:scroll;\n"
+                + "    border:none;\n"
                 + "}",
                 "ul {\n"
                 + "    list-style-type:disc;\n"
@@ -118,6 +129,21 @@
                 + "    background-color:#4D7A97;\n"
                 + "    height:16px;\n"
                 + "}",
+                // Test the formatting styles for proper content display in use and constant values pages.
+                ".overviewSummary td.colFirst, .overviewSummary th.colFirst,\n"
+                + ".useSummary td.colFirst, .useSummary th.colFirst,\n"
+                + ".overviewSummary td.colOne, .overviewSummary th.colOne,\n"
+                + ".memberSummary td.colFirst, .memberSummary th.colFirst,\n"
+                + ".memberSummary td.colOne, .memberSummary th.colOne,\n"
+                + ".typeSummary td.colFirst{\n"
+                + "    width:25%;\n"
+                + "    vertical-align:top;\n"
+                + "}",
+                ".overviewSummary td, .memberSummary td, .typeSummary td,\n"
+                + ".useSummary td, .constantsSummary td, .deprecatedSummary td {\n"
+                + "    text-align:left;\n"
+                + "    padding:0px 0px 12px 10px;\n"
+                + "}",
                 ".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {\n"
                 + "    padding-top:0px;\n"
                 + "    padding-left:0px;\n"
@@ -134,6 +160,9 @@
                 "<link rel=\"stylesheet\" type=\"text/css\" "
                 + "href=\"../stylesheet.css\" title=\"Style\">");
 
+        checkOutput("index.html", true,
+                "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">");
+
         checkOutput("stylesheet.css", false,
                 "* {\n"
                 + "    margin:0;\n"
--- a/test/tools/doclint/tool/HelpTest.out	Thu Mar 26 15:21:23 2015 -0700
+++ b/test/tools/doclint/tool/HelpTest.out	Thu Mar 26 15:47:59 2015 -0700
@@ -30,6 +30,13 @@
     equivalent to -Xmsgs:all/protected, meaning that
     all messages are reported for protected and public
     declarations only. 
+  -XcheckPackage:<packages>
+    Enable or disable checks in specific packages.
+    <packages> is a comma separated list of package specifiers.
+    Package specifier is either a qualified name of a package
+    or a package name prefix followed by '.*', which expands to
+    all sub-packages of the given package. Prefix the package specifier
+    with '-' to disable checks for the specified packages.
   -stats
     Report statistics on the reported issues.
   -h -help --help -usage -?
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T8071847/T8071847.java	Thu Mar 26 15:47:59 2015 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2015, 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 8071847
+ * @summary Verify proper termination when instance initialization method uses invalid flags
+ * @compile  T8071847.java
+ * @run main T8071847
+*/
+
+
+import java.io.*;
+import java.util.*;
+
+public class T8071847 {
+    String testclass="invalidFlags.class";
+    String testclassHexString =
+    "CAFEBABE00000031000D0A0003000A07000B07000C0100063C696E69743E0100" +
+    "03282956010004436F646501000F4C696E654E756D6265725461626C6501000A" +
+    "536F7572636546696C65010009546573742E6A6176610C0004000501000C696E" +
+    "76616C6964466C6167730100106A6176612F6C616E672F4F626A656374002000" +
+    "02000300000000000100A000040005000100060000001D00010001000000052A" +
+    "B70001B10000000100070000000600010000000100010008000000020009";
+
+    String testJavaFile = "testInvalidFlags.java";
+    String testJavaSource ="public class testInvalidFlags extends invalidFlags {" +
+        "invalidFlags c = null;" +
+        "public testInvalidFlags() {  c = new invalidFlags(); }" +
+        "public static void main(String... args) { " +
+        "new testInvalidFlags();}}";
+
+    public static void main(String[] args) throws Exception {
+        new  T8071847().run();
+    }
+
+    public void run() throws IOException {
+        writeHexFile(testclass,testclassHexString);
+        writeTestFile(testJavaFile, testJavaSource);
+        javac(testJavaFile);
+    }
+
+    File writeTestFile(String fname, String source) throws IOException {
+        File f = new File(fname);
+        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f)));
+        out.println(source);
+        out.close();
+        return f;
+    }
+
+    byte[] hexToByte(String str) {
+        char[] CA = str.toCharArray();
+        byte[] byteArry = new byte[str.length()/2];
+        int bi = 0;
+        for (int i = 0; i<CA.length ; i+=2) {
+            char c1 = CA[i], c2=CA[i+1];
+            byteArry[bi++] = (byte)((Character.digit((int)c1,16)<<4) +
+                             Character.digit((int)c2,16));
+        }
+        return byteArry;
+    }
+
+    File writeHexFile(String classFileName, String hexString) throws IOException {
+        File f = new File(classFileName);
+        FileOutputStream output  = new FileOutputStream(f);
+        output.write(hexToByte(hexString));
+        output.close();
+        return f;
+    }
+
+    String javac(String className) {
+        StringWriter sw = new StringWriter();
+        PrintWriter out = new PrintWriter(sw);
+        int rc = 0;
+        List<String> javacArgs = new ArrayList<>();
+        javacArgs.addAll(Arrays.asList("-XDrawDiagnostics", "-cp", ".", "-d", ".", className));
+        rc = com.sun.tools.javac.Main.compile(
+            javacArgs.toArray(new String[javacArgs.size()]),out);
+        out.close();
+        if (rc > 1) {
+            System.out.println(sw.toString());
+            throw new Error("javac " + className + " failed. rc=" + rc);
+        }
+        if (rc != 1 || !sw.toString().contains("compiler.misc.malformed.vararg.method"))
+            throw new RuntimeException("Unexpected output" + sw.toString());
+        return sw.toString();
+    }
+}
--- a/test/tools/javac/diags/examples.not-yet.txt	Thu Mar 26 15:21:23 2015 -0700
+++ b/test/tools/javac/diags/examples.not-yet.txt	Thu Mar 26 15:47:59 2015 -0700
@@ -87,6 +87,7 @@
 compiler.misc.unable.to.access.file                     # ClassFile
 compiler.misc.undecl.type.var                           # ClassReader
 compiler.misc.unicode.str.not.supported                 # ClassReader
+compiler.misc.malformed.vararg.method                   # ClassReader
 compiler.misc.verbose.retro                             # UNUSED
 compiler.misc.verbose.retro.with                        # UNUSED
 compiler.misc.verbose.retro.with.list                   # UNUSED
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/doclint/IncludePackagesTest.java	Thu Mar 26 15:47:59 2015 -0700
@@ -0,0 +1,248 @@
+/*
+ * Copyright (c) 2015, 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 8071851
+ * @summary Test the -Xdoclint/package option
+ */
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.tools.Diagnostic;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+import static javax.tools.Diagnostic.Kind.*;
+
+import com.sun.source.util.JavacTask;
+import com.sun.tools.javac.main.Main;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class IncludePackagesTest {
+    public static void main(String... args) throws Exception {
+        new IncludePackagesTest().run();
+    }
+
+    JavaCompiler javac;
+    StandardJavaFileManager fm;
+    List<JavaFileObject> files;
+
+    final String[] sources = new String[] {
+        "p1/p1T.java",
+        "package p1;\n" +
+        "/** Syntax < error. */\n" +
+        "public class p1T {\n" +
+        "}\n",
+        "p1/sp1/p1sp1T.java",
+        "package p1.sp1;\n" +
+        "/** Syntax < error. */\n" +
+        "public class p1sp1T {\n" +
+        "}\n",
+        "p1/sp1/sp2/p1sp1sp2T.java",
+        "package p1.sp1.sp2;\n" +
+        "/** Syntax < error. */\n" +
+        "public class p1sp1sp2T {\n" +
+        "}\n",
+        "p2/p2T.java",
+        "package p2;\n" +
+        "/** Syntax < error. */\n" +
+        "public class p2T {\n" +
+        "}\n",
+        "Default.java",
+        "/** Syntax < error. */\n" +
+        "public class Default {\n" +
+        "}\n",
+    };
+
+    final String rawDiags = "-XDrawDiagnostics";
+    private enum Message {
+        // doclint messages
+        p1T(ERROR, "p1T.java:2:12: compiler.err.proc.messager: malformed HTML"),
+        p1sp1T(ERROR, "p1sp1T.java:2:12: compiler.err.proc.messager: malformed HTML"),
+        p1sp1sp2T(ERROR, "p1sp1sp2T.java:2:12: compiler.err.proc.messager: malformed HTML"),
+        p2T(ERROR, "p2T.java:2:12: compiler.err.proc.messager: malformed HTML"),
+        Default(ERROR, "Default.java:1:12: compiler.err.proc.messager: malformed HTML"),
+        INVALID_PACKAGE_ERROR(ERROR, "invalid flag: -Xdoclint/package:wrong+package");
+
+        final Diagnostic.Kind kind;
+        final String text;
+
+        static Message get(String text) {
+            for (Message m: values()) {
+                if (m.text.equals(text))
+                    return m;
+            }
+            return null;
+        }
+
+        Message(Diagnostic.Kind kind, String text) {
+            this.kind = kind;
+            this.text = text;
+        }
+
+        @Override
+        public String toString() {
+            return "[" + kind + ",\"" + text + "\"]";
+        }
+    }
+    void run() throws Exception {
+        javac = ToolProvider.getSystemJavaCompiler();
+        fm = javac.getStandardFileManager(null, null, null);
+        try {
+            fm.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(new File(".")));
+            files = new ArrayList<>();
+
+            for (int si = 0; si < sources.length; si += 2) {
+                files.add(new JFOImpl(sources[si], sources[si + 1]));
+            }
+
+            test(Arrays.asList(rawDiags, "-Xdoclint"),
+                    Main.Result.ERROR,
+                    EnumSet.of(Message.p1T, Message.p1sp1T, Message.p1sp1sp2T,
+                               Message.p2T, Message.Default));
+
+            test(Arrays.asList(rawDiags, "-Xdoclint", "-Xdoclint/package:p1"),
+                    Main.Result.ERROR,
+                    EnumSet.of(Message.p1T));
+
+            test(Arrays.asList(rawDiags, "-Xdoclint", "-Xdoclint/package:p1.*"),
+                    Main.Result.ERROR,
+                    EnumSet.of(Message.p1sp1T, Message.p1sp1sp2T));
+
+            test(Arrays.asList(rawDiags, "-Xdoclint", "-Xdoclint/package:p1.*,-p1.sp1"),
+                    Main.Result.ERROR,
+                    EnumSet.of(Message.p1sp1sp2T));
+
+            test(Arrays.asList(rawDiags, "-Xdoclint", "-Xdoclint/package:-p1.sp1"),
+                    Main.Result.ERROR,
+                    EnumSet.of(Message.p1T, Message.p1sp1sp2T, Message.p2T, Message.Default));
+
+            test(Arrays.asList(rawDiags, "-Xdoclint", "-Xdoclint/package:wrong+package"),
+                    Main.Result.CMDERR,
+                    EnumSet.of(Message.INVALID_PACKAGE_ERROR));
+
+            if (errors > 0)
+                throw new Exception(errors + " errors occurred");
+        } finally {
+            fm.close();
+        }
+    }
+
+    void test(List<String> opts, Main.Result expectResult, Set<Message> expectMessages) {
+        System.err.println("test: " + opts);
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        try {
+            JavacTask t = (JavacTask) javac.getTask(pw, fm, null, opts, null, files);
+            boolean ok = t.call();
+            pw.close();
+            String out = sw.toString().replaceAll("[\r\n]+", "\n");
+            if (!out.isEmpty())
+                System.err.println(out);
+            if (ok && expectResult != Main.Result.OK) {
+                error("Compilation succeeded unexpectedly");
+            } else if (!ok && expectResult != Main.Result.ERROR) {
+                error("Compilation failed unexpectedly");
+            } else
+                check(out, expectMessages);
+        } catch (IllegalArgumentException e) {
+            System.err.println(e);
+            String expectOut = expectMessages.iterator().next().text;
+            if (expectResult != Main.Result.CMDERR)
+                error("unexpected exception caught");
+            else if (!e.getMessage().equals(expectOut)) {
+                error("unexpected exception message: "
+                        + e.getMessage()
+                        + " expected: " + expectOut);
+            }
+        }
+    }
+
+    private void check(String out, Set<Message> expect) {
+        Pattern stats = Pattern.compile("^([1-9]+) (error|warning)(s?)");
+        Set<Message> found = EnumSet.noneOf(Message.class);
+        int e = 0, w = 0;
+        if (!out.isEmpty()) {
+            for (String line: out.split("[\r\n]+")) {
+                Matcher s = stats.matcher(line);
+                if (s.matches()) {
+                    int i = Integer.valueOf(s.group(1));
+                    if (s.group(2).equals("error"))
+                        e++;
+                    else
+                        w++;
+                    continue;
+                }
+
+                Message m = Message.get(line);
+                if (m == null)
+                    error("Unexpected line: " + line);
+                else
+                    found.add(m);
+            }
+        }
+        for (Message m: expect) {
+            if (!found.contains(m))
+                error("expected message not found: " + m.text);
+        }
+        for (Message m: found) {
+            if (!expect.contains(m))
+                error("unexpected message found: " + m.text);
+        }
+    }
+
+    void error(String msg) {
+        System.err.println("Error: " + msg);
+        errors++;
+    }
+
+    int errors;
+
+    class JFOImpl extends SimpleJavaFileObject {
+
+        private final String code;
+
+        public JFOImpl(String fileName, String code) {
+            super(URI.create(fileName), JavaFileObject.Kind.SOURCE);
+            this.code = code;
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncoding) {
+            return code;
+        }
+    }
+}
--- a/test/tools/javac/enum/EnumSwitch2.java	Thu Mar 26 15:21:23 2015 -0700
+++ b/test/tools/javac/enum/EnumSwitch2.java	Thu Mar 26 15:47:59 2015 -0700
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 4936393
+ * @bug 4936393 8050021
  * @summary enum switch case labels required to be unqualified.
  * @author gafter
  * @compile/fail/ref=EnumSwitch2.out -XDrawDiagnostics EnumSwitch2.java
--- a/test/tools/javac/enum/EnumSwitch2.out	Thu Mar 26 15:21:23 2015 -0700
+++ b/test/tools/javac/enum/EnumSwitch2.out	Thu Mar 26 15:47:59 2015 -0700
@@ -1,4 +1,3 @@
 EnumSwitch2.java:14:16: compiler.err.enum.label.must.be.unqualified.enum
 EnumSwitch2.java:15:16: compiler.err.enum.label.must.be.unqualified.enum
-EnumSwitch2.java:15:9: compiler.err.duplicate.case.label
-3 errors
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/expression/BinopVoidTest.java	Thu Mar 26 15:47:59 2015 -0700
@@ -0,0 +1,14 @@
+/*
+ * @test  /nodynamiccopyright/
+ * @bug 8074148
+ * @summary Attr.visitBinary flags error at wrong position
+ *
+ * @compile/fail/ref=BinopVoidTest.out -XDrawDiagnostics  BinopVoidTest.java
+ */
+
+class BinopVoidTest {
+    void foo() {}
+    int x = 10 + foo();
+    int y = foo() + 10;
+    int z = foo() + foo();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/expression/BinopVoidTest.out	Thu Mar 26 15:47:59 2015 -0700
@@ -0,0 +1,5 @@
+BinopVoidTest.java:11:21: compiler.err.void.not.allowed.here
+BinopVoidTest.java:12:16: compiler.err.void.not.allowed.here
+BinopVoidTest.java:13:16: compiler.err.void.not.allowed.here
+BinopVoidTest.java:13:24: compiler.err.void.not.allowed.here
+4 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/inference/8048838/T8048838.java	Thu Mar 26 15:47:59 2015 -0700
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8048838
+ * @summary type inference performance regression
+ * @compile T8048838.java
+ */
+class T8048838 {
+
+    <T1 extends T2, T2 extends T3, T3 extends T4, T4 extends T5, T5 extends T6, T6 extends T7,
+            T7 extends T8, T8 extends T9, T9 extends T10, T10 extends T11, T11 extends T12,
+            T12 extends T13, T13 extends T14, T14 extends T15, T15 extends T16, T16 extends T17,
+            T17 extends T18, T18 extends T19, T19 extends T20, T20 extends T21, T21 extends T22,
+            T22 extends T23, T23 extends T24, T24 extends T25, T25 extends T26, T26 extends T27,
+            T27 extends T28, T28 extends T29, T29 extends T30, T30 extends T31, T31 extends T32,
+            T32 extends T33, T33 extends T34, T34 extends T35, T35 extends T36, T36 extends T37,
+            T37 extends T38, T38 extends T39, T39 extends T40, T40 extends T41, T41 extends T42,
+            T42 extends T43, T43 extends T44, T44 extends T45, T45 extends T46, T46 extends T47,
+            T47 extends T48, T48 extends T49, T49 extends T50, T50 extends T51, T51 extends T52,
+            T52 extends T53, T53 extends T54, T54 extends T55, T55 extends T56, T56 extends T57,
+            T57 extends T58, T58 extends T59, T59 extends T60, T60 extends T61, T61 extends T62,
+            T62 extends T63, T63 extends T64, T64 extends T65, T65 extends T66, T66 extends T67,
+            T67 extends T68, T68 extends T69, T69 extends T70, T70 extends T71, T71 extends T72,
+            T72 extends T73, T73 extends T74, T74 extends T75, T75 extends T76, T76 extends T77,
+            T77 extends T78, T78 extends T79, T79 extends T80, T80 extends T81, T81 extends T82,
+            T82 extends T83, T83 extends T84, T84 extends T85, T85 extends T86, T86 extends T87,
+            T87 extends T88, T88 extends T89, T89 extends T90, T90 extends T91, T91 extends T92,
+            T92 extends T93, T93 extends T94, T94 extends T95, T95 extends T96, T96 extends T97,
+            T97 extends T98, T98 extends T99, T99 extends T100, T100 extends Integer>
+    T1 foo(T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, T6 x6, T7 x7, T8 x8, T9 x9, T10 x10, T11 x11, T12 x12,
+           T13 x13, T14 x14, T15 x15, T16 x16, T17 x17, T18 x18, T19 x19, T20 x20, T21 x21, T22 x22,
+           T23 x23, T24 x24, T25 x25, T26 x26, T27 x27, T28 x28, T29 x29, T30 x30, T31 x31, T32 x32,
+           T33 x33, T34 x34, T35 x35, T36 x36, T37 x37, T38 x38, T39 x39, T40 x40, T41 x41, T42 x42,
+           T43 x43, T44 x44, T45 x45, T46 x46, T47 x47, T48 x48, T49 x49, T50 x50, T51 x51, T52 x52,
+           T53 x53, T54 x54, T55 x55, T56 x56, T57 x57, T58 x58, T59 x59, T60 x60, T61 x61, T62 x62,
+           T63 x63, T64 x64, T65 x65, T66 x66, T67 x67, T68 x68, T69 x69, T70 x70, T71 x71, T72 x72,
+           T73 x73, T74 x74, T75 x75, T76 x76, T77 x77, T78 x78, T79 x79, T80 x80, T81 x81, T82 x82,
+           T83 x83, T84 x84, T85 x85, T86 x86, T87 x87, T88 x88, T89 x89, T90 x90, T91 x91, T92 x92,
+           T93 x93, T94 x94, T95 x95, T96 x96, T97 x97, T98 x98, T99 x99, T100 x100) { return null; }
+
+    Object test() {
+        return foo(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+                22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
+                43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+                64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+                85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100); // type inference expected
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/8074381/T8074381a.java	Thu Mar 26 15:47:59 2015 -0700
@@ -0,0 +1,33 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8074381
+ * @summary java.lang.AssertionError during compiling
+ * @compile/fail/ref=T8074381a.out -XDrawDiagnostics T8074381a.java
+ */
+class T8074381a {
+    interface Sup<X> {
+        boolean m(X x);
+    }
+
+    interface Sub<X> extends Sup<String> {
+        boolean m(String s);
+    }
+
+    void testRaw() {
+        Sub s1 = c -> true;
+        Sub s2 = Boolean::new;
+        Sub s3 = new Sub() {
+            @Override
+            public boolean m(String o) { return true; }
+        };
+    }
+
+    void testNonRaw() {
+        Sub<Integer> s1 = c -> true;
+        Sub<Integer> s2 = Boolean::new;
+        Sub<Integer> s3 = new Sub<Integer>() {
+            @Override
+            public boolean m(String o) { return true; }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/8074381/T8074381a.out	Thu Mar 26 15:47:59 2015 -0700
@@ -0,0 +1,4 @@
+T8074381a.java:17:18: compiler.err.prob.found.req: (compiler.misc.no.suitable.functional.intf.inst: T8074381a.Sub)
+T8074381a.java:18:18: compiler.err.prob.found.req: (compiler.misc.no.suitable.functional.intf.inst: T8074381a.Sub)
+T8074381a.java:19:28: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: T8074381a$1, m(java.lang.Object), T8074381a.Sup
+3 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/8074381/T8074381b.java	Thu Mar 26 15:47:59 2015 -0700
@@ -0,0 +1,44 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8074381
+ * @summary java.lang.AssertionError during compiling
+ * @compile/fail/ref=T8074381b.out -XDrawDiagnostics T8074381b.java
+ */
+import java.util.function.BiConsumer;
+import java.util.function.Consumer;
+
+class T8074381b {
+
+    @SuppressWarnings("unchecked")
+    public Invocation resolve(Handler handler) {
+        return new Invocation((t) -> handler.handle((String) t));
+    }
+
+    public static class Handler {
+        public void handle(String s) {
+            System.out.println(s);
+        }
+    }
+
+    public static class Invocation<T> {
+        public final ThrowingConsumer<T> consumer;
+
+        public Invocation(final ThrowingConsumer<T> consumer) {
+            this.consumer = consumer;
+        }
+    }
+
+    @FunctionalInterface
+    public interface ThrowingConsumer<T> extends BiConsumer<T,Consumer<Throwable>> {
+        @Override
+        default void accept(final T elem, final Consumer<Throwable> errorHandler) {
+            try {
+                acceptThrows(elem);
+            } catch (final Throwable e) {
+                errorHandler.accept(e);
+            }
+        }
+
+        void acceptThrows(T elem) throws Throwable;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/8074381/T8074381b.out	Thu Mar 26 15:47:59 2015 -0700
@@ -0,0 +1,2 @@
+T8074381b.java:14:16: compiler.err.cant.apply.symbol: kindname.constructor, Invocation, T8074381b.ThrowingConsumer, @383, kindname.class, T8074381b.Invocation<T>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.no.suitable.functional.intf.inst: T8074381b.ThrowingConsumer))
+1 error