Merge
authorduke
Wed, 05 Jul 2017 21:30:21 +0200
changeset 36719 dd54d618e1c8
parent 36718 bf40906bf49d (diff)
parent 36703 1c0e0505c8cb (current diff)
child 36720 7359994942f8
Merge
hotspot/test/compiler/compilercontrol/jcmd/StressAddSequentiallyTest.java
jdk/make/src/native/genconstants/ch/genSocketOptionRegistry.c
jdk/make/src/native/genconstants/fs/genSolarisConstants.c
jdk/make/src/native/genconstants/fs/genUnixConstants.c
jdk/src/java.base/share/classes/sun/misc/Resource.java
jdk/src/java.base/share/classes/sun/misc/URLClassPath.java
jdk/src/java.base/unix/classes/sun/misc/FileURLMapper.java
jdk/src/java.base/windows/classes/sun/misc/FileURLMapper.java
jdk/src/jdk.deploy.osx/macosx/classes/module-info.java
nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/messages.properties
--- a/langtools/.hgtags	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/.hgtags	Wed Jul 05 21:30:21 2017 +0200
@@ -353,3 +353,4 @@
 fd18a155ad22f62e06a9b74850ab8609d415c752 jdk-9+108
 f5991c73ed73b9a355a090b65c8d7fb9a1901f89 jdk-9+109
 9b4c916633f8d61509a3dc6175efdf185b421343 jdk-9+110
