Merge
diff --git a/langtools/.hgtags b/langtools/.hgtags
index 444dcaa..2fe3fda 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -404,3 +404,4 @@
 39449d2a6398fee779630f041c55c0466f5fd2c0 jdk-9+159
 0f4fef68d2d84ad78b3aaf6eab2c07873aedf971 jdk-9+160
 2340259b31554a3761e9909953c8ab8ef124ac07 jdk-9+161
+440c45c2e8cee78f6883fa6f2505a781505f323c jdk-9+162
diff --git a/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java b/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java
index 7f22059..4924353 100644
--- a/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java
+++ b/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java
@@ -263,6 +263,7 @@
                 project.addBuildListener(this);
             }
         }
+        logger.setMessageOutputLevel(3);
         tasks.push(Task.ROOT);
     }
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
index 8c0539b..9cf7eae 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -362,14 +362,9 @@
 
             TreeMapper treeMapper = new TreeMapper(context);
             //TODO: to further refine the analysis, try all rewriting combinations
-            LocalCacheContext localCacheContext = argumentAttr.withLocalCacheContext();
-            try {
-                deferredAttr.attribSpeculative(fakeBlock, env, attr.statInfo, treeMapper,
-                        t -> new AnalyzeDeferredDiagHandler(context));
-            } finally {
-                localCacheContext.leave();
-            }
-
+            deferredAttr.attribSpeculative(fakeBlock, env, attr.statInfo, treeMapper,
+                    t -> new AnalyzeDeferredDiagHandler(context),
+                    argumentAttr.withLocalCacheContext());
             context.treeMap.entrySet().forEach(e -> {
                 context.treesToAnalyzer.get(e.getKey())
                         .process(e.getKey(), e.getValue(), context.errors.nonEmpty());
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java
index 7030511..d99bc73 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -260,8 +260,10 @@
     public void visitReference(JCMemberReference tree) {
         //perform arity-based check
         Env<AttrContext> localEnv = env.dup(tree);
-        JCExpression exprTree = (JCExpression)deferredAttr.attribSpeculative(tree.getQualifierExpression(), localEnv,
-                attr.memberReferenceQualifierResult(tree));
+        JCExpression exprTree;
+        exprTree = (JCExpression)deferredAttr.attribSpeculative(tree.getQualifierExpression(), localEnv,
+                attr.memberReferenceQualifierResult(tree),
+                withLocalCacheContext());
         JCMemberReference mref2 = new TreeCopier<Void>(attr.make).copy(tree);
         mref2.expr = exprTree;
         Symbol lhsSym = TreeInfo.symbol(exprTree);
@@ -277,9 +279,9 @@
                 (res.flags() & Flags.VARARGS) != 0 ||
                 (TreeInfo.isStaticSelector(exprTree, tree.name.table.names) &&
                 exprTree.type.isRaw() && !exprTree.type.hasTag(ARRAY))) {
-            tree.overloadKind = JCMemberReference.OverloadKind.OVERLOADED;
+            tree.setOverloadKind(JCMemberReference.OverloadKind.OVERLOADED);
         } else {
-            tree.overloadKind = JCMemberReference.OverloadKind.UNOVERLOADED;
+            tree.setOverloadKind(JCMemberReference.OverloadKind.UNOVERLOADED);
         }
         //return a plain old deferred type for this
         setResult(tree, deferredAttr.new DeferredType(tree, env));
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
index 77e54db..4f47a58 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -448,13 +448,21 @@
 
         NORMAL,
 
-        NO_TREE_UPDATE {     // Mode signalling 'fake check' - skip tree update
+        /**
+         * Mode signalling 'fake check' - skip tree update. A side-effect of this mode is
+         * that the captured var cache in {@code InferenceContext} will be used in read-only
+         * mode when performing inference checks.
+         */
+        NO_TREE_UPDATE {
             @Override
             public boolean updateTreeType() {
                 return false;
             }
         },
-        NO_INFERENCE_HOOK { // Mode signalling that caller will manage free types in tree decorations.
+        /**
+         * Mode signalling that caller will manage free types in tree decorations.
+         */
+        NO_INFERENCE_HOOK {
             @Override
             public boolean installPostInferenceHook() {
                 return false;
@@ -1517,7 +1525,9 @@
                             isBooleanOrNumeric(env, condTree.falsepart);
                 case APPLY:
                     JCMethodInvocation speculativeMethodTree =
-                            (JCMethodInvocation)deferredAttr.attribSpeculative(tree, env, unknownExprInfo);
+                            (JCMethodInvocation)deferredAttr.attribSpeculative(
+                                    tree, env, unknownExprInfo,
+                                    argumentAttr.withLocalCacheContext());
                     Symbol msym = TreeInfo.symbol(speculativeMethodTree.meth);
                     Type receiverType = speculativeMethodTree.meth.hasTag(IDENT) ?
                             env.enclClass.type :
@@ -1528,10 +1538,13 @@
                     JCExpression className =
                             removeClassParams.translate(((JCNewClass)tree).clazz);
                     JCExpression speculativeNewClassTree =
-                            (JCExpression)deferredAttr.attribSpeculative(className, env, unknownTypeInfo);
+                            (JCExpression)deferredAttr.attribSpeculative(
+                                    className, env, unknownTypeInfo,
+                                    argumentAttr.withLocalCacheContext());
                     return primitiveOrBoxed(speculativeNewClassTree.type);
                 default:
-                    Type speculativeType = deferredAttr.attribSpeculative(tree, env, unknownExprInfo).type;
+                    Type speculativeType = deferredAttr.attribSpeculative(tree, env, unknownExprInfo,
+                            argumentAttr.withLocalCacheContext()).type;
                     return primitiveOrBoxed(speculativeType);
             }
         }
@@ -3769,7 +3782,7 @@
                 break;
             case MTH: {
                 owntype = checkMethod(site, sym,
-                        new ResultInfo(resultInfo.pkind, resultInfo.pt.getReturnType(), resultInfo.checkContext),
+                        new ResultInfo(resultInfo.pkind, resultInfo.pt.getReturnType(), resultInfo.checkContext, resultInfo.checkMode),
                         env, TreeInfo.args(env.tree), resultInfo.pt.getParameterTypes(),
                         resultInfo.pt.getTypeArguments());
                 break;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
index 09b0380..0c726d8 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, 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
@@ -56,6 +56,9 @@
 import java.util.WeakHashMap;
 import java.util.function.Function;
 
+import com.sun.source.tree.MemberReferenceTree;
+import com.sun.tools.javac.tree.JCTree.JCMemberReference.OverloadKind;
+
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
@@ -148,6 +151,27 @@
                         return super.visitNewClass(node, p);
                     }
                 }
+
+                @Override @DefinedBy(Api.COMPILER_TREE)
+                public JCTree visitMemberReference(MemberReferenceTree node, Void p) {
+                    JCMemberReference t = (JCMemberReference) node;
+                    JCExpression expr = copy(t.expr, p);
+                    List<JCExpression> typeargs = copy(t.typeargs, p);
+                    /** once the value for overloadKind is determined for a copy, it can be safely forwarded to
+                     *  the copied tree, we want to profit from that
+                     */
+                    JCMemberReference result = new JCMemberReference(t.mode, t.name, expr, typeargs) {
+                        @Override
+                        public void setOverloadKind(OverloadKind overloadKind) {
+                            super.setOverloadKind(overloadKind);
+                            if (t.getOverloadKind() == null) {
+                                t.setOverloadKind(overloadKind);
+                            }
+                        }
+                    };
+                    result.pos = t.pos;
+                    return result;
+                }
             };
         deferredCopier = new TypeMapping<Void> () {
                 @Override
@@ -446,11 +470,17 @@
      */
     JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) {
         return attribSpeculative(tree, env, resultInfo, treeCopier,
-                (newTree)->new DeferredAttrDiagHandler(log, newTree));
+                (newTree)->new DeferredAttrDiagHandler(log, newTree), null);
+    }
+
+    JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo, LocalCacheContext localCache) {
+        return attribSpeculative(tree, env, resultInfo, treeCopier,
+                (newTree)->new DeferredAttrDiagHandler(log, newTree), localCache);
     }
 
     <Z> JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo, TreeCopier<Z> deferredCopier,
