8162674: change javadoc output text and style emitted by for-removal deprecations
authorbpatel
Tue, 13 Dec 2016 12:25:58 -0800
changeset 42816 3638773ff1b0
parent 42815 050370edaade
child 42817 6545638adc59
8162674: change javadoc output text and style emitted by for-removal deprecations Reviewed-by: jjg
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DeprecatedAPIListBuilder.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java
langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java
langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/DeprecatedClassByAnnotation.java
langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestAnnotationType.java
langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestClass.java
langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestEnum.java
langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestError.java
langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestException.java
langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestInterface.java
langtools/test/jdk/javadoc/doclet/testModules/TestModules.java
langtools/test/jdk/javadoc/doclet/testModules/module1/module-info.java
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java	Tue Dec 13 12:25:58 2016 -0800
@@ -360,7 +360,7 @@
      */
     protected void addComment(Element element, Content contentTree) {
         List<? extends DocTree> tags;
-        Content span = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase);
+        Content span = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(element));
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.addStyle(HtmlStyle.block);
         if (utils.isDeprecated(element)) {
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java	Tue Dec 13 12:25:58 2016 -0800
@@ -405,46 +405,6 @@
     }
 
     /**
-     * Add deprecated information to the documentation tree
-     *
-     * @param deprmembers list of deprecated members
-     * @param headingKey the caption for the deprecated members table
-     * @param tableSummary the summary for the deprecated members table
-     * @param tableHeader table headers for the deprecated members table
-     * @param contentTree the content tree to which the deprecated members table will be added
-     */
-    protected void addDeprecatedAPI(Collection<Element> deprmembers, String headingKey,
-            String tableSummary, List<String> tableHeader, Content contentTree) {
-        if (deprmembers.size() > 0) {
-            Content caption = writer.getTableCaption(configuration.getContent(headingKey));
-            Content table = (configuration.isOutputHtml5())
-                    ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption)
-                    : HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption);
-            table.addContent(writer.getSummaryTableHeader(tableHeader, "col"));
-            Content tbody = new HtmlTree(HtmlTag.TBODY);
-            boolean altColor = true;
-            for (Element member : deprmembers) {
-                HtmlTree thRow = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, getDeprecatedLink(member));
-                HtmlTree tr = HtmlTree.TR(thRow);
-                HtmlTree td = new HtmlTree(HtmlTag.TD);
-                td.addStyle(HtmlStyle.colLast);
-                List<? extends DocTree> deprTrees = utils.getBlockTags(member, DocTree.Kind.DEPRECATED);
-                if (!deprTrees.isEmpty()) {
-                    writer.addInlineDeprecatedComment(member, deprTrees.get(0), td);
-                }
-                tr.addContent(td);
-                tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
-                altColor = !altColor;
-                tbody.addContent(tr);
-            }
-            table.addContent(tbody);
-            Content li = HtmlTree.LI(HtmlStyle.blockList, table);
-            Content ul = HtmlTree.UL(HtmlStyle.blockList, li);
-            contentTree.addContent(ul);
-        }
-    }
-
-    /**
      * Add use information to the documentation tree.
      *
      * @param mems list of program elements for which the use information will be added
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Dec 13 12:25:58 2016 -0800
@@ -317,7 +317,7 @@
         List<? extends DocTree> deprs = utils.getBlockTags(annotationType, DocTree.Kind.DEPRECATED);
         if (utils.isDeprecated(annotationType)) {
             CommentHelper ch = utils.getCommentHelper(annotationType);
-            Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase);
+            Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(annotationType));
             Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
             if (!deprs.isEmpty()) {
 
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Tue Dec 13 12:25:58 2016 -0800
@@ -610,7 +610,7 @@
         classInfoTree.addContent(hr);
         List<? extends DocTree> deprs = utils.getBlockTags(typeElement, DocTree.Kind.DEPRECATED);
         if (utils.isDeprecated(typeElement)) {
-            Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase);
+            Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(typeElement));
             Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
             if (!deprs.isEmpty()) {
                 CommentHelper ch = utils.getCommentHelper(typeElement);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java	Tue Dec 13 12:25:58 2016 -0800
@@ -73,6 +73,7 @@
     public final Content deprecatedAPI;
     public final Content deprecatedLabel;
     public final Content deprecatedPhrase;
+    public final Content deprecatedForRemovalPhrase;
     public final Content descfrmClassLabel;
     public final Content descfrmInterfaceLabel;
     public final Content descriptionLabel;
@@ -186,6 +187,7 @@
         deprecatedAPI = getContent("doclet.Deprecated_API");
         deprecatedLabel = getContent("doclet.navDeprecated");
         deprecatedPhrase = getContent("doclet.Deprecated");
+        deprecatedForRemovalPhrase = getContent("doclet.DeprecatedForRemoval");
         descfrmClassLabel = getContent("doclet.Description_From_Class");
         descfrmInterfaceLabel = getContent("doclet.Description_From_Interface");
         descriptionLabel = getContent("doclet.Description");
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java	Tue Dec 13 12:25:58 2016 -0800
@@ -64,6 +64,8 @@
 
     private String getAnchorName(DeprElementKind kind) {
         switch (kind) {
+            case REMOVAL:
+                return "forRemoval";
             case MODULE:
                 return "module";
             case PACKAGE:
@@ -97,6 +99,8 @@
 
     private String getHeadingKey(DeprElementKind kind) {
         switch (kind) {
+            case REMOVAL:
+                return "doclet.Deprecated_For_Removal";
             case MODULE:
                 return "doclet.Deprecated_Modules";
             case PACKAGE:
@@ -130,6 +134,8 @@
 
     private String getSummaryKey(DeprElementKind kind) {
         switch (kind) {
+            case REMOVAL:
+                return "doclet.deprecated_for_removal";
             case MODULE:
                 return "doclet.deprecated_modules";
             case PACKAGE:
@@ -163,6 +169,8 @@
 
     private String getHeaderKey(DeprElementKind kind) {
         switch (kind) {
+            case REMOVAL:
+                return "doclet.Element";
             case MODULE:
                 return "doclet.Module";
             case PACKAGE:
@@ -212,6 +220,7 @@
         writerMap = new EnumMap<>(DeprElementKind.class);
         for (DeprElementKind kind : DeprElementKind.values()) {
             switch (kind) {
+                case REMOVAL:
                 case MODULE:
                 case PACKAGE:
                 case INTERFACE:
@@ -284,16 +293,8 @@
                 List<String> memberTableHeader = new ArrayList<>();
                 memberTableHeader.add(resources.getText(getHeaderKey(kind)));
                 memberTableHeader.add(resources.getText("doclet.Description"));
-                if (kind == DeprElementKind.MODULE) {
-                    addModuleDeprecatedAPI(deprapi.getSet(kind),
+                addDeprecatedAPI(deprapi.getSet(kind),
                             getHeadingKey(kind), memberTableSummary, memberTableHeader, div);
-                } else if (kind == DeprElementKind.PACKAGE) {
-                    addPackageDeprecatedAPI(deprapi.getSet(kind),
-                            getHeadingKey(kind), memberTableSummary, memberTableHeader, div);
-                } else {
-                    writerMap.get(kind).addDeprecatedAPI(deprapi.getSet(kind),
-                            getHeadingKey(kind), memberTableSummary, memberTableHeader, div);
-                }
             }
         }
         if (configuration.allowTag(HtmlTag.MAIN)) {
@@ -395,17 +396,17 @@
     }
 
     /**
-     * Add module deprecation information to the documentation tree
+     * Add deprecated information to the documentation tree
      *
-     * @param deprMdles list of deprecated modules
-     * @param headingKey the caption for the deprecated module table
-     * @param tableSummary the summary for the deprecated module table
-     * @param tableHeader table headers for the deprecated module table
-     * @param contentTree the content tree to which the deprecated module table will be added
+     * @param deprList list of deprecated API elements
+     * @param headingKey the caption for the deprecated table
+     * @param tableSummary the summary for the deprecated table
+     * @param tableHeader table headers for the deprecated table
+     * @param contentTree the content tree to which the deprecated table will be added
      */