+9adfb22ff08f2e82c7801b272607cd685976dbb1 jdk-9+111
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Jul 05 21:30:21 2017 +0200
@@ -282,7 +282,9 @@
      *  @param env    The current environment.
      */
     void checkAssignable(DiagnosticPosition pos, VarSymbol v, JCTree base, Env<AttrContext> env) {
-        if ((v.flags() & FINAL) != 0 &&
+        if (v.name == names._this) {
+            log.error(pos, Errors.CantAssignValToThis);
+        } else if ((v.flags() & FINAL) != 0 &&
             ((v.flags() & HASINIT) != 0
              ||
              !((base == null ||
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java	Wed Jul 05 21:30:21 2017 +0200
@@ -356,6 +356,7 @@
         ListBuffer<Type> minUndetVars = new ListBuffer<>();
         for (Type minVar : minVars) {
             UndetVar uv = (UndetVar)asUndetVar(minVar);
+            Assert.check(uv.incorporationActions.size() == 0);
             UndetVar uv2 = new UndetVar((TypeVar)minVar, infer.incorporationEngine(), types);
             for (InferenceBound ib : InferenceBound.values()) {
                 List<Type> newBounds = uv.getBounds(ib).stream()
@@ -403,15 +404,17 @@
         public Void visitUndetVar(UndetVar t, Void _unused) {
             if (min.add(t.qtype)) {
                 Set<Type> deps = minMap.getOrDefault(t.qtype, new HashSet<>(Collections.singleton(t.qtype)));
-                for (Type b : t.getBounds(InferenceBound.values())) {
-                    Type undet = asUndetVar(b);
-                    if (!undet.hasTag(TypeTag.UNDETVAR)) {
-                        visit(undet);
-                    } else if (isEquiv((UndetVar)undet, b)){
-                        deps.add(b);
-                        equiv.add(b);
-                    } else {
-                        visit(undet);
+                for (InferenceBound boundKind : InferenceBound.values()) {
+                    for (Type b : t.getBounds(boundKind)) {
+                        Type undet = asUndetVar(b);
+                        if (!undet.hasTag(TypeTag.UNDETVAR)) {
+                            visit(undet);
+                        } else if (isEquiv(t, b, boundKind)) {
+                            deps.add(b);
+                            equiv.add(b);
+                        } else {
+                            visit(undet);
+                        }
                     }
                 }
                 minMap.put(t.qtype, deps);
@@ -447,11 +450,17 @@
             return null;
         }
 
-        boolean isEquiv(UndetVar from, Type t) {
+        boolean isEquiv(UndetVar from, Type t, InferenceBound boundKind) {
             UndetVar uv = (UndetVar)asUndetVar(t);
             for (InferenceBound ib : InferenceBound.values()) {
-                List<Type> b1 = uv.getBounds(ib);
-                List<Type> b2 = from.getBounds(ib);
+                List<Type> b1 = from.getBounds(ib);
+                if (ib == boundKind) {
+                    b1 = b1.diff(List.of(t));
+                }
+                List<Type> b2 = uv.getBounds(ib);
+                if (ib == boundKind.complement()) {
+                    b2 = b2.diff(List.of(from.qtype));
+                }
                 if (!b1.containsAll(b2) || !b2.containsAll(b1)) {
                     return false;
                 }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Jul 05 21:30:21 2017 +0200
@@ -274,6 +274,9 @@
 compiler.err.cant.assign.val.to.final.var=\
     cannot assign a value to final variable {0}
 
+compiler.err.cant.assign.val.to.this=\
+    cannot assign to ''this''
+
 # 0: symbol, 1: message segment
 compiler.err.cant.ref.non.effectively.final.var=\
     local variables referenced from {1} must be final or effectively final
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java	Wed Jul 05 21:30:21 2017 +0200
@@ -361,22 +361,22 @@
             // Silently create a new javac_state file.
             noFileFound = true;
         } catch (IOException e) {
-            Log.info("Dropping old javac_state because of errors when reading it.");
+            Log.warn("Dropping old javac_state because of errors when reading it.");
             db = new JavacState(options, true);
             foundCorrectVerNr = true;
             newCommandLine = false;
             syntaxError = false;
     }
         if (foundCorrectVerNr == false && !noFileFound) {
-            Log.info("Dropping old javac_state since it is of an old version.");
+            Log.debug("Dropping old javac_state since it is of an old version.");
             db = new JavacState(options, true);
         } else
         if (newCommandLine == true && !noFileFound) {
-            Log.info("Dropping old javac_state since a new command line is used!");
+            Log.debug("Dropping old javac_state since a new command line is used!");
             db = new JavacState(options, true);
         } else
         if (syntaxError == true) {
-            Log.info("Dropping old javac_state since it contains syntax errors.");
+            Log.warn("Dropping old javac_state since it contains syntax errors.");
             db = new JavacState(options, true);
         }
         db.prev.calculateDependents();
@@ -868,7 +868,7 @@
                         // This is an incremental compile! The pubapi
                         // did change. Trigger recompilation of dependents.
                         packagesWithChangedPublicApis.add(pkg);
-                        Log.info("The API of " + Util.justPackageName(pkg) + " has changed!");
+                        Log.debug("The API of " + Util.justPackageName(pkg) + " has changed!");
                     }
                 }
             }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/client/SjavacClient.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/client/SjavacClient.java	Wed Jul 05 21:30:21 2017 +0200
@@ -139,7 +139,11 @@
                 String content = typeAndContent[1];
 
                 try {
-                    Log.log(Log.Level.valueOf(type), "[server] " + content);
+                    if (Log.isDebugging()) {
+                        // Distinguish server generated output if debugging.
+                        content = "[sjavac-server] " + content;
+                    }
+                    Log.log(Log.Level.valueOf(type), content);
                     continue;
                 } catch (IllegalArgumentException e) {
                     // Parsing of 'type' as log level failed.
@@ -172,7 +176,7 @@
         makeSureServerIsRunning(portFile);
         int attempt = 0;
         while (true) {
-            Log.info("Trying to connect. Attempt " + (++attempt) + " of " + MAX_CONNECT_ATTEMPTS);
+            Log.debug("Trying to connect. Attempt " + (++attempt) + " of " + MAX_CONNECT_ATTEMPTS);
             try {
                 return makeConnectionAttempt();
             } catch (IOException ex) {
@@ -191,7 +195,7 @@
         InetAddress localhost = InetAddress.getByName(null);
         InetSocketAddress address = new InetSocketAddress(localhost, portFile.getPort());
         socket.connect(address, CONNECTION_TIMEOUT);
-        Log.info("Connected");
+        Log.debug("Connected");
         return socket;
     }
 
@@ -238,7 +242,7 @@
               + ",keepalive="+ keepalive);
 
         Process serverProcess;
-        Log.info("Starting server. Command: " + String.join(" ", cmd));
+        Log.debug("Starting server. Command: " + String.join(" ", cmd));
         try {
             // If the cmd for some reason can't be executed (file is not found,
             // or is not executable for instance) this will throw an
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/SjavacServer.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/SjavacServer.java	Wed Jul 05 21:30:21 2017 +0200
@@ -165,7 +165,7 @@
             portFile.lock();
             portFile.getValues();
             if (portFile.containsPortInfo()) {
-                Log.info("Javac server not started because portfile exists!");
+                Log.debug("Javac server not started because portfile exists!");
                 portFile.unlock();
                 return -1;
             }
@@ -192,10 +192,10 @@
         portFileMonitor = new PortFileMonitor(portFile, this);
         portFileMonitor.start();
 
-        Log.info("Sjavac server started. Accepting connections...");
-        Log.info("    port: " + getPort());
-        Log.info("    time: " + new java.util.Date());
-        Log.info("    poolsize: " + poolsize);
+        Log.debug("Sjavac server started. Accepting connections...");
+        Log.debug("    port: " + getPort());
+        Log.debug("    time: " + new java.util.Date());
+        Log.debug("    poolsize: " + poolsize);
 
 
         keepAcceptingRequests.set(true);
@@ -208,7 +208,7 @@
             }
         } while (keepAcceptingRequests.get());
 
-        Log.info("Shutting down.");
+        Log.debug("Shutting down.");
 
         // No more connections accepted. If any client managed to connect after
         // the accept() was interrupted but before the server socket is closed
@@ -216,7 +216,7 @@
         // IOException on the client side.
 
         long realTime = System.currentTimeMillis() - serverStart;
-        Log.info("Total wall clock time " + realTime + "ms build time " + totalBuildTime + "ms");
+        Log.debug("Total wall clock time " + realTime + "ms build time " + totalBuildTime + "ms");
 
         // Shut down
         sjavac.shutdown();
@@ -231,7 +231,7 @@
             return;
         }
 
-        Log.info("Quitting: " + quitMsg);
+        Log.debug("Quitting: " + quitMsg);
 
         portFileMonitor.shutdown(); // No longer any need to monitor port file
 
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java	Wed Jul 05 21:30:21 2017 +0200
@@ -48,7 +48,7 @@
 import jdk.internal.jline.NoInterruptUnixTerminal;
 import jdk.internal.jline.Terminal;
 import jdk.internal.jline.TerminalFactory;
-import jdk.internal.jline.UnsupportedTerminal;
+import jdk.internal.jline.TerminalSupport;
 import jdk.internal.jline.WindowsTerminal;
 import jdk.internal.jline.console.ConsoleReader;
 import jdk.internal.jline.console.KeyMap;
@@ -70,7 +70,7 @@
         this.input = new StopDetectingInputStream(() -> repl.state.stop(), ex -> repl.hard("Error on input: %s", ex));
         Terminal term;
         if (System.getProperty("test.jdk") != null) {
-            term = new UnsupportedTerminal();
+            term = new TestTerminal(input);
         } else if (System.getProperty("os.name").toLowerCase(Locale.US).contains(TerminalFactory.WINDOWS)) {
             term = new JShellWindowsTerminal(input);
         } else {
@@ -80,7 +80,7 @@
         in = new ConsoleReader(cmdin, cmdout, term);
         in.setExpandEvents(false);
         in.setHandleUserInterrupt(true);
-        in.setHistory(history = new EditingHistory(JShellTool.PREFS) {
+        in.setHistory(history = new EditingHistory(repl.prefs) {
             @Override protected CompletionInfo analyzeCompletion(String input) {
                 return repl.analysis.analyzeCompletion(input);
             }
@@ -538,4 +538,22 @@
         }
 
     }
+
+    private static final class TestTerminal extends TerminalSupport {
+
+        private final StopDetectingInputStream input;
+
+        public TestTerminal(StopDetectingInputStream input) throws Exception {
+            super(true);
+            setAnsiSupported(false);
+            setEchoEnabled(true);
+            this.input = input;
+        }
+
+        @Override
+        public InputStream wrapInIfNeeded(InputStream in) throws IOException {
+            return input.setInputStream(super.wrapInIfNeeded(in));
+        }
+
+    }
 }
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java	Wed Jul 05 21:30:21 2017 +0200
@@ -28,18 +28,16 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.EnumMap;
 import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Set;
 import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-import java.util.stream.Collectors;
 import java.util.stream.Stream;
+import static java.util.stream.Collectors.joining;
 
 /**
  * Feedback customization support
@@ -57,29 +55,38 @@
     // Mapping of mode names to mode modes
     private final Map<String, Mode> modeMap = new HashMap<>();
 
+    // Mapping selector enum names to enums
+    private final Map<String, Selector<?>> selectorMap = new HashMap<>();
+
+    private static final long ALWAYS = bits(FormatCase.all, FormatAction.all, FormatWhen.all,
+            FormatResolve.all, FormatUnresolved.all, FormatErrors.all);
+    private static final long ANY = 0L;
+
     public boolean shouldDisplayCommandFluff() {
         return mode.commandFluff;
     }
 
     public String getPre() {
-        return mode.pre;
+        return mode.format("pre", ANY);
     }
 
     public String getPost() {
-        return mode.post;
+        return mode.format("post", ANY);
     }
 
     public String getErrorPre() {
-        return mode.errorPre;
+        return mode.format("errorpre", ANY);
     }
 
     public String getErrorPost() {
-        return mode.errorPost;
+        return mode.format("errorpost", ANY);
     }
 
-    public String getFormat(FormatCase fc, FormatWhen fw, FormatAction fa, FormatResolve fr,
-            boolean hasName, boolean hasType, boolean hasResult) {
-        return mode.getFormat(fc, fw, fa, fr, hasName, hasType, hasResult);
+    public String format(FormatCase fc, FormatAction fa, FormatWhen fw,
+                    FormatResolve fr, FormatUnresolved fu, FormatErrors fe,
+                    String name, String type, String value, String unresolved, List<String> errorLines) {
+        return mode.format(fc, fa, fw, fr, fu, fe,
+                name, type, value, unresolved, errorLines);
     }
 
     public String getPrompt(String nextId) {
@@ -91,184 +98,76 @@
     }
 
     public boolean setFeedback(JShellTool tool, ArgTokenizer at) {
-        return new FormatSetter(tool, at).setFeedback();
-    }
-
-    public boolean setField(JShellTool tool, ArgTokenizer at) {
-        return new FormatSetter(tool, at).setField();
+        return new Setter(tool, at).setFeedback();
     }
 
     public boolean setFormat(JShellTool tool, ArgTokenizer at) {
-        return new FormatSetter(tool, at).setFormat();
+        return new Setter(tool, at).setFormat();
     }
 
     public boolean setNewMode(JShellTool tool, ArgTokenizer at) {
-        return new FormatSetter(tool, at).setNewMode();
+        return new Setter(tool, at).setNewMode();
     }
 
     public boolean setPrompt(JShellTool tool, ArgTokenizer at) {
-        return new FormatSetter(tool, at).setPrompt();
+        return new Setter(tool, at).setPrompt();
     }
 
     public void printFeedbackHelp(JShellTool tool) {
-        new FormatSetter(tool, null).printFeedbackHelp();
-    }
-
-    public void printFieldHelp(JShellTool tool) {
-        new FormatSetter(tool, null).printFieldHelp();
+        new Setter(tool, null).printFeedbackHelp();
     }
 
     public void printFormatHelp(JShellTool tool) {
-        new FormatSetter(tool, null).printFormatHelp();
+        new Setter(tool, null).printFormatHelp();
     }
 
     public void printNewModeHelp(JShellTool tool) {
-        new FormatSetter(tool, null).printNewModeHelp();
+        new Setter(tool, null).printNewModeHelp();
     }
 
     public void printPromptHelp(JShellTool tool) {
-        new FormatSetter(tool, null).printPromptHelp();
+        new Setter(tool, null).printPromptHelp();
+    }
+
+    {
+        for (FormatCase e : EnumSet.allOf(FormatCase.class))
+            selectorMap.put(e.name().toLowerCase(Locale.US), e);
+        for (FormatAction e : EnumSet.allOf(FormatAction.class))
+            selectorMap.put(e.name().toLowerCase(Locale.US), e);
+        for (FormatResolve e : EnumSet.allOf(FormatResolve.class))
+            selectorMap.put(e.name().toLowerCase(Locale.US), e);
+        for (FormatUnresolved e : EnumSet.allOf(FormatUnresolved.class))
+            selectorMap.put(e.name().toLowerCase(Locale.US), e);
+        for (FormatErrors e : EnumSet.allOf(FormatErrors.class))
+            selectorMap.put(e.name().toLowerCase(Locale.US), e);
+        for (FormatWhen e : EnumSet.allOf(FormatWhen.class))
+            selectorMap.put(e.name().toLowerCase(Locale.US), e);
     }
 
     /**
      * Holds all the context of a mode mode
      */
-    private class Mode {
+    private static class Mode {
 
-        // Use name of mode mode
-
+        // Name of mode
         final String name;
 
         // Display command verification/information
         final boolean commandFluff;
 
-        // event cases: class, method
-        final EnumMap<FormatCase, EnumMap<FormatAction, EnumMap<FormatWhen, String>>> cases;
-
-        // action names: add. modified, replaced, ...
-        final EnumMap<FormatAction, EnumMap<FormatWhen, String>> actions;
-
-        // resolution status description format with %s for unresolved
-        final EnumMap<FormatResolve, EnumMap<FormatWhen, String>> resolves;
-
-        // primary snippet vs update
-        final EnumMap<FormatWhen, String> whens;
-
-        // fixed map of how to get format string for a field, given a specific formatting contet
-        final EnumMap<FormatField, Function<Context, String>> fields;
-
-        // format wrappers for name, type, and result
-        String fname = "%s";
-        String ftype = "%s";
-        String fresult = "%s";
-
-        // start and end, also used by hard-coded output
-        String pre = "|  ";
-        String post = "\n";
-        String errorPre = "|  Error: ";
-        String errorPost = "\n";
+        // Event cases: class, method, expression, ...
+        final Map<String, List<Setting>> cases;
 
         String prompt = "\n-> ";
         String continuationPrompt = ">> ";
 
-        /**
-         * The context of a specific mode to potentially display.
-         */
-        class Context {
-
-            final FormatCase fc;
-            final FormatAction fa;
-            final FormatResolve fr;
-            final FormatWhen fw;
-            final boolean hasName;
-            final boolean hasType;
-            final boolean hasResult;
-
-            Context(FormatCase fc, FormatWhen fw, FormatAction fa, FormatResolve fr,
-                    boolean hasName, boolean hasType, boolean hasResult) {
-                this.fc = fc;
-                this.fa = fa;
-                this.fr = fr;
-                this.fw = fw;
-                this.hasName = hasName;
-                this.hasType = hasType;
-                this.hasResult = hasResult;
-            }
-
-            String when() {
-                return whens.get(fw);
-            }
-
-            String action() {
-                return actions.get(fa).get(fw);
-            }
-
-            String resolve() {
-                return String.format(resolves.get(fr).get(fw), FormatField.RESOLVE.form);
-            }
-
-            String name() {
-                return hasName
-                        ? String.format(fname, FormatField.NAME.form)
-                        : "";
-            }
-
-            String type() {
-                return hasType
-                        ? String.format(ftype, FormatField.TYPE.form)
-                        : "";
+        static class Setting {
+            final long enumBits;
+            final String format;
+            Setting(long enumBits, String format) {
+                this.enumBits = enumBits;
+                this.format = format;
             }
-
-            String result() {
-                return hasResult
-                        ? String.format(fresult, FormatField.RESULT.form)
-                        : "";
-            }
-
-            /**
-             * Lookup format based on case, action, and whether it update.
-             * Replace fields with context specific formats.
-             *
-             * @return format string
-             */
-            String format() {
-                String format = cases.get(fc).get(fa).get(fw);
-                if (format == null) {
-                    return "";
-                }
-                Matcher m = FIELD_PATTERN.matcher(format);
-                StringBuffer sb = new StringBuffer(format.length());
-                while (m.find()) {
-                    String fieldName = m.group(1).toUpperCase(Locale.US);
-                    String sub = null;
-                    for (FormatField f : FormatField.values()) {
-                        if (f.name().startsWith(fieldName)) {
-                            sub = fields.get(f).apply(this);
-                            break;
-                        }
-                    }
-                    if (sub != null) {
-                        m.appendReplacement(sb, Matcher.quoteReplacement(sub));
-                    }
-                }
-                m.appendTail(sb);
-                return sb.toString();
-            }
-        }
-
-        {
-            // set fixed mappings of fields
-            fields = new EnumMap<>(FormatField.class);
-            fields.put(FormatField.WHEN, c -> c.when());
-            fields.put(FormatField.ACTION, c -> c.action());
-            fields.put(FormatField.RESOLVE, c -> c.resolve());
-            fields.put(FormatField.NAME, c -> c.name());
-            fields.put(FormatField.TYPE, c -> c.type());
-            fields.put(FormatField.RESULT, c -> c.result());
-            fields.put(FormatField.PRE, c -> pre);
-            fields.put(FormatField.POST, c -> post);
-            fields.put(FormatField.ERRORPRE, c -> errorPre);
-            fields.put(FormatField.ERRORPOST, c -> errorPost);
         }
 
         /**
@@ -280,41 +179,20 @@
         Mode(String name, boolean commandFluff) {
             this.name = name;
             this.commandFluff = commandFluff;
-            cases = new EnumMap<>(FormatCase.class);
-            for (FormatCase fc : FormatCase.values()) {
-                EnumMap<FormatAction, EnumMap<FormatWhen, String>> ac = new EnumMap<>(FormatAction.class);
-                cases.put(fc, ac);
-                for (FormatAction fa : FormatAction.values()) {
-                    EnumMap<FormatWhen, String> aw = new EnumMap<>(FormatWhen.class);
-                    ac.put(fa, aw);
-                    for (FormatWhen fw : FormatWhen.values()) {
-                        aw.put(fw, "");
-                    }
-                }
-            }
+            cases = new HashMap<>();
+            add("name",       new Setting(ALWAYS, "%1$s"));
+            add("type",       new Setting(ALWAYS, "%2$s"));
+            add("value",      new Setting(ALWAYS, "%3$s"));
+            add("unresolved", new Setting(ALWAYS, "%4$s"));
+            add("errors",     new Setting(ALWAYS, "%5$s"));
+            add("err",        new Setting(ALWAYS, "%6$s"));
 
-            actions = new EnumMap<>(FormatAction.class);
-            for (FormatAction fa : FormatAction.values()) {
-                EnumMap<FormatWhen, String> afw = new EnumMap<>(FormatWhen.class);
-                actions.put(fa, afw);
-                for (FormatWhen fw : FormatWhen.values()) {
-                    afw.put(fw, fa.name() + "-" + fw.name());
-                }
-            }
+            add("errorline",  new Setting(ALWAYS, "    {err}%n"));
 
-            resolves = new EnumMap<>(FormatResolve.class);
-            for (FormatResolve fr : FormatResolve.values()) {
-                EnumMap<FormatWhen, String> arw = new EnumMap<>(FormatWhen.class);
-                resolves.put(fr, arw);
-                for (FormatWhen fw : FormatWhen.values()) {
-                    arw.put(fw, fr.name() + "-" + fw.name() + ": %s");
-                }
-            }
-
-            whens = new EnumMap<>(FormatWhen.class);
-            for (FormatWhen fw : FormatWhen.values()) {
-                whens.put(fw, fw.name());
-            }
+            add("pre",        new Setting(ALWAYS, "|  "));
+            add("post",       new Setting(ALWAYS, "%n"));
+            add("errorpre",   new Setting(ALWAYS, "|  "));
+            add("errorpost",  new Setting(ALWAYS, "%n"));
         }
 
         /**
@@ -322,132 +200,91 @@
          *
          * @param name
          * @param commandFluff True if should display command fluff messages
-         * @param m Mode to copy
+         * @param m Mode to copy, or null for no fresh
          */
         Mode(String name, boolean commandFluff, Mode m) {
             this.name = name;
             this.commandFluff = commandFluff;
-            cases = new EnumMap<>(FormatCase.class);
-            for (FormatCase fc : FormatCase.values()) {
-                EnumMap<FormatAction, EnumMap<FormatWhen, String>> ac = new EnumMap<>(FormatAction.class);
-                EnumMap<FormatAction, EnumMap<FormatWhen, String>> mc = m.cases.get(fc);
-                cases.put(fc, ac);
-                for (FormatAction fa : FormatAction.values()) {
-                    EnumMap<FormatWhen, String> aw = new EnumMap<>(mc.get(fa));
-                    ac.put(fa, aw);
-                }
-            }
+            cases = new HashMap<>();
 
-            actions = new EnumMap<>(FormatAction.class);
-            for (FormatAction fa : FormatAction.values()) {
-                EnumMap<FormatWhen, String> afw = new EnumMap<>(m.actions.get(fa));
-                actions.put(fa, afw);
-            }
+            m.cases.entrySet().stream()
+                    .forEach(fes -> fes.getValue()
+                    .forEach(ing -> add(fes.getKey(), ing)));
 
-            resolves = new EnumMap<>(FormatResolve.class);
-            for (FormatResolve fr : FormatResolve.values()) {
-                EnumMap<FormatWhen, String> arw = new EnumMap<>(m.resolves.get(fr));
-                resolves.put(fr, arw);
-            }
-
-            whens = new EnumMap<>(m.whens);
-
-            this.fname = m.fname;
-            this.ftype = m.ftype;
-            this.fresult = m.fresult;
-            this.pre = m.pre;
-            this.post = m.post;
-            this.errorPre = m.errorPre;
-            this.errorPost = m.errorPost;
             this.prompt = m.prompt;
             this.continuationPrompt = m.continuationPrompt;
         }
 
-        String getFormat(FormatCase fc, FormatWhen fw, FormatAction fa, FormatResolve fr,
-                boolean hasName, boolean hasType, boolean hasResult) {
-            Context context = new Context(fc, fw, fa, fr,
-                    hasName, hasType, hasResult);
-            return context.format();
-        }
-
-        void setCases(String format, Collection<FormatCase> cc, Collection<FormatAction> ca, Collection<FormatWhen> cw) {
-            for (FormatCase fc : cc) {
-                EnumMap<FormatAction, EnumMap<FormatWhen, String>> ma = cases.get(fc);
-                for (FormatAction fa : ca) {
-                    EnumMap<FormatWhen, String> mw = ma.get(fa);
-                    for (FormatWhen fw : cw) {
-                        mw.put(fw, format);
-                    }
-                }
+        private boolean add(String field, Setting ing) {
+            List<Setting> settings =  cases.computeIfAbsent(field, k -> new ArrayList<>());
+            if (settings == null) {
+                return false;
             }
+            settings.add(ing);
+            return true;
         }
 
-        void setActions(String format, Collection<FormatAction> ca, Collection<FormatWhen> cw) {
-            for (FormatAction fa : ca) {
-                EnumMap<FormatWhen, String> mw = actions.get(fa);
-                for (FormatWhen fw : cw) {
-                    mw.put(fw, format);
-                }
-            }
+        void set(String field,
+                Collection<FormatCase> cc, Collection<FormatAction> ca, Collection<FormatWhen> cw,
+                Collection<FormatResolve> cr, Collection<FormatUnresolved> cu, Collection<FormatErrors> ce,
+                String format) {
+            long bits = bits(cc, ca, cw, cr, cu, ce);
+            set(field, bits, format);
         }
 
-        void setResolves(String format, Collection<FormatResolve> cr, Collection<FormatWhen> cw) {
-            for (FormatResolve fr : cr) {
-                EnumMap<FormatWhen, String> mw = resolves.get(fr);
-                for (FormatWhen fw : cw) {
-                    mw.put(fw, format);
-                }
-            }
-        }
-
-        void setWhens(String format, Collection<FormatWhen> cw) {
-            for (FormatWhen fw : cw) {
-                whens.put(fw, format);
-            }
+        void set(String field, long bits, String format) {
+            add(field, new Setting(bits, format));
         }
 
-        void setName(String s) {
-            fname = s;
-        }
-
-        void setType(String s) {
-            ftype = s;
-        }
-
-        void setResult(String s) {
-            fresult = s;
-        }
-
-        void setPre(String s) {
-            pre = s;
-        }
-
-        void setPost(String s) {
-            post = s;
+        /**
+         * Lookup format Replace fields with context specific formats.
+         *
+         * @return format string
+         */
+        String format(String field, long bits) {
+            List<Setting> settings = cases.get(field);
+            if (settings == null) {
+                return ""; //TODO error?
+            }
+            String format = null;
+            for (int i = settings.size() - 1; i >= 0; --i) {
+                Setting ing = settings.get(i);
+                long mask = ing.enumBits;
+                if ((bits & mask) == bits) {
+                    format = ing.format;
+                    break;
+                }
+            }
+            if (format == null || format.isEmpty()) {
+                return "";
+            }
+            Matcher m = FIELD_PATTERN.matcher(format);
+            StringBuffer sb = new StringBuffer(format.length());
+            while (m.find()) {
+                String fieldName = m.group(1);
+                String sub = format(fieldName, bits);
+                m.appendReplacement(sb, Matcher.quoteReplacement(sub));
+            }
+            m.appendTail(sb);
+            return sb.toString();
         }
 
-        void setErrorPre(String s) {
-            errorPre = s;
-        }
-
-        void setErrorPost(String s) {
-            errorPost = s;
-        }
-
-        String getPre() {
-            return pre;
-        }
-
-        String getPost() {
-            return post;
-        }
-
-        String getErrorPre() {
-            return errorPre;
-        }
-
-        String getErrorPost() {
-            return errorPost;
+        String format(FormatCase fc, FormatAction fa, FormatWhen fw,
+                    FormatResolve fr, FormatUnresolved fu, FormatErrors fe,
+                    String name, String type, String value, String unresolved, List<String> errorLines) {
+            long bits = bits(fc, fa, fw, fr, fu, fe);
+            String fname = name==null? "" : name;
+            String ftype = type==null? "" : type;
+            String fvalue = value==null? "" : value;
+            String funresolved = unresolved==null? "" : unresolved;
+            String errors = errorLines.stream()
+                    .map(el -> String.format(
+                            format("errorline", bits),
+                            fname, ftype, fvalue, funresolved, "*cannot-use-errors-here*", el))
+                    .collect(joining());
+            return String.format(
+                    format("display", bits),
+                    fname, ftype, fvalue, funresolved, errors, "*cannot-use-err-here*");
         }
 
         void setPrompts(String prompt, String continuationPrompt) {
@@ -464,50 +301,82 @@
         }
     }
 
-    /**
-     * The brace delimited substitutions
-     */
-    public enum FormatField {
-        WHEN,
-        ACTION,
-        RESOLVE("%1$s"),
-        NAME("%2$s"),
-        TYPE("%3$s"),
-        RESULT("%4$s"),
-        PRE,
-        POST,
-        ERRORPRE,
-        ERRORPOST;
-        String form;
+    // Representation of one instance of all the enum values as bits in a long
+    private static long bits(FormatCase fc, FormatAction fa, FormatWhen fw,
+            FormatResolve fr, FormatUnresolved fu, FormatErrors fe) {
+        long res = 0L;
+        res |= 1 << fc.ordinal();
+        res <<= FormatAction.count;
+        res |= 1 << fa.ordinal();
+        res <<= FormatWhen.count;
+        res |= 1 << fw.ordinal();
+        res <<= FormatResolve.count;
+        res |= 1 << fr.ordinal();
+        res <<= FormatUnresolved.count;
+        res |= 1 << fu.ordinal();
+        res <<= FormatErrors.count;
+        res |= 1 << fe.ordinal();
+        return res;
+    }
 
-        FormatField(String s) {
-            this.form = s;
-        }
+    // Representation of a space of enum values as or'edbits in a long
+    private static long bits(Collection<FormatCase> cc, Collection<FormatAction> ca, Collection<FormatWhen> cw,
+                Collection<FormatResolve> cr, Collection<FormatUnresolved> cu, Collection<FormatErrors> ce) {
+        long res = 0L;
+        for (FormatCase fc : cc)
+            res |= 1 << fc.ordinal();
+        res <<= FormatAction.count;
+        for (FormatAction fa : ca)
+            res |= 1 << fa.ordinal();
+        res <<= FormatWhen.count;
+        for (FormatWhen fw : cw)
+            res |= 1 << fw.ordinal();
+        res <<= FormatResolve.count;
+        for (FormatResolve fr : cr)
+            res |= 1 << fr.ordinal();
+        res <<= FormatUnresolved.count;
+        for (FormatUnresolved fu : cu)
+            res |= 1 << fu.ordinal();
+        res <<= FormatErrors.count;
+        for (FormatErrors fe : ce)
+            res |= 1 << fe.ordinal();
+        return res;
+    }
 
-        FormatField() {
-            this.form = null;
-        }
+    interface Selector<E extends Enum<E> & Selector<E>> {
+        SelectorCollector<E> collector(Setter.SelectorList sl);
+        String doc();
     }
 
     /**
      * The event cases
      */
-    public enum FormatCase {
-        IMPORT("import declaration: {action} {name}"),
-        CLASS("class, interface, enum, or annotation declaration: {action} {name} {resolve}"),
-        INTERFACE("class, interface, enum, or annotation declaration: {action} {name} {resolve}"),
-        ENUM("class, interface, enum, or annotation declaration: {action} {name} {resolve}"),
-        ANNOTATION("annotation interface declaration: {action} {name} {resolve}"),
-        METHOD("method declaration: {action} {name} {type}==parameter-types {resolve}"),
-        VARDECL("variable declaration: {action} {name} {type} {resolve}"),
-        VARDECLRECOVERABLE("recoverably failed variable declaration: {action} {name} {resolve}"),
-        VARINIT("variable declaration with init: {action} {name} {type} {resolve} {result}"),
-        VARRESET("variable reset on update: {action} {name}"),
-        EXPRESSION("expression: {action}=='Saved to scratch variable' {name} {type} {result}"),
-        VARVALUE("variable value expression: {action} {name} {type} {result}"),
-        ASSIGNMENT("assign variable: {action} {name} {type} {result}"),
-        STATEMENT("statement: {action}");
+    public enum FormatCase implements Selector<FormatCase> {
+        IMPORT("import declaration"),
+        CLASS("class declaration"),
+        INTERFACE("interface declaration"),
+        ENUM("enum declaration"),
+        ANNOTATION("annotation interface declaration"),
+        METHOD("method declaration -- note: {type}==parameter-types"),
+        VARDECL("variable declaration without init"),
+        VARINIT("variable declaration with init"),
+        EXPRESSION("expression -- note: {name}==scratch-variable-name"),
+        VARVALUE("variable value expression"),
+        ASSIGNMENT("assign variable"),
+        STATEMENT("statement");
         String doc;
+        static final EnumSet<FormatCase> all = EnumSet.allOf(FormatCase.class);
+        static final int count = all.size();
+
+        @Override
+        public SelectorCollector<FormatCase> collector(Setter.SelectorList sl) {
+            return sl.cases;
+        }
+
+        @Override
+        public String doc() {
+            return doc;
+        }
 
         private FormatCase(String doc) {
             this.doc = doc;
@@ -517,14 +386,26 @@
     /**
      * The event actions
      */
-    public enum FormatAction {
+    public enum FormatAction implements Selector<FormatAction> {
         ADDED("snippet has been added"),
         MODIFIED("an existing snippet has been modified"),
         REPLACED("an existing snippet has been replaced with a new snippet"),
         OVERWROTE("an existing snippet has been overwritten"),
         DROPPED("snippet has been dropped"),
-        REJECTED("snippet has failed and been rejected");
+        USED("snippet was used when it cannot be");
         String doc;
+        static final EnumSet<FormatAction> all = EnumSet.allOf(FormatAction.class);
+        static final int count = all.size();
+
+        @Override
+        public SelectorCollector<FormatAction> collector(Setter.SelectorList sl) {
+            return sl.actions;
+        }
+
+        @Override
+        public String doc() {
+            return doc;
+        }
 
         private FormatAction(String doc) {
             this.doc = doc;
@@ -534,10 +415,22 @@
     /**
      * When the event occurs: primary or update
      */
-    public enum FormatWhen {
+    public enum FormatWhen implements Selector<FormatWhen> {
         PRIMARY("the entered snippet"),
         UPDATE("an update to a dependent snippet");
         String doc;
+        static final EnumSet<FormatWhen> all = EnumSet.allOf(FormatWhen.class);
+        static final int count = all.size();
+
+        @Override
+        public SelectorCollector<FormatWhen> collector(Setter.SelectorList sl) {
+            return sl.whens;
+        }
+
+        @Override
+        public String doc() {
+            return doc;
+        }
 
         private FormatWhen(String doc) {
             this.doc = doc;
@@ -545,46 +438,119 @@
     }
 
     /**
-     * Resolution problems with event
+     * Resolution problems
      */
-    public enum FormatResolve {
+    public enum FormatResolve implements Selector<FormatResolve> {
         OK("resolved correctly"),
         DEFINED("defined despite recoverably unresolved references"),
         NOTDEFINED("not defined because of recoverably unresolved references");
         String doc;
+        static final EnumSet<FormatResolve> all = EnumSet.allOf(FormatResolve.class);
+        static final int count = all.size();
+
+        @Override
+        public SelectorCollector<FormatResolve> collector(Setter.SelectorList sl) {
+            return sl.resolves;
+        }
+
+        @Override
+        public String doc() {
+            return doc;
+        }
 
         private FormatResolve(String doc) {
             this.doc = doc;
         }
     }
 
+    /**
+     * Count of unresolved references
+     */
+    public enum FormatUnresolved implements Selector<FormatUnresolved> {
+        UNRESOLVED0("no names are unresolved"),
+        UNRESOLVED1("one name is unresolved"),
+        UNRESOLVED2("two or more names are unresolved");
+        String doc;
+        static final EnumSet<FormatUnresolved> all = EnumSet.allOf(FormatUnresolved.class);
+        static final int count = all.size();
+
+        @Override
+        public SelectorCollector<FormatUnresolved> collector(Setter.SelectorList sl) {
+            return sl.unresolvedCounts;
+        }
+
+        @Override
+        public String doc() {
+            return doc;
+        }
+
+        private FormatUnresolved(String doc) {
+            this.doc = doc;
+        }
+    }
+
+    /**
+     * Count of unresolved references
+     */
+    public enum FormatErrors implements Selector<FormatErrors> {
+        ERROR0("no errors"),
+        ERROR1("one error"),
+        ERROR2("two or more errors");
+        String doc;
+        static final EnumSet<FormatErrors> all = EnumSet.allOf(FormatErrors.class);
+        static final int count = all.size();
+
+        @Override
+        public SelectorCollector<FormatErrors> collector(Setter.SelectorList sl) {
+            return sl.errorCounts;
+        }
+
+        @Override
+        public String doc() {
+            return doc;
+        }
+
+        private FormatErrors(String doc) {
+            this.doc = doc;
+        }
+    }
+
+    class SelectorCollector<E extends Enum<E> & Selector<E>> {
+        final EnumSet<E> all;
+        EnumSet<E> set = null;
+        SelectorCollector(EnumSet<E> all) {
+            this.all = all;
+        }
+        void add(Object o) {
+            @SuppressWarnings("unchecked")
+            E e = (E) o;
+            if (set == null) {
+                set = EnumSet.of(e);
+            } else {
+                set.add(e);
+            }
+        }
+
+        boolean isEmpty() {
+            return set == null;
+        }
+
+        EnumSet<E> getSet() {
+            return set == null
+                    ? all
+                    : set;
+        }
+    }
+
     // Class used to set custom eval output formats
-    // For both /set format  and /set field -- Parse arguments, setting custom format, or printing error
-    private class FormatSetter {
+    // For both /set format  -- Parse arguments, setting custom format, or printing error
+    private class Setter {
 
         private final ArgTokenizer at;
         private final JShellTool tool;
         boolean valid = true;
 
-        class Case<E1 extends Enum<E1>, E2 extends Enum<E2>, E3 extends Enum<E3>> {
-
-            Set<E1> e1;
-            Set<E2> e2;
-            Set<E3> e3;
-
-            Case(Set<E1> e1, Set<E2> e2, Set<E3> e3) {
-                this.e1 = e1;
-                this.e2 = e2;
-                this.e3 = e3;
-            }
-
-            Case(Set<E1> e1, Set<E2> e2) {
-                this.e1 = e1;
-                this.e2 = e2;
-            }
-        }
-
-        FormatSetter(JShellTool tool, ArgTokenizer at) {
+        Setter(JShellTool tool, ArgTokenizer at) {
             this.tool = tool;
             this.at = at;
         }
@@ -593,6 +559,10 @@
             tool.hard(format, args);
         }
 
+        void hardrb(String key) {
+            tool.hardrb(key);
+        }
+
         <E extends Enum<E>> void hardEnums(EnumSet<E> es, Function<E, String> e2s) {
             hardPairs(es.stream(), ev -> ev.name().toLowerCase(Locale.US), e2s);
         }
@@ -681,137 +651,31 @@
         // For /set format <mode> "<format>" <selector>...
         boolean setFormat() {
             Mode m = nextMode();
-            String format = nextFormat();
-            if (valid) {
-                List<Case<FormatCase, FormatAction, FormatWhen>> specs = new ArrayList<>();
-                String s;
-                while ((s = at.next()) != null) {
-                    String[] d = s.split("-");
-                    specs.add(new Case<>(
-                            parseFormatCase(d, 0),
-                            parseFormatAction(d, 1),
-                            parseFormatWhen(d, 2)
-                    ));
-                }
-                if (valid && specs.isEmpty()) {
-                    errorat("At least one selector required");
-                    valid = false;
-                }
-                if (valid) {
-                    // set the format in the specified cases
-                    specs.stream()
-                            .forEach(c -> m.setCases(format, c.e1, c.e2, c.e3));
-                }
+            String field = at.next();
+            if (field == null || at.isQuoted()) {
+                errorat("Expected field name missing");
+                valid = false;
             }
-            if (!valid) {
-                fluff("See '/help /set format' for help");
+            String format = valid? nextFormat() : null;
+            String slRaw;
+            List<SelectorList> slList = new ArrayList<>();
+            while (valid && (slRaw = at.next()) != null) {
+                SelectorList sl = new SelectorList();
+                sl.parseSelectorList(slRaw);
+                slList.add(sl);
             }
-            return valid;
-        }
-
-        // For /set field mode <field> "<format>" <selector>...
-        boolean setField() {
-            Mode m = nextMode();
-            String fieldName = at.next();
-            FormatField field = parseFormatSelector(fieldName, EnumSet.allOf(FormatField.class), "field");
-            String format = nextFormat();
             if (valid) {
-                switch (field) {
-                    case ACTION: {
-                        List<Case<FormatAction, FormatWhen, FormatWhen>> specs = new ArrayList<>();
-                        String s;
-                        while ((s = at.next()) != null) {
-                            String[] d = s.split("-");
-                            specs.add(new Case<>(
-                                    parseFormatAction(d, 0),
-                                    parseFormatWhen(d, 1)
-                            ));
-                        }
-                        if (valid && specs.isEmpty()) {
-                            errorat("At least one selector required");
-                            valid = false;
-                        }
-                        if (valid) {
-                            // set the format of the specified actions
-                            specs.stream()
-                                    .forEach(c -> m.setActions(format, c.e1, c.e2));
-                        }
-                        break;
-                    }
-                    case RESOLVE: {
-                        List<Case<FormatResolve, FormatWhen, FormatWhen>> specs = new ArrayList<>();
-                        String s;
-                        while ((s = at.next()) != null) {
-                            String[] d = s.split("-");
-                            specs.add(new Case<>(
-                                    parseFormatResolve(d, 0),
-                                    parseFormatWhen(d, 1)
-                            ));
-                        }
-                        if (valid && specs.isEmpty()) {
-                            errorat("At least one selector required");
-                            valid = false;
-                        }
-                        if (valid) {
-                            // set the format of the specified resolves
-                            specs.stream()
-                                    .forEach(c -> m.setResolves(format, c.e1, c.e2));
-                        }
-                        break;
-                    }
-                    case WHEN: {
-                        List<Case<FormatWhen, FormatWhen, FormatWhen>> specs = new ArrayList<>();
-                        String s;
-                        while ((s = at.next()) != null) {
-                            String[] d = s.split("-");
-                            specs.add(new Case<>(
-                                    parseFormatWhen(d, 1),
-                                    null
-                            ));
-                        }
-                        if (valid && specs.isEmpty()) {
-                            errorat("At least one selector required");
-                            valid = false;
-                        }
-                        if (valid) {
-                            // set the format of the specified whens
-                            specs.stream()
-                                    .forEach(c -> m.setWhens(format, c.e1));
-                        }
-                        break;
-                    }
-                    case NAME: {
-                        m.setName(format);
-                        break;
-                    }
-                    case TYPE: {
-                        m.setType(format);
-                        break;
-                    }
-                    case RESULT: {
-                        m.setResult(format);
-                        break;
-                    }
-                    case PRE: {
-                        m.setPre(format);
-                        break;
-                    }
-                    case POST: {
-                        m.setPost(format);
-                        break;
-                    }
-                    case ERRORPRE: {
-                        m.setErrorPre(format);
-                        break;
-                    }
-                    case ERRORPOST: {
-                        m.setErrorPost(format);
-                        break;
-                    }
+                if (slList.isEmpty()) {
+                    m.set(field, ALWAYS, format);
+                } else {
+                    slList.stream()
+                            .forEach(sl -> m.set(field,
+                                sl.cases.getSet(), sl.actions.getSet(), sl.whens.getSet(),
+                                sl.resolves.getSet(), sl.unresolvedCounts.getSet(), sl.errorCounts.getSet(),
+                                format));
                 }
-            }
-            if (!valid) {
-                fluff("See '/help /set field' for help");
+            } else {
+                fluff("See '/help /set format' for help");
             }
             return valid;
         }
@@ -843,12 +707,11 @@
                 if (matches.length == 0) {
                     errorat("Does not match any current feedback mode: %s", umode);
                 } else {
-                    errorat("Matchs more then one current feedback mode: %s", umode);
+                    errorat("Matches more then one current feedback mode: %s", umode);
                 }
                 fluff("The feedback mode should be one of the following:");
                 modeMap.keySet().stream()
                         .forEach(mk -> fluff("   %s", mk));
-                fluff("You may also use just enough letters to make it unique.");
                 return null;
             }
         }
@@ -869,181 +732,75 @@
             return format;
         }
 
-        final Set<FormatCase> parseFormatCase(String[] s, int i) {
-            return parseFormatSelectorStar(s, i, FormatCase.class, EnumSet.allOf(FormatCase.class), "case");
-        }
-
-        final Set<FormatAction> parseFormatAction(String[] s, int i) {
-            return parseFormatSelectorStar(s, i, FormatAction.class,
-                    EnumSet.of(FormatAction.ADDED, FormatAction.MODIFIED, FormatAction.REPLACED), "action");
-        }
+        class SelectorList {
 
-        final Set<FormatResolve> parseFormatResolve(String[] s, int i) {
-            return parseFormatSelectorStar(s, i, FormatResolve.class,
-                    EnumSet.of(FormatResolve.DEFINED, FormatResolve.NOTDEFINED), "resolve");
-        }
-
-        final Set<FormatWhen> parseFormatWhen(String[] s, int i) {
-            return parseFormatSelectorStar(s, i, FormatWhen.class, EnumSet.of(FormatWhen.PRIMARY), "when");
-        }
+            SelectorCollector<FormatCase> cases = new SelectorCollector<>(FormatCase.all);
+            SelectorCollector<FormatAction> actions = new SelectorCollector<>(FormatAction.all);
+            SelectorCollector<FormatWhen> whens = new SelectorCollector<>(FormatWhen.all);
+            SelectorCollector<FormatResolve> resolves = new SelectorCollector<>(FormatResolve.all);
+            SelectorCollector<FormatUnresolved> unresolvedCounts = new SelectorCollector<>(FormatUnresolved.all);
+            SelectorCollector<FormatErrors> errorCounts = new SelectorCollector<>(FormatErrors.all);
 
-        /**
-         * In a selector x-y-z , parse x, y, or z -- whether they are missing,
-         * or a comma separated list of identifiers and stars.
-         *
-         * @param <E> The enum this selector should belong to
-         * @param sa The array of selector strings
-         * @param i The index of which selector string to use
-         * @param klass The class of the enum that should be used
-         * @param defaults The set of enum values to use if the selector is
-         * missing
-         * @return The set of enum values specified by this selector
-         */
-        final <E extends Enum<E>> Set<E> parseFormatSelectorStar(String[] sa, int i, Class<E> klass, EnumSet<E> defaults, String label) {
-            String s = sa.length > i
-                    ? sa[i]
-                    : null;
-            if (s == null || s.isEmpty()) {
-                return defaults;
-            }
-            Set<E> set = EnumSet.noneOf(klass);
-            EnumSet<E> values = EnumSet.allOf(klass);
-            for (String as : s.split(",")) {
-                if (as.equals("*")) {
-                    set.addAll(values);
-                } else if (!as.isEmpty()) {
-                    set.add(parseFormatSelector(as, values, label));
+            final void parseSelectorList(String sl) {
+                for (String s : sl.split("-")) {
+                    SelectorCollector<?> lastCollector = null;
+                    for (String as : s.split(",")) {
+                        if (!as.isEmpty()) {
+                            Selector<?> sel = selectorMap.get(as);
+                            if (sel == null) {
+                                errorat("Not a valid selector %s in %s", as, s);
+                                valid = false;
+                                return;
+                            }
+                            SelectorCollector<?> collector = sel.collector(this);
+                            if (lastCollector == null) {
+                                if (!collector.isEmpty()) {
+                                    errorat("Selector kind in multiple sections of selector list %s in %s", as, s);
+                                    valid = false;
+                                    return;
+                                }
+                            } else if (collector != lastCollector) {
+                                errorat("Different selector kinds in same sections of selector list %s in %s", as, s);
+                                valid = false;
+                                return;
+                            }
+                            collector.add(sel);
+                            lastCollector = collector;
+                        }
+                    }
                 }
             }
-            return set;
-        }
-
-        /**
-         * In a x-y-a,b selector, parse an x, y, a, or b -- that is an
-         * identifier
-         *
-         * @param <E> The enum this selector should belong to
-         * @param s The string to parse: x, y, or z
-         * @param values The allowed of this enum
-         * @return The enum value
-         */
-        final <E extends Enum<E>> E parseFormatSelector(String s, EnumSet<E> values, String label) {
-            if (s == null) {
-                valid = false;
-                return null;
-            }
-            String u = s.toUpperCase(Locale.US);
-            for (E c : values) {
-                if (c.name().startsWith(u)) {
-                    return c;
-                }
-            }
-
-            errorat("Not a valid %s: %s, must be one of: %s", label, s,
-                    values.stream().map(v -> v.name().toLowerCase(Locale.US)).collect(Collectors.joining(" ")));
-            valid = false;
-            return values.iterator().next();
         }
 
         final void printFormatHelp() {
-            hard("Set the format for reporting a snippet event.");
-            hard("");
-            hard("/set format <mode> \"<format>\" <selector>...");
-            hard("");
-            hard("Where <mode> is the name of a previously defined feedback mode -- see '/help /set newmode'.");
-            hard("Where <format> is a quoted string which will have these field substitutions:");
-            hard("   {action}    == The action, e.g.: Added, Modified, Assigned, ...");
-            hard("   {name}      == The name, e.g.: the variable name, ...");
-            hard("   {type}      == The type name");
-            hard("   {resolve}   == Unresolved info, e.g.: ', however, it cannot be invoked until'");
-            hard("   {result}    == The result value");
-            hard("   {when}      == The entered snippet or a resultant update");
-            hard("   {pre}       == The feedback prefix");
-            hard("   {post}      == The feedback postfix");
-            hard("   {errorpre}  == The error prefix");
-            hard("   {errorpost} == The error postfix");
-            hard("Use '/set field' to set the format of these substitutions.");
-            hard("Where <selector> is the context in which the format is applied.");
-            hard("The structure of selector is: <case>[-<action>[-<when>]]");
-            hard("Where each field component may be missing (indicating defaults),");
-            hard("star (indicating all), or a comma separated list of field values.");
-            hard("For case, the field values are:");
+            hardrb("help.set.format");
+            hardrb("help.set.format.case");
             hardEnums(EnumSet.allOf(FormatCase.class), ev -> ev.doc);
-            hard("For action, the field values are:");
+            hardrb("help.set.format.action");
             hardEnums(EnumSet.allOf(FormatAction.class), ev -> ev.doc);
-            hard("For when, the field values are:");
+            hardrb("help.set.format.when");
             hardEnums(EnumSet.allOf(FormatWhen.class), ev -> ev.doc);
-            hard("");
-            hard("Example:");
-            hard("   /set format example '{pre}{action} variable {name}, reset to null{post}' varreset-*-update");
-        }
-
-        final void printFieldHelp() {
-            hard("Set the format of a field substitution as used in '/set format'.");
-            hard("");
-            hard("/set field <mode> <field> \"<format>\" <selector>...");
-            hard("");
-            hard("Where <mode> is the name of a previously defined feedback mode -- see '/set newmode'.");
-            hard("Where <field> is context-specific format to set, each with its own selector structure:");
-            hard("   action    == The action. The selector: <action>-<when>.");
-            hard("   name      == The name.  '%%s' is the name.  No selectors.");
-            hard("   type      == The type name.  '%%s' is the type. No selectors.");
-            hard("   resolve   == Unresolved info.  '%%s' is the unresolved list. The selector: <resolve>-<when>.");
-            hard("   result    == The result value.  '%%s' is the result value. No selectors.");
-            hard("   when      == The entered snippet or a resultant update. The selector: <when>");
-            hard("   pre       == The feedback prefix. No selectors.");
-            hard("   post      == The feedback postfix. No selectors.");
-            hard("   errorpre  == The error prefix. No selectors.");
-            hard("   errorpost == The error postfix. No selectors.");
-            hard("Where <format> is a quoted string -- see the description specific to the field (above).");
-            hard("Where <selector> is the context in which the format is applied (see above).");
-            hard("For action, the field values are:");
-            hardEnums(EnumSet.allOf(FormatAction.class), ev -> ev.doc);
-            hard("For when, the field values are:");
-            hardEnums(EnumSet.allOf(FormatWhen.class), ev -> ev.doc);
-            hard("For resolve, the field values are:");
+            hardrb("help.set.format.resolve");
             hardEnums(EnumSet.allOf(FormatResolve.class), ev -> ev.doc);
-            hard("");
-            hard("Example:");
-            hard("   /set field example resolve ' which cannot be invoked until%%s is declared' defined-update");
+            hardrb("help.set.format.unresolved");
+            hardEnums(EnumSet.allOf(FormatUnresolved.class), ev -> ev.doc);
+            hardrb("help.set.format.errors");
+            hardEnums(EnumSet.allOf(FormatErrors.class), ev -> ev.doc);
+            hardrb("help.set.format.end");
         }
 
         final void printFeedbackHelp() {
-            hard("Set the feedback mode describing displayed feedback for entered snippets and commands.");
-            hard("");
-            hard("/set feedback <mode>");
-            hard("");
-            hard("Where <mode> is the name of a previously defined feedback mode.");
-            hard("Currently defined feedback modes:");
+            hardrb("help.set.feedback");
             modeMap.keySet().stream()
                     .forEach(m -> hard("   %s", m));
-            hard("User-defined modes can be added, see '/help /set newmode'");
         }
 
         final void printNewModeHelp() {
-            hard("Create a user-defined feedback mode, optionally copying from an existing mode.");
-            hard("");
-            hard("/set newmode <new-mode> [command|quiet [<old-mode>]]");
-            hard("");
-            hard("Where <new-mode> is the name of a mode you wish to create.");
-            hard("Where <old-mode> is the name of a previously defined feedback mode.");
-            hard("If <old-mode> is present, its settings are copied to the new mode.");
-            hard("'command' vs 'quiet' determines if informative/verifying command feedback is displayed.");
-            hard("");
-            hard("Once the new mode is created, use '/set format', '/set field', and '/set prompt' to configure it.");
-            hard("Use '/set feedback' to use the new mode.");
+            hardrb("help.set.newmode");
         }
 
         final void printPromptHelp() {
-            hard("Set the prompts.  Both the normal prompt and the continuation-prompt must be set.");
-            hard("");
-            hard("/set prompt <mode> \"<prompt>\" \"<continuation-propmt>\"");
-            hard("");
-            hard("Where <mode> is the name of a previously defined feedback mode.");
-            hard("Where <prompt> and <continuation-propmt> are quoted strings printed as input promptds;");
-            hard("Both may optionally contain '%%s' which will be substituted with the next snippet id --");
-            hard("note that what is entered may not be assigned that id, for example it may be an error or command.");
-            hard("The continuation-prompt is used on the second and subsequent lines of a multi-line snippet.");
+            hardrb("help.set.prompt");
         }
     }
 }
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Wed Jul 05 21:30:21 2017 +0200
@@ -75,7 +75,6 @@
 import jdk.jshell.PersistentSnippet;
 import jdk.jshell.Snippet;
 import jdk.jshell.Snippet.Status;
-import jdk.jshell.Snippet.SubKind;
 import jdk.jshell.SnippetEvent;
 import jdk.jshell.SourceCodeAnalysis;
 import jdk.jshell.SourceCodeAnalysis.CompletionInfo;
@@ -95,10 +94,11 @@
 import java.util.function.Supplier;
 import jdk.internal.jshell.tool.Feedback.FormatAction;
 import jdk.internal.jshell.tool.Feedback.FormatCase;
+import jdk.internal.jshell.tool.Feedback.FormatErrors;
 import jdk.internal.jshell.tool.Feedback.FormatResolve;
+import jdk.internal.jshell.tool.Feedback.FormatUnresolved;
 import jdk.internal.jshell.tool.Feedback.FormatWhen;
 import static java.util.stream.Collectors.toList;
-import static jdk.jshell.Snippet.Kind.METHOD;
 import static java.util.stream.Collectors.toMap;
 import static jdk.jshell.Snippet.SubKind.VAR_VALUE_SUBKIND;
 
@@ -113,6 +113,12 @@
     private static final Pattern HISTORY_ALL_START_FILENAME = Pattern.compile(
             "((?<cmd>(all|history|start))(\\z|\\p{javaWhitespace}+))?(?<filename>.*)");
     private static final String RECORD_SEPARATOR = "\u241E";
+    private static final String RB_NAME_PREFIX  = "jdk.internal.jshell.tool.resources";
+    private static final String VERSION_RB_NAME = RB_NAME_PREFIX + ".version";
+    private static final String L10N_RB_NAME    = RB_NAME_PREFIX + ".l10n";
+    private static ResourceBundle versionRB = null;
+    private static ResourceBundle outputRB  = null;
+
 
     final InputStream cmdin;
     final PrintStream cmdout;
@@ -121,6 +127,7 @@
     final InputStream userin;
     final PrintStream userout;
     final PrintStream usererr;
+    final Preferences prefs;
 
     final Feedback feedback = new Feedback();
 
@@ -137,7 +144,8 @@
      */
     public JShellTool(InputStream cmdin, PrintStream cmdout, PrintStream cmderr,
             PrintStream console,
-            InputStream userin, PrintStream userout, PrintStream usererr) {
+            InputStream userin, PrintStream userout, PrintStream usererr,
+            Preferences prefs) {
         this.cmdin = cmdin;
         this.cmdout = cmdout;
         this.cmderr = cmderr;
@@ -145,82 +153,19 @@
         this.userin = userin;
         this.userout = userout;
         this.usererr = usererr;
-        initializeFeedbackModes();
-    }
-
-    /**
-     * Create the default set of feedback modes
-     */
-    final void initializeFeedbackModes() {
-        // Initialize normal feedback mode
-        cmdSet("newmode normal command");
-        cmdSet("prompt normal '\n-> ' '>> '");
-        cmdSet("field normal pre '|  '");
-        cmdSet("field normal post '%n'");
-        cmdSet("field normal errorpre '|  '");
-        cmdSet("field normal errorpost '%n'");
-        cmdSet("field normal action 'Added' added-primary");
-        cmdSet("field normal action 'Modified' modified-primary");
-        cmdSet("field normal action 'Replaced' replaced-primary");
-        cmdSet("field normal action 'Overwrote' overwrote-primary");
-        cmdSet("field normal action 'Dropped' dropped-primary");
-        cmdSet("field normal action 'Rejected' rejected-primary");
-        cmdSet("field normal action '  Update added' added-update");
-        cmdSet("field normal action '  Update modified' modified-update");
-        cmdSet("field normal action '  Update replaced' replaced-update");
-        cmdSet("field normal action '  Update overwrote' overwrote-update");
-        cmdSet("field normal action '  Update dropped' dropped-update");
-        cmdSet("field normal action '  Update rejected' rejected-update");
-        cmdSet("field normal resolve '' ok-*");
-        cmdSet("field normal resolve ', however, it cannot be invoked until%s is declared' defined-primary");
-        cmdSet("field normal resolve ', however, it cannot be referenced until%s is declared' notdefined-primary");
-        cmdSet("field normal resolve ' which cannot be invoked until%s is declared' defined-update");
-        cmdSet("field normal resolve ' which cannot be referenced until%s is declared' notdefined-update");
-        cmdSet("field normal name '%s'");
-        cmdSet("field normal type '%s'");
-        cmdSet("field normal result '%s'");
-
-        cmdSet("format normal '' *-*-*");
-
-        cmdSet("format normal '{pre}{action} class {name}{resolve}{post}' class");
-        cmdSet("format normal '{pre}{action} interface {name}{resolve}{post}' interface");
-        cmdSet("format normal '{pre}{action} enum {name}{resolve}{post}' enum");
-        cmdSet("format normal '{pre}{action} annotation interface {name}{resolve}{post}' annotation");
-
-        cmdSet("format normal '{pre}{action} method {name}({type}){resolve}{post}' method");
-
-        cmdSet("format normal '{pre}{action} variable {name} of type {type}{resolve}{post}' vardecl");
-        cmdSet("format normal '{pre}{action} variable {name} of type {type} with initial value {result}{resolve}{post}' varinit");
-        cmdSet("format normal '{pre}{action} variable {name}{resolve}{post}' vardeclrecoverable");
-        cmdSet("format normal '{pre}{action} variable {name}, reset to null{post}' varreset-*-update");
-
-        cmdSet("format normal '{pre}Expression value is: {result}{post}" +
-                "{pre}  assigned to temporary variable {name} of type {type}{post}' expression");
-        cmdSet("format normal '{pre}Variable {name} of type {type} has value {result}{post}' varvalue");
-        cmdSet("format normal '{pre}Variable {name} has been assigned the value {result}{post}' assignment");
-
-        cmdSet("feedback normal");
-
-        // Initialize off feedback mode
-        cmdSet("newmode off quiet");
-        cmdSet("prompt off '-> ' '>> '");
-        cmdSet("field off pre '|  '");
-        cmdSet("field off post '%n'");
-        cmdSet("field off errorpre '|  '");
-        cmdSet("field off errorpost '%n'");
-        cmdSet("format off '' *-*-*");
+        this.prefs = prefs;
     }
 
     private IOContext input = null;
     private boolean regenerateOnDeath = true;
     private boolean live = false;
+    private boolean feedbackInitialized = false;
 
     SourceCodeAnalysis analysis;
     JShell state = null;
     Subscription shutdownSubscription = null;
 
     private boolean debug = false;
-    private boolean displayPrompt = true;
     public boolean testPrompt = false;
     private String cmdlineClasspath = null;
     private String cmdlineStartup = null;
@@ -230,8 +175,6 @@
     private List<String> replayableHistory;
     private List<String> replayableHistoryPrevious;
 
-    static final Preferences PREFS = Preferences.userRoot().node("tool/JShell");
-
     static final String STARTUP_KEY = "STARTUP";
     static final String REPLAY_RESTORE_KEY = "REPLAY_RESTORE";
 
@@ -325,6 +268,43 @@
         }
     }
 
+    /**
+     * Print using resource bundle look-up and adding prefix and postfix
+     *
+     * @param key the resource key
+     */
+    String getResourceString(String key) {
+        if (outputRB == null) {
+            try {
+                outputRB = ResourceBundle.getBundle(L10N_RB_NAME);
+            } catch (MissingResourceException mre) {
+                error("Cannot find ResourceBundle: %s", L10N_RB_NAME);
+                return "";
+            }
+        }
+        String s;
+        try {
+            s = outputRB.getString(key);
+        } catch (MissingResourceException mre) {
+            error("Missing resource: %s in %s", key, L10N_RB_NAME);
+            return "";
+        }
+        return s;
+    }
+
+    /**
+     * Print using resource bundle look-up and adding prefix and postfix
+     *
+     * @param key the resource key
+     */
+    void hardrb(String key) {
+        String s = getResourceString(key);
+        String out = feedback.getPre()
+                + s.substring(0, s.length() - 1).replaceAll("\\R", "\n" + feedback.getPre())
+                + s.substring(s.length() - 1, s.length());
+        cmdout.print(out);
+    }
+
     <T> void hardPairs(Stream<T> stream, Function<T, String> a, Function<T, String> b) {
         Map<String, String> a2b = stream.collect(toMap(a, b,
                 (m1, m2) -> m1,
@@ -342,26 +322,6 @@
     }
 
     /**
-     * User custom feedback mode only
-     *
-     * @param fcase Event to report
-     * @param update Is this an update (rather than primary)
-     * @param fa Action
-     * @param fr Resolution status
-     * @param name Name string
-     * @param type Type string or null
-     * @param result Result value or null
-     * @param unresolved The unresolved symbols
-     */
-    void custom(FormatCase fcase, boolean update, FormatAction fa, FormatResolve fr,
-            String name, String type, String unresolved, String result) {
-        String format = feedback.getFormat(fcase,
-                (update ? FormatWhen.UPDATE : FormatWhen.PRIMARY), fa, fr,
-                name != null, type != null, result != null);
-        fluffRaw(format, unresolved, name, type, result);
-    }
-
-    /**
      * Trim whitespace off end of string
      *
      * @param s
@@ -387,7 +347,8 @@
      */
     public static void main(String[] args) throws Exception {
         new JShellTool(System.in, System.out, System.err, System.out,
-                 new ByteArrayInputStream(new byte[0]), System.out, System.err)
+                 new ByteArrayInputStream(new byte[0]), System.out, System.err,
+                 Preferences.userRoot().node("tool/JShell"))
                 .start(args);
     }
 
@@ -406,7 +367,7 @@
         resetState(); // Initialize
 
         // Read replay history from last jshell session into previous history
-        String prevReplay = PREFS.get(REPLAY_RESTORE_KEY, null);
+        String prevReplay = prefs.get(REPLAY_RESTORE_KEY, null);
         if (prevReplay != null) {
             replayableHistoryPrevious = Arrays.asList(prevReplay.split(RECORD_SEPARATOR));
         }
@@ -542,7 +503,6 @@
                         ? currentNameSpace.tid(sn)
                         : errorNamespace.tid(sn))
                 .build();
-        analysis = state.sourceCodeAnalysis();
         shutdownSubscription = state.onShutdown((JShell deadState) -> {
             if (deadState == state) {
                 hard("State engine terminated.");
@@ -550,7 +510,12 @@
                 live = false;
             }
         });
+        analysis = state.sourceCodeAnalysis();
         live = true;
+        if (!feedbackInitialized) {
+            startUpRun(getResourceString("startup.feedback"));
+            feedbackInitialized = true;
+        }
 
         if (cmdlineClasspath != null) {
             state.addToClasspath(cmdlineClasspath);
@@ -558,20 +523,24 @@
 
         String start;
         if (cmdlineStartup == null) {
-            start = PREFS.get(STARTUP_KEY, "<nada>");
+            start = prefs.get(STARTUP_KEY, "<nada>");
             if (start.equals("<nada>")) {
                 start = DEFAULT_STARTUP;
-                PREFS.put(STARTUP_KEY, DEFAULT_STARTUP);
+                prefs.put(STARTUP_KEY, DEFAULT_STARTUP);
             }
         } else {
             start = cmdlineStartup;
         }
+        startUpRun(start);
+        currentNameSpace = mainNamespace;
+    }
+    //where
+    private void startUpRun(String start) {
         try (IOContext suin = new FileScannerIOContext(new StringReader(start))) {
             run(suin);
         } catch (Exception ex) {
             hard("Unexpected exception reading start-up: %s\n", ex);
         }
-        currentNameSpace = mainNamespace;
     }
 
     private void closeState() {
@@ -594,7 +563,7 @@
             String incomplete = "";
             while (live) {
                 String prompt;
-                if (displayPrompt) {
+                if (currentNameSpace == mainNamespace) {
                     prompt = testPrompt
                                     ? incomplete.isEmpty()
                                             ? "\u0005" //ENQ
@@ -677,21 +646,22 @@
             cmd = cmd.substring(0, idx);
         }
         Command[] candidates = findCommand(cmd, c -> c.kind.isRealCommand);
-        if (candidates.length == 0) {
-            if (!rerunHistoryEntryById(cmd.substring(1))) {
-                error("No such command or snippet id: %s", cmd);
+        switch (candidates.length) {
+            case 0:
+                if (!rerunHistoryEntryById(cmd.substring(1))) {
+                    error("No such command or snippet id: %s", cmd);
+                    fluff("Type /help for help.");
+                }   break;
+            case 1:
+                Command command = candidates[0];
+                // If comand was successful and is of a replayable kind, add it the replayable history
+                if (command.run.apply(arg) && command.kind == CommandKind.REPLAY) {
+                    addToReplayHistory((command.command + " " + arg).trim());
+                }   break;
+            default:
+                error("Command: %s is ambiguous: %s", cmd, Arrays.stream(candidates).map(c -> c.command).collect(Collectors.joining(", ")));
                 fluff("Type /help for help.");
-            }
-        } else if (candidates.length == 1) {
-            Command command = candidates[0];
-
-            // If comand was successful and is of a replayable kind, add it the replayable history
-            if (command.run.apply(arg) && command.kind == CommandKind.REPLAY) {
-                addToReplayHistory((command.command + " " + arg).trim());
-            }
-        } else {
-            error("Command: %s is ambiguous: %s", cmd, Arrays.stream(candidates).map(c -> c.command).collect(Collectors.joining(", ")));
-            fluff("Type /help for help.");
+                break;
         }
     }
 
@@ -1020,7 +990,7 @@
                 "  -- Display information about the specified help subject. Example: /help intro\n",
                 arg -> cmdHelp(arg),
                 EMPTY_COMPLETION_PROVIDER));
-        registerCommand(new Command("/set", "editor|start|feedback|newmode|prompt|format|field ...", "set jshell configuration information",
+        registerCommand(new Command("/set", "editor|start|feedback|newmode|prompt|format ...", "set jshell configuration information",
                 "Set jshell configuration information, including:\n" +
                 "the external editor to use, the start-up definitions to use, a new feedback mode,\n" +
                 "the command prompt, the feedback mode to use, or the format of output.\n" +
@@ -1041,16 +1011,13 @@
                 "/set prompt <mode> \"<prompt>\" \"<continuation-prompt>\"\n" +
                 "  -- Set the displayed prompts for a given feedback mode.\n" +
                 "\n" +
-                "/set format <mode> \"<format>\" <selector>...\n" +
-                "  -- Configure a feedback mode by setting the format to use in a specified set of cases.\n" +
-                "\n" +
-                "/set field name|type|result|when|action|resolve|pre|post|errorpre|errorpost \"<format>\"  <format-case>...\n" +
-                "  -- Set the format of a field within the <format-string> of a \"/set format\" command\n" +
+                "/set format <mode> <field> \"<format>\" <selector>...\n" +
+                "  -- Configure a feedback mode by setting the format of a field when the selector matchs.\n" +
                 "\n" +
                 "To get more information about one of these forms, use /help with the form specified.\n" +
                 "For example:   /help /set format\n",
                 arg -> cmdSet(arg),
-                new FixedCompletionProvider("format", "field", "feedback", "prompt", "newmode", "start", "editor")));
+                new FixedCompletionProvider("format", "feedback", "prompt", "newmode", "start", "editor")));
         registerCommand(new Command("/?", "", "get information about jshell",
                 "Display information about jshell (abbreviation for /help).\n" +
                 "/?\n" +
@@ -1151,11 +1118,9 @@
 
     // --- Command implementations ---
 
-    private static final String[] setSub = new String[]{
-        "format", "field", "feedback", "newmode", "prompt", "editor", "start"};
+    private static final String[] SET_SUBCOMMANDS = new String[]{
+        "format", "feedback", "newmode", "prompt", "editor", "start"};
 
-    // The /set command.  Currently /set format, /set field and /set feedback.
-    // Other commands will fold here, see: 8148317
     final boolean cmdSet(String arg) {
         ArgTokenizer at = new ArgTokenizer(arg.trim());
         String which = setSubCommand(at);
@@ -1165,8 +1130,6 @@
         switch (which) {
             case "format":
                 return feedback.setFormat(this, at);
-            case "field":
-                return feedback.setField(this, at);
             case "feedback":
                 return feedback.setFeedback(this, at);
             case "newmode":
@@ -1198,7 +1161,7 @@
                     try {
                         byte[] encoded = Files.readAllBytes(toPathResolvingUserHome(filename));
                         String init = new String(encoded);
-                        PREFS.put(STARTUP_KEY, init);
+                        prefs.put(STARTUP_KEY, init);
                     } catch (AccessDeniedException e) {
                         hard("File '%s' for /set start is not accessible.", filename);
                         return false;
@@ -1227,9 +1190,6 @@
             case "format":
                 feedback.printFormatHelp(this);
                 return true;
-            case "field":
-                feedback.printFieldHelp(this);
-                return true;
             case "feedback":
                 feedback.printFeedbackHelp(this);
                 return true;
@@ -1263,13 +1223,13 @@
     }
 
     String setSubCommand(ArgTokenizer at) {
-        String[] matches = at.next(setSub);
+        String[] matches = at.next(SET_SUBCOMMANDS);
         if (matches == null) {
             error("The /set command requires arguments. See: /help /set");
             return null;
         } else if (matches.length == 0) {
             error("Not a valid argument to /set: %s", at.val());
-            fluff("/set is followed by one of: %s", Arrays.stream(setSub)
+            fluff("/set is followed by one of: %s", Arrays.stream(SET_SUBCOMMANDS)
                     .collect(Collectors.joining(", "))
             );
             return null;
@@ -1347,8 +1307,20 @@
         regenerateOnDeath = false;
         live = false;
         if (!replayableHistory.isEmpty()) {
-            PREFS.put(REPLAY_RESTORE_KEY, replayableHistory.stream().reduce(
-                    (a, b) -> a + RECORD_SEPARATOR + b).get());
+            // Prevent history overflow by calculating what will fit, starting
+            // with must recent
+            int sepLen = RECORD_SEPARATOR.length();
+            int length = 0;
+            int first = replayableHistory.size();
+            while(length < Preferences.MAX_VALUE_LENGTH && --first >= 0) {
+                length += replayableHistory.get(first).length() + sepLen;
+            }
+            String hist = replayableHistory
+                    .subList(first + 1, replayableHistory.size())
+                    .stream()
+                    .reduce( (a, b) -> a + RECORD_SEPARATOR + b)
+                    .get();
+            prefs.put(REPLAY_RESTORE_KEY, hist);
         }
         fluff("Goodbye\n");
         return true;
@@ -1839,68 +1811,55 @@
                 .collect(toList());
     }
 
-    void printDiagnostics(String source, List<Diag> diagnostics, boolean embed) {
-        String padding = embed? "    " : "";
-        for (Diag diag : diagnostics) {
-            //assert diag.getSource().equals(source);
+    void displayDiagnostics(String source, Diag diag, List<String> toDisplay) {
+        for (String line : diag.getMessage(null).split("\\r?\\n")) { // TODO: Internationalize
+            if (!line.trim().startsWith("location:")) {
+                toDisplay.add(line);
+            }
+        }
 
-            if (!embed) {
-                if (diag.isError()) {
-                    hard("Error:");
-                } else {
-                    hard("Warning:");
-                }
+        int pstart = (int) diag.getStartPosition();
+        int pend = (int) diag.getEndPosition();
+        Matcher m = LINEBREAK.matcher(source);
+        int pstartl = 0;
+        int pendl = -2;
+        while (m.find(pstartl)) {
+            pendl = m.start();
+            if (pendl >= pstart) {
+                break;
+            } else {
+                pstartl = m.end();
             }
-
-            for (String line : diag.getMessage(null).split("\\r?\\n")) { // TODO: Internationalize
-                if (!line.trim().startsWith("location:")) {
-                    hard("%s%s", padding, line);
-                }
-            }
+        }
+        if (pendl < pstart) {
+            pendl = source.length();
+        }
+        toDisplay.add(source.substring(pstartl, pendl));
 
-            int pstart = (int) diag.getStartPosition();
-            int pend = (int) diag.getEndPosition();
-            Matcher m = LINEBREAK.matcher(source);
-            int pstartl = 0;
-            int pendl = -2;
-            while (m.find(pstartl)) {
-                pendl = m.start();
-                if (pendl >= pstart) {
-                    break;
-                } else {
-                    pstartl = m.end();
-                }
+        StringBuilder sb = new StringBuilder();
+        int start = pstart - pstartl;
+        for (int i = 0; i < start; ++i) {
+            sb.append(' ');
+        }
+        sb.append('^');
+        boolean multiline = pend > pendl;
+        int end = (multiline ? pendl : pend) - pstartl - 1;
+        if (end > start) {
+            for (int i = start + 1; i < end; ++i) {
+                sb.append('-');
             }
-            if (pendl < pstart) {
-                pendl = source.length();
+            if (multiline) {
+                sb.append("-...");
+            } else {
+                sb.append('^');
             }
-            fluff("%s%s", padding, source.substring(pstartl, pendl));
+        }
+        toDisplay.add(sb.toString());
 
-            StringBuilder sb = new StringBuilder();
-            int start = pstart - pstartl;
-            for (int i = 0; i < start; ++i) {
-                sb.append(' ');
-            }
-            sb.append('^');
-            boolean multiline = pend > pendl;
-            int end = (multiline ? pendl : pend) - pstartl - 1;
-            if (end > start) {
-                for (int i = start + 1; i < end; ++i) {
-                    sb.append('-');
-                }
-                if (multiline) {
-                    sb.append("-...");
-                } else {
-                    sb.append('^');
-                }
-            }
-            fluff("%s%s", padding, sb.toString());
-
-            debug("printDiagnostics start-pos = %d ==> %d -- wrap = %s", diag.getStartPosition(), start, this);
-            debug("Code: %s", diag.getCode());
-            debug("Pos: %d (%d - %d)", diag.getPosition(),
-                    diag.getStartPosition(), diag.getEndPosition());
-        }
+        debug("printDiagnostics start-pos = %d ==> %d -- wrap = %s", diag.getStartPosition(), start, this);
+        debug("Code: %s", diag.getCode());
+        debug("Pos: %d (%d - %d)", diag.getPosition(),
+                diag.getStartPosition(), diag.getEndPosition());
     }
 
     private String processSource(String srcInput) throws IllegalStateException {
@@ -1941,6 +1900,7 @@
         return failed;
     }
 
+    // Handle incoming snippet events -- return true on failure
     private boolean handleEvent(SnippetEvent ste) {
         Snippet sn = ste.snippet();
         if (sn == null) {
@@ -1951,162 +1911,49 @@
         String source = sn.source();
         if (ste.causeSnippet() == null) {
             // main event
-            printDiagnostics(source, diagnostics, false);
-            if (ste.status().isActive) {
+            for (Diag d : diagnostics) {
+                if (d.isError()) {
+                    hard("Error:");
+                } else {
+                    hard("Warning:");
+                }
+                List<String> disp = new ArrayList<>();
+                displayDiagnostics(source, d, disp);
+                disp.stream()
+                        .forEach(l -> hard(l));
+            }
+
+            if (ste.status() != Status.REJECTED) {
                 if (ste.exception() != null) {
                     if (ste.exception() instanceof EvalException) {
                         printEvalException((EvalException) ste.exception());
                         return true;
                     } else if (ste.exception() instanceof UnresolvedReferenceException) {
-                        printUnresolved((UnresolvedReferenceException) ste.exception());
+                        printUnresolvedException((UnresolvedReferenceException) ste.exception());
                     } else {
                         hard("Unexpected execution exception: %s", ste.exception());
                         return true;
                     }
                 } else {
-                    displayDeclarationAndValue(ste, false, ste.value());
+                    new DisplayEvent(ste, false, ste.value(), diagnostics).displayDeclarationAndValue();
                 }
-            } else if (ste.status() == Status.REJECTED) {
+            } else {
                 if (diagnostics.isEmpty()) {
                     hard("Failed.");
                 }
                 return true;
             }
-        } else if (ste.status() == Status.REJECTED) {
-            //TODO -- I don't believe updates can cause failures any more
-            hard("Caused failure of dependent %s --", ((DeclarationSnippet) sn).name());
-            printDiagnostics(source, diagnostics, true);
         } else {
             // Update
             if (sn instanceof DeclarationSnippet) {
-                // display update information
-                displayDeclarationAndValue(ste, true, ste.value());
+                List<Diag> other = errorsOnly(diagnostics);
 
-                List<Diag> other = errorsOnly(diagnostics);
-                if (other.size() > 0) {
-                    printDiagnostics(source, other, true);
-                }
+                // display update information
+                new DisplayEvent(ste, true, ste.value(), other).displayDeclarationAndValue();
             }
         }
         return false;
     }
-
-    @SuppressWarnings("fallthrough")
-    private void displayDeclarationAndValue(SnippetEvent ste, boolean update, String value) {
-        Snippet key = ste.snippet();
-        FormatAction action;
-        Status status = ste.status();
-        switch (status) {
-            case VALID:
-            case RECOVERABLE_DEFINED:
-            case RECOVERABLE_NOT_DEFINED:
-                if (ste.previousStatus().isActive) {
-                    action = ste.isSignatureChange()
-                        ? FormatAction.REPLACED
-                        : FormatAction.MODIFIED;
-                } else {
-                    action = FormatAction.ADDED;
-                }
-                break;
-            case OVERWRITTEN:
-                action = FormatAction.OVERWROTE;
-                break;
-            case DROPPED:
-                action = FormatAction.DROPPED;
-                break;
-            case REJECTED:
-                action = FormatAction.REJECTED;
-                break;
-            case NONEXISTENT:
-            default:
-                // Should not occur
-                error("Unexpected status: " + ste.previousStatus().toString() + "=>" + status.toString());
-                return;
-        }
-        FormatResolve resolution;
-        String unresolved;
-        if (key instanceof DeclarationSnippet && (status == Status.RECOVERABLE_DEFINED || status == Status.RECOVERABLE_NOT_DEFINED)) {
-            resolution = (status == Status.RECOVERABLE_NOT_DEFINED)
-                    ? FormatResolve.NOTDEFINED
-                    : FormatResolve.DEFINED;
-            unresolved = unresolved((DeclarationSnippet) key);
-        } else {
-            resolution = FormatResolve.OK;
-            unresolved = "";
-        }
-        switch (key.subKind()) {
-            case CLASS_SUBKIND:
-                custom(FormatCase.CLASS, update, action, resolution,
-                        ((TypeDeclSnippet) key).name(), null, unresolved, null);
-                break;
-            case INTERFACE_SUBKIND:
-                custom(FormatCase.INTERFACE, update, action, resolution,
-                        ((TypeDeclSnippet) key).name(), null, unresolved, null);
-                break;
-            case ENUM_SUBKIND:
-                custom(FormatCase.ENUM, update, action, resolution,
-                        ((TypeDeclSnippet) key).name(), null, unresolved, null);
-                break;
-            case ANNOTATION_TYPE_SUBKIND:
-                custom(FormatCase.ANNOTATION, update, action, resolution,
-                        ((TypeDeclSnippet) key).name(), null, unresolved, null);
-                break;
-            case METHOD_SUBKIND:
-                custom(FormatCase.METHOD, update, action, resolution,
-                        ((MethodSnippet) key).name(), ((MethodSnippet) key).parameterTypes(), unresolved, null);
-                break;
-            case VAR_DECLARATION_SUBKIND:
-            case VAR_DECLARATION_WITH_INITIALIZER_SUBKIND: {
-                VarSnippet vk = (VarSnippet) key;
-                if (status == Status.RECOVERABLE_NOT_DEFINED) {
-                    custom(FormatCase.VARDECLRECOVERABLE, update, action, resolution,
-                            vk.name(), null, unresolved, null);
-                } else if (update && ste.isSignatureChange()) {
-                    custom(FormatCase.VARRESET, update, action, resolution,
-                            vk.name(), null, unresolved, value);
-                } else if (key.subKind() == SubKind.VAR_DECLARATION_WITH_INITIALIZER_SUBKIND) {
-                    custom(FormatCase.VARINIT, update, action, resolution,
-                            vk.name(), vk.typeName(), unresolved, value);
-                } else {
-                    custom(FormatCase.VARDECL, update, action, resolution,
-                            vk.name(), vk.typeName(), unresolved, value);
-                }
-                break;
-            }
-            case TEMP_VAR_EXPRESSION_SUBKIND: {
-                VarSnippet vk = (VarSnippet) key;
-                custom(FormatCase.EXPRESSION, update, action, resolution,
-                        vk.name(), vk.typeName(), null, value);
-                break;
-            }
-            case OTHER_EXPRESSION_SUBKIND:
-                error("Unexpected expression form -- value is: %s", (value));
-                break;
-            case VAR_VALUE_SUBKIND: {
-                ExpressionSnippet ek = (ExpressionSnippet) key;
-                custom(FormatCase.VARVALUE, update, action, resolution,
-                        ek.name(), ek.typeName(), null, value);
-                break;
-            }
-            case ASSIGNMENT_SUBKIND: {
-                ExpressionSnippet ek = (ExpressionSnippet) key;
-                custom(FormatCase.ASSIGNMENT, update, action, resolution,
-                        ek.name(), ek.typeName(), null, value);
-                break;
-            }
-            case SINGLE_TYPE_IMPORT_SUBKIND:
-            case TYPE_IMPORT_ON_DEMAND_SUBKIND:
-            case SINGLE_STATIC_IMPORT_SUBKIND:
-            case STATIC_IMPORT_ON_DEMAND_SUBKIND:
-                custom(FormatCase.IMPORT, update, action, resolution,
-                        ((ImportSnippet) key).name(), null, null, null);
-                break;
-            case STATEMENT_SUBKIND:
-                custom(FormatCase.STATEMENT, update, action, resolution,
-                        null, null, null, null);
-                break;
-        }
-    }
     //where
     void printStackTrace(StackTraceElement[] stes) {
         for (StackTraceElement ste : stes) {
@@ -2139,31 +1986,11 @@
         }
     }
     //where
-    void printUnresolved(UnresolvedReferenceException ex) {
+    void printUnresolvedException(UnresolvedReferenceException ex) {
         DeclarationSnippet corralled =  ex.getSnippet();
         List<Diag> otherErrors = errorsOnly(state.diagnostics(corralled));
-        StringBuilder sb = new StringBuilder();
-        if (otherErrors.size() > 0) {
-            if (state.unresolvedDependencies(corralled).size() > 0) {
-                sb.append(" and");
-            }
-            if (otherErrors.size() == 1) {
-                sb.append(" this error is addressed --");
-            } else {
-                sb.append(" these errors are addressed --");
-            }
-        } else {
-            sb.append(".");
-        }
-
-        String format = corralled.kind() == METHOD
-                ? "Attempted to call %s which cannot be invoked until%s"
-                : "Attempted to use %s which cannot be accessed until%s";
-        hard(format, corralled.name(),
-                unresolved(corralled), sb.toString());
-        if (otherErrors.size() > 0) {
-            printDiagnostics(corralled.source(), otherErrors, true);
-        }
+        new DisplayEvent(corralled, state.status(corralled), FormatAction.USED, true, null, otherErrors)
+                .displayDeclarationAndValue();
     }
     //where
     void printEvalException(EvalException ex) {
@@ -2174,26 +2001,180 @@
         }
         printStackTrace(ex.getStackTrace());
     }
-    //where
-    String unresolved(DeclarationSnippet key) {
-        List<String> unr = state.unresolvedDependencies(key);
-        StringBuilder sb = new StringBuilder();
-        int fromLast = unr.size();
-        if (fromLast > 0) {
-            sb.append(" ");
+
+    private FormatAction toAction(Status status, Status previousStatus, boolean isSignatureChange) {
+        FormatAction act;
+        switch (status) {
+            case VALID:
+            case RECOVERABLE_DEFINED:
+            case RECOVERABLE_NOT_DEFINED:
+                if (previousStatus.isActive) {
+                    act = isSignatureChange
+                            ? FormatAction.REPLACED
+                            : FormatAction.MODIFIED;
+                } else {
+                    act = FormatAction.ADDED;
+                }
+                break;
+            case OVERWRITTEN:
+                act = FormatAction.OVERWROTE;
+                break;
+            case DROPPED:
+                act = FormatAction.DROPPED;
+                break;
+            case REJECTED:
+            case NONEXISTENT:
+            default:
+                // Should not occur
+                error("Unexpected status: " + previousStatus.toString() + "=>" + status.toString());
+                act = FormatAction.DROPPED;
+        }
+        return act;
+    }
+
+    class DisplayEvent {
+        private final Snippet sn;
+        private final FormatAction action;
+        private final boolean update;
+        private final String value;
+        private final List<String> errorLines;
+        private final FormatResolve resolution;
+        private final String unresolved;
+        private final FormatUnresolved unrcnt;
+        private final FormatErrors errcnt;
+
+        DisplayEvent(SnippetEvent ste, boolean update, String value, List<Diag> errors) {
+            this(ste.snippet(), ste.status(), toAction(ste.status(), ste.previousStatus(), ste.isSignatureChange()), update, value, errors);
         }
-        for (String u : unr) {
-            --fromLast;
-            sb.append(u);
-            if (fromLast == 0) {
-                // No suffix
-            } else if (fromLast == 1) {
-                sb.append(", and ");
+
+        DisplayEvent(Snippet sn, Status status, FormatAction action, boolean update, String value, List<Diag> errors) {
+            this.sn = sn;
+            this.action = action;
+            this.update = update;
+            this.value = value;
+            this.errorLines = new ArrayList<>();
+            for (Diag d : errors) {
+                displayDiagnostics(sn.source(), d, errorLines);
+            }
+            int unresolvedCount;
+            if (sn instanceof DeclarationSnippet && (status == Status.RECOVERABLE_DEFINED || status == Status.RECOVERABLE_NOT_DEFINED)) {
+                resolution = (status == Status.RECOVERABLE_NOT_DEFINED)
+                        ? FormatResolve.NOTDEFINED
+                        : FormatResolve.DEFINED;
+                unresolved = unresolved((DeclarationSnippet) sn);
+                unresolvedCount = state.unresolvedDependencies((DeclarationSnippet) sn).size();
             } else {
-                sb.append(", ");
+                resolution = FormatResolve.OK;
+                unresolved = "";
+                unresolvedCount = 0;
+            }
+            unrcnt = unresolvedCount == 0
+                    ? FormatUnresolved.UNRESOLVED0
+                    : unresolvedCount == 1
+                        ? FormatUnresolved.UNRESOLVED1
+                        : FormatUnresolved.UNRESOLVED2;
+            errcnt = errors.isEmpty()
+                    ? FormatErrors.ERROR0
+                    : errors.size() == 1
+                        ? FormatErrors.ERROR1
+                        : FormatErrors.ERROR2;
+        }
+
+        private String unresolved(DeclarationSnippet key) {
+            List<String> unr = state.unresolvedDependencies(key);
+            StringBuilder sb = new StringBuilder();
+            int fromLast = unr.size();
+            if (fromLast > 0) {
+                sb.append(" ");
+            }
+            for (String u : unr) {
+                --fromLast;
+                sb.append(u);
+                switch (fromLast) {
+                    // No suffix
+                    case 0:
+                        break;
+                    case 1:
+                        sb.append(", and ");
+                        break;
+                    default:
+                        sb.append(", ");
+                        break;
+                }
+            }
+            return sb.toString();
+        }
+
+        private void custom(FormatCase fcase, String name) {
+            custom(fcase, name, null);
+        }
+
+        private void custom(FormatCase fcase, String name, String type) {
+            String display = feedback.format(fcase, action, (update ? FormatWhen.UPDATE : FormatWhen.PRIMARY),
+                    resolution, unrcnt, errcnt,
+                    name, type, value, unresolved, errorLines);
+            if (interactive()) {
+                cmdout.print(display);
             }
         }
-        return sb.toString();
+
+        @SuppressWarnings("fallthrough")
+        private void displayDeclarationAndValue() {
+            switch (sn.subKind()) {
+                case CLASS_SUBKIND:
+                    custom(FormatCase.CLASS, ((TypeDeclSnippet) sn).name());
+                    break;
+                case INTERFACE_SUBKIND:
+                    custom(FormatCase.INTERFACE, ((TypeDeclSnippet) sn).name());
+                    break;
+                case ENUM_SUBKIND:
+                    custom(FormatCase.ENUM, ((TypeDeclSnippet) sn).name());
+                    break;
+                case ANNOTATION_TYPE_SUBKIND:
+                    custom(FormatCase.ANNOTATION, ((TypeDeclSnippet) sn).name());
+                    break;
+                case METHOD_SUBKIND:
+                    custom(FormatCase.METHOD, ((MethodSnippet) sn).name(), ((MethodSnippet) sn).parameterTypes());
+                    break;
+                case VAR_DECLARATION_SUBKIND: {
+                    VarSnippet vk = (VarSnippet) sn;
+                    custom(FormatCase.VARDECL, vk.name(), vk.typeName());
+                    break;
+                }
+                case VAR_DECLARATION_WITH_INITIALIZER_SUBKIND: {
+                    VarSnippet vk = (VarSnippet) sn;
+                    custom(FormatCase.VARINIT, vk.name(), vk.typeName());
+                    break;
+                }
+                case TEMP_VAR_EXPRESSION_SUBKIND: {
+                    VarSnippet vk = (VarSnippet) sn;
+                    custom(FormatCase.EXPRESSION, vk.name(), vk.typeName());
+                    break;
+                }
+                case OTHER_EXPRESSION_SUBKIND:
+                    error("Unexpected expression form -- value is: %s", (value));
+                    break;
+                case VAR_VALUE_SUBKIND: {
+                    ExpressionSnippet ek = (ExpressionSnippet) sn;
+                    custom(FormatCase.VARVALUE, ek.name(), ek.typeName());
+                    break;
+                }
+                case ASSIGNMENT_SUBKIND: {
+                    ExpressionSnippet ek = (ExpressionSnippet) sn;
+                    custom(FormatCase.ASSIGNMENT, ek.name(), ek.typeName());
+                    break;
+                }
+                case SINGLE_TYPE_IMPORT_SUBKIND:
+                case TYPE_IMPORT_ON_DEMAND_SUBKIND:
+                case SINGLE_STATIC_IMPORT_SUBKIND:
+                case STATIC_IMPORT_ON_DEMAND_SUBKIND:
+                    custom(FormatCase.IMPORT, ((ImportSnippet) sn).name());
+                    break;
+                case STATEMENT_SUBKIND:
+                    custom(FormatCase.STATEMENT, null);
+                    break;
+            }
+        }
     }
 
     /** The current version number as a string.
@@ -2208,13 +2189,10 @@
         return version("full"); // mm.mm.oo[-milestone]-build
     }
 
-    private static final String versionRBName = "jdk.internal.jshell.tool.resources.version";
-    private static ResourceBundle versionRB;
-
     private static String version(String key) {
         if (versionRB == null) {
             try {
-                versionRB = ResourceBundle.getBundle(versionRBName);
+                versionRB = ResourceBundle.getBundle(VERSION_RB_NAME);
             } catch (MissingResourceException e) {
                 return "(version info not available)";
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,179 @@
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  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.
+#
+
+help.set.format = \
+Set the format for reporting a snippet event.\n\
+\n\
+/set format <mode> <field> "<format>" <selector>...\n\
+\n\
+Where <mode> is the name of a previously defined feedback mode -- see '/help /set newmode'.\n\
+Where <field> is the name of context-specific format to define.\n\
+Where <format> is a quoted string which will be the value of the field if one of\n\
+the selectors matches (or there are no selectors). When the format is used,\n\
+field names enclosed in braces are replaced with the value of the field at that\n\
+time. These fields may have been previously defined with this command or may be\n\
+one of these predefined fields specific to the context:\n\t\
+{name}       == The name, e.g.: the variable name, ...\n\t\
+{type}       == The type name. The type of a variable or expression, the\n\t\t\t\
+                 parameter types of a method\n\t\
+{value}      == The result value of an expression or variable initialization\n\t\
+{unresolved} == The list of unresolved references\n\t\
+{errors}     == The list of recoverable errors (during the processing of the\n\t\t\t\
+                "display" field only)\n\t\
+{err}        == An unformatted error line (during the processing of the\n\t\t\t\
+                "errorline" field only)\n\
+The following fields are accessed by the tool to determine the displayed feedback:\n\t\
+{display}    == The displayed message for a snippet event\n\t\
+{errorline}  == The format of one error line within the "errors" field\n\t\
+{pre}        == The feedback prefix (begins command feedback)\n\t\
+{post}       == The feedback postfix (ends command feedback)\n\t\
+{errorpre}   == The error prefix (begins error feedback)\n\t\
+{errorpost}  == The error postfix (ends error feedback)\n\
+These fields have default settings (which may be overwritten).\n\
+Where <selector> is the context in which the format is applied.\n\
+The structure of selector is a hyphen separated list of selector kind lists.\n\
+A selector kind list is a comma separated list of values of one selector kind.\n\
+A selector matches if each selector kind list matches; A selector kind list\n\
+matches if one of the values matches.\n
+help.set.format.case = The case selector kind describes the kind of snippet.  The values are:\n
+help.set.format.action = The action selector kind describes what happened to the snippet.  The values are:\n
+help.set.format.when = The when-did-it-occur selector kind describes if this is a direct or indirect action.  The values are:\n
+help.set.format.resolve = The resolution-state selector kind describes the state of resolution/definition of the snippet.  The values are:\n
+help.set.format.unresolved = The unresolved-count selector kind describes the number of unresolved references.  The values are:\n
+help.set.format.errors = The errors-count selector kind describes the number of errors.  The values are:\n
+help.set.format.end = \n\
+Examples:\n\t\
+/set format myformat action 'Created' added-primary\n\t\
+/set format myformat action 'Update replaced' replaced-update\n\t\
+/set format myformat display '{pre}{action} class {name}{post}' class-ok\n\t\
+/set format myformat display '{pre}{action} variable {name}, reset to null{post}' replaced-vardecl,varinit-ok-update\n\n\
+Note that subsequent selectors for a field may overwrite some or all of previous used selectors -- last one wins\n
+
+help.set.feedback = \
+Set the feedback mode describing displayed feedback for entered snippets and commands.\n\
+\n\
+/set feedback <mode>\n\
+\n\
+Where <mode> is the name of a previously defined feedback mode.\n\
+You may use just enough letters to make it unique.\n\
+User-defined modes can be added, see '/help /set newmode'\n\
+Currently defined feedback modes:\n
+
+help.set.newmode = \
+Create a user-defined feedback mode, optionally copying from an existing mode.\n\
+\n\
+/set newmode <new-mode> [command|quiet [<old-mode>]]\n\
+\n\
+Where <new-mode> is the name of a mode you wish to create.\n\
+Where <old-mode> is the name of a previously defined feedback mode.\n\
+If <old-mode> is present, its settings are copied to the new mode.\n\
+'command' vs 'quiet' determines if informative/verifying command feedback is displayed.\n\
+\n\
+Once the new mode is created, use '/set format' and '/set prompt' to configure it.\n\
+Use '/set feedback' to use the new mode.\n\
+
+help.set.prompt = \
+Set the prompts.  Both the normal prompt and the continuation-prompt must be set.\n\
+\n\
+/set prompt <mode> \"<prompt>\" \"<continuation-propmt>\"\n\
+\n\
+Where <mode> is the name of a previously defined feedback mode.\n\
+Where <prompt> and <continuation-propmt> are quoted strings printed as input prompts;\n\
+Both may optionally contain '%s' which will be substituted with the next snippet id --\n\
+note that what is entered may not be assigned that id, for example it may be an error or command.\n\
+The continuation-prompt is used on the second and subsequent lines of a multi-line snippet.\n
+
+startup.feedback = \
+/set newmode normal command    \n\
+/set prompt normal '\\n-> ' '>> '    \n\
+/set format normal pre '|  '    \n\
+/set format normal post '%n'    \n\
+/set format normal errorpre '|  '    \n\
+/set format normal errorpost '%n'    \n\
+    \n\
+/set format normal errorline '{post}{pre}    {err}'    \n\
+    \n\
+/set format normal action 'Added' added-primary    \n\
+/set format normal action 'Modified' modified-primary    \n\
+/set format normal action 'Replaced' replaced-primary    \n\
+/set format normal action 'Overwrote' overwrote-primary    \n\
+/set format normal action 'Dropped' dropped-primary    \n\
+/set format normal action '  Update added' added-update    \n\
+/set format normal action '  Update modified' modified-update    \n\
+/set format normal action '  Update replaced' replaced-update    \n\
+/set format normal action '  Update overwrote' overwrote-update    \n\
+/set format normal action '  Update dropped' dropped-update    \n\
+    \n\
+/set format normal until ', however, it cannot be instanciated or its methods invoked until'  defined-class-primary    \n\
+/set format normal until ', however, its methods cannot be invoked until'                     defined-interface-primary    \n\
+/set format normal until ', however, it cannot be used until'                                 defined-enum,annotation-primary    \n\
+/set format normal until ', however, it cannot be invoked until'                              defined-method-primary    \n\
+/set format normal until ', however, it cannot be referenced until'                           notdefined-primary    \n\
+/set format normal until ' which cannot be instanciated or its methods invoked until'         defined-class-update    \n\
+/set format normal until ' whose methods cannot be invoked until'                             defined-interface-update    \n\
+/set format normal until ' which cannot be invoked until'                                     defined-method-update    \n\
+/set format normal until ' which cannot be referenced until'                                  notdefined-update    \n\
+    \n\
+/set format normal unrerr '{unresolved} is declared'                                           unresolved1-error0    \n\
+/set format normal unrerr '{unresolved} are declared'                                          unresolved2-error0    \n\
+/set format normal unrerr ' this error is corrected: {errors}'                                 unresolved0-error1    \n\
+/set format normal unrerr '{unresolved} is declared and this error is corrected: {errors}'     unresolved1-error1    \n\
+/set format normal unrerr '{unresolved} are declared and this error is corrected: {errors}'    unresolved2-error1    \n\
+/set format normal unrerr ' these errors are corrected: {errors}'                              unresolved0-error2    \n\
+/set format normal unrerr '{unresolved} is declared and these errors are corrected: {errors}'  unresolved1-error2    \n\
+/set format normal unrerr '{unresolved} are declared and these errors are corrected: {errors}' unresolved2-error2    \n\
+    \n\
+/set format normal resolve '{until}{unrerr}'                                                added,modified,replaced,used    \n\
+    \n\
+/set format normal typeKind 'class'                  class    \n\
+/set format normal typeKind 'interface'              interface    \n\
+/set format normal typeKind 'enum'                   enum    \n\
+/set format normal typeKind 'annotation interface'   annotation    \n\
+    \n\
+/set format normal display '{pre}{action} {typeKind} {name}{resolve}{post}'                 class,interface,enum,annotation    \n\
+/set format normal display '{pre}{action} method {name}({type}){resolve}{post}'             method    \n\
+    \n\
+/set format normal display '{pre}{action} variable {name} of type {type}{resolve}{post}'    vardecl    \n\
+/set format normal display '{pre}{action} variable {name} of type {type} with initial value {value}{resolve}{post}'    varinit    \n\
+/set format normal display '{pre}{action} variable {name}, reset to null{post}'             replaced-vardecl,varinit-ok-update    \n\
+/set format normal display '{pre}{action} variable {name}{resolve}{post}'                   vardecl,varinit-notdefined    \n\
+/set format normal display '{pre}{action} variable {name}{post}'                            overwrote,dropped-vardecl,varinit    \n\
+    \n\
+/set format normal display '{pre}Expression value is: {value}{post}{pre}  assigned to temporary variable {name} of type {type}{post}' expression    \n\
+/set format normal display '{pre}Variable {name} of type {type} has value {value}{post}'    varvalue    \n\
+/set format normal display '{pre}Variable {name} has been assigned the value {value}{post}' assignment    \n\
+    \n\
+/set format normal display '{pre}Attempted to use {typeKind} {name}{resolve}{post}'         used-class,interface,enum,annotation    \n\
+/set format normal display '{pre}Attempted to call method {name}({type}){resolve}{post}'    used-method    \n\
+    \n\
+/set feedback normal    \n\
+    \n\
+/set newmode off quiet    \n\
+/set prompt off '-> ' '>> '    \n\
+/set format off pre '|  '    \n\
+/set format off post '%n'    \n\
+/set format off errorpre '|  '    \n\
+/set format off errorpost '%n'    \n\
+/set format off display ''    \n
--- a/langtools/test/ProblemList.txt	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/ProblemList.txt	Wed Jul 05 21:30:21 2017 +0200
@@ -23,8 +23,77 @@
 #
 ###########################################################################
 
+###########################################################################
+#
+# javadoc
 
-##### javac ####################################################################
+com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java                    8006735    generic-all    output type annotations in javadoc
+com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java                            8013406    generic-all    Test cases fail in javadoc test TestSmoke.java
+
+jdk/javadoc/tool/6176978/T6176978.java                                          8152049    generic-all    no longer applicable, should delete
+jdk/javadoc/tool/InlineTagsWithBraces.java                                      8152050    generic-all    API, re-evaluate @bold, @maybe causes doclint to throw up.
+jdk/javadoc/tool/LangVers.java                                                  8152051    generic-all    API, re-evaluate, unsure of this test.
+jdk/javadoc/tool/VerifyLocale.java                                              8149565    generic-all    -locale option issues
+jdk/javadoc/tool/enum/docComments/Main.java                                     8152054    generic-all    API modifications
+jdk/javadoc/tool/enum/enumType/Main.java                                        8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/genericClass/Main.java                                8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/genericInnerAndOuter/Main.java                        8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/genericInterface/Main.java                            8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/genericMethod/Main.java                               8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/genericSuper/Main.java                                8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/supertypes/Main.java                                  8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/throwsGeneric/Main.java                               8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/tparamCycle/Main.java                                 8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/tparamTagOnMethod/Main.java                           8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/tparamTagOnType/Main.java                             8152054    generic-all    API modifications
+jdk/javadoc/tool/generics/wildcards/Main.java                                   8152054    generic-all    API modifications
+jdk/javadoc/tool/imports/MissingImport.java                                     8152054    generic-all    API modifications, testing deprecated APIs.
+jdk/javadoc/tool/sourceOnly/Test.java                                           8152054    generic-all    API modifications
+jdk/javadoc/tool/sourceOption/SourceOption.java                                 8152054    generic-all    API modifications
+jdk/javadoc/tool/subpackageIgnore/SubpackageIgnore.java                         8152054    generic-all    API modifications
+jdk/javadoc/tool/varArgs/Main.java                                              8152054    generic-all    API modifications
+
+###########################################################################
+#
+# jshell
 
-tools/javac/Paths/MineField.sh                                                  8149599	generic-all   needs rewrite
+jdk/jshell/EditorPadTest.java                                                   8139872    generic-all    test requires a non-headless environment
+jdk/jshell/ExternalEditorTest.java                                              8080843    generic-all    invalid key error occurs when external editor is used.
+jdk/jshell/ToolBasicTest.java                                                   8139873    generic-all    JShell tests failing
+
+###########################################################################
+#
+# javac
 
+tools/javac/Paths/AbsolutePathTest.java                                         8055768    generic-all    ToolBox does not close opened files
+tools/javac/Paths/MineField.sh                                                  8149599	   generic-all    needs rewrite
+tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.java      8057679    generic-all    clarify error messages trying to annotate scoping
+tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.java       8057679    generic-all    clarify error messages trying to annotate scoping
+tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.java  8057679    generic-all    clarify error messages trying to annotate scoping
+tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.java  8057683    generic-all    improve ordering of errors with type annotations
+tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.java  8057679    generic-all    clarify error messages trying to annotate scoping
+tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.java  8057683    generic-all    improve order of errors with type annotations
+tools/javac/annotations/typeAnnotations/newlocations/RepeatingTypeAnnotations.java 8057683 generic-all    improve ordering of errors with type annotations
+tools/javac/annotations/typeAnnotations/referenceinfos/Lambda.java              8057687    generic-all    emit correct byte code an attributes for type annotations
+tools/javac/annotations/typeAnnotations/referenceinfos/NestedTypes.java         8057687    generic-all    emit correct byte code an attributes for type annotations
+tools/javac/warnings/suppress/TypeAnnotations.java                              8057683    generic-all    improve ordering of errors with type annotations
+
+###########################################################################
+#
+# javap
+
+tools/javap/output/RepeatingTypeAnnotations.java                                8057687    generic-all    emit correct byte code an attributes for type annotations
+
+###########################################################################
+#
+# sjavac
+
+tools/sjavac/IncCompileFullyQualifiedRef.java                                   8152055    generic-all    Requires dependency code to deal with in-method dependencies.
+tools/sjavac/IncCompileWithChanges.java                                         8152055    generic-all    Requires dependency code to deal with in-method dependencies.
+
+###########################################################################
+#
+# jdeps 
+
+tools/jdeps/modules/GenModuleInfo.java                                          8152502    windows-all    fails to clean up files
+
--- a/langtools/test/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4973609 8015249 8025633 8026567 6469561
+ * @bug      4973609 8015249 8025633 8026567 6469561 8071982
  * @summary  Make sure that annotation types with 0 members does not have
  *           extra HR tags.
  * @author   jamieh
@@ -42,7 +42,7 @@
 
     @Test
     void test() {
-        javadoc("-d", "out",
+        javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "pkg");
         checkExit(Exit.OK);
@@ -90,5 +90,27 @@
                 + "<P>\n\n"
                 + "<P>"
                 + "<!-- ========= END OF CLASS DATA ========= -->" + "<HR>");
+
+        javadoc("-d", "out-2",
+                "-linksource",
+                "-sourcepath", testSrc,
+                "pkg");
+        checkExit(Exit.OK);
+
+        checkOutput("src-html/pkg/AnnotationType.html", true,
+                "<title>Source code</title>",
+                "@Documented public @interface AnnotationType {");
+
+        checkOutput("src-html/pkg/AnnotationTypeField.html", true,
+                "<title>Source code</title>",
+                "@Documented public @interface AnnotationTypeField {");
+
+        checkOutput("pkg/AnnotationType.html", true,
+                "public @interface <a href=\"../src-html/pkg/AnnotationType.html#line.34"
+                + "\">AnnotationType</a></pre>");
+
+        checkOutput("pkg/AnnotationTypeField.html", true,
+                "public @interface <a href=\"../src-html/pkg/AnnotationTypeField.html#line.31"
+                + "\">AnnotationTypeField</a></pre>");
     }
 }
--- a/langtools/test/jdk/javadoc/doclet/testClassCrossReferences/C.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testClassCrossReferences/C.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * Cross link to inner class: {@link javax.swing.text.AbstractDocument.AttributeContext Link to AttributeContext innerclass} <br>
  * Cross link to class: {@link java.math.BigDecimal Link to external class BigDecimal}<br>
  * Cross link to member: {@link java.math.BigInteger#gcd(java.math.BigInteger) Link to external member gcd}<br>
+ * Cross link to package: {@link javax.tools.SimpleJavaFileObject#URI Link to external member URI}<br>
  */
 public class C {
 
--- a/langtools/test/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4652655 4857717 8025633 8026567
+ * @bug 4652655 4857717 8025633 8026567 8071982
  * @summary This test verifies that class cross references work properly.
  * @author jamieh
  * @library ../lib
@@ -42,9 +42,10 @@
 
     @Test
     void test() {
-        final String uri = "http://java.sun.com/j2se/1.4/docs/api/";
+        final String uri = "http://docs.oracle.com/javase/8/docs/api/";
 
         javadoc("-d", "out",
+                "-Xdoclint:none",
                 "-sourcepath", testSrc,
                 "-linkoffline", uri, testSrc,
                 testSrc("C.java"));
@@ -59,6 +60,8 @@
                 + "title=\"class or interface in java.math\"><code>Link to external class BigDecimal</code></a>",
                 "<a href=\"" + uri + "java/math/BigInteger.html?is-external=true#gcd-java.math.BigInteger-\" "
                 + "title=\"class or interface in java.math\"><code>Link to external member gcd</code></a>",
+                "<a href=\"" + uri + "javax/tools/SimpleJavaFileObject.html?is-external=true#URI\" "
+                + "title=\"class or interface in javax.tools\"><code>Link to external member URI</code></a>",
                 "<dl>\n"
                 + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
                 + "<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>\n"
--- a/langtools/test/jdk/javadoc/doclet/testClassCrossReferences/package-list	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testClassCrossReferences/package-list	Wed Jul 05 21:30:21 2017 +0200
@@ -1,2 +1,3 @@
 java.math
+javax.tools
 javax.swing.text
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/TestClassDocCatalog.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 8071982
+ * @summary Test for package-frame.html.
+ * @library ../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build JavadocTester
+ * @run main TestClassDocCatalog
+ */
+
+public class TestClassDocCatalog extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestClassDocCatalog tester = new TestClassDocCatalog();
+        tester.runTests();
+    }
+
+    @Test
+    void test() {
+        javadoc("-d", "out",
+                testSrc("pkg1/EmptyAnnotation.java"),
+                testSrc("pkg1/EmptyClass.java"),
+                testSrc("pkg1/EmptyEnum.java"),
+                testSrc("pkg1/EmptyError.java"),
+                testSrc("pkg1/EmptyException.java"),
+                testSrc("pkg1/EmptyInterface.java"),
+                testSrc("pkg2/EmptyAnnotation.java"),
+                testSrc("pkg2/EmptyClass.java"),
+                testSrc("pkg2/EmptyEnum.java"),
+                testSrc("pkg2/EmptyError.java"),
+                testSrc("pkg2/EmptyException.java"),
+                testSrc("pkg2/EmptyInterface.java"));
+        checkExit(Exit.OK);
+
+        checkOutput("overview-frame.html", true,
+                "<li><a href=\"pkg1/package-frame.html\" target=\"packageFrame\">pkg1</a>"
+                + "</li>\n<li><a href=\"pkg2/package-frame.html\" target=\"packageFrame\">pkg2</a></li>");
+
+        checkOutput("pkg1/package-frame.html", true,
+                "<li><a href=\"EmptyInterface.html\" title=\"interface in pkg1\" "
+                + "target=\"classFrame\"><span class=\"interfaceName\">EmptyInterface"
+                + "</span></a></li>",
+                "<li><a href=\"EmptyClass.html\" title=\"class in pkg1\" "
+                + "target=\"classFrame\">EmptyClass</a></li>",
+                "<li><a href=\"EmptyEnum.html\" title=\"enum in pkg1\" "
+                + "target=\"classFrame\">EmptyEnum</a></li>",
+                "<li><a href=\"EmptyError.html\" title=\"class in pkg1\" "
+                + "target=\"classFrame\">EmptyError</a></li>",
+                "<li><a href=\"EmptyAnnotation.html\" title=\"annotation in pkg1\""
+                + " target=\"classFrame\">EmptyAnnotation</a></li>");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyAnnotation.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg1;
+
+import java.lang.annotation.Documented;
+
+@Documented public @interface EmptyAnnotation {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyClass.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg1;
+
+public class EmptyClass {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyEnum.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg1;
+
+public enum EmptyEnum {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyError.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg1;
+
+public class EmptyError extends Error {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyException.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg1;
+
+public class EmptyException extends Exception {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg1/EmptyInterface.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg1;
+
+public interface EmptyInterface {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyAnnotation.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg2;
+
+import java.lang.annotation.Documented;
+
+@Documented public @interface EmptyAnnotation {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyClass.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg2;
+
+public class EmptyClass {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyEnum.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg2;
+
+public enum EmptyEnum {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyError.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg2;
+
+public class EmptyError extends Error {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyException.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg2;
+
+public class EmptyException extends Exception {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testClassDocCatalog/pkg2/EmptyInterface.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg2;
+
+public interface EmptyInterface {
+}
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4927552 8026567
+ * @bug      4927552 8026567 8071982
  * @summary  <DESC>
  * @author   jamieh
  * @library  ../lib
@@ -50,6 +50,7 @@
                 "annotation_test1 passes",
                 "annotation_test2 passes",
                 "annotation_test3 passes",
+                "annotation_test4 passes.",
                 "class_test1 passes",
                 "class_test2 passes",
                 "class_test3 passes",
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestAnnotationType.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestAnnotationType.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,4 +39,9 @@
      * @deprecated annotation_test3 passes.
      */
     int required();
+
+    /**
+     * @deprecated annotation_test4 passes.
+     */
+    int field = 0;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testGroupOption/C.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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.
+ */
+
+public class C {}
--- a/langtools/test/jdk/javadoc/doclet/testGroupOption/TestGroupOption.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testGroupOption/TestGroupOption.java	Wed Jul 05 21:30:21 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug      4924383
  * @summary  Test to make sure the -group option does not cause a bad warning
- *           to be printed.
+ *           to be printed. Test for the group defined using patterns.
  * @author   jamieh
  * @library  ../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -42,7 +42,7 @@
 
     @Test
     void test1() {
-        //Make sure the warning is not printed when -group is used correctly.
+        // Make sure the warning is not printed when -group is used correctly.
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "-group", "Package One", "pkg1",
@@ -55,11 +55,29 @@
                 "-group");
     }
 
-    @Test
+    // @Test
+    // @ignore 8149402
+    // Make sure the "Other packages" section is printed and the header for empty section is not.
+    // Make sure that the headers of group that is defined using patterns are printed.
     void test2() {
-        //Make sure the warning is printed when -group is not used correctly.
         javadoc("-d", "out-2",
                 "-sourcepath", testSrc,
+                "-group", "Group pkg*", "pkg*",
+                "-group", "Group abc*", "abc*",
+                "-group", "Empty group", "qwerty*",
+                "-group", "Group a*", "a*",
+                "pkg1", "pkg2", "pkg3", "abc1",  "abc2", "abc3", "other", testSrc("C.java"));
+        checkExit(Exit.OK);
+
+        checkOutput("overview-summary.html", true, "Group pkg*", "Group abc*", "Other Packages");
+        checkOutput("overview-summary.html", false, "Empty group", "Group a*");
+    }
+
+    @Test
+    void test3() {
+        // Make sure the warning is printed when -group is not used correctly.
+        javadoc("-d", "out-3",
+                "-sourcepath", testSrc,
                 "-group", "Package One", "pkg1",
                 "-group", "Package One", "pkg2",
                 "-group", "Package One", "pkg3",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testGroupOption/abc1/C.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 abc1;
+
+public class C {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testGroupOption/abc2/C.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 abc2;
+
+public class C {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testGroupOption/abc3/C.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 abc3;
+
+public class C {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testGroupOption/other/C.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 other;
+
+public class C {}
--- a/langtools/test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java	Wed Jul 05 21:30:21 2017 +0200
@@ -64,6 +64,7 @@
                 "-sourcepath", testSrc,
                 "-nohelp",
                 testSrc("Sample.java"));
+        checkOutput("Sample.html", false, "<li><a href=\"../help-doc.html\">Help</a></li>");
         checkExit(Exit.OK);
     }
 
@@ -76,6 +77,8 @@
         checkExit(Exit.OK);
         checkOutput("Sample.html", true,
                 "<li><a href=\"test-help.html\">Help</a></li>");
+        checkOutput("test-help.html", true,
+                "Help, help.");
     }
 
     @Test
@@ -135,7 +138,15 @@
                 "-sourcetab ",
                 "-keywords ",
                 "-stylesheetfile ",
-                "-docencoding ");
+                "-docencoding ",
+                "-html4 ",
+                "-html5 ",
+                "-top ",
+                "-author ",
+                "-noqualifier ",
+                "-nosince ",
+                "-notimestamp ",
+                "-sourcetab ");
 
         checkOutput("Sample.html", !withOption,
                 "<li><a href=\"help-doc.html\">Help</a></li>");
--- a/langtools/test/jdk/javadoc/doclet/testIndex/TestIndex.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testIndex/TestIndex.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4852280 4517115 4973608 4994589 8026567
+ * @bug      4852280 4517115 4973608 4994589 8026567 8071982
  * @summary  Perform tests on index.html file.
  *           Also test that index-all.html has the appropriate output.
  *           Test for unnamed package in index.
@@ -75,6 +75,8 @@
                 + "- Static variable in class pkg.<a href=\"pkg/C.html\" title=\"class in pkg\">"
                 + "C</a></dt>\n"
                 + "<dd>&nbsp;</dd>\n"
-                + "</dl>");
+                + "</dl>",
+                "<dt><span class=\"searchTagLink\"><a href=\"pkg/Coin.html#Enum\">Enum</a>"
+                + "</span> - Search tag in pkg.Coin</dt>");
     }
 }
--- a/langtools/test/jdk/javadoc/doclet/testIndex/pkg/Coin.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testIndex/pkg/Coin.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,13 @@
 package pkg;
 
 /**
- * This is a sample Enum.
- *
+ * This is a sample {@index Enum} Enum.
  * @author Jamie Ho
  */
 public enum Coin {
 
-  Penny, Nickel, Dime;
+  Penny(1), Nickel(2), Dime(3);
 
-public Coin(int i) {}
+Coin(int i) {}
 
 }
--- a/langtools/test/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4732864 6280605 7064544 8014636 8016328 8025633
+ * @bug      4732864 6280605 7064544 8014636 8016328 8025633 8071982
  * @summary  Make sure that you can link from one member to another using
  *           non-qualified name, furthermore, ensure the right one is linked.
  * @author   jamieh
@@ -54,7 +54,8 @@
                 + " Unqualified Link2: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
                 + " Qualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n"
                 + " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n"
-                + " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>");
+                + " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>\n"
+                + " Package Link: <a href=\"../pkg/package-summary.html\"><code>pkg</code></a>.<br/>");
 
         checkOutput("pkg/C.InnerC.html", true,
                 "Link to member in outer class: <a href=\"../pkg/C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>\n"
--- a/langtools/test/jdk/javadoc/doclet/testLinkTaglet/checkPkg/B.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testLinkTaglet/checkPkg/B.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,10 +27,8 @@
  * @see A
  */
 public class B {
-
-        /**
+    /**
      * @see A#m()
      */
-        public void m2();
-
+    public void m2() {};
 }
--- a/langtools/test/jdk/javadoc/doclet/testLinkTaglet/pkg/C.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testLinkTaglet/pkg/C.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,9 @@
  * Qualified Link: {@link #method(pkg.C.InnerC, pkg.C.InnerC2)}.<br/>
  * Unqualified Link: {@link #method(C.InnerC, C.InnerC2)}.<br/>
  * Unqualified Link: {@link #method(InnerC, InnerC2)}.<br/>
+ * Package Link: {@link pkg}.<br/>
+ *
+ *
  */
 public class C {
 
--- a/langtools/test/jdk/javadoc/doclet/testNavigation/TestNavigation.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testNavigation/TestNavigation.java	Wed Jul 05 21:30:21 2017 +0200
@@ -42,22 +42,25 @@
 
     @Test
     void test() {
-        javadoc("-d", "out",
+        javadoc("-d", "out", "-overview", testSrc("overview.html"),
                 "-sourcepath", testSrc,
                 "pkg");
         checkExit(Exit.OK);
 
         checkOutput("pkg/A.html", true,
                 "<li>Prev&nbsp;Class</li>",
-                "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>");
+                "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
+                "<li><a href=\"../overview-summary.html\">Overview</a></li>");
 
         checkOutput("pkg/C.html", true,
                 "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
-                "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>");
+                "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
+                "<li><a href=\"../overview-summary.html\">Overview</a></li>");
 
         checkOutput("pkg/E.html", true,
                 "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
-                "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>");
+                "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
+                "<li><a href=\"../overview-summary.html\">Overview</a></li>");
 
         checkOutput("pkg/I.html", true,
                 "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
@@ -66,7 +69,8 @@
                 "<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n"
                 + "<a name=\"navbar.top.firstrow\">\n"
                 + "<!--   -->\n"
-                + "</a>");
+                + "</a>",
+                "<li><a href=\"../overview-summary.html\">Overview</a></li>");
 
         // Remaining tests check for additional padding to offset the fixed navigation bar.
         checkOutput("pkg/A.html", true,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testNavigation/overview.html	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body bgcolor="white">
+
+This document is generated from sample source code and HTML files 
+with examples of a wide variety of Java language constructs: packages, 
+subclasses, subinterfaces, nested classes, nested interfaces,
+inheriting from other packages, constructors, fields,
+methods, and so forth.
+
+</body>
+</html>
--- a/langtools/test/jdk/javadoc/doclet/testOptions/TestOptions.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testOptions/TestOptions.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,8 +23,8 @@
 
 /*
  * @test
- * @bug      4749567
- * @summary  Test the output for -header and -footer options.
+ * @bug      4749567 8071982
+ * @summary  Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree, -stylesheetfile options.
  * @author   Bhavesh Patel
  * @library  ../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -32,6 +32,8 @@
  * @run main TestOptions
  */
 
+import java.io.File;
+
 public class TestOptions extends JavadocTester {
 
     public static void main(String... args) throws Exception {
@@ -40,8 +42,8 @@
     }
 
     @Test
-    void test() {
-        javadoc("-d", "out",
+    void testHeaderFooter() {
+        javadoc("-d", "out-1",
                 "-header", "Test header",
                 "-footer", "Test footer",
                 "-sourcepath", testSrc,
@@ -52,5 +54,163 @@
                 "<div class=\"aboutLanguage\">Test header</div>",
                 "<div class=\"aboutLanguage\">Test footer</div>");
     }
+
+    @Test
+    void testNoOverview() {
+        javadoc("-d", "out-4",
+                "-nooverview",
+                "-sourcepath", testSrc,
+                "pkg", "deprecated");
+
+        checkExit(Exit.OK);
+
+        checkFiles(false, "overview-summary.html");
+    }
+
+    @Test
+    void testNoDeprecatedList() {
+        javadoc("-d", "out-5",
+                "-nodeprecatedlist",
+                "-sourcepath", testSrc,
+                "deprecated");
+        checkExit(Exit.OK);
+
+        checkFiles(false, "deprecated-list.html");
+    }
+
+    @Test
+    void testNoNavbar() {
+        javadoc("-d", "out-6",
+                "-nonavbar",
+                "-bottom", "Bottom text",
+                "-sourcepath", testSrc,
+                "pkg");
+        checkExit(Exit.OK);
+
+        checkOutput("pkg/Foo.html", false, "navbar");
+        checkOutput("pkg/Foo.html", true, "Bottom text");
+    }
+
+    @Test
+    void testNoTree() {
+        javadoc("-d", "out-7",
+                "-notree",
+                "-sourcepath", testSrc,
+                "pkg");
+        checkExit(Exit.OK);
+
+        checkFiles(false, "overview-tree.html");
+        checkFiles(false, "pkg/package-tree.html");
+        checkOutput("pkg/Foo.html", false, "<li><a href=\"package-tree.html\">Tree</a></li>");
+    }
+
+    @Test
+    void testStylesheetFile() {
+        javadoc("-d", "out-8",
+                "-stylesheetfile", new File(testSrc, "custom-stylesheet.css").getAbsolutePath(),
+                "-sourcepath", testSrc,
+                "pkg");
+        checkExit(Exit.OK);
+
+        checkOutput("custom-stylesheet.css", true, "Custom javadoc style sheet");
+        checkOutput("pkg/Foo.html", true, "<link rel=\"stylesheet\" type=\"text/css\" "
+                + "href=\"../custom-stylesheet.css\" title=\"Style\">");
+    }
+
+    @Test
+    void testLinkSource() {
+        javadoc("-d", "out-9",
+                "-linksource",
+                "-javafx",
+                "-sourcepath", testSrc,
+                "-package",
+                "linksource");
+        checkExit(Exit.OK);
+
+        checkOutput("linksource/AnnotationTypeField.html", true,
+                "<pre>@Documented\npublic @interface <a href="
+                + "\"../src-html/linksource/AnnotationTypeField.html#line.31\">"
+                + "AnnotationTypeField</a></pre>",
+                "<h4>DEFAULT_NAME</h4>\n<pre>static final&nbsp;java.lang.String&nbsp;"
+                + "<a href=\"../src-html/linksource/AnnotationTypeField.html#line.32\">"
+                + "DEFAULT_NAME</a></pre>",
+                "<h4>name</h4>\n<pre>java.lang.String&nbsp;<a href="
+                + "\"../src-html/linksource/AnnotationTypeField.html#line.34\">name</a></pre>");
+
+        checkOutput("src-html/linksource/AnnotationTypeField.html", true,
+                "<title>Source code</title>",
+                "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">"
+                + "@Documented public @interface AnnotationTypeField {</a>");
+
+        checkOutput("linksource/Properties.html", true,
+                "<pre>public class <a href=\"../src-html/linksource/Properties.html#line.29\">"
+                + "Properties</a>",
+                "<pre>public&nbsp;java.lang.Object <a href="
+                + "\"../src-html/linksource/Properties.html#line.31\">someProperty</a></pre>",
+                "<pre>public&nbsp;java.lang.Object&nbsp;<a href="
+                + "\"../src-html/linksource/Properties.html#line.31\">someProperty</a>()</pre>");
+
+        checkOutput("src-html/linksource/Properties.html", true,
+                "<title>Source code</title>",
+                "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">    "
+                + "public Object someProperty() {</a>");
+
+        checkOutput("linksource/SomeClass.html", true,
+                "<pre>public class <a href=\"../src-html/linksource/SomeClass.html#line.29\">"
+                + "SomeClass</a>\nextends java.lang.Object</pre>",
+                "<pre>public&nbsp;int <a href=\"../src-html/linksource/SomeClass.html#line.31\">"
+                + "field</a></pre>",
+                "<pre>public&nbsp;<a href=\"../src-html/linksource/SomeClass.html#line.33\">"
+                + "SomeClass</a>()</pre>",
+                "<pre>public&nbsp;int&nbsp;<a href=\"../src-html/linksource/SomeClass.html#line.36\">"
+                + "method</a>()</pre>");
+
+        checkOutput("src-html/linksource/SomeClass.html", true,
+                "<title>Source code</title>",
+                "<span class=\"sourceLineNo\">029</span><a name=\"line.29\">"
+                + "public class SomeClass {</a>",
+                "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">    "
+                + "public int field;</a>",
+                "<span class=\"sourceLineNo\">033</span><a name=\"line.33\">    "
+                + "public SomeClass() {</a>",
+                "<span class=\"sourceLineNo\">036</span><a name=\"line.36\">    "
+                + "public int method() {</a>");
+
+        checkOutput("linksource/SomeEnum.html", true,
+                "<pre>public static final&nbsp;<a href=\"../linksource/SomeEnum.html\" "
+                + "title=\"enum in linksource\">SomeEnum</a> <a href="
+                + "\"../src-html/linksource/SomeEnum.html#line.29\">VALUE1</a></pre>",
+                "<pre>public static final&nbsp;<a href=\"../linksource/SomeEnum.html\" "
+                + "title=\"enum in linksource\">SomeEnum</a> <a href="
+                + "\"../src-html/linksource/SomeEnum.html#line.30\">VALUE2</a></pre>");
+
+        checkOutput("src-html/linksource/SomeEnum.html", true,
+                "<span class=\"sourceLineNo\">029</span><a name=\"line.29\">    VALUE1,</a>",
+                "<span class=\"sourceLineNo\">030</span><a name=\"line.30\">    VALUE2</a>");
+    }
+
+    @Test
+    void testNoQualifier() {
+        javadoc("-d", "out-10",
+                "-noqualifier", "pkg",
+                "-sourcepath", testSrc,
+                "pkg", "deprecated");
+        checkExit(Exit.OK);
+
+        checkOutput("pkg/Foo.html", true,
+                "<li>Foo</li>");
+        checkOutput("deprecated/Foo.html", true,
+                "<li>deprecated.Foo</li>");
+
+        javadoc("-d", "out-10a",
+                "-noqualifier", "all",
+                "-sourcepath", testSrc,
+                "pkg", "deprecated");
+        checkExit(Exit.OK);
+
+        checkOutput("pkg/Foo.html", true,
+                "<li>Foo</li>");
+        checkOutput("deprecated/Foo.html", true,
+                "<li>Foo</li>");
+    }
 }
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testOptions/custom-stylesheet.css	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,751 @@
+/* Custom javadoc style sheet */
+/*
+Overall document style
+*/
+
+@import url('resources/fonts/dejavu.css');
+
+body {
+    background-color:#ffffff;
+    color:#353833;
+    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;
+    color:#4A6782;
+}
+a:hover, a:focus {
+    text-decoration:none;
+    color:#bb7a2a;
+}
+a:active {
+    text-decoration:none;
+    color:#4A6782;
+}
+a[name] {
+    color:#353833;
+}
+a[name]:hover {
+    text-decoration:none;
+    color:#353833;
+}
+a[name]:before, a[name]:target {
+    content:"";
+    display:block;
+    height:120px;
+    margin:-120px 0 0;
+}
+a[id]:before, a[id]:target {
+    padding-top:129px;
+    margin-top:-129px;
+    color:red;
+}
+pre {
+    font-family:'DejaVu Sans Mono', monospace;
+    font-size:14px;
+}
+h1 {
+    font-size:20px;
+}
+h2 {
+    font-size:18px;
+}
+h3 {
+    font-size:16px;
+    font-style:italic;
+}
+h4 {
+    font-size:13px;
+}
+h5 {
+    font-size:12px;
+}
+h6 {
+    font-size:11px;
+}
+ul {
+    list-style-type:disc;
+}
+code, tt {
+    font-family:'DejaVu Sans Mono', monospace;
+    font-size:14px;
+    padding-top:4px;
+    margin-top:8px;
+    line-height:1.4em;
+}
+dt code {
+    font-family:'DejaVu Sans Mono', monospace;
+    font-size:14px;
+    padding-top:4px;
+}
+table tr td dt code {
+    font-family:'DejaVu Sans Mono', monospace;
+    font-size:14px;
+    vertical-align:top;
+    padding-top:4px;
+}
+sup {
+    font-size:8px;
+}
+/*
+Document title and Copyright styles
+*/
+.clear {
+    clear:both;
+    height:0px;
+    overflow:hidden;
+}
+.aboutLanguage {
+    float:right;
+    padding:0px 21px;
+    font-size:11px;
+    z-index:200;
+    margin-top:-9px;
+}
+.legalCopy {
+    margin-left:.5em;
+}
+.bar a, .bar a:link, .bar a:visited, .bar a:active {
+    color:#FFFFFF;
+    text-decoration:none;
+}
+.bar a:hover, .bar a:focus {
+    color:#bb7a2a;
+}
+.tab {
+    background-color:#0066FF;
+    color:#ffffff;
+    padding:8px;
+    width:5em;
+    font-weight:bold;
+}
+/*
+Navigation bar styles
+*/
+.bar {
+    background-color:#4D7A97;
+    color:#FFFFFF;
+    padding:.8em .5em .4em .8em;
+    height:auto;/*height:1.8em;*/
+    font-size:11px;
+    margin:0;
+}
+.fixedNav {
+    position:fixed;
+    width:100%;
+    z-index:999;
+    background-color:#ffffff;
+}
+.topNav {
+    background-color:#4D7A97;
+    color:#FFFFFF;
+    float:left;
+    padding:0;
+    width:100%;
+    clear:right;
+    height:2.8em;
+    padding-top:10px;
+    overflow:hidden;
+    font-size:12px; 
+}
+.bottomNav {
+    margin-top:10px;
+    background-color:#4D7A97;
+    color:#FFFFFF;
+    float:left;
+    padding:0;
+    width:100%;
+    clear:right;
+    height:2.8em;
+    padding-top:10px;
+    overflow:hidden;
+    font-size:12px;
+}
+.subNav {
+    background-color:#dee3e9;
+    float:left;
+    width:100%;
+    overflow:hidden;
+    font-size:12px;
+}
+.subNav div {
+    clear:left;
+    float:left;
+    padding:0 0 5px 6px;
+    text-transform:uppercase;
+}
+ul.navList, ul.subNavList {
+    float:left;
+    margin:0 25px 0 0;
+    padding:0;
+}
+ul.navList li{
+    list-style:none;
+    float:left;
+    padding: 5px 6px;
+    text-transform:uppercase;
+}
+ul.navListSearch {
+    float:right;
+    margin:0 0 0 0;
+    padding:0;
+}
+ul.navListSearch li {
+    list-style:none;
+    float:right;
+    padding: 5px 6px;
+    text-transform:uppercase;
+}
+ul.navListSearch li span {
+    position:relative;
+    right:-16px;
+}
+ul.subNavList li {
+    list-style:none;
+    float:left;
+}
+.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
+    color:#FFFFFF;
+    text-decoration:none;
+    text-transform:uppercase;
+}
+.topNav a:hover, .bottomNav a:hover {
+    text-decoration:none;
+    color:#bb7a2a;
+    text-transform:uppercase;
+}
+.navBarCell1Rev {
+    background-color:#F8981D;
+    color:#253441;
+    margin: auto 5px;
+}
+.skipNav {
+    position:absolute;
+    top:auto;
+    left:-9999px;
+    overflow:hidden;
+}
+/*
+Page header and footer styles
+*/
+.header, .footer {
+    clear:both;
+    margin:0 20px;
+    padding:5px 0 0 0;
+}
+.indexNav {
+    margin:10px;
+    position:relative;
+}
+.indexNav ul {
+    padding:0;
+    margin:0;
+}
+.indexNav ul li {
+    display:inline;
+    list-style-type:none;
+    padding-right:10px;
+}
+.indexNav h1 {
+    font-size:13px;
+}
+.title {
+    color:#2c4557;
+    margin:10px 0;
+    padding-top:5.4em;
+}
+.subTitle {
+    margin:5px 0 0 0;
+}
+.header ul {
+    margin:0 0 15px 0;
+    padding:0;
+}
+.footer ul {
+    margin:20px 0 5px 0;
+}
+.header ul li, .footer ul li {
+    list-style:none;
+    font-size:13px;
+}
+/*
+Heading styles
+*/
+div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
+    background-color:#dee3e9;
+    border:1px solid #d0d9e0;
+    margin:0 0 6px -8px;
+    padding:7px 5px;
+}
+ul.blockList ul.blockList ul.blockList li.blockList h3 {
+    background-color:#dee3e9;
+    border:1px solid #d0d9e0;
+    margin:0 0 6px -8px;
+    padding:7px 5px;
+}
+ul.blockList ul.blockList li.blockList h3 {
+    padding:0;
+    margin:15px 0;
+}
+ul.blockList li.blockList h2 {
+    padding:0px 0 20px 0;
+}
+/*
+Page layout container styles
+*/
+.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
+    clear:both;
+    padding:10px 20px;
+    position:relative;
+}
+.indexContainer {
+    margin:10px;
+    position:relative;
+    font-size:12px;
+}
+.indexContainer h2 {
+    font-size:13px;
+    padding:0 0 3px 0;
+}
+.indexContainer ul {
+    margin:0;
+    padding:0;
+}
+.indexContainer ul li {
+    list-style:none;
+    padding-top:2px;
+}
+.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
+    font-size:12px;
+    font-weight:bold;
+    margin:10px 0 0 0;
+    color:#4E4E4E;
+}
+.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
+    margin:5px 0 10px 0px;
+    font-size:14px;
+    font-family:'DejaVu Sans Mono',monospace;
+}
+.serializedFormContainer dl.nameValue dt {
+    margin-left:1px;
+    font-size:1.1em;
+    display:inline;
+    font-weight:bold;
+}
+.serializedFormContainer dl.nameValue dd {
+    margin:0 0 0 1px;
+    font-size:1.1em;
+    display:inline;
+}
+/*
+List styles
+*/
+li.circle {
+    list-style:circle;
+}
+ul.horizontal li {
+    display:inline;
+    font-size:0.9em;
+}
+ul.inheritance {
+    margin:0;
+    padding:0;
+}
+ul.inheritance li {
+    display:inline;
+    list-style:none;
+}
+ul.inheritance li ul.inheritance {
+    margin-left:15px;
+    padding-left:15px;
+    padding-top:1px;
+}
+ul.blockList, ul.blockListLast {
+    margin:10px 0 10px 0;
+    padding:0;
+}
+ul.blockList li.blockList, ul.blockListLast li.blockList {
+    list-style:none;
+    margin-bottom:15px;
+    line-height:1.4;
+}
+ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
+    padding:0px 20px 5px 10px;
+    border:1px solid #ededed; 
+    background-color:#f8f8f8;
+}
+ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
+    padding:0 0 5px 8px;
+    background-color:#ffffff;
+    border:none;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
+    margin-left:0;
+    padding-left:0;
+    padding-bottom:15px;
+    border:none;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
+    list-style:none;
+    border-bottom:none;
+    padding-bottom:0;
+}
+table tr td dl, table tr td dl dt, table tr td dl dd {
+    margin-top:0;
+    margin-bottom:1px;
+}
+/*
+Table styles
+*/
+.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary {
+    width:100%;
+    border-spacing:0;
+    border-left:1px solid #EEE; 
+    border-right:1px solid #EEE; 
+    border-bottom:1px solid #EEE; 
+}
+.overviewSummary, .memberSummary  {
+    padding:0px;
+}
+.overviewSummary caption, .memberSummary caption, .typeSummary caption,
+.useSummary caption, .constantsSummary caption, .deprecatedSummary caption {
+    position:relative;
+    text-align:left;
+    background-repeat:no-repeat;
+    color:#253441;
+    font-weight:bold;
+    clear:none;
+    overflow:hidden;
+    padding:0px;
+    padding-top:10px;
+    padding-left:1px;
+    margin:0px;
+    white-space:pre;
+}
+.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link,
+.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link,
+.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover,
+.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover,
+.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active,
+.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active,
+.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited,
+.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited {
+    color:#FFFFFF;
+}
+.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span,
+.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {
+    white-space:nowrap;
+    padding-top:5px;
+    padding-left:12px;
+    padding-right:12px;
+    padding-bottom:7px;
+    display:inline-block;
+    float:left;
+    background-color:#F8981D;
+    border: none;
+    height:16px;
+}
+.memberSummary caption span.activeTableTab span {
+    white-space:nowrap;
+    padding-top:5px;
+    padding-left:12px;
+    padding-right:12px;
+    margin-right:3px;
+    display:inline-block;
+    float:left;
+    background-color:#F8981D;
+    height:16px;
+}
+.memberSummary caption span.tableTab span {
+    white-space:nowrap;
+    padding-top:5px;
+    padding-left:12px;
+    padding-right:12px;
+    margin-right:3px;
+    display:inline-block;
+    float:left;
+    background-color:#4D7A97;
+    height:16px;
+}
+.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {
+    padding-top:0px;
+    padding-left:0px;
+    padding-right:0px;
+    background-image:none;
+    float:none;
+    display:inline;
+}
+.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd,
+.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd {
+    display:none;
+    width:5px;
+    position:relative;
+    float:left;
+    background-color:#F8981D;
+}
+.memberSummary .activeTableTab .tabEnd {
+    display:none;
+    width:5px;
+    margin-right:3px;
+    position:relative; 
+    float:left;
+    background-color:#F8981D;
+}
+.memberSummary .tableTab .tabEnd {
+    display:none;
+    width:5px;
+    margin-right:3px;
+    position:relative;
+    background-color:#4D7A97;
+    float:left;
+
+}
+.overviewSummary td, .memberSummary td, .typeSummary td,
+.useSummary td, .constantsSummary td, .deprecatedSummary td {
+    text-align:left;
+    padding:0px 0px 12px 10px;
+}
+th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th,
+td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{
+    vertical-align:top;
+    padding-right:0px;
+    padding-top:8px;
+    padding-bottom:3px;
+}
+th.colFirst, th.colLast, th.colOne, .constantsSummary th {
+    background:#dee3e9;
+    text-align:left;
+    padding:8px 3px 3px 7px;
+}
+td.colFirst, th.colFirst {
+    white-space:nowrap;
+    font-size:13px;
+}
+td.colLast, th.colLast {
+    font-size:13px;
+}
+td.colOne, th.colOne {
+    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,
+.typeSummary td.colFirst{
+    width:25%;
+    vertical-align:top;
+}
+td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
+    font-weight:bold;
+}
+.tableSubHeadingColor {
+    background-color:#EEEEFF;
+}
+.altColor {
+    background-color:#FFFFFF;
+}
+.rowColor {
+    background-color:#EEEEEF;
+}
+/*
+Content styles
+*/
+.description pre {
+    margin-top:0;
+}
+.deprecatedContent {
+    margin:0;
+    padding:10px 0;
+}
+.docSummary {
+    padding:0;
+}
+
+ul.blockList ul.blockList ul.blockList li.blockList h3 {
+    font-style:normal;
+}
+
+div.block {
+    font-size:14px;
+    font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
+}
+
+td.colLast div {
+    padding-top:0px;
+}
+
+
+td.colLast a {
+    padding-bottom:3px;
+}
+/*
+Formatting effect styles
+*/
+.sourceLineNo {
+    color:green;
+    padding:0 30px 0 0;
+}
+h1.hidden {
+    visibility:hidden;
+    overflow:hidden;
+    font-size:10px;
+}
+.block {
+    display:block;
+    margin:3px 10px 2px 0px;
+    color:#474747;
+}
+.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink,
+.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel,
+.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink, .searchTagLink {
+    font-weight:bold;
+}
+.deprecationComment, .emphasizedPhrase, .interfaceName {
+    font-style:italic;
+}
+
+div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase,
+div.block div.block span.interfaceName {
+    font-style:normal;
+}
+
+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;
+}
+/*
+HTML5 specific styles
+*/
+main, nav, header, footer, section {
+    display:block;
+}
+.ui-autocomplete-category {
+    font-weight:bold;
+    font-size:15px;
+    padding:7px 0 7px 3px;
+    background-color:#4D7A97;
+    color:#FFFFFF;
+}
+.resultItem {
+    font-size:13px;
+}
+.ui-autocomplete {
+    max-height:85%;
+    max-width:65%;
+    overflow-y:scroll;
+    overflow-x:scroll;
+    white-space:nowrap;
+    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
+}
+ul.ui-autocomplete {
+    position:fixed;
+    z-index:999999;
+}
+ul.ui-autocomplete  li {
+    float:left;
+    clear:both;
+    width:100%;
+}
+.resultHighlight {
+    font-weight:bold;
+}
+#search {
+    background-image:url('resources/glass.png');
+    background-size:13px;
+    background-repeat:no-repeat;
+    background-position:2px 3px;
+    padding-left:20px;
+    position:relative;
+    right:-18px;
+}
+#reset {
+    background-color: rgb(255,255,255);
+    border:0 none;
+    width:16px;
+    height:17px;
+    position:relative;
+    left:-2px;
+    background-image:url('resources/x.png');
+    background-repeat:no-repeat;
+    background-size:12px;
+    background-position:center;
+}
+.watermark {
+    color:#888;
+}
+.searchTagDescResult {
+    font-style:italic;
+    font-size:11px;
+}
+.searchTagHolderResult {
+    font-style:italic;
+    font-size:12px;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testOptions/deprecated/Foo.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 deprecated;
+
+import pkg.*;
+
+@Deprecated
+public class Foo {}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testOptions/help.html	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,242 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!-- NewPage -->
+<html lang="ru">
+<head>
+<!-- Generated by javadoc (9-internal) on Mon Jan 04 22:47:26 MSK 2016 -->
+<title>API Help</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="date" content="2016-01-04">
+<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
+<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
+<script type="text/javascript" src="script.js"></script>
+<script type="text/javascript" src="jquery/jszip/dist/jszip.min.js"></script>
+<script type="text/javascript" src="jquery/jszip-utils/dist/jszip-utils.min.js"></script>
+<!--[if IE]>
+<script type="text/javascript" src="jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
+<![endif]-->
+<script type="text/javascript" src="jquery/jquery-1.10.2.js"></script>
+<script type="text/javascript" src="jquery/jquery-ui.js"></script>
+</head>
+<body>
+<script type="text/javascript"><!--
+    try {
+        if (location.href.indexOf('is-external=true') == -1) {
+            parent.document.title="API Help";
+        }
+    }
+    catch(err) {
+    }
+//-->
+var pathtoroot = "./";loadScripts(document, 'script');</script>
+<noscript>
+<div>JavaScript is disabled on your browser.</div>
+</noscript>
+<div class="fixedNav">
+<!-- ========= START OF TOP NAVBAR ======= -->
+<div class="topNav"><a name="navbar.top">
+<!--   -->
+</a>
+<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
+<a name="navbar.top.firstrow">
+<!--   -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="pkg/package-summary.html">Package</a></li>
+<li>Class</li>
+<li><a href="pkg/package-tree.html">Tree</a></li>
+<li><a href="deprecated-list.html">Deprecated</a></li>
+<li><a href="index-all.html">Index</a></li>
+<li class="navBarCell1Rev">Help</li>
+</ul>
+<div class="aboutLanguage">Test header</div>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li>Prev</li>
+<li>Next</li>
+</ul>
+<ul class="navList">
+<li><a href="index.html?help-doc.html" target="_top">Frames</a></li>
+<li><a href="help-doc.html" target="_top">No&nbsp;Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_top">
+<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
+</ul>
+<ul class="navListSearch">
+<li><span>SEARCH:&nbsp;</span>
+<input type="text" id="search" value=" " disabled="disabled">
+<input type="reset" id="reset" value=" " disabled="disabled">
+</li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+  allClassesLink = document.getElementById("allclasses_navbar_top");
+  if(window==top) {
+    allClassesLink.style.display = "block";
+  }
+  else {
+    allClassesLink.style.display = "none";
+  }
+  //-->
+</script>
+<noscript>
+<div>JavaScript is disabled on your browser.</div>
+</noscript>
+</div>
+<a name="skip.navbar.top">
+<!--   -->
+</a></div>
+<!-- ========= END OF TOP NAVBAR ========= -->
+</div>
+<div class="header">
+<h1 class="title">How This API Document Is Organized (custom help file)</h1>
+<div class="subTitle">This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.</div>
+</div>
+<div class="contentContainer">
+<ul class="blockList">
+<li class="blockList">
+<h2>Package</h2>
+<p>Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:</p>
+<ul>
+<li>Interfaces (italic)</li>
+<li>Classes</li>
+<li>Enums</li>
+<li>Exceptions</li>
+<li>Errors</li>
+<li>Annotation Types</li>
+</ul>
+</li>
+<li class="blockList">
+<h2>Class/Interface</h2>
+<p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:</p>
+<ul>
+<li>Class inheritance diagram</li>
+<li>Direct Subclasses</li>
+<li>All Known Subinterfaces</li>
+<li>All Known Implementing Classes</li>
+<li>Class/interface declaration</li>
+<li>Class/interface description</li>
+</ul>
+<ul>
+<li>Nested Class Summary</li>
+<li>Field Summary</li>
+<li>Constructor Summary</li>
+<li>Method Summary</li>
+</ul>
+<ul>
+<li>Field Detail</li>
+<li>Constructor Detail</li>
+<li>Method Detail</li>
+</ul>
+<p>Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</p>
+</li>
+<li class="blockList">
+<h2>Annotation Type</h2>
+<p>Each annotation type has its own separate page with the following sections:</p>
+<ul>
+<li>Annotation Type declaration</li>
+<li>Annotation Type description</li>
+<li>Required Element Summary</li>
+<li>Optional Element Summary</li>
+<li>Element Detail</li>
+</ul>
+</li>
+<li class="blockList">
+<h2>Enum</h2>
+<p>Each enum has its own separate page with the following sections:</p>
+<ul>
+<li>Enum declaration</li>
+<li>Enum description</li>
+<li>Enum Constant Summary</li>
+<li>Enum Constant Detail</li>
+</ul>
+</li>
+<li class="blockList">
+<h2>Tree (Class Hierarchy)</h2>
+<p>There is a <a href="overview-tree.html">Class Hierarchy</a> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.</p>
+<ul>
+<li>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.</li>
+<li>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</li>
+</ul>
+</li>
+<li class="blockList">
+<h2>Deprecated API</h2>
+<p>The <a href="deprecated-list.html">Deprecated API</a> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</p>
+</li>
+<li class="blockList">
+<h2>Index</h2>
+<p>The <a href="index-all.html">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p>
+</li>
+<li class="blockList">
+<h2>Prev/Next</h2>
+<p>These links take you to the next or previous class, interface, package, or related page.</p>
+</li>
+<li class="blockList">
+<h2>Frames/No Frames</h2>
+<p>These links show and hide the HTML frames.  All pages are available with or without frames.</p>
+</li>
+<li class="blockList">
+<h2>All Classes</h2>
+<p>The <a href="allclasses-noframe.html">All Classes</a> link shows all classes and interfaces except non-static nested types.</p>
+</li>
+<li class="blockList">
+<h2>Serialized Form</h2>
+<p>Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.</p>
+</li>
+<li class="blockList">
+<h2>Constant Field Values</h2>
+<p>The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.</p>
+</li>
+</ul>
+<span class="emphasizedPhrase">This help file applies to API documentation generated using the standard doclet.</span></div>
+<!-- ======= START OF BOTTOM NAVBAR ====== -->
+<div class="bottomNav"><a name="navbar.bottom">
+<!--   -->
+</a>
+<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
+<a name="navbar.bottom.firstrow">
+<!--   -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="pkg/package-summary.html">Package</a></li>
+<li>Class</li>
+<li><a href="pkg/package-tree.html">Tree</a></li>
+<li><a href="deprecated-list.html">Deprecated</a></li>
+<li><a href="index-all.html">Index</a></li>
+<li class="navBarCell1Rev">Help</li>
+</ul>
+<div class="aboutLanguage">Test footer</div>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li>Prev</li>
+<li>Next</li>
+</ul>
+<ul class="navList">
+<li><a href="index.html?help-doc.html" target="_top">Frames</a></li>
+<li><a href="help-doc.html" target="_top">No&nbsp;Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_bottom">
+<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+  allClassesLink = document.getElementById("allclasses_navbar_bottom");
+  if(window==top) {
+    allClassesLink.style.display = "block";
+  }
+  else {
+    allClassesLink.style.display = "none";
+  }
+  //-->
+</script>
+<noscript>
+<div>JavaScript is disabled on your browser.</div>
+</noscript>
+</div>
+<a name="skip.navbar.bottom">
+<!--   -->
+</a></div>
+<!-- ======== END OF BOTTOM NAVBAR ======= -->
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testOptions/linksource/AnnotationTypeField.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 linksource;
+
+import java.lang.annotation.*;
+
+/**
+ * This is just a test for annotation type fields.
+ */
+@Documented public @interface AnnotationTypeField {
+    String DEFAULT_NAME = "test";
+
+    String name() default DEFAULT_NAME;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testOptions/linksource/Properties.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 linksource;
+
+/**
+ * This is just a test for property writer.
+ */
+public class Properties {
+
+    public Object someProperty() {
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testOptions/linksource/SomeClass.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 linksource;
+
+/**
+ * This is just a test for constructor, field and method writers.
+ */
+public class SomeClass {
+
+    public int field;
+
+    public SomeClass() {
+    }
+
+    public int method() {
+        return 0;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testOptions/linksource/SomeEnum.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 linksource;
+
+/**
+ * This is just a test for enum constant writers.
+ */
+public enum SomeEnum {
+    VALUE1,
+    VALUE2
+}
--- a/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8141492
+ * @bug 8141492 8071982
  * @summary Test the search feature of javadoc.
  * @author bpatel
  * @library ../lib
@@ -234,6 +234,12 @@
         checkOutput("index-all.html", expectedOutput,
                 "<dt><span class=\"searchTagLink\"><a href=\"pkg/package-summary.html#phrasewithspaces\">"
                         + "phrase with spaces</a></span> - Search tag in pkg</dt>",
+                "<dt><span class=\"searchTagLink\"><a href=\"pkg/package-summary.html#pkg\">"
+                        + "pkg</a></span> - Search tag in pkg</dt>",
+                "<dt><span class=\"searchTagLink\"><a href=\"pkg/package-summary.html#pkg2.5\">"
+                        + "pkg2.5</a></span> - Search tag in pkg</dt>",
+                "<dt><span class=\"searchTagLink\"><a href=\"pkg/package-summary.html#r\">"
+                        + "r</a></span> - Search tag in pkg</dt>",
                 "<dt><span class=\"searchTagLink\"><a href=\"pkg1/RegClass.html#searchphrase\">"
                         + "search phrase</a></span> - Search tag in pkg1.RegClass</dt>",
                 "<dt><span class=\"searchTagLink\"><a href=\"pkg1/RegClass.html#SearchWordWithDescription\">"
@@ -290,7 +296,14 @@
                         + "SingleWord</a></span> - Search tag in pkg</dt>");
         checkOutput("index-files/index-9.html", true,
                 "<dt><span class=\"searchTagLink\"><a href=\"../pkg/package-summary.html#phrasewithspaces\">"
-                        + "phrase with spaces</a></span> - Search tag in pkg</dt>");
+                        + "phrase with spaces</a></span> - Search tag in pkg</dt>",
+                "<dt><span class=\"searchTagLink\"><a href=\"../pkg/package-summary.html#pkg\">"
+                        + "pkg</a></span> - Search tag in pkg</dt>",
+                "<dt><span class=\"searchTagLink\"><a href=\"../pkg/package-summary.html#pkg2.5\">"
+                        + "pkg2.5</a></span> - Search tag in pkg</dt>");
+        checkOutput("index-files/index-11.html", true,
+                "<dt><span class=\"searchTagLink\"><a href=\"../pkg/package-summary.html#r\">"
+                        + "r</a></span> - Search tag in pkg</dt>");
         checkOutput("index-files/index-8.html", true,
                 "<dt><span class=\"searchTagLink\"><a href=\"../pkg/AnotherClass.ModalExclusionType.html"
                         + "#nested%7B@indexnested_tag_test%7D\">nested {@index nested_tag_test}</a></span> - "
@@ -309,6 +322,12 @@
         checkOutput("index-all.html", false,
                 "<dt><span class=\"searchTagLink\"><a href=\"pkg/package-summary.html#phrasewithspaces\">"
                         + "phrase with spaces</a></span> - Search tag in pkg</dt>",
+                "<dt><span class=\"searchTagLink\"><a href=\"pkg/package-summary.html#pkg\">"
+                        + "pkg</a></span> - Search tag in pkg</dt>",
+                "<dt><span class=\"searchTagLink\"><a href=\"pkg/package-summary.html#pkg2.5\">"
+                        + "pkg2.5</a></span> - Search tag in pkg</dt>",
+                "<dt><span class=\"searchTagLink\"><a href=\"pkg/package-summary.html#r\">"
+                        + "r</a></span> - Search tag in pkg</dt>",
                 "<dt><span class=\"searchTagLink\"><a href=\"pkg1/RegClass.html#searchphrase\">"
                         + "search phrase</a></span> - Search tag in pkg1.RegClass</dt>",
                 "<dt><span class=\"searchTagLink\"><a href=\"pkg1/RegClass.html#SearchWordWithDescription\">"
--- a/langtools/test/jdk/javadoc/doclet/testSearch/pkg/AnotherClass.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testSearch/pkg/AnotherClass.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -72,7 +72,7 @@
      * @param param some parameter.
      * @return a test object.
      */
-    public Class method(pkg1.RegClass param) {
+    public pkg1.RegClass method(pkg1.RegClass param) {
         return param;
     }
 }
--- a/langtools/test/jdk/javadoc/doclet/testSearch/pkg/package-info.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testSearch/pkg/package-info.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,9 @@
 
 /**
  * Test package. Testing search tag for package. Single {@index SingleWord} search tag.
- * Search {@index "phrase with spaces"}.
+ * Search tag 1 {@index "phrase with spaces"}.
+ * Search tag 2 {@index "pkg"}.
+ * Search tag 3 {@index "pkg2.5"}.
+ * Search tag 5 {@index "r"}.
  */
 package pkg;
--- a/langtools/test/jdk/javadoc/doclet/testSearch/pkgfx/C.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testSearch/pkgfx/C.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,24 +60,24 @@
 
     public final void setRate(double value) {}
 
-    public final double getRate() {}
+    public final double getRate() {return 0.0;}
 
-    public final DoubleProperty rateProperty() {}
+    public final DoubleProperty rateProperty() {return null;}
 
     private BooleanProperty paused;
 
     public final void setPaused(boolean value) {}
 
-    public final double isPaused() {}
+    public final double isPaused() {return 0.0;}
 
     class DoubleProperty {}
 
     class BooleanProperty {}
 
-    public final BooleanProperty setTestMethodProperty() {}
+    public final BooleanProperty setTestMethodProperty() {return null;}
 
     private class Inner {
-        private BooleanProperty testMethodProperty() {}
+        private BooleanProperty testMethodProperty() {return null;}
 
         /**
          * Defines the direction/speed at which the {@code Timeline} is expected to
@@ -88,8 +88,8 @@
 
         public final void setRate(double value) {}
 
-        public final double getRate() {}
+        public final double getRate() {return 0.0;}
 
-        public final DoubleProperty rateProperty() {}
+        public final DoubleProperty rateProperty() {return null;}
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testSerializedForm/ExternalizedForm.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+public class ExternalizedForm implements Externalizable {
+
+    /**
+     * @throws IOException when there is an I/O error.
+     */
+    public void writeExternal(ObjectOutput oo) throws IOException {}
+
+    /**
+     * @throws IOException when there is an I/O error.
+     * @throws ClassNotFoundException if no class found.
+     * @serialData This is a serial data comment.
+     */
+    public void readExternal(ObjectInput oi) throws IOException, ClassNotFoundException {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testSerializedForm/SerializedForm.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamField;
+import java.io.Serializable;
+
+public class SerializedForm implements Serializable {
+
+    /**
+     * @serialField name String a test
+     * @see TestSerializedForm
+     */
+    @Deprecated
+    private static final ObjectStreamField[] serialPersistentFields = {
+        new ObjectStreamField("i", int.class),
+        new ObjectStreamField("count", Integer.TYPE),
+        new ObjectStreamField("name", String.class)
+    };
+
+    /**
+     * The entry point of the test.
+     * @param args the array of command line arguments.
+     */
+
+    /**
+     * @param s ObjectInputStream.
+     * @throws IOException when there is an I/O error.
+     * @serial
+     */
+    private void readObject(ObjectInputStream s) throws IOException {}
+
+    /**
+     * @param s ObjectOutputStream.
+     * @throws IOException when there is an I/O error.
+     * @serial
+     */
+    private void writeObject(ObjectOutputStream s) throws IOException {}
+
+    /**
+     * @throws IOException when there is an I/O error.
+     * @serialData This is a serial data comment.
+     * @return an object.
+     */
+    protected Object readResolve() throws IOException {return null;}
+
+    /**
+     * @throws IOException when there is an I/O error.
+     * @serialData This is a serial data comment.
+     * @return an object.
+     */
+    protected Object writeReplace() throws IOException {return null;}
+
+    /**
+     * @throws IOException when there is an I/O error.
+     * @serialData This is a serial data comment.
+     * @return an object.
+     */
+    protected Object readObjectNoData() throws IOException {
+        return null;
+    }
+}
--- a/langtools/test/jdk/javadoc/doclet/testSerializedForm/TestSerializedForm.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testSerializedForm/TestSerializedForm.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4341304 4485668 4966728 8032066
+ * @bug 4341304 4485668 4966728 8032066 8071982
  * @summary Test that methods readResolve and writeReplace show
  * up in serialized-form.html the same way that readObject and writeObject do.
  * If the doclet includes readResolve and writeReplace in the serialized-form
@@ -41,7 +41,7 @@
 
 import java.io.*;
 
-public class TestSerializedForm extends JavadocTester implements Serializable {
+public class TestSerializedForm extends JavadocTester {
     public static void main(String... args) throws Exception {
         TestSerializedForm tester = new TestSerializedForm();
         tester.runTests();
@@ -50,18 +50,23 @@
 //        tester.printSummary();
     }
 
-    @Test
+    // @ignore 8146022
+    // @Test
     void testDefault() {
-        javadoc("-d", "out-default",
+        javadoc("-d", "out-default", "-serialwarn", "-Xdoclint:none",
                 "-sourcepath", testSrc,
-                testSrc("TestSerializedForm.java"), "pkg1");
+                testSrc("SerializedForm.java"), testSrc("ExternalizedForm.java"), "pkg1");
         checkExit(Exit.OK);
 
         checkOutput("serialized-form.html", true,
                 "protected&nbsp;java.lang.Object&nbsp;readResolve()",
                 "protected&nbsp;java.lang.Object&nbsp;writeReplace()",
                 "protected&nbsp;java.lang.Object&nbsp;readObjectNoData()",
-                "See Also",
+                "<h3>Serialization Overview</h3>\n<ul class=\"blockList\">\n"
+                + "<li class=\"blockListLast\">\n<div class=\"block\">"
+                + "<span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>\n"
+                + "<dl>\n<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+                + "<dd><code>TestSerializedForm</code></dd>\n</dl>",
                 "<h3>Class pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass "
                 + "extends java.lang.Object implements Serializable</h3>",
                 "<h3>Class pkg1.PrivateIncludeInnerClass.PriInnerClass extends "
@@ -86,7 +91,7 @@
         javadoc("-private",
                 "-d", "out-private",
                 "-sourcepath", testSrc,
-                testSrc("TestSerializedForm.java"), "pkg1");
+                testSrc("SerializedForm.java"), testSrc("ExternalizedForm.java"), "pkg1");
         checkExit(Exit.OK);
 
         checkOutput("serialized-form.html", true,
@@ -109,53 +114,4 @@
                 + "title=\"class in pkg1\">pkg1.PublicExcludeInnerClass.PubInnerClass</a> "
                 + "extends java.lang.Object implements Serializable</h3>");
     }
-
-    /**
-     * @serial
-     * @see TestSerializedForm
-     */
-    public final int SERIALIZABLE_CONSTANT = 1;
-
-    /**
-     * The entry point of the test.
-     * @param args the array of command line arguments.
-     */
-
-    /**
-     * @param s ObjectInputStream.
-     * @throws IOException when there is an I/O error.
-     * @serial
-     */
-    private void readObject(ObjectInputStream s) throws IOException {}
-
-    /**
-     * @param s ObjectOutputStream.
-     * @throws IOException when there is an I/O error.
-     * @serial
-     */
-    private void writeObject(ObjectOutputStream s) throws IOException {}
-
-    /**
-     * @throws IOException when there is an I/O error.
-     * @serialData This is a serial data comment.
-     * @return an object.
-     */
-    protected Object readResolve() throws IOException {return null;}
-
-    /**
-     * @throws IOException when there is an I/O error.
-     * @serialData This is a serial data comment.
-     * @return an object.
-     */
-    protected Object writeReplace() throws IOException {return null;}
-
-    /**
-     * @throws IOException when there is an I/O error.
-     * @serialData This is a serial data comment.
-     * @return an object.
-     */
-    protected Object readObjectNoData() throws IOException {
-        return null;
-    }
-
 }
--- a/langtools/test/jdk/javadoc/doclet/testSimpleTag/C.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testSimpleTag/C.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,4 +28,10 @@
  * @tag-with-hyphens a tag that contains hyphens.
  */
 
-public class C {}
+public class C {
+    /**
+     * @param arg this is an int argument.
+     */
+    public void m(int arg) {
+    }
+}
--- a/langtools/test/jdk/javadoc/doclet/testSimpleTag/TestSimpleTag.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testSimpleTag/TestSimpleTag.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4695326 4750173 4920381 8078320
+ * @bug 4695326 4750173 4920381 8078320 8071982
  * @summary Test the declaration of simple tags using -tag. Verify that
  * "-tag name" is a shortcut for "-tag name:a:Name:".  Also verity that
  * you can escape the ":" character with a back slash so that it is not
@@ -46,6 +46,7 @@
     void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
+                "-tag", "param",
                 "-tag", "todo",
                 "-tag", "ejb\\:bean:a:EJB Beans:",
                 "-tag", "regular:a:Regular Tag:",
@@ -57,6 +58,8 @@
                 "<span class=\"simpleTagLabel\">Todo:</span>",
                 "<span class=\"simpleTagLabel\">EJB Beans:</span>",
                 "<span class=\"simpleTagLabel\">Regular Tag:</span>",
-                "<span class=\"simpleTagLabel\">Tag-With-Hyphens:</span>");
+                "<span class=\"simpleTagLabel\">Tag-With-Hyphens:</span>",
+                "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n"
+                + "<dd><code>arg</code> - this is an int argument.</dd>");
     }
 }
--- a/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8005091 8009686 8025633 8026567 6469562
+ * @bug      8005091 8009686 8025633 8026567 6469562 8071982 8071984
  * @summary  Make sure that type annotations are displayed correctly
  * @author   Bhavesh Patel
  * @library  ../lib
@@ -355,5 +355,369 @@
         checkOutput("typeannos/Generic2.html", true,
                 "<pre>void&nbsp;test2(<a href=\"../typeannos/RcvrA.html\" title=\""
                 + "annotation in typeannos\">@RcvrA</a>&nbsp;Generic2&lt;X&gt;&nbsp;this)</pre>");
+
+
+        // Test for repeated type annotations (RepeatedAnnotations.java).
+        checkOutput("typeannos/RepeatingAtClassLevel.html", true,
+                "<pre><a href=\"../typeannos/RepTypeA.html\" title=\"annotation in "
+                + "typeannos\">@RepTypeA</a> <a href=\"../typeannos/RepTypeA.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeA</a>\n<a href="
+                + "\"../typeannos/RepTypeB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeB</a> <a href=\"../typeannos/RepTypeB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeB</a>\nclass <span class="
+                + "\"typeNameLabel\">RepeatingAtClassLevel</span>\nextends "
+                + "java.lang.Object</pre>");
+
+// @ignore 8146008
+//        checkOutput("typeannos/RepeatingAtClassLevel2.html", true,
+//                "<pre><a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation "
+//                + "in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+//                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a>\n<a href="
+//                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos"
+//                + "\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+//                + "title=\"annotation in typeannos\">@RepTypeUseB</a>\nclass <span "
+//                + "class=\"typeNameLabel\">RepeatingAtClassLevel2</span>\nextends "
+//                + "java.lang.Object</pre>");
+//
+//        checkOutput("typeannos/RepeatingAtClassLevel2.html", true,
+//                "<pre><a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation"
+//                + " in typeannos\">@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+//                + "\" title=\"annotation in typeannos\">@RepAllContextsA</a>\n<a href="
+//                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos"
+//                + "\">@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+//                + "\" title=\"annotation in typeannos\">@RepAllContextsB</a>\n"
+//                + "class <span class=\"typeNameLabel\">RepeatingAtClassLevel3</span>\n"
+//                + "extends java.lang.Object</pre>");
+
+        checkOutput("typeannos/RepeatingOnConstructor.html", true,
+                "<pre><a href=\"../typeannos/RepConstructorA.html\" title=\"annotation "
+                + "in typeannos\">@RepConstructorA</a> <a href=\"../typeannos/RepConstructorA.html"
+                + "\" title=\"annotation in typeannos\">@RepConstructorA</a>\n<a href="
+                + "\"../typeannos/RepConstructorB.html\" title=\"annotation in typeannos"
+                + "\">@RepConstructorB</a> <a href=\"../typeannos/RepConstructorB.html"
+                + "\" title=\"annotation in typeannos\">@RepConstructorB</a>\n"
+                + "RepeatingOnConstructor()</pre>",
+
+                "<pre><a href=\"../typeannos/RepConstructorA.html\" title=\"annotation in typeannos"
+                + "\">@RepConstructorA</a> <a href=\"../typeannos/RepConstructorA.html"
+                + "\" title=\"annotation in typeannos\">@RepConstructorA</a>\n<a href="
+                + "\"../typeannos/RepConstructorB.html\" title=\"annotation in typeannos"
+                + "\">@RepConstructorB</a> <a href=\"../typeannos/RepConstructorB.html"
+                + "\" title=\"annotation in typeannos\">@RepConstructorB</a>\n"
+                + "RepeatingOnConstructor(int&nbsp;i,\n                       int&nbsp;j)</pre>",
+
+                "<pre><a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos"
+                + "\">@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+                + "\" title=\"annotation in typeannos\">@RepAllContextsA</a>\n"
+                + "<a href=\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos"
+                + "\">@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+                + "\" title=\"annotation in typeannos\">@RepAllContextsB</a>\n"
+                + "RepeatingOnConstructor(int&nbsp;i,\n                       int&nbsp;j,\n"
+                + "                       int&nbsp;k)</pre>",
+
+                "<pre>RepeatingOnConstructor(<a href=\"../typeannos/RepParameterA.html"
+                + "\" title=\"annotation in typeannos\">@RepParameterA</a> <a href="
+                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos"
+                + "\">@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html"
+                + "\" title=\"annotation in typeannos\">@RepParameterB</a> "
+                + "<a href=\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos"
+                + "\">@RepParameterB</a>\n                       java.lang.String&nbsp;parameter,\n"
+                + "                       <a href=\"../typeannos/RepParameterA.html\" "
+                + "title=\"annotation in typeannos\">@RepParameterA</a> <a href="
+                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html\" "
+                + "title=\"annotation in typeannos\">@RepParameterB</a> <a href="
+                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterB</a>\n                       java.lang.String "
+                + "<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">@RepTypeUseB</a> "
+                + "<a href=\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> ...&nbsp;vararg)</pre>"
+        );
+
+        checkOutput("typeannos/RepeatingOnConstructor.Inner.html", true,
+                "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnConstructor.Inner.html"
+                + "#Inner-java.lang.String-java.lang.String...-\">Inner</a></span>"
+                + "(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> ...&nbsp;vararg)</code>",
+
+                "Inner(<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a>&nbsp;RepeatingOnConstructor&nbsp;this,\n      <a href="
+                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterA.html\" title="
+                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html"
+                + "\" title=\"annotation in typeannos\">@RepParameterB</a> <a href="
+                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterB</a>\n      java.lang.String&nbsp;parameter,\n"
+                + "      <a href=\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterA.html\" title="
+                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html"
+                + "\" title=\"annotation in typeannos\">@RepParameterB</a> <a href="
+                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterB</a>\n      java.lang.String <a href=\"../typeannos/RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> ...&nbsp;vararg)");
+
+        checkOutput("typeannos/RepeatingOnField.html", true,
+                "<code>(package private) java.lang.Integer</code></td>\n<td class=\"colLast\">"
+                + "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnField.html#i1"
+                + "\">i1</a></span></code>",
+
+                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\""
+                + "../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer</code></td>\n"
+                + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href="
+                + "\"../typeannos/RepeatingOnField.html#i2\">i2</a></span></code>",
+
+                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer</code>"
+                + "</td>\n<td class=\"colLast\"><code><span class=\"memberNameLink\">"
+                + "<a href=\"../typeannos/RepeatingOnField.html#i3\">i3</a></span></code>",
+
+                "<code>(package private) <a href=\"../typeannos/RepAllContextsA.html\" title=\""
+                + "annotation in typeannos\">@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+                + "\" title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
+                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html\" title="
+                + "\"annotation in typeannos\">@RepAllContextsB</a> java.lang.Integer</code>"
+                + "</td>\n<td class=\"colLast\"><code><span class=\"memberNameLink\">"
+                + "<a href=\"../typeannos/RepeatingOnField.html#i4\">i4</a></span></code>",
+
+                "<code>(package private) java.lang.String <a href=\"../typeannos/RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> [] <a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> []</code></td>\n<td class=\"colLast\"><code><span class="
+                + "\"memberNameLink\"><a href=\"../typeannos/RepeatingOnField.html#sa"
+                + "\">sa</a></span></code>",
+
+                "<pre><a href=\"../typeannos/RepFieldA.html\" title=\"annotation in typeannos\">"
+                + "@RepFieldA</a> <a href=\"../typeannos/RepFieldA.html\" title="
+                + "\"annotation in typeannos\">@RepFieldA</a>\n<a href=\"../typeannos/RepFieldB.html"
+                + "\" title=\"annotation in typeannos\">@RepFieldB</a> <a href="
+                + "\"../typeannos/RepFieldB.html\" title=\"annotation in typeannos\">"
+                + "@RepFieldB</a>\njava.lang.Integer i1</pre>",
+
+                "<pre><a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos"
+                + "\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> "
+                + "<a href=\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer i2</pre>",
+
+                "<pre><a href=\"../typeannos/RepFieldA.html\" title=\"annotation in typeannos\">"
+                + "@RepFieldA</a> <a href=\"../typeannos/RepFieldA.html\" title="
+                + "\"annotation in typeannos\">@RepFieldA</a>\n<a href=\"../typeannos/RepFieldB.html"
+                + "\" title=\"annotation in typeannos\">@RepFieldB</a> <a href="
+                + "\"../typeannos/RepFieldB.html\" title=\"annotation in typeannos\">"
+                + "@RepFieldB</a>\n<a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer i3</pre>",
+
+                "<pre><a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+                + "\" title=\"annotation in typeannos\">@RepAllContextsA</a>\n<a href="
+                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+                + "\" title=\"annotation in typeannos\">@RepAllContextsB</a>\n"
+                + "<a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html\" "
+                + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
+                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+                + "\" title=\"annotation in typeannos\">@RepAllContextsB</a> java.lang.Integer i4</pre>",
+
+                "<pre>java.lang.String <a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> [] <a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> [] sa</pre>");
+
+        checkOutput("typeannos/RepeatingOnMethod.html", true,
+                "<code>(package private) java.lang.String</code></td>\n<td class="
+                + "\"colLast\"><code><span class=\"memberNameLink\"><a href="
+                + "\"../typeannos/RepeatingOnMethod.html#test1--\">test1</a></span>()</code>",
+
+                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String</code>"
+                + "</td>\n<td class=\"colLast\"><code><span class=\"memberNameLink\">"
+                + "<a href=\"../typeannos/RepeatingOnMethod.html#test2--\">test2</a>"
+                + "</span>()</code>",
+
+                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String</code>"
+                + "</td>\n<td class=\"colLast\"><code><span class=\"memberNameLink\">"
+                + "<a href=\"../typeannos/RepeatingOnMethod.html#test3--\">test3</a>"
+                + "</span>()</code>",
+
+                "<code>(package private) <a href=\"../typeannos/RepAllContextsA.html\" "
+                + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
+                + "\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsB.html\" "
+                + "title=\"annotation in typeannos\">@RepAllContextsB</a> <a href="
+                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> java.lang.String</code></td>\n<td class=\"colLast\">"
+                + "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnMethod.html"
+                + "#test4--\">test4</a></span>()</code>",
+
+                "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnMethod.html"
+                + "#test5-java.lang.String-java.lang.String...-\">test5</a></span>"
+                + "(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> ...&nbsp;vararg)</code>",
+
+                "<a href=\"../typeannos/RepMethodA.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodA</a> <a href=\"../typeannos/RepMethodA.html\" title="
+                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html\""
+                + " title=\"annotation in typeannos\">@RepMethodB</a> <a href="
+                + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodB</a>\njava.lang.String&nbsp;test1()",
+
+                "<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String&nbsp;test2()",
+
+                "<a href=\"../typeannos/RepMethodA.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodA</a> <a href=\"../typeannos/RepMethodA.html\" title="
+                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html\" "
+                + "title=\"annotation in typeannos\">@RepMethodB</a> <a href="
+                + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodB</a>\n<a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String&nbsp;test3()",
+
+                "<a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html\" "
+                + "title=\"annotation in typeannos\">@RepAllContextsA</a>\n<a href="
+                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html\" "
+                + "title=\"annotation in typeannos\">@RepAllContextsB</a>\n<a href="
+                + "\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html\" "
+                + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
+                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html\" "
+                + "title=\"annotation in typeannos\">@RepAllContextsB</a> java.lang.String&nbsp;test4()",
+
+                "java.lang.String&nbsp;test5(<a href=\"../typeannos/RepTypeUseA.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseB</a>&nbsp;RepeatingOnMethod&nbsp;"
+                + "this,\n                       <a href=\"../typeannos/RepParameterA.html\" "
+                + "title=\"annotation in typeannos\">@RepParameterA</a> <a href="
+                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html\" "
+                + "title=\"annotation in typeannos\">@RepParameterB</a> <a href="
+                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterB</a>\n                       java.lang.String&nbsp;parameter,\n"
+                + "                       <a href=\"../typeannos/RepParameterA.html\" title="
+                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"../typeannos/RepParameterA.html\""
+                + " title=\"annotation in typeannos\">@RepParameterA</a> <a href="
+                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterB</a> <a href=\"../typeannos/RepParameterB.html\" title="
+                + "\"annotation in typeannos\">@RepParameterB</a>\n                       "
+                + "java.lang.String <a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> ...&nbsp;vararg)");
+
+        checkOutput("typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html", true,
+                "<code>(package private) &lt;T&gt;&nbsp;java.lang.String</code></td>\n"
+                + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href="
+                + "\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
+                + "genericMethod-T-\">genericMethod</a></span>(T&nbsp;t)</code>",
+
+                "<code>(package private) &lt;T&gt;&nbsp;java.lang.String</code></td>\n"
+                + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href="
+                + "\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
+                + "genericMethod2-T-\">genericMethod2</a></span>(<a href=\"../typeannos/RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> T&nbsp;t)</code>",
+
+                "<code>(package private) java.lang.String</code></td>\n<td class=\"colLast\"><code>"
+                + "<span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
+                + "test--\">test</a></span>()</code>",
+
+                "java.lang.String&nbsp;test(<a href=\"../typeannos/RepTypeUseA.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseB</a>&nbsp;"
+                + "RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod&lt;<a href="
+                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseB</a> T&gt;&nbsp;this)");
+
+        checkOutput("typeannos/RepeatingOnVoidMethodDeclaration.html", true,
+                "<a href=\"../typeannos/RepMethodA.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodA</a> <a href=\"../typeannos/RepMethodA.html\" title="
+                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html"
+                + "\" title=\"annotation in typeannos\">@RepMethodB</a> <a href="
+                + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodB</a>\nvoid&nbsp;test()");
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/RepeatedAnnotations.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,346 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR RepeatingA PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+
+/*
+ * This class is partially replicated from test/tools/javac/annotations/typeAnnotations/classfile/CombinationsTargetTest1.java; CombinationsTargetTest2.java; CombinationsTargetTest3.java
+ */
+@RepTypeA @RepTypeA @RepTypeB @RepTypeB class RepeatingAtClassLevel {
+}
+
+@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB class RepeatingAtClassLevel2 {
+}
+
+@RepAllContextsA @RepAllContextsA @RepAllContextsB @RepAllContextsB class RepeatingAtClassLevel3 {
+}
+
+class RepeatingOnConstructor {
+
+    @RepConstructorA @RepConstructorA @RepConstructorB @RepConstructorB
+    RepeatingOnConstructor() {
+    }
+
+    @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB RepeatingOnConstructor(int i) {
+    }
+
+    @RepConstructorA @RepConstructorA @RepConstructorB @RepConstructorB
+    @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB RepeatingOnConstructor(int i, int j) {
+    }
+
+    @RepAllContextsA @RepAllContextsA @RepAllContextsB @RepAllContextsB RepeatingOnConstructor(int i, int j, int k) {
+    }
+
+    RepeatingOnConstructor(@RepParameterA @RepParameterA @RepParameterB @RepParameterB String parameter, @RepParameterA @RepParameterA @RepParameterB @RepParameterB String @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB ... vararg) {
+    }
+
+    class Inner {
+        Inner(@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB RepeatingOnConstructor RepeatingOnConstructor.this, @RepParameterA @RepParameterA @RepParameterB @RepParameterB String parameter, @RepParameterA @RepParameterA @RepParameterB @RepParameterB String @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB ... vararg) {
+        }
+    }
+}
+
+class RepeatingOnField {
+    @RepFieldA @RepFieldA @RepFieldB @RepFieldB
+    Integer i1;
+
+    @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB Integer i2;
+
+    @RepFieldA @RepFieldA @RepFieldB @RepFieldB
+    @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB Integer i3;
+
+    @RepAllContextsA @RepAllContextsA @RepAllContextsB @RepAllContextsB Integer i4;
+
+    String @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB [] @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB [] sa = null;
+}
+
+class RepeatingOnMethod {
+
+    @RepMethodA @RepMethodA @RepMethodB @RepMethodB
+    String test1() {
+        return null;
+    }
+
+    @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB String test2() {
+        return null;
+    }
+
+    @RepMethodA @RepMethodA @RepMethodB @RepMethodB
+    @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB String test3() {
+        return null;
+    }
+
+    @RepAllContextsA @RepAllContextsA @RepAllContextsB @RepAllContextsB String test4() {
+        return null;
+    }
+
+    String test5(@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB RepeatingOnMethod this, @RepParameterA @RepParameterA @RepParameterB @RepParameterB String parameter, @RepParameterA @RepParameterA @RepParameterB @RepParameterB String @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB ... vararg) {
+        return null;
+    }
+}
+
+class RepeatingOnTypeParametersBoundsTypeArgumentsOnClassDecl <@RepTypeParameterA @RepTypeParameterA @RepTypeParameterB @RepTypeParameterB T extends @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB Object> {
+
+    <T> String genericMethod(T t) {
+        return null;
+    }
+}
+
+class RepeatingOnTypeParametersBoundsTypeArgumentsOnClassDecl2 <@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB T extends @RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB Object> {
+
+    <T> String genericMethod(T t) {
+        return null;
+    }
+}
+
+class RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod <T extends Object> {
+
+    String test(@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod<@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB T> this) {
+        return null;
+    }
+
+    <@RepTypeParameterA @RepTypeParameterA @RepTypeParameterB @RepTypeParameterB T> String genericMethod(@RepParameterA @RepParameterA @RepParameterB @RepParameterB T t) {
+        return null;
+    }
+
+    <@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB T> String genericMethod2(@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB T t) {
+        return null;
+    }
+}
+
+class RepeatingOnVoidMethodDeclaration {
+
+    @RepMethodA @RepMethodA @RepMethodB @RepMethodB void test() {}
+}
+
+class RepeatingOnStaticMethodOfInterface {
+
+    interface I {
+        static @RepMethodA @RepMethodA @RepMethodB @RepMethodB String m() {
+            return null;
+        }
+    }
+}
+
+//------------------------------------------------------------------------------
+@Target({TYPE})
+@Repeatable(ContTypeA.class)
+@Documented
+@interface RepTypeA { }
+
+@Target({TYPE})
+@Documented
+@interface ContTypeA { RepTypeA[] value(); }
+
+@Target({TYPE})
+@Repeatable(ContTypeB.class)
+@Documented
+@interface RepTypeB { }
+
+@Target({TYPE})
+@Documented
+@interface ContTypeB { RepTypeB[] value(); }
+
+//------------------------------------------------------------------------------
+@Target({CONSTRUCTOR})
+@Repeatable(ContConstructorA.class)
+@Documented
+@interface RepConstructorA { }
+
+@Target({CONSTRUCTOR})
+@Documented
+@interface ContConstructorA { RepConstructorA[] value(); }
+
+@Target({CONSTRUCTOR})
+@Repeatable(ContConstructorB.class )
+@Documented
+@interface RepConstructorB { }
+
+@Target({CONSTRUCTOR})
+@Documented
+@interface ContConstructorB { RepConstructorB[] value(); }
+
+//------------------------------------------------------------------------------
+@Target({METHOD})
+@Repeatable(ContMethodA.class)
+@Documented
+@interface RepMethodA {}
+
+@Target({METHOD})
+@Documented
+@interface ContMethodA {
+    RepMethodA[] value();
+}
+
+@Target({METHOD})
+@Repeatable(ContMethodB.class)
+@Documented
+@interface RepMethodB {}
+
+@Target({METHOD})
+@Documented
+@interface ContMethodB {
+    RepMethodB[] value();
+}
+
+//------------------------------------------------------------------------------
+@Target({FIELD})
+@Repeatable(ContFieldA.class)
+@Documented
+@interface RepFieldA {}
+
+@Target({FIELD})
+@Documented
+@interface ContFieldA {
+    RepFieldA[] value();
+}
+
+@Target({FIELD})
+@Repeatable(ContFieldB.class)
+@Documented
+@interface RepFieldB {}
+
+@Target({FIELD})
+@Documented
+@interface ContFieldB {
+    RepFieldB[] value();
+}
+
+//------------------------------------------------------------------------------
+@Target({TYPE_USE})
+@Repeatable(ContTypeUseA.class)
+@Documented
+@interface RepTypeUseA {}
+
+@Target({TYPE_USE})
+@Documented
+@interface ContTypeUseA {
+    RepTypeUseA[] value();
+}
+
+@Target({TYPE_USE})
+@Repeatable(ContTypeUseB.class)
+@Documented
+@interface RepTypeUseB {}
+
+@Target({TYPE_USE})
+@Documented
+@interface ContTypeUseB {
+    RepTypeUseB[] value();
+}
+
+//------------------------------------------------------------------------------
+@Target({TYPE_PARAMETER})
+@Repeatable(ContTypeParameterA.class)
+@Documented
+@interface RepTypeParameterA {}
+
+@Target({TYPE_PARAMETER})
+@Documented
+@interface ContTypeParameterA {
+    RepTypeParameterA[] value();
+}
+
+@Target({TYPE_PARAMETER})
+@Repeatable(ContTypeParameterB.class)
+@Documented
+@interface RepTypeParameterB {}
+
+@Target({TYPE_PARAMETER})
+@Documented
+@interface ContTypeParameterB {
+    RepTypeParameterB[] value();
+}
+
+//------------------------------------------------------------------------------
+@Target({PARAMETER})
+@Repeatable(ContParameterA.class)
+@Documented
+@interface RepParameterA {}
+
+@Target({PARAMETER})
+@Documented
+@interface ContParameterA {
+    RepParameterA[] value();
+}
+
+@Target({PARAMETER})
+@Repeatable(ContParameterB.class)
+@Documented
+@interface RepParameterB {}
+
+@Target({PARAMETER})
+@Documented
+@interface ContParameterB {
+    RepParameterB[] value();
+}
+
+
+//------------------------------------------------------------------------------
+@Target({PACKAGE})
+@Repeatable(ContPackageA.class)
+@Documented
+@interface RepPackageA {}
+
+@Target({PACKAGE})
+@Documented
+@interface ContPackageA {
+    RepPackageA[] value();
+}
+
+@Target({PACKAGE})
+@Repeatable(ContPackageB.class)
+@Documented
+@interface RepPackageB {}
+
+@Target({PACKAGE})
+@Documented
+@interface ContPackageB {
+    RepPackageB[] value();
+}
+
+//------------------------------------------------------------------------------
+@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE, TYPE_PARAMETER, TYPE_USE})
+@Repeatable(ContAllContextsA.class)
+@Documented
+@interface RepAllContextsA {}
+
+@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE, TYPE_PARAMETER, TYPE_USE})
+@Documented
+@interface ContAllContextsA {
+    RepAllContextsA[] value();
+}
+
+@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE, TYPE_PARAMETER, TYPE_USE})
+@Repeatable(ContAllContextsB.class)
+@Documented
+@interface RepAllContextsB {}
+
+@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE, TYPE_PARAMETER, TYPE_USE})
+@Documented
+@interface ContAllContextsB {
+    RepAllContextsB[] value();
+}
--- a/langtools/test/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4496290 4985072 7006178 7068595 8016328 8050031 8048351 8081854
+ * @bug 4496290 4985072 7006178 7068595 8016328 8050031 8048351 8081854 8071982
  * @summary A simple test to ensure class-use files are correct.
  * @author jamieh
  * @library ../lib
@@ -121,6 +121,21 @@
             "<a href=\"../../pkg1/C10.html#withTypeParametersOfType-java.lang.Class-\">" +
             "withTypeParametersOfType</a>"
         );
+        checkOutput("pkg1/class-use/UsedInterface.html", true,
+            "Subinterfaces of <a href=\"../../pkg1/UsedInterface.html\" title=\"interface in pkg1\">"
+            + "UsedInterface</a> in <a href=\"../../pkg1/package-summary.html\">pkg1",
+            "<td class=\"colFirst\"><code>interface&nbsp;</code></td>\n<td class=\"colLast\">"
+            + "<code><span class=\"memberNameLink\"><a href=\"../../pkg1/SubInterface.html\" "
+            + "title=\"interface in pkg1\">SubInterface</a>&lt;T&gt;</span></code>&nbsp;</td>"
+        );
+        checkOutput("pkg1/class-use/UsedThrowable.html", true,
+            "Methods in <a href=\"../../pkg1/package-summary.html\">pkg1</a> that throw "
+            + "<a href=\"../../pkg1/UsedThrowable.html\" title=\"class in pkg1\">UsedThrowable</a>",
+            "<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><span class="
+            + "\"typeNameLabel\">C1.</span><code><span class=\"memberNameLink\">"
+            + "<a href=\"../../pkg1/C1.html#methodInC1ThrowsThrowable--\">methodInC1ThrowsThrowable"
+            + "</a></span>()</code>&nbsp;</td>"
+        );
     }
 
     @Test
@@ -128,7 +143,7 @@
         javadoc("-d", "out-2",
                 "-sourcepath", testSrc,
                 "-use",
-                testSrc("C.java"), testSrc("UsedInC.java"));
+                testSrc("C.java"), testSrc("UsedInC.java"), "pkg3");
         checkExit(Exit.OK);
 
         checkOutput("class-use/UsedInC.html", true,
@@ -140,7 +155,9 @@
         );
         checkOutput("package-use.html", true,
                 "<td class=\"colOne\">"
-                + "<a href=\"class-use/UsedInC.html#unnamed.package\">UsedInC</a>&nbsp;</td>"
+                + "<a href=\"class-use/UsedInC.html#unnamed.package\">UsedInC</a>&nbsp;</td>",
+                "<td class=\"colFirst\"><a href=\"#-Unnamed-\">&lt;Unnamed&gt;</a></td>\n"
+                + "<td class=\"colLast\">&nbsp;</td>"
         );
     }
 
--- a/langtools/test/jdk/javadoc/doclet/testUseOption/pkg1/C1.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testUseOption/pkg1/C1.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,10 +47,13 @@
         return null;
     }
 
+    public void methodInC1ThrowsThrowable() throws UsedThrowable {
+    }
+
     /*
      * this must not appear anywhere.
      */
     UsedClass methodInC1Protected(List<UsedClass> p){
-        return p;
+        return p.get(0);
     }
 }
--- a/langtools/test/jdk/javadoc/doclet/testUseOption/pkg1/C9.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testUseOption/pkg1/C9.java	Wed Jul 05 21:30:21 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,5 +28,10 @@
  *
  */
 public class C9 implements UsedInterface, UsedInterfaceA {
+    @Override
     public void doNothing(){}
+
+    @Override
+    public void doNothingA() {
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testUseOption/pkg1/SubInterface.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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.
+ */
+
+/**
+ * An interface
+ *
+ */
+
+package pkg1;
+
+public interface SubInterface<T> extends UsedInterface {
+
+    /**
+     * Does nothing
+     */
+    void doNothingS();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testUseOption/pkg1/UsedThrowable.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg1;
+
+public class UsedThrowable extends Throwable {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testUseOption/pkg3/C.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR 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 pkg3;
+
+public class C {}
--- a/langtools/test/jdk/javadoc/tool/VerifyLocale.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/javadoc/tool/VerifyLocale.java	Wed Jul 05 21:30:21 2017 +0200
@@ -26,6 +26,7 @@
  * @bug 8035473
  * @summary Verify that init method works correctly.
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @ignore 8149565
  */
 
 import java.util.Collections;
@@ -40,6 +41,10 @@
 import jdk.javadoc.doclet.DocletEnvironment;
 
 public class VerifyLocale implements Doclet {
+    static String language;
+    static String country;
+    static String variant;
+
     Locale locale;
     Reporter reporter;
 
@@ -48,20 +53,29 @@
             new java.io.File(System.getProperty("test.src", "."),
                              "VerifyLocale.java");
 
-        String[] argarray = {
-            // jumble the options in some weird order
-            "-doclet", "VerifyLocale",
-            "-locale", "ja",
-            "-docletpath", System.getProperty("test.classes", "."),
-            thisFile
-        };
-        if (jdk.javadoc.internal.tool.Main.execute(argarray) != 0)
-            throw new Error("Javadoc encountered warnings or errors.");
+        for (Locale loc : Locale.getAvailableLocales()) {
+            language = loc.getLanguage();
+            country = loc.getCountry();
+            variant = loc.getVariant();
+            if (!language.equals("")) {
+                String[] command_line = {
+                    // jumble the options in some weird order
+                    "-doclet", "VerifyLocale",
+                    "-locale", language + (country.equals("") ? "" : ("_" + country + (variant.equals("") ? "" : "_" + variant))),
+                    "-docletpath", System.getProperty("test.classes", "."),
+                    thisFile
+                };
+                if (jdk.javadoc.internal.tool.Main.execute(command_line) != 0)
+                    throw new Error("Javadoc encountered warnings or errors.");
+            }
+        }
     }
 
     public boolean run(DocletEnvironment root) {
         reporter.print(Kind.NOTE, "just a test: Locale is: " + locale.getDisplayName());
-        return locale.getDisplayName(Locale.ENGLISH).contains("Japan");
+        return language.equals(locale.getLanguage())
+               && country.equals(locale.getCountry())
+               && variant.equals(locale.getVariant());
     }
 
     @Override
--- a/langtools/test/jdk/jshell/ReplToolTesting.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/jshell/ReplToolTesting.java	Wed Jul 05 21:30:21 2017 +0200
@@ -33,6 +33,9 @@
 import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Predicate;
+import java.util.prefs.AbstractPreferences;
+import java.util.prefs.BackingStoreException;
+import java.util.prefs.Preferences;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
@@ -41,6 +44,8 @@
 import jdk.internal.jshell.tool.JShellTool;
 import jdk.jshell.SourceCodeAnalysis.Suggestion;
 
+import org.testng.annotations.BeforeMethod;
+
 import static java.util.stream.Collectors.toList;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
@@ -83,6 +88,7 @@
     private Map<String, ClassInfo> classes;
     private Map<String, ImportInfo> imports;
     private boolean isDefaultStartUp = true;
+    private Preferences prefs;
 
     public JShellTool repl = null;
 
@@ -219,6 +225,11 @@
         }
     }
 
+    @BeforeMethod
+    public void setUp() {
+        prefs = new MemoryPreferences();
+    }
+
     public void testRaw(String[] args, ReplTest... tests) {
         cmdin = new WaitingTestingInputStream();
         cmdout = new ByteArrayOutputStream();
@@ -234,7 +245,8 @@
                 new PrintStream(console),
                 userin,
                 new PrintStream(userout),
-                new PrintStream(usererr));
+                new PrintStream(usererr),
+                prefs);
         repl.testPrompt = true;
         try {
             repl.start(args);
@@ -362,8 +374,8 @@
         }
     }
 
-    private void dropKey(boolean after, String cmd, String name, Map<String, ? extends MemberInfo> map) {
-        assertCommand(after, cmd, "");
+    private void dropKey(boolean after, String cmd, String name, Map<String, ? extends MemberInfo> map, String output) {
+        assertCommand(after, cmd, output);
         if (after) {
             map.remove(name);
             for (int i = 0; i < keys.size(); ++i) {
@@ -377,20 +389,20 @@
         }
     }
 
-    public void dropVariable(boolean after, String cmd, String name) {
-        dropKey(after, cmd, name, variables);
+    public void dropVariable(boolean after, String cmd, String name, String output) {
+        dropKey(after, cmd, name, variables, output);
     }
 
-    public void dropMethod(boolean after, String cmd, String name) {
-        dropKey(after, cmd, name, methods);
+    public void dropMethod(boolean after, String cmd, String name, String output) {
+        dropKey(after, cmd, name, methods, output);
     }
 
-    public void dropClass(boolean after, String cmd, String name) {
-        dropKey(after, cmd, name, classes);
+    public void dropClass(boolean after, String cmd, String name, String output) {
+        dropKey(after, cmd, name, classes, output);
     }
 
-    public void dropImport(boolean after, String cmd, String name) {
-        dropKey(after, cmd, name, imports);
+    public void dropImport(boolean after, String cmd, String name, String output) {
+        dropKey(after, cmd, name, imports, output);
     }
 
     public void assertCommand(boolean after, String cmd, String out) {
@@ -424,10 +436,10 @@
             }
             setCommandInput(cmd + "\n");
         } else {
-            assertOutput(getCommandOutput(), out, "command");
-            assertOutput(getCommandErrorOutput(), err, "command error");
-            assertOutput(getUserOutput(), print, "user");
-            assertOutput(getUserErrorOutput(), usererr, "user error");
+            assertOutput(getCommandOutput(), out, "command output: " + cmd);
+            assertOutput(getCommandErrorOutput(), err, "command error: " + cmd);
+            assertOutput(getUserOutput(), print, "user output: " + cmd);
+            assertOutput(getUserErrorOutput(), usererr, "user error: " + cmd);
         }
     }
 
@@ -447,7 +459,7 @@
 
     private List<String> computeCompletions(String code, boolean isSmart) {
         JShellTool js = this.repl != null ? this.repl
-                                      : new JShellTool(null, null, null, null, null, null, null);
+                                      : new JShellTool(null, null, null, null, null, null, null, prefs);
         int cursor =  code.indexOf('|');
         code = code.replace("|", "");
         assertTrue(cursor > -1, "'|' not found: " + code);
@@ -464,9 +476,9 @@
         return (output) -> assertTrue(output.startsWith(prefix), "Output: \'" + output + "' does not start with: " + prefix);
     }
 
-    public void assertOutput(String got, String expected, String kind) {
+    public void assertOutput(String got, String expected, String display) {
         if (expected != null) {
-            assertEquals(got, expected, "Kind: " + kind + ".\n");
+            assertEquals(got, expected, display + ".\n");
         }
     }
 
@@ -762,4 +774,62 @@
             }
         }
     }
+
+    public static final class MemoryPreferences extends AbstractPreferences {
+
+        private final Map<String, String> values = new HashMap<>();
+        private final Map<String, MemoryPreferences> nodes = new HashMap<>();
+
+        public MemoryPreferences() {
+            this(null, "");
+        }
+
+        public MemoryPreferences(MemoryPreferences parent, String name) {
+            super(parent, name);
+        }
+
+        @Override
+        protected void putSpi(String key, String value) {
+            values.put(key, value);
+        }
+
+        @Override
+        protected String getSpi(String key) {
+            return values.get(key);
+        }
+
+        @Override
+        protected void removeSpi(String key) {
+            values.remove(key);
+        }
+
+        @Override
+        protected void removeNodeSpi() throws BackingStoreException {
+            ((MemoryPreferences) parent()).nodes.remove(name());
+        }
+
+        @Override
+        protected String[] keysSpi() throws BackingStoreException {
+            return values.keySet().toArray(new String[0]);
+        }
+
+        @Override
+        protected String[] childrenNamesSpi() throws BackingStoreException {
+            return nodes.keySet().toArray(new String[0]);
+        }
+
+        @Override
+        protected AbstractPreferences childSpi(String name) {
+            return nodes.computeIfAbsent(name, n -> new MemoryPreferences(this, name));
+        }
+
+        @Override
+        protected void syncSpi() throws BackingStoreException {
+        }
+
+        @Override
+        protected void flushSpi() throws BackingStoreException {
+        }
+
+    }
 }
--- a/langtools/test/jdk/jshell/StartOptionTest.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/jshell/StartOptionTest.java	Wed Jul 05 21:30:21 2017 +0200
@@ -54,7 +54,8 @@
     private ByteArrayOutputStream err;
 
     private JShellTool getShellTool() {
-        return new JShellTool(null, new PrintStream(out), new PrintStream(err), null, null, null, null);
+        return new JShellTool(null, new PrintStream(out), new PrintStream(err), null, null, null,
+                              null, new ReplToolTesting.MemoryPreferences());
     }
 
     private String getOutput() {
--- a/langtools/test/jdk/jshell/ToolBasicTest.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/jshell/ToolBasicTest.java	Wed Jul 05 21:30:21 2017 +0200
@@ -755,13 +755,13 @@
     public void testDrop() {
         test(false, new String[]{"-nostartup"},
                 a -> assertVariable(a, "int", "a"),
-                a -> dropVariable(a, "/drop 1", "int a = 0"),
+                a -> dropVariable(a, "/drop 1", "int a = 0", "|  Dropped variable a\n"),
                 a -> assertMethod(a, "int b() { return 0; }", "()I", "b"),
-                a -> dropMethod(a, "/drop 2", "b ()I"),
+                a -> dropMethod(a, "/drop 2", "b ()I", "|  Dropped method b()\n"),
                 a -> assertClass(a, "class A {}", "class", "A"),
-                a -> dropClass(a, "/drop 3", "class A"),
+                a -> dropClass(a, "/drop 3", "class A", "|  Dropped class A\n"),
                 a -> assertImport(a, "import java.util.stream.*;", "", "java.util.stream.*"),
-                a -> dropImport(a, "/drop 4", "import java.util.stream.*"),
+                a -> dropImport(a, "/drop 4", "import java.util.stream.*", ""),
                 a -> assertCommandCheckOutput(a, "/vars", assertVariables()),
                 a -> assertCommandCheckOutput(a, "/methods", assertMethods()),
                 a -> assertCommandCheckOutput(a, "/classes", assertClasses()),
@@ -769,11 +769,11 @@
         );
         test(false, new String[]{"-nostartup"},
                 a -> assertVariable(a, "int", "a"),
-                a -> dropVariable(a, "/drop a", "int a = 0"),
+                a -> dropVariable(a, "/drop a", "int a = 0", "|  Dropped variable a\n"),
                 a -> assertMethod(a, "int b() { return 0; }", "()I", "b"),
-                a -> dropMethod(a, "/drop b", "b ()I"),
+                a -> dropMethod(a, "/drop b", "b ()I", "|  Dropped method b()\n"),
                 a -> assertClass(a, "class A {}", "class", "A"),
-                a -> dropClass(a, "/drop A", "class A"),
+                a -> dropClass(a, "/drop A", "class A", "|  Dropped class A\n"),
                 a -> assertCommandCheckOutput(a, "/vars", assertVariables()),
                 a -> assertCommandCheckOutput(a, "/methods", assertMethods()),
                 a -> assertCommandCheckOutput(a, "/classes", assertClasses()),
--- a/langtools/test/jdk/jshell/ToolFormatTest.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/jshell/ToolFormatTest.java	Wed Jul 05 21:30:21 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8148316 8148317
+ * @bug 8148316 8148317 8151755 8152246
  * @summary Tests for output customization
  * @library /tools/lib
  * @modules jdk.compiler/com.sun.tools.javac.api
@@ -33,6 +33,8 @@
  * @build KullaTesting TestingInputStream ToolBox Compiler
  * @run testng ToolFormatTest
  */
+import java.util.ArrayList;
+import java.util.List;
 import org.testng.annotations.Test;
 
 @Test
@@ -42,28 +44,34 @@
         try {
             test(
                     (a) -> assertCommandOutputStartsWith(a, "/set newmode test command", "|  Created new feedback mode: test"),
-                    (a) -> assertCommand(a, "/set field test pre '$ '", ""),
-                    (a) -> assertCommand(a, "/set field test post ''", ""),
-                    (a) -> assertCommand(a, "/set field test action 'ADD ' added-primary", ""),
-                    (a) -> assertCommand(a, "/set field test action 'MOD ' modified-primary", ""),
-                    (a) -> assertCommand(a, "/set field test action 'REP ' replaced-primary", ""),
-                    (a) -> assertCommand(a, "/set field test action 'UP-ADD ' added-update", ""),
-                    (a) -> assertCommand(a, "/set field test action 'UP-MOD ' modified-update", ""),
-                    (a) -> assertCommand(a, "/set field test action 'UP-REP ' replaced-update", ""),
-                    (a) -> assertCommand(a, "/set field test resolve 'OK' ok-*", ""),
-                    (a) -> assertCommand(a, "/set field test resolve 'DEF' defined-*", ""),
-                    (a) -> assertCommand(a, "/set field test resolve 'NODEF' notdefined-*", ""),
-                    (a) -> assertCommand(a, "/set field test name ':%s ' ", ""),
-                    (a) -> assertCommand(a, "/set field test type '[%s]' ", ""),
-                    (a) -> assertCommand(a, "/set field test result '=%s ' ", ""),
-                    (a) -> assertCommand(a, "/set format test '{pre}{action}{type}{name}{result}{resolve}' *-*-*", ""),
-                    (a) -> assertCommand(a, "/set format test '{pre}HI this is enum' enum", ""),
+                    (a) -> assertCommand(a, "/set format test pre '$ '", ""),
+                    (a) -> assertCommand(a, "/set format test post ''", ""),
+                    (a) -> assertCommand(a, "/set format test act 'ADD' added", ""),
+                    (a) -> assertCommand(a, "/set format test act 'MOD' modified", ""),
+                    (a) -> assertCommand(a, "/set format test act 'REP' replaced", ""),
+                    (a) -> assertCommand(a, "/set format test act 'OVR' overwrote", ""),
+                    (a) -> assertCommand(a, "/set format test act 'USE' used", ""),
+                    (a) -> assertCommand(a, "/set format test act 'DRP' dropped", ""),
+                    (a) -> assertCommand(a, "/set format test up 'UP-' update", ""),
+                    (a) -> assertCommand(a, "/set format test action '{up}{act} '", ""),
+                    (a) -> assertCommand(a, "/set format test resolve 'OK' ok", ""),
+                    (a) -> assertCommand(a, "/set format test resolve 'DEF' defined", ""),
+                    (a) -> assertCommand(a, "/set format test resolve 'NODEF' notdefined", ""),
+                    (a) -> assertCommand(a, "/set format test fname ':{name} ' ", ""),
+                    (a) -> assertCommand(a, "/set format test ftype '[{type}]' method,expression", ""),
+                    (a) -> assertCommand(a, "/set format test result '={value} ' expression", ""),
+                    (a) -> assertCommand(a, "/set format test display '{pre}{action}{ftype}{fname}{result}{resolve}'", ""),
+                    (a) -> assertCommand(a, "/set format test display '{pre}HI this is enum' enum", ""),
                     (a) -> assertCommand(a, "/set feedback test", "$ Feedback mode: test"),
                     (a) -> assertCommand(a, "class D {}", "$ ADD :D OK"),
                     (a) -> assertCommand(a, "void m() {}", "$ ADD []:m OK"),
                     (a) -> assertCommand(a, "interface EX extends EEX {}", "$ ADD :EX NODEF"),
                     (a) -> assertCommand(a, "56", "$ ADD [int]:$4 =56 OK"),
-                    (a) -> assertCommand(a, "class D { int hh; }", "$ REP :D OK$ OVERWROTE-UPDATE:D OK"),
+                    (a) -> assertCommand(a, "class D { int hh; }", "$ REP :D OK$ UP-OVR :D OK"),
+                    (a) -> assertCommand(a, "enum E {A,B}", "$ HI this is enum"),
+                    (a) -> assertCommand(a, "int z() { return f(); }", "$ ADD []:z DEF"),
+                    (a) -> assertCommand(a, "z()", "$ UP-USE []:z DEF"),
+                    (a) -> assertCommand(a, "/drop z", "$ DRP []:z OK"),
                     (a) -> assertCommandOutputStartsWith(a, "/set feedback normal", "|  Feedback mode: normal")
             );
         } finally {
@@ -72,7 +80,82 @@
         }
     }
 
-    public void testNewModeQuiet() {
+    public void testSetFormatSelector() {
+        List<ReplTest> tests = new ArrayList<>();
+        tests.add((a) -> assertCommandOutputStartsWith(a, "/set newmode ate quiet",
+                            "|  Created new feedback mode: ate"));
+        tests.add((a) -> assertCommand(a, "/set feedback ate", ""));
+        StringBuilder sb = new StringBuilder();
+        class KindList {
+            final String[] values;
+            final int matchIndex;
+            int current;
+            boolean match;
+            KindList(String[] values, int matchIndex) {
+                this.values = values;
+                this.matchIndex = matchIndex;
+                this.current = 1 << values.length;
+            }
+            boolean next() {
+                if (current <= 0) {
+                    return false;
+                }
+                --current;
+                return true;
+            }
+            boolean append(boolean ahead) {
+                boolean any = false;
+                match = false;
+                for (int i = values.length - 1; i >= 0 ; --i) {
+                    if ((current & (1 << i)) != 0) {
+                        match |= i == matchIndex;
+                        if (any) {
+                            sb.append(",");
+                        } else {
+                            if (ahead) {
+                                sb.append("-");
+                            }
+                        }
+                        sb.append(values[i]);
+                        any = true;
+                    }
+                }
+                match |= !any;
+                return ahead || any;
+            }
+        }
+        KindList klcase = new KindList(new String[] {"class", "method", "expression", "vardecl"}, 2);
+        while (klcase.next()) {
+            KindList klact  = new KindList(new String[] {"added", "modified", "replaced"}, 0);
+            while (klact.next()) {
+                KindList klwhen = new KindList(new String[] {"update", "primary"}, 1);
+                while (klwhen.next()) {
+                    sb.setLength(0);
+                    klwhen.append(
+                        klact.append(
+                            klcase.append(false)));
+                    boolean match = klcase.match && klact.match && klwhen.match;
+                    String select = sb.toString();
+                    String yes = "+++" + select + "+++";
+                    String no  = "---" + select + "---";
+                    String expect = match? yes : no;
+                    tests.add((a) -> assertCommand(a, "/set format ate display '" + no  + "'", ""));
+                    tests.add((a) -> assertCommand(a, "/set format ate display '" + yes + "' " + select, ""));
+                    tests.add((a) -> assertCommand(a, "\"" + select + "\"", expect));
+                }
+            }
+        }
+        tests.add((a) -> assertCommandOutputStartsWith(a, "/set feedback normal", "|  Feedback mode: normal"));
+
+        try {
+            test(tests.toArray(new ReplTest[tests.size()]));
+        } finally {
+            assertCommandCheckOutput(false, "/set feedback normal", s -> {
+            });
+        }
+    }
+
+    public void testSetNewModeQuiet() {
         try {
             test(
                     (a) -> assertCommandOutputStartsWith(a, "/set newmode nmq quiet normal", "|  Created new feedback mode: nmq"),
@@ -82,7 +165,8 @@
                     (a) -> assertCommand(a, "/set newmode nmc command normal", ""),
                     (a) -> assertCommandOutputStartsWith(a, "/set feedback nmc", "|  Feedback mode: nmc"),
                     (a) -> assertCommandOutputStartsWith(a, "/set newmode nm", "|  Created new feedback mode: nm"),
-                    (a) -> assertCommandOutputStartsWith(a, "/set feedback nm", "|  Feedback mode: nm")
+                    (a) -> assertCommandOutputStartsWith(a, "/set feedback nm", "|  Feedback mode: nm"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set feedback normal", "|  Feedback mode: normal")
             );
         } finally {
             assertCommandCheckOutput(false, "/set feedback normal", s -> {
@@ -93,38 +177,75 @@
     public void testSetError() {
         try {
             test(
-                    (a) -> assertCommandOutputStartsWith(a, "/set newmode te command normal", "|  Created new feedback mode: te"),
-                    (a) -> assertCommand(a, "/set field te errorpre 'ERROR: '", ""),
-                    (a) -> assertCommandOutputStartsWith(a, "/set feedback te", ""),
-                    (a) -> assertCommandCheckOutput(a, "/set ", assertStartsWith("ERROR: The /set command requires arguments")),
-                    (a) -> assertCommandCheckOutput(a, "/set xyz", assertStartsWith("ERROR: Not a valid argument to /set")),
-                    (a) -> assertCommandCheckOutput(a, "/set f", assertStartsWith("ERROR: Ambiguous argument to /set")),
-                    (a) -> assertCommandCheckOutput(a, "/set feedback", assertStartsWith("ERROR: Expected a feedback mode")),
-                    (a) -> assertCommandCheckOutput(a, "/set feedback xyz", assertStartsWith("ERROR: Does not match any current feedback mode")),
-                    (a) -> assertCommandCheckOutput(a, "/set format", assertStartsWith("ERROR: Expected a feedback mode")),
-                    (a) -> assertCommandCheckOutput(a, "/set format xyz", assertStartsWith("ERROR: Does not match any current feedback mode")),
-                    (a) -> assertCommandCheckOutput(a, "/set format te", assertStartsWith("ERROR: Expected format missing")),
-                    (a) -> assertCommandCheckOutput(a, "/set format te aaa", assertStartsWith("ERROR: Format 'aaa' must be quoted")),
-                    (a) -> assertCommandCheckOutput(a, "/set format te 'aaa'", assertStartsWith("ERROR: At least one selector required")),
-                    (a) -> assertCommandCheckOutput(a, "/set format te 'aaa' frog", assertStartsWith("ERROR: Not a valid case")),
-                    (a) -> assertCommandCheckOutput(a, "/set format te 'aaa' import-frog", assertStartsWith("ERROR: Not a valid action")),
-                    (a) -> assertCommandCheckOutput(a, "/set newmode", assertStartsWith("ERROR: Expected new feedback mode")),
-                    (a) -> assertCommandCheckOutput(a, "/set newmode te", assertStartsWith("ERROR: Expected a new feedback mode name")),
-                    (a) -> assertCommandCheckOutput(a, "/set newmode x xyz", assertStartsWith("ERROR: Specify either 'command' or 'quiet'")),
-                    (a) -> assertCommandCheckOutput(a, "/set newmode x quiet y", assertStartsWith("ERROR: Does not match any current feedback mode")),
-                    (a) -> assertCommandCheckOutput(a, "/set prompt", assertStartsWith("ERROR: Expected a feedback mode")),
-                    (a) -> assertCommandCheckOutput(a, "/set prompt te", assertStartsWith("ERROR: Expected format missing")),
-                    (a) -> assertCommandCheckOutput(a, "/set prompt te aaa xyz", assertStartsWith("ERROR: Format 'aaa' must be quoted")),
-                    (a) -> assertCommandCheckOutput(a, "/set prompt te 'aaa' xyz", assertStartsWith("ERROR: Format 'xyz' must be quoted")),
-                    (a) -> assertCommandCheckOutput(a, "/set prompt", assertStartsWith("ERROR: Expected a feedback mode")),
-                    (a) -> assertCommandCheckOutput(a, "/set prompt te", assertStartsWith("ERROR: Expected format missing")),
-                    (a) -> assertCommandCheckOutput(a, "/set prompt te aaa", assertStartsWith("ERROR: Format 'aaa' must be quoted")),
-                    (a) -> assertCommandCheckOutput(a, "/set prompt te 'aaa'", assertStartsWith("ERROR: Expected format missing")),
-                    (a) -> assertCommandCheckOutput(a, "/set field", assertStartsWith("ERROR: Expected a feedback mode")),
-                    (a) -> assertCommandCheckOutput(a, "/set field xyz", assertStartsWith("ERROR: Does not match any current feedback mode: xyz")),
-                    (a) -> assertCommandCheckOutput(a, "/set field te xyz", assertStartsWith("ERROR: Not a valid field: xyz, must be one of: when")),
-                    (a) -> assertCommandCheckOutput(a, "/set field te action", assertStartsWith("ERROR: Expected format missing")),
-                    (a) -> assertCommandCheckOutput(a, "/set field te action 'act'", assertStartsWith("ERROR: At least one selector required"))
+                    (a) -> assertCommandOutputStartsWith(a, "/set newmode tee command foo",
+                            "|  Does not match any current feedback mode: foo"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set newmode tee flurb",
+                            "|  Specify either 'command' or 'quiet'"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set newmode te2",
+                            "|  Created new feedback mode: te2"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set newmode te2 command",
+                            "|  Expected a new feedback mode name. te2 is a known feedback mode"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set newmode te command normal",
+                            "|  Created new feedback mode: te"),
+                    (a) -> assertCommand(a, "/set format te errorpre 'ERROR: '", ""),
+                    (a) -> assertCommandOutputStartsWith(a, "/set feedback te",
+                            ""),
+                    (a) -> assertCommandOutputStartsWith(a, "/set ",
+                            "ERROR: The /set command requires arguments"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set xyz",
+                            "ERROR: Not a valid argument to /set"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set f",
+                            "ERROR: Ambiguous argument to /set"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set feedback",
+                            "ERROR: Expected a feedback mode"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set feedback xyz",
+                            "ERROR: Does not match any current feedback mode"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set format",
+                            "ERROR: Expected a feedback mode"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set format xyz",
+                            "ERROR: Does not match any current feedback mode"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set format t",
+                            "ERROR: Matches more then one current feedback mode: t"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set format te",
+                            "ERROR: Expected field name missing"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set format te fld",
+                            "ERROR: Expected format missing"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set format te fld aaa",
+                            "ERROR: Format 'aaa' must be quoted"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set format te fld 'aaa' frog",
+                            "ERROR: Not a valid selector"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set format te fld 'aaa' import-frog",
+                            "ERROR: Not a valid selector"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set format te fld 'aaa' import-import",
+                            "ERROR: Selector kind in multiple sections of"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set format te fld 'aaa' import,added",
+                            "ERROR: Different selector kinds in same sections of"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set newmode",
+                            "ERROR: Expected new feedback mode"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set newmode te",
+                            "ERROR: Expected a new feedback mode name"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set newmode x xyz",
+                            "ERROR: Specify either 'command' or 'quiet'"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set newmode x quiet y",
+                            "ERROR: Does not match any current feedback mode"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set prompt",
+                            "ERROR: Expected a feedback mode"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set prompt te",
+                            "ERROR: Expected format missing"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set prompt te aaa xyz",
+                            "ERROR: Format 'aaa' must be quoted"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set prompt te 'aaa' xyz",
+                            "ERROR: Format 'xyz' must be quoted"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set prompt",
+                            "ERROR: Expected a feedback mode"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set prompt te",
+                            "ERROR: Expected format missing"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set prompt te aaa",
+                            "ERROR: Format 'aaa' must be quoted"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set prompt te 'aaa'",
+                            "ERROR: Expected format missing"),
+                    (a) -> assertCommandOutputStartsWith(a, "/set feedback normal",
+                            "|  Feedback mode: normal")
             );
         } finally {
             assertCommandCheckOutput(false, "/set feedback normal", s -> {
@@ -136,7 +257,7 @@
         try {
             test(
                     (a) -> assertCommandOutputContains(a, "/help /set", "command to launch"),
-                    (a) -> assertCommandOutputContains(a, "/help /set format", "vardecl"),
+                    (a) -> assertCommandOutputContains(a, "/help /set format", "display"),
                     (a) -> assertCommandOutputContains(a, "/hel /se for", "vardecl"),
                     (a) -> assertCommandOutputContains(a, "/help /set editor", "temporary file")
             );
@@ -150,7 +271,7 @@
         try {
             test(
                     (a) -> assertCommandOutputStartsWith(a, "/set newmode te command normal", "|  Created new feedback mode: te"),
-                    (a) -> assertCommand(a, "/set field te errorpre 'ERROR: '", ""),
+                    (a) -> assertCommand(a, "/set format te errorpre 'ERROR: '", ""),
                     (a) -> assertCommandOutputStartsWith(a, "/set feedback te", "|  Feedback mode: te"),
                     (a) -> assertCommandOutputContains(a, "/help /set xyz", "ERROR: Not a valid argument to /set: xyz"),
                     (a) -> assertCommandOutputContains(a, "/help /set f", "ERROR: Ambiguous argument to /set: f")
--- a/langtools/test/jdk/jshell/ToolReloadTest.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/jdk/jshell/ToolReloadTest.java	Wed Jul 05 21:30:21 2017 +0200
@@ -92,11 +92,11 @@
     public void testReloadDrop() {
         test(false, new String[]{"-nostartup"},
                 a -> assertVariable(a, "int", "a"),
-                a -> dropVariable(a, "/dr 1", "int a = 0"),
+                a -> dropVariable(a, "/dr 1", "int a = 0", "|  Dropped variable a\n"),
                 a -> assertMethod(a, "int b() { return 0; }", "()I", "b"),
-                a -> dropMethod(a, "/drop b", "b ()I"),
+                a -> dropMethod(a, "/drop b", "b ()I", "|  Dropped method b()\n"),
                 a -> assertClass(a, "class A {}", "class", "A"),
-                a -> dropClass(a, "/dr A", "class A"),
+                a -> dropClass(a, "/dr A", "class A", "|  Dropped class A\n"),
                 a -> assertCommand(a, "/reload",
                         "|  Restarting and restoring state.\n" +
                         "-: int a;\n" +
@@ -115,11 +115,11 @@
     public void testReloadQuiet() {
         test(false, new String[]{"-nostartup"},
                 a -> assertVariable(a, "int", "a"),
-                a -> dropVariable(a, "/dr 1", "int a = 0"),
+                a -> dropVariable(a, "/dr 1", "int a = 0", "|  Dropped variable a\n"),
                 a -> assertMethod(a, "int b() { return 0; }", "()I", "b"),
-                a -> dropMethod(a, "/drop b", "b ()I"),
+                a -> dropMethod(a, "/drop b", "b ()I", "|  Dropped method b()\n"),
                 a -> assertClass(a, "class A {}", "class", "A"),
-                a -> dropClass(a, "/dr A", "class A"),
+                a -> dropClass(a, "/dr A", "class A", "|  Dropped class A\n"),
                 a -> assertCommand(a, "/reload quiet",
                         "|  Restarting and restoring state.\n"),
                 a -> assertCommandCheckOutput(a, "/vars", assertVariables()),
--- a/langtools/test/tools/javac/completionDeps/DepsAndAnno.java	Wed Jul 05 21:30:09 2017 +0200
+++ b/langtools/test/tools/javac/completionDeps/DepsAndAnno.java	Wed Jul 05 21:30:21 2017 +0200
@@ -26,6 +26,10 @@
  * @bug 8078600
  * @summary Make sure -XDcompletionDeps does not cause an infinite loop.
  * @library /tools/lib
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.file
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.jdeps/com.sun.tools.javap
  * @build ToolBox
  * @run main/othervm/timeout=10 DepsAndAnno
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/CantAssignToThis.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.cant.assign.val.to.this
+
+class CantAssignToThis {
+    void m() {
+        this = null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/8152411/T8152411.java	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,18 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8152411
+ * @summary Regression: nested unchecked call does not trigger erasure of return type
+ *
+ * @compile/fail/ref=T8152411.out -XDrawDiagnostics T8152411.java
+ */
+import java.util.List;
+
+class T8152411 {
+        <A2 extends A, A> A m(List<? super A2> a2) { return null; }
+        <B> B g(B b) { return null; }
+
+        void test() {
+                List<Integer> I = null;
+                String s = g(m(I));
+        }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/8152411/T8152411.out	Wed Jul 05 21:30:21 2017 +0200
@@ -0,0 +1,2 @@
+T8152411.java:16:29: compiler.err.prob.found.req: (compiler.misc.incompatible.upper.bounds: A2, java.lang.String,B,java.lang.Object,java.lang.Integer,A)
+1 error