-                                 Function<JCTree, DeferredDiagnosticHandler> diagHandlerCreator) {
+                                 Function<JCTree, DeferredDiagnosticHandler> diagHandlerCreator,
+                                 LocalCacheContext localCache) {
         final JCTree newTree = deferredCopier.copy(tree);
         Env<AttrContext> speculativeEnv = env.dup(newTree, env.info.dup(env.info.scope.dupUnshared(env.info.scope.owner)));
         speculativeEnv.info.isSpeculative = true;
@@ -461,6 +491,9 @@
         } finally {
             new UnenterScanner(env.toplevel.modle).scan(newTree);
             log.popDiagnosticHandler(deferredDiagnosticHandler);
+            if (localCache != null) {
+                localCache.leave();
+            }
         }
     }
     //where
@@ -847,6 +880,7 @@
 
             @Override
             public void visitReference(JCMemberReference tree) {
+                Assert.checkNonNull(tree.getOverloadKind());
                 Check.CheckContext checkContext = resultInfo.checkContext;
                 Type pt = resultInfo.pt;
                 if (!inferenceContext.inferencevars.contains(pt)) {
@@ -856,8 +890,9 @@
                         checkContext.report(null, ex.getDiagnostic());
                     }
                     Env<AttrContext> localEnv = env.dup(tree);
-                    JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
-                            attr.memberReferenceQualifierResult(tree));
+                    JCExpression exprTree;
+                    exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
+                            attr.memberReferenceQualifierResult(tree), argumentAttr.withLocalCacheContext());
                     ListBuffer<Type> argtypes = new ListBuffer<>();
                     for (Type t : types.findDescriptorType(pt).getParameterTypes()) {
                         argtypes.append(Type.noType);
@@ -1125,7 +1160,7 @@
             Type descType = types.findDescriptorType(pt);
             List<Type> freeArgVars = inferenceContext.freeVarsIn(descType.getParameterTypes());
             if (freeArgVars.nonEmpty() &&
-                    tree.overloadKind == JCMemberReference.OverloadKind.OVERLOADED) {
+                    tree.getOverloadKind() == JCMemberReference.OverloadKind.OVERLOADED) {
                 stuckVars.addAll(freeArgVars);
                 depVars.addAll(inferenceContext.freeVarsIn(descType.getReturnType()));
             }
@@ -1190,7 +1225,7 @@
         @Override
         public void visitReference(JCMemberReference tree) {
             super.visitReference(tree);
-            if (tree.overloadKind == JCMemberReference.OverloadKind.OVERLOADED) {
+            if (tree.getOverloadKind() == JCMemberReference.OverloadKind.OVERLOADED) {
                 stuck = true;
             }
         }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
index 9dcd4cd..e369c04 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
@@ -27,6 +27,7 @@
 
 import com.sun.tools.javac.code.Type.UndetVar.UndetVarListener;
 import com.sun.tools.javac.code.Types.TypeMapping;
+import com.sun.tools.javac.comp.Attr.CheckMode;
 import com.sun.tools.javac.tree.JCTree;
 import com.sun.tools.javac.tree.JCTree.JCTypeCast;
 import com.sun.tools.javac.tree.TreeInfo;
@@ -419,7 +420,7 @@
             }
         } else if (rsInfoInfContext.free(resultInfo.pt)) {
             //propagation - cache captured vars
-            qtype = inferenceContext.asUndetVar(rsInfoInfContext.cachedCapture(tree, from, false));
+            qtype = inferenceContext.asUndetVar(rsInfoInfContext.cachedCapture(tree, from, !resultInfo.checkMode.updateTreeType()));
         }
         Assert.check(allowGraphInference || !rsInfoInfContext.free(to),
                 "legacy inference engine cannot handle constraints on both sides of a subtyping assertion");
@@ -509,7 +510,7 @@
         inferenceContext.solve(List.of(from.qtype), new Warner());
         inferenceContext.notifyChange();
         Type capturedType = resultInfo.checkContext.inferenceContext()
-                .cachedCapture(tree, from.getInst(), false);
+                .cachedCapture(tree, from.getInst(), !resultInfo.checkMode.updateTreeType());
         if (types.isConvertible(capturedType,
                 resultInfo.checkContext.inferenceContext().asUndetVar(to))) {
             //effectively skip additional return-type constraint generation (compatibility)
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java
index 3cccddc..054a5b6 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, 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
@@ -2133,7 +2133,7 @@
         public Type varargsElement;
         public PolyKind refPolyKind;
         public boolean ownerAccessible;
-        public OverloadKind overloadKind;
+        private OverloadKind overloadKind;
         public Type referentType;
 
         public enum OverloadKind {
@@ -2174,7 +2174,7 @@
             }
         }
 