-    protected void addModuleDeprecatedAPI(SortedSet<Element> deprMdles, String headingKey,
+    protected void addDeprecatedAPI(SortedSet<Element> deprList, String headingKey,
             String tableSummary, List<String> tableHeader, Content contentTree) {
-        if (deprMdles.size() > 0) {
+        if (deprList.size() > 0) {
             Content caption = getTableCaption(configuration.getContent(headingKey));
             Content table = (configuration.isOutputHtml5())
                     ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption)
@@ -413,16 +414,28 @@
             table.addContent(getSummaryTableHeader(tableHeader, "col"));
             Content tbody = new HtmlTree(HtmlTag.TBODY);
             boolean altColor = true;
-            for (Element e : deprMdles) {
-                ModuleElement mdle = (ModuleElement) e;
-                HtmlTree thRow = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst,
-                        getModuleLink(mdle, new StringContent(mdle.getQualifiedName())));
+            for (Element e : deprList) {
+                HtmlTree thRow;
+                switch (e.getKind()) {
+                    case MODULE:
+                        ModuleElement m = (ModuleElement)e;
+                        thRow = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst,
+                        getModuleLink(m, new StringContent(m.getQualifiedName())));
+                        break;
+                    case PACKAGE:
+                        PackageElement pkg = (PackageElement)e;
+                        thRow = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst,
+                        getPackageLink(pkg, getPackageName(pkg)));
+                        break;
+                    default:
+                        thRow = getDeprecatedLink(e);
+                }
                 HtmlTree tr = HtmlTree.TR(thRow);
                 HtmlTree tdDesc = new HtmlTree(HtmlTag.TD);
                 tdDesc.addStyle(HtmlStyle.colLast);
-                List<? extends DocTree> tags = utils.getDeprecatedTrees(mdle);
+                List<? extends DocTree> tags = utils.getDeprecatedTrees(e);
                 if (!tags.isEmpty()) {
-                    addInlineDeprecatedComment(mdle, tags.get(0), tdDesc);
+                    addInlineDeprecatedComment(e, tags.get(0), tdDesc);
                 }
                 tr.addContent(tdDesc);
                 tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
@@ -436,45 +449,30 @@
         }
     }
 