-        protected JCMemberReference(ReferenceMode mode, Name name, JCExpression expr, List<JCExpression> typeargs) {
+        public JCMemberReference(ReferenceMode mode, Name name, JCExpression expr, List<JCExpression> typeargs) {
             this.mode = mode;
             this.name = name;
             this.expr = expr;
@@ -2205,6 +2205,20 @@
         public boolean hasKind(ReferenceKind kind) {
             return this.kind == kind;
         }
+
+        /**
+         * @return the overloadKind
+         */
+        public OverloadKind getOverloadKind() {
+            return overloadKind;
+        }
+
+        /**
+         * @param overloadKind the overloadKind to set
+         */
+        public void setOverloadKind(OverloadKind overloadKind) {
+            this.overloadKind = overloadKind;
+        }
     }
 
     /**
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Taglet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Taglet.java
index 24ea5ae..9e806cc 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Taglet.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Taglet.java
@@ -28,6 +28,8 @@
 import java.util.List;
 import java.util.Set;
 
+import javax.lang.model.element.Element;
+
 import com.sun.source.doctree.DocTree;
 
 /**
@@ -65,18 +67,34 @@
     String getName();
 
     /**
+     * Initializes this taglet with the given doclet environment and doclet.
+     *
+     * @apiNote
+     * The environment may be used to access utility classes for
+     * {@link javax.lang.model.util.Elements elements} and
+     * {@link javax.lang.model.util.Types types} if needed.
+     *
+     * @implSpec
+     * This implementation does nothing.
+     *
+     * @param env the environment in which the doclet and taglet are running
+     * @param doclet the doclet that instantiated this taglet
+     */
+    default void init(DocletEnvironment env, Doclet doclet) { }
+
+    /**
      * Returns the string representation of a series of instances of
      * this tag to be included in the generated output.
      * If this taglet is for an {@link #isInlineTag inline} tag} it will
      * be called once per instance of the tag, each time with a singleton list.
      * Otherwise, if this tag is a block tag, it will be called once per
-     * comment, with a list of all the instances of the tag in the comment.
-     * @param tags the list of {@code DocTree} containing one or more
-     *  instances of this tag
+     * comment, with a list of all the instances of the tag in a comment.
+     * @param tags the list of instances of this tag
+     * @param element the element to which the enclosing comment belongs
      * @return the string representation of the tags to be included in
      *  the generated output
      */
-    String toString(List<? extends DocTree> tags);
+    String toString(List<? extends DocTree> tags, Element element);
 
     /**
      * The kind of location in which a tag may be used.
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java
index 9543b1a..b26e473 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, 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
@@ -240,7 +240,8 @@
      * Constructor. Initializes resource for the
      * {@link com.sun.tools.doclets.internal.toolkit.util.MessageRetriever MessageRetriever}.
      */
-    public ConfigurationImpl() {
+    public ConfigurationImpl(Doclet doclet) {
+        super(doclet);
         resources = new Resources(this,
                 Configuration.sharedResourceBundleName,
                 "jdk.javadoc.internal.doclets.formats.html.resources.standard");
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java
index d8f52ae..b6456d9 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -61,7 +61,7 @@
 public class HtmlDoclet extends AbstractDoclet {
 
     public HtmlDoclet() {
-        configuration = new ConfigurationImpl();
+        configuration = new ConfigurationImpl(this);
     }
 
     @Override // defined by Doclet
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java
index f65440b..a0d4272 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java
@@ -74,6 +74,10 @@
  * @author Jamie Ho
  */
 public abstract class Configuration {
+    /**
+     * The doclet that created this configuration.
+     */
+    public final Doclet doclet;
 
     /**
      * The factory for builders.
@@ -342,8 +346,10 @@
             "jdk.javadoc.internal.doclets.toolkit.resources.doclets";
     /**
      * Constructs the configurations needed by the doclet.
+     * @param doclet the doclet that created this configuration
      */
-    public Configuration() {
+    public Configuration(Doclet doclet) {
+        this.doclet = doclet;
         excludedDocFileDirs = new HashSet<>();
         excludedQualifiers = new HashSet<>();
         setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH);
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java
index 886c31f..61ed432 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,12 @@
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.element.VariableElement;
+import javax.lang.model.type.ArrayType;
+import javax.lang.model.type.DeclaredType;
+import javax.lang.model.type.ExecutableType;
+import javax.lang.model.type.PrimitiveType;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.util.SimpleTypeVisitor9;
 
 import com.sun.source.doctree.DocTree;
 import com.sun.source.doctree.DocTree.Kind;
@@ -440,16 +446,10 @@
 
             if (null != setter) {
                 VariableElement param = setter.getParameters().get(0);
-                String typeName = utils.getTypeName(param.asType(), false);
-                // Removal of type parameters and package information.
-                typeName = typeName.split("<")[0];
-                if (typeName.contains(".")) {
-                    typeName = typeName.substring(typeName.lastIndexOf(".") + 1);
-                }
                 StringBuilder sb = new StringBuilder("#");
                 sb.append(utils.getSimpleName(setter));
                 if (!utils.isTypeVariable(param.asType())) {
-                    sb.append("(").append(typeName).append(")");
+                    sb.append("(").append(utils.getTypeSignature(param.asType(), false, true)).append(")");
                 }
                 blockTags.add(cmtutils.makeSeeTree(sb.toString(), setter));
             }
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java
index f1db1df..ba64475 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, 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 @@
 package jdk.javadoc.internal.doclets.toolkit.taglets;
 
 import java.io.*;
+import java.lang.reflect.InvocationTargetException;
 import java.util.*;
 
 import javax.lang.model.element.Element;
@@ -39,6 +40,8 @@
 import javax.tools.StandardJavaFileManager;
 
 import com.sun.source.doctree.DocTree;
+import jdk.javadoc.doclet.Doclet;
+import jdk.javadoc.doclet.DocletEnvironment;
 import jdk.javadoc.internal.doclets.toolkit.Configuration;
 import jdk.javadoc.internal.doclets.toolkit.Messages;
 import jdk.javadoc.internal.doclets.toolkit.Resources;
@@ -125,6 +128,9 @@
      */
     private List<Taglet> serializedFormTags;
 
+    private final DocletEnvironment docEnv;
+    private final Doclet doclet;
+
     private final Messages messages;
     private final Resources resources;
 
@@ -184,7 +190,7 @@
      * @param showversion true if we want to use @version tags.
      * @param showauthor true if we want to use @author tags.
      * @param javafx indicates whether javafx is active.
-     * @param message the message retriever to print warnings.
+     * @param configuration the configuration for this taglet manager
      */
     public TagletManager(boolean nosince, boolean showversion,
                          boolean showauthor, boolean javafx,
@@ -199,6 +205,8 @@
         this.showversion = showversion;
         this.showauthor = showauthor;
         this.javafx = javafx;
+        this.docEnv = configuration.docEnv;
+        this.doclet = configuration.doclet;
         this.messages = configuration.getMessages();
         this.resources = configuration.getResources();
         initStandardTaglets();
@@ -236,7 +244,7 @@
      */
     public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) {
         try {
-            ClassLoader tagClassLoader = null;
+            ClassLoader tagClassLoader;
             if (!fileManager.hasLocation(TAGLET_PATH)) {
                 List<File> paths = new ArrayList<>();
                 if (tagletPath != null) {
@@ -249,9 +257,11 @@
                 }
             }
             tagClassLoader = fileManager.getClassLoader(TAGLET_PATH);
-            Class<?> customTagClass = tagClassLoader.loadClass(classname);
-            Object instance = customTagClass.getConstructor().newInstance();
-            Taglet newLegacy = new UserTaglet((jdk.javadoc.doclet.Taglet)instance);
+            Class<? extends jdk.javadoc.doclet.Taglet> customTagClass =
+                    tagClassLoader.loadClass(classname).asSubclass(jdk.javadoc.doclet.Taglet.class);
+            jdk.javadoc.doclet.Taglet instance = customTagClass.getConstructor().newInstance();
+            instance.init(docEnv, doclet);
+            Taglet newLegacy = new UserTaglet(instance);
             String tname = newLegacy.getName();
             Taglet t = customTags.get(tname);
             if (t != null) {
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/UserTaglet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/UserTaglet.java
index 11bd82f..cb6ebb6 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/UserTaglet.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/UserTaglet.java
@@ -132,7 +132,7 @@
      */
     public Content getTagletOutput(Element element, DocTree tag, TagletWriter writer){
         Content output = writer.getOutputInstance();
-        output.addContent(new RawHtml(userTaglet.toString(Collections.singletonList(tag))));
+        output.addContent(new RawHtml(userTaglet.toString(Collections.singletonList(tag), element)));
         return output;
     }
 
@@ -144,7 +144,7 @@
         Utils utils = writer.configuration().utils;
         List<? extends DocTree> tags = utils.getBlockTags(holder, getName());
         if (!tags.isEmpty()) {
-            String tagString = userTaglet.toString(tags);
+            String tagString = userTaglet.toString(tags, holder);
             if (tagString != null) {
                 output.addContent(new RawHtml(tagString));
             }
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java
index 8c4eb8a..9143002 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java
@@ -725,7 +725,7 @@
         return result.toString();
     }
 
-    private String getTypeSignature(TypeMirror t, boolean qualifiedName, boolean noTypeParameters) {
+    public String getTypeSignature(TypeMirror t, boolean qualifiedName, boolean noTypeParameters) {
         return new SimpleTypeVisitor9<StringBuilder, Void>() {
             final StringBuilder sb = new StringBuilder();
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java
index 3e106b4..7cf4086 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java
@@ -30,6 +30,7 @@
 import java.util.Collections;
 import java.util.EnumMap;
 import java.util.EnumSet;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
@@ -75,6 +76,7 @@
 
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 
+import static javax.lang.model.util.Elements.Origin.*;
 import static javax.tools.JavaFileObject.Kind.*;
 
 import static jdk.javadoc.internal.tool.Main.Result.*;
@@ -520,15 +522,21 @@
         }
     }
 
-    private void addPackagesFromLocations(Location packageLocn, ModulePackage modpkg) throws ToolException {
-        Iterable<JavaFileObject> list = null;
+    /* Call fm.list and wrap any IOException that occurs in a ToolException */
+    private Iterable<JavaFileObject> fmList(Location location,
+                                            String packagename,
+                                            Set<JavaFileObject.Kind> kinds,
+                                            boolean recurse) throws ToolException {
         try {
-            list = fm.list(packageLocn, modpkg.packageName, sourceKinds, true);
+            return fm.list(location, packagename, kinds, recurse);
         } catch (IOException ioe) {
-            String text = messager.getText("main.file.manager.list", modpkg.packageName);
+            String text = messager.getText("main.file.manager.list", packagename);
             throw new ToolException(SYSERR, text, ioe);
         }
-        for (JavaFileObject fo : list) {
+    }
+
+    private void addPackagesFromLocations(Location packageLocn, ModulePackage modpkg) throws ToolException {
+        for (JavaFileObject fo : fmList(packageLocn, modpkg.packageName, sourceKinds, true)) {
             String binaryName = fm.inferBinaryName(packageLocn, fo);
             String pn = getPackageName(binaryName);
             String simpleName = getSimpleName(binaryName);
@@ -555,25 +563,51 @@
     /**
      * Returns the "requires" modules for the target module.
      * @param mdle the target module element
-     * @param isPublic true gets all the public requires, otherwise
-     *                 gets all the non-public requires
+     * @param onlyTransitive true gets all the requires transitive, otherwise
+     *                 gets all the non-transitive requires
      *
      * @return a set of modules
      */
-    private Set<ModuleElement> getModuleRequires(ModuleElement mdle, boolean isPublic) {
+    private Set<ModuleElement> getModuleRequires(ModuleElement mdle, boolean onlyTransitive) throws ToolException {
         Set<ModuleElement> result = new HashSet<>();
         for (RequiresDirective rd : ElementFilter.requiresIn(mdle.getDirectives())) {
-            if (isPublic && rd.isTransitive()) {
-                result.add(rd.getDependency());
-            }
-            if (!isPublic && !rd.isTransitive()) {
-                result.add(rd.getDependency());
+            ModuleElement dep = rd.getDependency();
+            if (result.contains(dep))
+                continue;
+            if (!isMandated(mdle, rd) && onlyTransitive == rd.isTransitive()) {
+                if (!haveModuleSources(dep)) {
+                    messager.printWarning(dep, "main.module_not_found", dep.getSimpleName());
+                }
+                result.add(dep);
+            } else if (isMandated(mdle, rd) && haveModuleSources(dep)) {
+                result.add(dep);
             }
         }
         return result;
     }
 
-    private void computeSpecifiedModules() {
+    private boolean isMandated(ModuleElement mdle, RequiresDirective rd) {
+        return toolEnv.elements.getOrigin(mdle, rd) == MANDATED;
+    }
+
+    Map<ModuleSymbol, Boolean> haveModuleSourcesCache = new HashMap<>();
+    private boolean haveModuleSources(ModuleElement mdle) throws ToolException {
+        ModuleSymbol msym =  (ModuleSymbol)mdle;
+        if (msym.sourceLocation != null) {
+            return true;
+        }
+        if (msym.patchLocation != null) {
+            Boolean value = haveModuleSourcesCache.get(msym);
+            if (value == null) {
+                value = fmList(msym.patchLocation, "", sourceKinds, true).iterator().hasNext();
+                haveModuleSourcesCache.put(msym, value);
+            }
+            return value;
+        }
+        return false;
+    }
+
+    private void computeSpecifiedModules() throws ToolException {
         if (expandRequires == null) { // no expansion requested
             specifiedModuleElements = Collections.unmodifiableSet(specifiedModuleElements);
             return;
@@ -617,20 +651,14 @@
         ModuleSymbol msym = (ModuleSymbol) mdle;
         List<Location> msymlocs = getModuleLocation(locations, msym.name.toString());
         for (Location msymloc : msymlocs) {
-            try {
-                for (JavaFileObject fo : fm.list(msymloc, "", sourceKinds, true)) {
-                    if (fo.getName().endsWith("module-info.java")) {
-                        continue;
-                    }
-                    String binaryName = fm.inferBinaryName(msymloc, fo);
-                    String pn = getPackageName(binaryName);
-                    PackageSymbol psym = syms.enterPackage(msym, names.fromString(pn));
-                    result.add((PackageElement) psym);
+            for (JavaFileObject fo : fmList(msymloc, "", sourceKinds, true)) {
+                if (fo.getName().endsWith("module-info.java")) {
+                    continue;
                 }
-
-            } catch (IOException ioe) {
-                String text = messager.getText("main.file.manager.list", msymloc.getName());
-                throw new ToolException(SYSERR, text, ioe);
+                String binaryName = fm.inferBinaryName(msymloc, fo);
+                String pn = getPackageName(binaryName);
+                PackageSymbol psym = syms.enterPackage(msym, names.fromString(pn));
+                result.add((PackageElement) psym);
             }
         }
         return result;
@@ -727,10 +755,9 @@
 
         Set<PackageElement> packlist = new LinkedHashSet<>();
         cmdLinePackages.forEach((modpkg) -> {
-            ModuleElement mdle = null;
             PackageElement pkg;
             if (modpkg.hasModule()) {
-                mdle = toolEnv.elements.getModuleElement(modpkg.moduleName);
+                ModuleElement mdle = toolEnv.elements.getModuleElement(modpkg.moduleName);
                 pkg = toolEnv.elements.getPackageElement(mdle, modpkg.packageName);
             } else {
                 pkg = toolEnv.elements.getPackageElement(modpkg.toString());
@@ -821,17 +848,12 @@
         }
         String pname = modpkg.packageName;
         for (Location packageLocn : locs) {
-            try {
-                for (JavaFileObject fo : fm.list(packageLocn, pname, sourceKinds, recurse)) {
-                    String binaryName = fm.inferBinaryName(packageLocn, fo);
-                    String simpleName = getSimpleName(binaryName);
-                    if (isValidClassName(simpleName)) {
-                        lb.append(fo);
-                    }
+            for (JavaFileObject fo : fmList(packageLocn, pname, sourceKinds, recurse)) {
+                String binaryName = fm.inferBinaryName(packageLocn, fo);
+                String simpleName = getSimpleName(binaryName);
+                if (isValidClassName(simpleName)) {
+                    lb.append(fo);
                 }
-            } catch (IOException ioe) {
-                String text = messager.getText("main.file.manager.list", pname);
-                throw new ToolException(SYSERR, text, ioe);
             }
         }
         return lb.toList();
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties
index 6b9f374..12aaed1 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties
@@ -85,10 +85,10 @@
 main.opt.expand.requires.desc=\
     Instructs the tool to expand the set of modules to be\n\
     documented. By default, only the modules given explicitly on\n\
-    the command line will be documented. A value of "transitive" will\n\
-    additionally include all "requires transitive" dependencies of\n\
-    those modules. A value of "all" will include all dependencies\n\
-    of those modules.
+    the command line will be documented. A value of "transitive"\n\
+    will additionally include all "requires transitive"\n\
+    dependencies of those modules. A value of "all" will include\n\
+    all dependencies of those modules.
 
 main.opt.help.desc=\
     Display command line options and exit
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java
index f1e0b60..a093fb7 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java
@@ -618,7 +618,6 @@
         public Void visitModuleTarget(ModuleTarget_attribute attr, ClassOutputStream out) {
             out.writeShort(attr.os_name_index);
             out.writeShort(attr.os_arch_index);
-            out.writeShort(attr.os_version_index);
             return null;
         }
 
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java
index 630eac1..ca317ad 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java
@@ -40,7 +40,6 @@
         super(name_index, length);
         os_name_index = cr.readUnsignedShort();
         os_arch_index = cr.readUnsignedShort();
-        os_version_index = cr.readUnsignedShort();
     }
 
     @Override
@@ -50,5 +49,4 @@
 
     public final int os_name_index;
     public final int os_arch_index;
-    public final int os_version_index;
 }
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
index 00f09d0..c5950a1 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
@@ -680,12 +680,6 @@
             print("// " + getOSArch(attr));
         }
         println();
-        print("os_version: #" + attr.os_version_index);
-        if (attr.os_version_index != 0) {
-            tab();
-            print("// " + getOSVersion(attr));
-        }
-        println();
         indent(-1);
         return null;
     }
@@ -706,14 +700,6 @@
         }
     }
 
-    private String getOSVersion(ModuleTarget_attribute attr) {
-        try {
-            return constant_pool.getUTF8Value(attr.os_version_index);
-        } catch (ConstantPoolException e) {
-            return report(e);
-        }
-    }
-
     @Override
     public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, Void ignore) {
         println("RuntimeVisibleAnnotations:");
diff --git a/langtools/test/ProblemList.txt b/langtools/test/ProblemList.txt
index f5a6f78..6dbdfcd 100644
--- a/langtools/test/ProblemList.txt
+++ b/langtools/test/ProblemList.txt
@@ -54,6 +54,7 @@
 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
 tools/javac/modules/T8159439/NPEForModuleInfoWithNonZeroSuperClassTest.java     8160396    generic-all    current version of jtreg needs a new promotion to include lastes version of ASM
+tools/javac/platform/PlatformProviderTest.java                                  8176801    generic-all    fails due to warnings printed to stderr
 
 ###########################################################################
 #
diff --git a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/Check.java b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/Check.java
index 342ff40..4ec80f9 100644
--- a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/Check.java
+++ b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/Check.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, 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,6 +24,7 @@
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Set;
+import javax.lang.model.element.Element;
 
 import com.sun.source.doctree.DocTree;
 import jdk.javadoc.doclet.Taglet;
@@ -64,10 +65,11 @@
      * representation.
      *
      * @param tags the array of tags representing this custom tag.
+     * @param element the declaration to which the enclosing comment belongs
      * @return null to test if the javadoc throws an exception or not.
      */
     @Override
-    public String toString(List<? extends DocTree> tags) {
+    public String toString(List<? extends DocTree> tags, Element element) {
         return null;
     }
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/ToDoTaglet.java b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/ToDoTaglet.java
index d7a4773..bd77982 100644
--- a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/ToDoTaglet.java
+++ b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/ToDoTaglet.java
@@ -24,8 +24,8 @@
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Map;
-
 import java.util.Set;
+import javax.lang.model.element.Element;
 
 import com.sun.source.doctree.DocTree;
 import com.sun.source.doctree.TextTree;
@@ -87,9 +87,10 @@
      * Given an array of <code>Tag</code>s representing this custom
      * tag, return its string representation.
      * @param tags  the array of <code>DocTree</code>s representing this custom tag.
+     * @param element the declaration to which the enclosing comment belongs
      */
     @Override
-    public String toString(List<? extends DocTree> tags) {
+    public String toString(List<? extends DocTree> tags, Element element) {
         if (tags.isEmpty()) {
             return "";
         }
diff --git a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/UnderlineTaglet.java b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/UnderlineTaglet.java
index d5cc074..6f56ac1 100644
--- a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/UnderlineTaglet.java
+++ b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/UnderlineTaglet.java
@@ -24,6 +24,7 @@
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Set;
+import javax.lang.model.element.Element;
 
 import com.sun.source.doctree.DocTree;
 import jdk.javadoc.doclet.Taglet;
@@ -70,9 +71,10 @@
      * Given the <code>DocTree</code> representation of this custom
      * tag, return its string representation.
      * @param tags the <code>DocTree</code> representation of this custom tag.
+     * @param element the declaration to which the enclosing comment belongs
      */
     @Override
-    public String toString(List<? extends DocTree> tags) {
+    public String toString(List<? extends DocTree> tags, Element element) {
         return "<u>" + ToDoTaglet.getText(tags.get(0)) + "</u>";
     }
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/TestProperty.java b/langtools/test/jdk/javadoc/doclet/testProperty/TestProperty.java
new file mode 100644
index 0000000..69eec3a
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/TestProperty.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2017, 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      8176231
+ * @summary  Test JavaFX property.
+ * @library  ../lib/
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build    JavadocTester TestProperty
+ * @run main TestProperty
+ */
+
+public class TestProperty extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestProperty tester = new TestProperty();
+        tester.runTests();
+    }
+
+    @Test
+    void testArrays() {
+        javadoc("-d", "out",
+                "-javafx",
+                "-sourcepath", testSrc,
+                "pkg");
+        checkExit(Exit.OK);
+
+        checkOutput("pkg/MyClass.html", true,
+                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                + "title=\"class in pkg\">ObjectProperty</a>"
+                + "&lt;<a href=\"../pkg/MyObj.html\" "
+                + "title=\"class in pkg\">MyObj</a>&gt; goodProperty</pre>\n"
+                + "<div class=\"block\">This is an Object property where the "
+                + "Object is a single Object.</div>\n"
+                + "<dl>\n"
+                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+                + "<dd><a href=\"../pkg/MyClass.html#getGood--\"><code>getGood()</code></a>, \n"
+                + "<a href=\"../pkg/MyClass.html#setGood-pkg.MyObj-\">"
+                + "<code>setGood(MyObj)</code></a></dd>\n"
+                + "</dl>",
+
+                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                + "title=\"class in pkg\">ObjectProperty</a>"
+                + "&lt;<a href=\"../pkg/MyObj.html\" "
+                + "title=\"class in pkg\">MyObj</a>[]&gt; badProperty</pre>\n"
+                + "<div class=\"block\">This is an Object property where the "
+                + "Object is an array.</div>\n"
+                + "<dl>\n"
+                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+                + "<dd><a href=\"../pkg/MyClass.html#getBad--\"><code>getBad()</code></a>, \n"
+                + "<a href=\"../pkg/MyClass.html#setBad-pkg.MyObj:A-\">"
+                + "<code>setBad(MyObj[])</code></a></dd>\n"
+                + "</dl>"
+        );
+
+        checkOutput("pkg/MyClassT.html", true,
+                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                + "title=\"class in pkg\">ObjectProperty</a>"
+                + "&lt;java.util.List&lt;<a href=\"../pkg/MyClassT.html\" "
+                + "title=\"type parameter in MyClassT\">T</a>&gt;&gt; "
+                + "listProperty</pre>\n"
+                + "<div class=\"block\">This is an Object property where the "
+                + "Object is a single <code>List&lt;T&gt;</code>.</div>\n"
+                + "<dl>\n"
+                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+                + "<dd><a href=\"../pkg/MyClassT.html#getList--\">"
+                + "<code>getList()</code></a>, \n"
+                + "<a href=\"../pkg/MyClassT.html#setList-java.util.List-\">"
+                + "<code>setList(List)</code></a></dd>\n"
+                + "</dl>"
+        );
+    }
+}
+
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClass.java b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClass.java
new file mode 100644
index 0000000..429977f
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClass.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+/**
+ * Test program for javadoc properties.
+ */
+public class MyClass {
+
+    private SimpleObjectProperty<MyObj> good
+            = new SimpleObjectProperty<MyObj>();
+
+    /**
+     * This is an Object property where the Object is a single Object.
+     *
+     * @return the good
+     */
+    public final ObjectProperty<MyObj> goodProperty() {
+        return good;
+    }
+
+    public final void setGood(MyObj good) {
+    }
+
+    public final MyObj getGood() {
+        return good.get();
+    }
+
+
+    private SimpleObjectProperty<MyObj[]> bad
+            = new SimpleObjectProperty<MyObj[]>();
+
+    /**
+     * This is an Object property where the Object is an array.
+     *
+     * @return the bad
+     */
+    public final ObjectProperty<MyObj[]> badProperty() {
+        return bad;
+    }
+
+    public final void setBad(MyObj[] bad) {
+    }
+
+    public final MyObj[] getBad() {
+        return bad.get();
+    }
+
+}
+
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClassT.java b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClassT.java
new file mode 100644
index 0000000..c428d5b
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClassT.java
@@ -0,0 +1,32 @@
+package pkg;
+
+import java.util.List;
+
+//import javafx.beans.property.*;
+
+/**
+ * Test program for javadoc properties.
+ */
+public class MyClassT<T> {
+
+    private SimpleObjectProperty<List<T>> list
+            = new SimpleObjectProperty<List<T>>();
+
+    /**
+     * This is an Object property where the Object is a single {@code List<T>}.
+     *
+     * @return the list
+     */
+    public final ObjectProperty<List<T>> listProperty() {
+        return list;
+    }
+
+    public final void setList(List<T> list) {
+    }
+
+    public final List<T> getList() {
+        return list.get();
+    }
+
+
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyObj.java b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyObj.java
new file mode 100644
index 0000000..564f4c7
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyObj.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+public class MyObj {
+}
+
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/pkg/ObjectProperty.java b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/ObjectProperty.java
new file mode 100644
index 0000000..eecf8c3
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/ObjectProperty.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+public class ObjectProperty<T> { }
+
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/pkg/SimpleObjectProperty.java b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/SimpleObjectProperty.java
new file mode 100644
index 0000000..3d64a9e
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/SimpleObjectProperty.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+public class SimpleObjectProperty<T> { }
+
diff --git a/langtools/test/jdk/javadoc/doclet/testUserTaglet/InfoTaglet.java b/langtools/test/jdk/javadoc/doclet/testUserTaglet/InfoTaglet.java
new file mode 100644
index 0000000..19d4ee8
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testUserTaglet/InfoTaglet.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
+import javax.lang.model.element.Element;
+
+import jdk.javadoc.doclet.Doclet;
+import jdk.javadoc.doclet.DocletEnvironment;
+import jdk.javadoc.doclet.Taglet;
+import static jdk.javadoc.doclet.Taglet.Location.*;
+
+import com.sun.source.doctree.DocTree;
+
+/**
+ * A taglet to test access to a taglet's context.
+ */
+public class InfoTaglet implements Taglet {
+    private DocletEnvironment env;
+    private Doclet doclet;
+
+    @Override
+    public void init(DocletEnvironment env, Doclet doclet) {
+        this.env = env;
+        this.doclet = doclet;
+    }
+
+    @Override
+    public Set<Location> getAllowedLocations() {
+        return EnumSet.of(TYPE);
+    }
+
+    @Override
+    public boolean isInlineTag() {
+        return false;
+    }
+
+    @Override
+    public String getName() {
+        return "info";
+    }
+
+    @Override
+    public String toString(List<? extends DocTree> tags, Element element) {
+        // The content lines below are primarily to help verify the element
+        // and the values passed to init.
+        return "<dt>"
+                +"<span class=\"simpleTagLabel\">Info:</span>\n"
+                + "</dt>"
+                + "<dd>"
+                + "<ul>\n"
+                + "<li>Element: " + element.getKind() + " " + element.getSimpleName() + "\n"
+                + "<li>Element supertypes: " +
+                        env.getTypeUtils().directSupertypes(element.asType()) + "\n"
+                + "<li>Doclet: " + doclet.getClass() + "\n"
+                + "</ul>\n"
+                + "</dd>";
+    }
+}
+
diff --git a/langtools/test/jdk/javadoc/doclet/testUserTaglet/TestUserTaglet.java b/langtools/test/jdk/javadoc/doclet/testUserTaglet/TestUserTaglet.java
new file mode 100644
index 0000000..4451d5c
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testUserTaglet/TestUserTaglet.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017, 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      8176836
+ * @summary  Provide Taglet with context
+ * @library  ../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build    JavadocTester InfoTaglet
+ * @run main TestUserTaglet
+ */
+
+public class TestUserTaglet extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestUserTaglet tester = new TestUserTaglet();
+        tester.runTests();
+    }
+
+    @Test
+    void test() {
+        javadoc("-d", "out",
+                "-sourcepath", testSrc,
+                "-tagletpath", System.getProperty("test.class.path"),
+                "-taglet", "InfoTaglet",
+                "pkg");
+        checkExit(Exit.OK);
+
+        // The following checks verify that information was successfully
+        // derived from the context information available to the taglet.
+        checkOutput("pkg/C.html", true,
+            "<li>Element: CLASS C",
+            "<li>Element supertypes: [java.lang.Object]",
+            "<li>Doclet: class jdk.javadoc.internal.doclets.formats.html.HtmlDoclet"
+        );
+    }
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testUserTaglet/pkg/C.java b/langtools/test/jdk/javadoc/doclet/testUserTaglet/pkg/C.java
new file mode 100644
index 0000000..ea52594
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testUserTaglet/pkg/C.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+/** @info */
+public class C { }
+
diff --git a/langtools/test/jdk/javadoc/tool/EnsureNewOldDoclet.java b/langtools/test/jdk/javadoc/tool/EnsureNewOldDoclet.java
index 8942866..1dfc19f 100644
--- a/langtools/test/jdk/javadoc/tool/EnsureNewOldDoclet.java
+++ b/langtools/test/jdk/javadoc/tool/EnsureNewOldDoclet.java
@@ -40,6 +40,7 @@
 import java.util.Set;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
+import javax.lang.model.element.Element;
 
 import com.sun.javadoc.Tag;
 import com.sun.source.doctree.DocTree;
@@ -186,7 +187,7 @@
                 "-tagletpath",
                 testClasses,
                 testSrc.toString());
-        Task.Result tr = task.run(Task.Expect.FAIL, 1);
+        Task.Result tr = task.run(Task.Expect.FAIL, 1).writeAll();
         //Task.Result tr = task.run();
         List<String> out = tr.getOutputLines(Task.OutputKind.STDOUT);
         List<String> err = tr.getOutputLines(Task.OutputKind.STDERR);
@@ -358,7 +359,7 @@
         }
 
         @Override
-        public String toString(List<? extends DocTree> tags) {
+        public String toString(List<? extends DocTree> tags, Element element) {
             return tags.toString();
         }
 
diff --git a/langtools/test/jdk/javadoc/tool/api/basic/taglets/UnderlineTaglet.java b/langtools/test/jdk/javadoc/tool/api/basic/taglets/UnderlineTaglet.java
index 278e7b1..0cac9a3 100644
--- a/langtools/test/jdk/javadoc/tool/api/basic/taglets/UnderlineTaglet.java
+++ b/langtools/test/jdk/javadoc/tool/api/basic/taglets/UnderlineTaglet.java
@@ -1,44 +1,30 @@
 /*
  * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
+ * 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.
  *
- * -Redistributions of source code must retain the above copyright
- *  notice, this list of conditions and the following disclaimer.
+ * 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).
  *
- * -Redistribution in binary form must reproduce the above copyright
- *  notice, this list of conditions and the following disclaimer in
- *  the documentation and/or other materials provided with the
- *  distribution.
+ * 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.
  *
- * Neither the name of Oracle nor the names of
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any
- * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
- * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
- * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
- * DAMAGES OR LIABILITIES  SUFFERED BY LICENSEE AS A RESULT OF OR
- * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR
- * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE
- * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,
- * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
- * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF
- * THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that Software is not designed, licensed or
- * intended for use in the design, construction, operation or
- * maintenance of any nuclear facility.
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
  */
 
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Set;
+import javax.lang.model.element.Element;
 
 import com.sun.source.doctree.DocTree;
 import com.sun.source.doctree.TextTree;
@@ -88,8 +74,9 @@
      * Given the <code>DocTree</code> representation of this custom
      * tag, return its string representation.
      * @param tags the list of trees representing of this custom tag.
+     * @param element the declaration to which the enclosing comment belongs
      */
-    public String toString(List<? extends DocTree> tags) {
+    public String toString(List<? extends DocTree> tags, Element element) {
         return "<u>" + getText(tags.get(0)) + "</u>";
     }
 
diff --git a/langtools/test/jdk/javadoc/tool/modules/MissingSourceModules.java b/langtools/test/jdk/javadoc/tool/modules/MissingSourceModules.java
new file mode 100644
index 0000000..9da055a
--- /dev/null
+++ b/langtools/test/jdk/javadoc/tool/modules/MissingSourceModules.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2017, 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 8176481
+ * @summary Tests behavior of the tool, when modules are present as
+ *          binaries.
+ * @modules
+ *      jdk.javadoc/jdk.javadoc.internal.api
+ *      jdk.javadoc/jdk.javadoc.internal.tool
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.main
+ * @library /tools/lib
+ * @build toolbox.ToolBox toolbox.TestRunner
+ * @run main MissingSourceModules
+ */
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import toolbox.*;
+
+public class MissingSourceModules extends ModuleTestBase {
+
+    public static void main(String... args) throws Exception {
+        new MissingSourceModules().runTests();
+    }
+
+    @Test
+    public void testExplicitBinaryModuleOnModulePath(Path base) throws Exception {
+        Path modulePath = base.resolve("modules");
+
+        ModuleBuilder ma = new ModuleBuilder(tb, "ma");
+        ma.comment("Module ma.")
+                .exports("pkg1")
+                .classes("package pkg1; /** Class A */ public class A { }")
+                .classes("package pkg1.pkg2; /** Class B */ public class B { }")
+                .build(modulePath);
+
+        execNegativeTask("--module-path", modulePath.toString(),
+                "--module", "ma");
+        assertMessagePresent("module ma not found.");
+    }
+
+    @Test
+    public void testExplicitBinaryModuleOnLegacyPaths(Path base) throws Exception {
+        Path modulePath = base.resolve("modules");
+
+        ModuleBuilder ma = new ModuleBuilder(tb, "ma");
+        ma.comment("Module ma.")
+                .exports("pkg1")
+                .classes("package pkg1; /** Class A */ public class A { }")
+                .classes("package pkg1.pkg2; /** Class B */ public class B { }")
+                .build(modulePath);
+
+        Path mPath = Paths.get(modulePath.toString(), "ma");
+        execNegativeTask("--source-path", mPath.toString(),
+                "--module", "ma");
+        assertMessagePresent("module ma not found.");
+
+        execNegativeTask("--class-path", mPath.toString(),
+                "--module", "ma");
+        assertMessagePresent("module ma not found.");
+    }
+
+    @Test
+    public void testImplicitBinaryRequiresModule(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path modulePath = base.resolve("modules");
+
+        ModuleBuilder mb = new ModuleBuilder(tb, "mb");
+        mb.comment("Module mb.")
+                .exports("pkgb")
+                .classes("package pkgb; /** Class A */ public class A { }")
+                .build(modulePath);
+
+        ModuleBuilder ma = new ModuleBuilder(tb, "ma");
+        ma.comment("Module ma.")
+                .exports("pkga")
+                .requires("mb", modulePath)
+                .classes("package pkga; /** Class A */ public class A { }")
+                .write(src);
+
+        execTask("--module-path", modulePath.toString(),
+                "--module-source-path", src.toString(),
+                "--expand-requires", "all",
+                "--module", "ma");
+        assertMessagePresent("module mb not found.");
+    }
+
+    @Test
+    public void testImplicitBinaryTransitiveModule(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path modulePath = base.resolve("modules");
+
+        ModuleBuilder mb = new ModuleBuilder(tb, "mb");
+        mb.comment("Module mb.")
+                .exports("pkgb")
+                .classes("package pkgb; /** Class A */ public class A { }")
+                .build(modulePath);
+
+        ModuleBuilder ma = new ModuleBuilder(tb, "ma");
+        ma.comment("Module ma.")
+                .exports("pkga")
+                .requiresTransitive("mb", modulePath)
+                .classes("package pkga; /** Class A */ public class A { }")
+                .write(src);
+
+        execTask("--module-path", modulePath.toString(),
+                "--module-source-path", src.toString(),
+                "--expand-requires", "transitive",
+                "--module", "ma");
+        assertMessagePresent("module mb not found.");
+    }
+}
diff --git a/langtools/test/jdk/javadoc/tool/modules/Modules.java b/langtools/test/jdk/javadoc/tool/modules/Modules.java
index 0799c5c..adbe6e6 100644
--- a/langtools/test/jdk/javadoc/tool/modules/Modules.java
+++ b/langtools/test/jdk/javadoc/tool/modules/Modules.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8159305 8166127 8175860
+ * @bug 8159305 8166127 8175860 8176481
  * @summary Tests primarily the module graph computations.
  * @modules
  *      jdk.javadoc/jdk.javadoc.internal.api
@@ -35,7 +35,6 @@
  * @run main Modules
  */
 
-import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -421,6 +420,7 @@
         checkPackagesIncluded("p");
         checkTypesIncluded("p.Main");
         checkPackagesNotIncluded(".*open.*");
+        assertMessageNotPresent("warning");
     }
 
     @Test
@@ -442,9 +442,46 @@
                 "--expand-requires", "transitive");
 
         checkModulesSpecified("M", "N", "O");
+        checkModulesNotSpecified("java.base");
         checkModulesIncluded("M", "N", "O");
+        checkModulesNotIncluded("java.base");
         checkPackagesIncluded("p", "openN", "openO");
         checkTypesIncluded("p.Main", "openN.N", "openO.O");
+        assertMessageNotPresent("warning");
+    }
+
+    @Test
+    public void testExpandRequiresTransitiveWithMandated(Path base) throws Exception {
+        Path src = base.resolve("src");
+
+        createAuxiliaryModules(src);
+
+        Path patchSrc = Paths.get(src.toString(), "patch");
+
+        new ModuleBuilder(tb, "M")
+                .comment("The M module.")
+                .requiresTransitive("N", src)
+                .requires("L", src)
+                .exports("p")
+                .classes("package p; public class Main { openO.O o; openN.N n; openL.L l; }")
+                .write(src);
+
+        // build the patching module
+        tb.writeJavaFiles(patchSrc, "package pkg1;\n" +
+                "/** Class A */ public class A extends java.util.ArrayList { }");
+        tb.writeJavaFiles(patchSrc, "package pkg1;\n"
+                + "/** Class B */ public class B { }");
+
+        execTask("--module-source-path", src.toString(),
+                "--patch-module", "java.base=" + patchSrc.toString(),
+                "--module", "M",
+                "--expand-requires", "transitive");
+
+        checkModulesSpecified("java.base", "M", "N", "O");
+        checkModulesIncluded("java.base", "M", "N", "O");
+        checkPackagesIncluded("p", "openN", "openO");
+        checkTypesIncluded("p.Main", "openN.N", "openO.O");
+        assertMessageNotPresent("warning");
     }
 
     @Test
@@ -466,13 +503,14 @@
                 "--module", "M",
                 "--expand-requires", "all");
 
-        checkModulesSpecified("M", "java.base", "N", "L", "O");
-        checkModulesIncluded("M", "java.base", "N", "L", "O");
+        checkModulesSpecified("M", "N", "L", "O");
+        checkModulesIncluded("M", "N", "L", "O");
         checkModulesNotIncluded("P", "J", "Q");
         checkPackagesIncluded("p", "openN", "openL", "openO");
         checkPackagesNotIncluded(".*openP.*", ".*openJ.*");
         checkTypesIncluded("p.Main", "openN.N", "openL.L", "openO.O");
         checkTypesNotIncluded(".*openP.*", ".*openJ.*");
+        assertMessageNotPresent("warning");
     }
 
     @Test
@@ -577,7 +615,7 @@
         new ModuleBuilder(tb, "L")
                 .comment("The L module.")
                 .exports("openL")
-                . requiresTransitive("P")
+                .requiresTransitive("P")
                 .classes("package openL; /** Class L open */ public class L { }")
                 .classes("package closedL;  /** Class L closed */ public class L { }")
                 .write(src);
@@ -599,7 +637,7 @@
                 .write(src);
 
         new ModuleBuilder(tb, "P")
-                .comment("The O module.")
+                .comment("The P module.")
                 .exports("openP")
                 .requires("J")
                 .classes("package openP; /** Class O open. */ public class O { openJ.J j; }")
diff --git a/langtools/test/jdk/javadoc/tool/modules/PatchModules.java b/langtools/test/jdk/javadoc/tool/modules/PatchModules.java
index f77575a..0cba257 100644
--- a/langtools/test/jdk/javadoc/tool/modules/PatchModules.java
+++ b/langtools/test/jdk/javadoc/tool/modules/PatchModules.java
@@ -129,7 +129,6 @@
     // Case B.1: (jsr166) augment and override system module
     @Test
     public void testPatchModuleModifyingSystemModule(Path base) throws Exception {
-        Path src = base.resolve("src");
         Path patchSrc = base.resolve("patch");
 
         // build the patching sources
diff --git a/langtools/test/tools/javac/T8176714/FieldOverloadKindNotAssignedTest.java b/langtools/test/tools/javac/T8176714/FieldOverloadKindNotAssignedTest.java
new file mode 100644
index 0000000..e1e7134
--- /dev/null
+++ b/langtools/test/tools/javac/T8176714/FieldOverloadKindNotAssignedTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2017, 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 8176714
+ * @summary javac is wrongly assuming that field JCMemberReference.overloadKind has been assigned to
+ * @library /tools/javac/lib
+ * @modules jdk.compiler/com.sun.source.util
+ *          jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.code
+ *          jdk.compiler/com.sun.tools.javac.file
+ *          jdk.compiler/com.sun.tools.javac.tree
+ *          jdk.compiler/com.sun.tools.javac.util
+ * @build DPrinter
+ * @run main FieldOverloadKindNotAssignedTest
+ */
+
+import java.net.URI;
+import java.util.Arrays;
+
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.util.JavacTask;
+import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.JCMemberReference;
+import com.sun.tools.javac.tree.TreeScanner;
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.javac.util.Context;
+
+public class FieldOverloadKindNotAssignedTest {
+    public static void main(String... args) throws Exception {
+        new FieldOverloadKindNotAssignedTest().run();
+    }
+
+    void run() throws Exception {
+        Context context = new Context();
+        JavacFileManager.preRegister(context);
+        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+        JavacTask ct = (JavacTask)tool.getTask(null, null, null, null, null, Arrays.asList(new JavaSource()));
+        Iterable<? extends CompilationUnitTree> elements = ct.parse();
+        ct.analyze();
+        Assert.check(elements.iterator().hasNext());
+        JCTree topLevel = (JCTree)elements.iterator().next();
+        new TreeScanner() {
+            @Override
+            public void visitReference(JCMemberReference tree) {
+                Assert.check(tree.getOverloadKind() != null);
+            }
+        }.scan(topLevel);
+    }
+
+    static class JavaSource extends SimpleJavaFileObject {
+
+        String source =
+                "import java.util.function.*;\n" +
+
+                "class Test {\n" +
+                "    void m(Predicate<String> psi) {}\n" +
+                "    void m(Function<String, String> fss) {}\n" +
+
+                "    void foo(boolean b) {\n" +
+                "        m(b ? s -> false : Test::g);\n" +
+                "    }\n" +
+
+                "    static boolean g(String s) { return false; }\n" +
+                "    static boolean g(Integer i) { return false; }\n" +
+                "}";
+
+        public JavaSource() {
+            super(URI.create("myfo:/Foo.java"), JavaFileObject.Kind.SOURCE);
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest01.java b/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest01.java
new file mode 100644
index 0000000..5978b2f
--- /dev/null
+++ b/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest01.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2017, 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 8176714
+ * @summary javac is wrongly assuming that field JCMemberReference.overloadKind has been assigned to
+ * @compile TimingOfMReferenceCheckingTest01.java
+ */
+
+import java.util.function.*;
+
+public class TimingOfMReferenceCheckingTest01 {
+    <Z> void g(Consumer<Z> fzr, Z z) {}
+
+    void test(boolean cond) {
+       g(cond ? this::m : this::m, "");
+    }
+
+    void m(String s) {}
+    void m(Integer i) {}
+}
diff --git a/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest02.java b/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest02.java
new file mode 100644
index 0000000..e9e8c9b
--- /dev/null
+++ b/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest02.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017, 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 8176714
+ * @summary javac is wrongly assuming that field JCMemberReference.overloadKind has been assigned to
+ * @compile TimingOfMReferenceCheckingTest02.java
+ */
+
+import java.util.function.*;
+
+public class TimingOfMReferenceCheckingTest02 {
+    <Z> void g(Consumer<Z> fzr, Z z) {}
+   <T> T f(T t) { return null; }
+
+   void test(boolean cond) {
+        g(cond ?
+            f(cond ?
+                this::m :
+                this::m) :
+            this::m, "");
+    }
+
+    void m(String s) {}
+    void m(Integer i) {}
+}
diff --git a/langtools/test/tools/javac/generics/inference/8177097/T8177097a.java b/langtools/test/tools/javac/generics/inference/8177097/T8177097a.java
new file mode 100644
index 0000000..98bbd45
--- /dev/null
+++ b/langtools/test/tools/javac/generics/inference/8177097/T8177097a.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8177097
+ * @summary Generic method reference returning wildcard parameterized type does not compile
+ * @compile T8177097a.java
+ */
+
+import java.util.Map;
+
+class T8177097a {
+    interface X<O> {
+        Map<?, O> apply();
+    }
+
+    <O> void go(X<O> x) { }
+
+    static <I> Map<?, Integer> a() {
+        return null;
+    }
+
+    void test() {
+        go(T8177097a::a);
+    }
+}
diff --git a/langtools/test/tools/javac/generics/inference/8177097/T8177097b.java b/langtools/test/tools/javac/generics/inference/8177097/T8177097b.java
new file mode 100644
index 0000000..a7d2b5c
--- /dev/null
+++ b/langtools/test/tools/javac/generics/inference/8177097/T8177097b.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8177097
+ * @summary Generic method reference returning wildcard parameterized type does not compile
+ * @compile T8177097b.java
+ */
+
+import java.util.Map;
+
+class T8177097b {
+    interface X<O> {
+        O apply(Class<Map<Integer, ?>> m2);
+    }
+
+    <O> void go(X<O> x) {}
+
+    static <I> I a(Class<I> c) { return null; }
+
+
+    void test() {
+        go(T8177097b::a);
+    }
+}