-    /**
-     * Add package deprecation information to the documentation tree
-     *
-     * @param deprPkgs list of deprecated packages
-     * @param headingKey the caption for the deprecated package table
-     * @param tableSummary the summary for the deprecated package table
-     * @param tableHeader table headers for the deprecated package table
-     * @param contentTree the content tree to which the deprecated package table will be added
-     */
-    protected void addPackageDeprecatedAPI(SortedSet<Element> deprPkgs, String headingKey,
-            String tableSummary, List<String> tableHeader, Content contentTree) {
-        if (deprPkgs.size() > 0) {
-            Content caption = getTableCaption(configuration.getContent(headingKey));
-            Content table = (configuration.isOutputHtml5())
-                    ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption)
-                    : HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption);
-            table.addContent(getSummaryTableHeader(tableHeader, "col"));
-            Content tbody = new HtmlTree(HtmlTag.TBODY);
-            boolean altColor = true;
-            for (Element e : deprPkgs) {
-                PackageElement pkg = (PackageElement) e;
-                HtmlTree thRow = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst,
-                        getPackageLink(pkg, getPackageName(pkg)));
-                HtmlTree tr = HtmlTree.TR(thRow);
-                HtmlTree tdDesc = new HtmlTree(HtmlTag.TD);
-                tdDesc.addStyle(HtmlStyle.colLast);
-                List<? extends DocTree> tags = utils.getDeprecatedTrees(pkg);
-                if (!tags.isEmpty()) {
-                    addInlineDeprecatedComment(pkg, tags.get(0), tdDesc);
-                }
-                tr.addContent(tdDesc);
-                tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
-                altColor = !altColor;
-                tbody.addContent(tr);
-            }
-            table.addContent(tbody);
-            Content li = HtmlTree.LI(HtmlStyle.blockList, table);
-            Content ul = HtmlTree.UL(HtmlStyle.blockList, li);
-            contentTree.addContent(ul);
+    protected HtmlTree getDeprecatedLink(Element e) {
+        AbstractMemberWriter writer;
+        switch (e.getKind()) {
+            case INTERFACE:
+            case CLASS:
+            case ENUM:
+            case ANNOTATION_TYPE:
+                writer = new NestedClassWriterImpl(this);
+                break;
+            case FIELD:
+                writer = new FieldWriterImpl(this);
+                break;
+            case METHOD:
+                writer = new MethodWriterImpl(this);
+                break;
+            case CONSTRUCTOR:
+                writer = new ConstructorWriterImpl(this);
+                break;
+            case ENUM_CONSTANT:
+                writer = new EnumConstantWriterImpl(this);
+                break;
+            default:
+                writer = new AnnotationTypeOptionalMemberWriterImpl(this, null);
         }
+        return HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, writer.getDeprecatedLink(e));
     }
 }
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java	Tue Dec 13 12:25:58 2016 -0800
@@ -412,7 +412,7 @@
                 HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD);
                 tdClassDescription.addStyle(HtmlStyle.colLast);
                 if (utils.isDeprecated(te)) {
-                    tdClassDescription.addContent(contents.deprecatedLabel);
+                    tdClassDescription.addContent(getDeprecatedPhrase(te));
                     List<? extends DocTree> tags = utils.getDeprecatedTrees(te);
                     if (!tags.isEmpty()) {
                         addSummaryDeprecatedComment(te, tags.get(0), tdClassDescription);
@@ -1617,6 +1617,18 @@
     }
 
     /**
+     * Get the deprecated phrase as content.
+     *
+     * @param e the Element for which the inline deprecated comment will be added
+     * @return a content tree for the deprecated phrase.
+     */
+    public Content getDeprecatedPhrase(Element e) {
+        return (utils.isDeprecatedForRemoval(e))
+                ? contents.deprecatedForRemovalPhrase
+                : contents.deprecatedPhrase;
+    }
+
+    /**
      * Add the inline deprecated comment.
      *
      * @param e the Element for which the inline deprecated comment will be added
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Tue Dec 13 12:25:58 2016 -0800
@@ -506,7 +506,7 @@
             CommentHelper ch = utils.getCommentHelper(mdle);
             HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
             deprDiv.addStyle(HtmlStyle.deprecatedContent);
-            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase);
+            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(mdle));
             deprDiv.addContent(deprPhrase);
             if (!deprs.isEmpty()) {
                 List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
@@ -648,7 +648,7 @@
             deprs = utils.getDeprecatedTrees(pkg);
             HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
             deprDiv.addStyle(HtmlStyle.deprecatedContent);
-            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase);
+            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(pkg));
             deprDiv.addContent(deprPhrase);
             if (!deprs.isEmpty()) {
                 CommentHelper ch = utils.getCommentHelper(pkg);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Tue Dec 13 12:25:58 2016 -0800
@@ -172,7 +172,7 @@
             CommentHelper ch = utils.getCommentHelper(packageElement);
             HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
             deprDiv.addStyle(HtmlStyle.deprecatedContent);
-            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase);
+            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(packageElement));
             deprDiv.addContent(deprPhrase);
             if (!deprs.isEmpty()) {
                 List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
@@ -223,7 +223,7 @@
                 HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD);
                 tdClassDescription.addStyle(HtmlStyle.colLast);
                 if (utils.isDeprecated(klass)) {
-                    tdClassDescription.addContent(contents.deprecatedLabel);
+                    tdClassDescription.addContent(getDeprecatedPhrase(klass));
                     List<? extends DocTree> tags = utils.getDeprecatedTrees(klass);
                     if (!tags.isEmpty()) {
                         addSummaryDeprecatedComment(klass, tags.get(0), tdClassDescription);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java	Tue Dec 13 12:25:58 2016 -0800
@@ -187,7 +187,7 @@
         List<? extends DocTree> deprs = utils.getBlockTags(member, DocTree.Kind.DEPRECATED);
         Content div;
         if (utils.isDeprecated(member)) {
-            Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase);
+            Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(member));
             div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
             div.addContent(Contents.SPACE);
             if (!deprs.isEmpty()) {
@@ -198,7 +198,7 @@
         } else {
             Element te = member.getEnclosingElement();
             if (te != null &&  utils.isTypeElement(te) && utils.isDeprecated(te)) {
-                Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase);
+                Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(te));
                 div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
                 div.addContent(Contents.SPACE);
                 tdSummary.addContent(div);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java	Tue Dec 13 12:25:58 2016 -0800
@@ -178,7 +178,7 @@
         if (utils.isTypeElement(element)) {
             if (utils.isDeprecated(element)) {
                 result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
-                        new StringContent(configuration.getText("doclet.Deprecated"))));
+                        htmlWriter.getDeprecatedPhrase(element)));
                 result.addContent(RawHtml.nbsp);
                 if (!deprs.isEmpty()) {
                     List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
@@ -190,7 +190,7 @@
         } else {
             if (utils.isDeprecated(element)) {
                 result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
-                        new StringContent(configuration.getText("doclet.Deprecated"))));
+                        htmlWriter.getDeprecatedPhrase(element)));
                 result.addContent(RawHtml.nbsp);
                 if (!deprs.isEmpty()) {
                     List<? extends DocTree> bodyTags = ch.getBody(configuration, deprs.get(0));
@@ -199,9 +199,10 @@
                         result.addContent(HtmlTree.SPAN(HtmlStyle.deprecationComment, body));
                 }
             } else {
-                if (utils.isDeprecated(utils.getEnclosingTypeElement(element))) {
+                Element ee = utils.getEnclosingTypeElement(element);
+                if (utils.isDeprecated(ee)) {
                     result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
-                            new StringContent(configuration.getText("doclet.Deprecated"))));
+                        htmlWriter.getDeprecatedPhrase(ee)));
                     result.addContent(RawHtml.nbsp);
                 }
             }
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties	Tue Dec 13 12:25:58 2016 -0800
@@ -3,6 +3,7 @@
 doclet.Overview=Overview
 doclet.Window_Overview=Overview List
 doclet.Window_Overview_Summary=Overview
+doclet.Element=Element
 doclet.Package=Package
 doclet.Module=Module
 doclet.All_Packages=All Packages
@@ -71,6 +72,7 @@
 doclet.see.class_or_package_not_accessible=Tag {0}: reference not accessible: {1}
 doclet.tag.invalid_usage=invalid usage of tag {0}
 doclet.Deprecated_API=Deprecated API
+doclet.Deprecated_For_Removal=Deprecated For Removal
 doclet.Deprecated_Modules=Deprecated Modules
 doclet.Deprecated_Packages=Deprecated Packages
 doclet.Deprecated_Classes=Deprecated Classes
@@ -84,6 +86,7 @@
 doclet.Deprecated_Methods=Deprecated Methods
 doclet.Deprecated_Enum_Constants=Deprecated Enum Constants
 doclet.Deprecated_Annotation_Type_Members=Deprecated Annotation Type Elements
+doclet.deprecated_for_removal=deprecated for removal
 doclet.deprecated_modules=deprecated modules
 doclet.deprecated_packages=deprecated packages
 doclet.deprecated_classes=deprecated classes
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties	Tue Dec 13 12:25:58 2016 -0800
@@ -150,6 +150,7 @@
 doclet.Method_Detail=Method Detail
 doclet.Constructor_Detail=Constructor Detail
 doclet.Deprecated=Deprecated.
+doclet.DeprecatedForRemoval=Deprecated, for removal: This API element is subject to removal in a future version. 
 doclet.Hidden=Hidden
 doclet.Groupname_already_used=In -group option, groupname already used: {0}
 doclet.value_tag_invalid_reference={0} (referenced by @value tag) is an unknown reference.
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DeprecatedAPIListBuilder.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DeprecatedAPIListBuilder.java	Tue Dec 13 12:25:58 2016 -0800
@@ -52,6 +52,7 @@
     private final Configuration configuration;
     private final Utils utils;
     public static enum DeprElementKind {
+        REMOVAL,
         MODULE,
         PACKAGE,
         INTERFACE,
@@ -90,9 +91,13 @@
      * @param configuration the current configuration of the doclet.
      */
     private void buildDeprecatedAPIInfo() {
+        SortedSet<Element> rset = deprecatedMap.get(DeprElementKind.REMOVAL);
         SortedSet<ModuleElement> modules = configuration.modules;
         SortedSet<Element> mset = deprecatedMap.get(DeprElementKind.MODULE);
         for (Element me : modules) {
+            if (utils.isDeprecatedForRemoval(me)) {
+                rset.add(me);
+            }
             if (utils.isDeprecated(me)) {
                 mset.add(me);
             }
@@ -100,6 +105,9 @@
         SortedSet<PackageElement> packages = configuration.packages;
         SortedSet<Element> pset = deprecatedMap.get(DeprElementKind.PACKAGE);
         for (Element pe : packages) {
+            if (utils.isDeprecatedForRemoval(pe)) {
+                rset.add(pe);
+            }
             if (utils.isDeprecated(pe)) {
                 pset.add(pe);
             }
@@ -107,6 +115,9 @@
         for (Element e : configuration.getIncludedTypeElements()) {
             TypeElement te = (TypeElement)e;
             SortedSet<Element> eset;
+            if (utils.isDeprecatedForRemoval(e)) {
+                rset.add(e);
+            }
             if (utils.isDeprecated(e)) {
                 switch (e.getKind()) {
                     case ANNOTATION_TYPE:
@@ -133,18 +144,18 @@
                         break;
                 }
             }
-            composeDeprecatedList(deprecatedMap.get(DeprElementKind.FIELD),
+            composeDeprecatedList(rset, deprecatedMap.get(DeprElementKind.FIELD),
                     utils.getFields(te));
-            composeDeprecatedList(deprecatedMap.get(DeprElementKind.METHOD),
+            composeDeprecatedList(rset, deprecatedMap.get(DeprElementKind.METHOD),
                     utils.getMethods(te));
-            composeDeprecatedList(deprecatedMap.get(DeprElementKind.CONSTRUCTOR),
+            composeDeprecatedList(rset, deprecatedMap.get(DeprElementKind.CONSTRUCTOR),
                     utils.getConstructors(te));
             if (utils.isEnum(e)) {
-                composeDeprecatedList(deprecatedMap.get(DeprElementKind.ENUM_CONSTANT),
+                composeDeprecatedList(rset, deprecatedMap.get(DeprElementKind.ENUM_CONSTANT),
                         utils.getEnumConstants(te));
             }
             if (utils.isAnnotationType(e)) {
-                composeDeprecatedList(deprecatedMap.get(DeprElementKind.ANNOTATION_TYPE_MEMBER),
+                composeDeprecatedList(rset, deprecatedMap.get(DeprElementKind.ANNOTATION_TYPE_MEMBER),
                         utils.getAnnotationMembers(te));
 
             }
@@ -154,11 +165,16 @@
     /**
      * Add the members into a single list of deprecated members.
      *
+     * @param rset set of elements deprecated for removal.
+     * @param sset set of deprecated elements.
      * @param list List of all the particular deprecated members, e.g. methods.
      * @param members members to be added in the list.
      */
-    private void composeDeprecatedList(SortedSet<Element> sset, List<? extends Element> members) {
+    private void composeDeprecatedList(SortedSet<Element> rset, SortedSet<Element> sset, List<? extends Element> members) {
         for (Element member : members) {
+            if (utils.isDeprecatedForRemoval(member)) {
+                rset.add(member);
+            }
             if (utils.isDeprecated(member)) {
                 sset.add(member);
             }
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java	Tue Dec 13 12:25:58 2016 -0800
@@ -36,6 +36,7 @@
 
 import javax.lang.model.SourceVersion;
 import javax.lang.model.element.AnnotationMirror;
+import javax.lang.model.element.AnnotationValue;
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ElementKind;
 import javax.lang.model.element.ExecutableElement;
@@ -74,10 +75,12 @@
 import com.sun.source.util.DocSourcePositions;
 import com.sun.source.util.DocTrees;
 import com.sun.source.util.TreePath;
+import com.sun.tools.javac.model.JavacTypes;
 import jdk.javadoc.internal.doclets.toolkit.CommentUtils.DocCommentDuo;
 import jdk.javadoc.internal.doclets.toolkit.Configuration;
 import jdk.javadoc.internal.doclets.toolkit.Messages;
 import jdk.javadoc.internal.doclets.toolkit.WorkArounds;
+import jdk.javadoc.internal.tool.DocEnvImpl;
 
 import static javax.lang.model.element.ElementKind.*;
 import static javax.lang.model.element.Modifier.*;
@@ -1477,6 +1480,30 @@
     }
 
     /**
+     * Return true if the given Element is deprecated for removal.
+     *
+     * @param e the Element to check.
+     * @return true if the given Element is deprecated for removal.
+     */
+    public boolean isDeprecatedForRemoval(Element e) {
+        List<? extends AnnotationMirror> annotationList = e.getAnnotationMirrors();
+        JavacTypes jctypes = ((DocEnvImpl) configuration.docEnv).toolEnv.typeutils;
+        for (AnnotationMirror anno : annotationList) {
+            if (jctypes.isSameType(anno.getAnnotationType().asElement().asType(), getDeprecatedType())) {
+                Map<? extends ExecutableElement, ? extends AnnotationValue> pairs = anno.getElementValues();
+                if (!pairs.isEmpty()) {
+                    for (ExecutableElement element : pairs.keySet()) {
+                        if (element.getSimpleName().contentEquals("forRemoval")) {
+                            return Boolean.parseBoolean((pairs.get(element)).toString());
+                        }
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
      * A convenience method to get property name from the name of the
      * getter or setter method.
      * @param e the input method.
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Tue Dec 13 12:25:58 2016 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4927552 8026567 8071982
+ * @bug      4927552 8026567 8071982 8162674
  * @summary  <DESC>
  * @author   jamieh
  * @library  ../lib
@@ -79,14 +79,138 @@
                 "<pre>@Deprecated\n"
                 + "public class <span class=\"typeNameLabel\">DeprecatedClassByAnnotation</span>\n"
                 + "extends java.lang.Object</pre>",
-                "<pre>@Deprecated\n"
+                "<pre>@Deprecated(forRemoval=true)\n"
                 + "public&nbsp;int field</pre>\n"
-                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>",
-                "<pre>@Deprecated\n"
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;</div>",
+                "<pre>@Deprecated(forRemoval=true)\n"
                 + "public&nbsp;DeprecatedClassByAnnotation()</pre>\n"
-                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>",
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;</div>",
                 "<pre>@Deprecated\n"
                 + "public&nbsp;void&nbsp;method()</pre>\n"
                 + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>");
+
+        checkOutput("pkg/TestAnnotationType.html", true,
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                + "<div class=\"block\"><span class=\"deprecationComment\">annotation_test1 passes.</span></div>\n"
+                + "</div>\n"
+                + "<br>\n"
+                + "<pre>@Deprecated(forRemoval=true)\n"
+                + "@Documented\n"
+                + "public @interface <span class=\"memberNameLabel\">TestAnnotationType</span></pre>",
+                "<pre>@Deprecated(forRemoval=true)\n"
+                + "static final&nbsp;int&nbsp;field</pre>\n"
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This "
+                + "API element is subject to removal in a future version. </span>&nbsp;<span class=\"deprecationComment\">annotation_test4 passes.</span></div>",
+                "<pre>@Deprecated(forRemoval=true)\n"
+                + "int&nbsp;required</pre>\n"
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;"
+                + "<span class=\"deprecationComment\">annotation_test3 passes.</span></div>",
+                "<pre>java.lang.String&nbsp;optional</pre>\n"
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;<span class=\"deprecationComment\">annotation_test2 passes.</span></div>");
+
+        checkOutput("pkg/TestClass.html", true,
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                + "<div class=\"block\"><span class=\"deprecationComment\">class_test1 passes.</span></div>\n"
+                + "</div>\n"
+                + "<br>\n"
+                + "<pre>@Deprecated(forRemoval=true)\n"
+                + "public class <span class=\"typeNameLabel\">TestClass</span>\n"
+                + "extends java.lang.Object</pre>",
+                "<pre>@Deprecated(forRemoval=true)\n"
+                + "public&nbsp;TestClass()</pre>\n"
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;"
+                + "<span class=\"deprecationComment\">class_test3 passes.</span></div>");
+
+        checkOutput("pkg/TestEnum.html", true,
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                + "<div class=\"block\"><span class=\"deprecationComment\">enum_test1 passes.</span></div>\n"
+                + "</div>\n"
+                + "<br>\n"
+                + "<pre>@Deprecated(forRemoval=true)\n"
+                + "public enum <span class=\"typeNameLabel\">TestEnum</span>\n"
+                + "extends java.lang.Enum&lt;<a href=\"../pkg/TestEnum.html\" title=\"enum in pkg\">TestEnum</a>&gt;</pre>",
+                "<pre>@Deprecated(forRemoval=true)\n"
+                + "public static final&nbsp;<a href=\"../pkg/TestEnum.html\" title=\"enum in pkg\">TestEnum</a> FOR_REMOVAL</pre>\n"
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;"
+                + "<span class=\"deprecationComment\">enum_test3 passes.</span></div>");
+
+        checkOutput("pkg/TestError.html", true,
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                + "<div class=\"block\"><span class=\"deprecationComment\">error_test1 passes.</span></div>\n"
+                + "</div>\n"
+                + "<br>\n"
+                + "<pre>@Deprecated(forRemoval=true)\n"
+                + "public class <span class=\"typeNameLabel\">TestError</span>\n"
+                + "extends java.lang.Error</pre>");
+
+        checkOutput("pkg/TestException.html", true,
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                + "<div class=\"block\"><span class=\"deprecationComment\">exception_test1 passes.</span></div>\n"
+                + "</div>\n"
+                + "<br>\n"
+                + "<pre>@Deprecated(forRemoval=true)\n"
+                + "public class <span class=\"typeNameLabel\">TestException</span>\n"
+                + "extends java.lang.Exception</pre>");
+
+        checkOutput("pkg/TestInterface.html", true,
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                + "<div class=\"block\"><span class=\"deprecationComment\">interface_test1 passes.</span></div>\n"
+                + "</div>\n"
+                + "<br>\n"
+                + "<pre>@Deprecated(forRemoval=true)\n"
+                + "public class <span class=\"typeNameLabel\">TestInterface</span>\n"
+                + "extends java.lang.Object</pre>");
+
+        checkOutput("deprecated-list.html", true,
+                "<ul>\n"
+                + "<li><a href=\"#forRemoval\">Deprecated For Removal</a></li>\n"
+                + "<li><a href=\"#class\">Deprecated Classes</a></li>\n"
+                + "<li><a href=\"#enum\">Deprecated Enums</a></li>\n"
+                + "<li><a href=\"#exception\">Deprecated Exceptions</a></li>\n"
+                + "<li><a href=\"#error\">Deprecated Errors</a></li>\n"
+                + "<li><a href=\"#annotation.type\">Deprecated Annotation Types</a></li>\n"
+                + "<li><a href=\"#field\">Deprecated Fields</a></li>\n"
+                + "<li><a href=\"#method\">Deprecated Methods</a></li>\n"
+                + "<li><a href=\"#constructor\">Deprecated Constructors</a></li>\n"
+                + "<li><a href=\"#enum.constant\">Deprecated Enum Constants</a></li>\n"
+                + "<li><a href=\"#annotation.type.member\">Deprecated Annotation Type Elements</a></li>\n"
+                + "</ul>",
+                "<a name=\"forRemoval\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated For Removal table, listing deprecated for removal, and an explanation\">\n"
+                + "<caption><span>Deprecated For Removal</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Element</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Enums table, listing deprecated enums, and an explanation\">\n"
+                + "<caption><span>Deprecated Enums</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Enum</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>\n"
+                + "<tbody>\n"
+                + "<tr class=\"altColor\">\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"pkg/TestEnum.html\" title=\"enum in pkg\">pkg.TestEnum</a></th>\n"
+                + "<td class=\"colLast\">\n"
+                + "<div class=\"block\"><span class=\"deprecationComment\">enum_test1 passes.</span></div>\n"
+                + "</td>\n"
+                + "</tr>\n"
+                + "</tbody>\n"
+                + "</table>",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Exceptions table, listing deprecated exceptions, and an explanation\">\n"
+                + "<caption><span>Deprecated Exceptions</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Exceptions</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>\n"
+                + "<tbody>\n"
+                + "<tr class=\"altColor\">\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"pkg/TestException.html\" title=\"class in pkg\">pkg.TestException</a></th>\n"
+                + "<td class=\"colLast\">\n"
+                + "<div class=\"block\"><span class=\"deprecationComment\">exception_test1 passes.</span></div>\n"
+                + "</td>\n"
+                + "</tr>\n"
+                + "</tbody>\n"
+                + "</table>");
     }
 }
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/DeprecatedClassByAnnotation.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/DeprecatedClassByAnnotation.java	Tue Dec 13 12:25:58 2016 -0800
@@ -26,10 +26,10 @@
 @Deprecated()
 public class DeprecatedClassByAnnotation {
 
-    @Deprecated()
+    @Deprecated(forRemoval=true)
     public int field;
 
-    @Deprecated()
+    @Deprecated(forRemoval=true)
     public DeprecatedClassByAnnotation() {}
 
     @Deprecated()
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestAnnotationType.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestAnnotationType.java	Tue Dec 13 12:25:58 2016 -0800
@@ -28,6 +28,7 @@
 /**
  * @deprecated annotation_test1 passes.
  */
+@Deprecated(forRemoval=true)
 @Documented public @interface TestAnnotationType {
 
     /**
@@ -38,10 +39,12 @@
    /**
      * @deprecated annotation_test3 passes.
      */
+    @Deprecated(forRemoval=true)
     int required();
 
     /**
      * @deprecated annotation_test4 passes.
      */
+    @Deprecated(forRemoval=true)
     int field = 0;
 }
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestClass.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestClass.java	Tue Dec 13 12:25:58 2016 -0800
@@ -26,6 +26,7 @@
 /**
  * @deprecated class_test1 passes.
  */
+@Deprecated(forRemoval=true)
 public class TestClass {
 
     /**
@@ -36,6 +37,7 @@
     /**
      * @deprecated class_test3 passes.
      */
+    @Deprecated(forRemoval=true)
     public TestClass() {}
 
     /**
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestEnum.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestEnum.java	Tue Dec 13 12:25:58 2016 -0800
@@ -26,10 +26,17 @@
 /**
  * @deprecated enum_test1 passes.
  */
+@Deprecated(forRemoval=true)
 public enum TestEnum {
 
     /**
      * @deprecated enum_test2 passes.
      */
-    ONE, TWO, THREE;
+    ONE, TWO, THREE,
+
+    /**
+     * @deprecated enum_test3 passes.
+     */
+    @Deprecated(forRemoval=true)
+    FOR_REMOVAL;
 }
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestError.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestError.java	Tue Dec 13 12:25:58 2016 -0800
@@ -26,6 +26,7 @@
 /**
  * @deprecated error_test1 passes.
  */
+@Deprecated(forRemoval=true)
 public class TestError extends Error {
 
     /**
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestException.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestException.java	Tue Dec 13 12:25:58 2016 -0800
@@ -26,6 +26,7 @@
 /**
  * @deprecated exception_test1 passes.
  */
+@Deprecated(forRemoval=true)
 public class TestException extends Exception {
 
     /**
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestInterface.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/pkg/TestInterface.java	Tue Dec 13 12:25:58 2016 -0800
@@ -30,6 +30,7 @@
 /**
  * @deprecated interface_test1 passes.
  */
+@Deprecated(forRemoval=true)
 public class TestInterface {
 
     /**
--- a/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java	Tue Dec 13 12:25:58 2016 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363 8168766 8168688
+ * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363 8168766 8168688 8162674
  * @summary Test modules support in javadoc.
  * @author bpatel
  * @library ../lib
@@ -253,7 +253,8 @@
     void checkHtml5Description(boolean found) {
         checkOutput("module1-summary.html", found,
                 "<section role=\"region\">\n"
-                + "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n"
+                + "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated, for removal:"
+                + " This API element is subject to removal in a future version. </span>\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n"
                 + "</div>\n"
                 + "<!-- ============ MODULE DESCRIPTION =========== -->\n"
@@ -597,11 +598,13 @@
 
     void checkModuleDeprecation(boolean found) {
         checkOutput("module1-summary.html", found,
-                "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n"
+                "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated, for removal:"
+                + " This API element is subject to removal in a future version. </span>\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n"
                 + "</div>");
         checkOutput("deprecated-list.html", found,
                 "<ul>\n"
+                + "<li><a href=\"#forRemoval\">Deprecated For Removal</a></li>\n"
                 + "<li><a href=\"#module\">Deprecated Modules</a></li>\n"
                 + "</ul>",
                 "<tr class=\"altColor\">\n"
--- a/langtools/test/jdk/javadoc/doclet/testModules/module1/module-info.java	Tue Dec 13 10:49:28 2016 +0100
+++ b/langtools/test/jdk/javadoc/doclet/testModules/module1/module-info.java	Tue Dec 13 12:25:58 2016 -0800
@@ -28,7 +28,7 @@
   *
   * @deprecated This module is deprecated.
   */
-@Deprecated
+@Deprecated(forRemoval=true)
 module module1 {
     requires module2;