diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java
index 19d18030fe2..6d501000b81 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java
@@ -166,6 +166,7 @@ public class IndexBuilder {
adjustIndexMap(utils.getFields(te));
adjustIndexMap(utils.getMethods(te));
adjustIndexMap(utils.getConstructors(te));
+ adjustIndexMap(utils.getEnumConstants(te));
}
diff --git a/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java b/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java
index 14f12cd64be..3225e690876 100644
--- a/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java
+++ b/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8141492 8071982 8141636
+ * @bug 8141492 8071982 8141636 8147890
* @summary Test the search feature of javadoc.
* @author bpatel
* @library ../lib
@@ -31,7 +31,6 @@
* @build JavadocTester
* @run main TestSearch
*/
-
public class TestSearch extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -241,146 +240,160 @@ public class TestSearch extends JavadocTester {
// Test for search tags markup in index file.
checkOutput("index-all.html", expectedOutput,
"
"
- + "phrase with spaces - Search tag in pkg",
+ + "phrase with spaces - Search tag in pkg",
""
- + "pkg - Search tag in pkg",
+ + "pkg - Search tag in pkg",
""
- + "pkg2.5 - Search tag in pkg",
+ + "pkg2.5 - Search tag in pkg",
""
- + "r - Search tag in pkg",
+ + "r - Search tag in pkg",
""
- + "search phrase - Search tag in pkg1.RegClass",
+ + "search phrase - Search tag in pkg1.RegClass",
""
- + "SearchWordWithDescription - Search tag in pkg1.RegClass.CONSTANT_FIELD_1",
+ + "SearchWordWithDescription - Search tag in pkg1.RegClass.CONSTANT_FIELD_1",
""
- + "search phrase with desc deprecated - Search tag in pkg2.TestAnnotationType",
+ + "search phrase with desc deprecated - Search tag in pkg2.TestAnnotationType",
""
- + "SearchTagDeprecatedClass - Search tag in pkg2.TestClass",
+ + "SearchTagDeprecatedClass - Search tag in pkg2.TestClass",
""
- + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
+ + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
""
- + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
+ + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
""
- + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError",
+ + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError",
""
- + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError",
+ + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError",
""
- + "SingleWord - Search tag in pkg",
+ + "SingleWord - Search tag in pkg",
"nested {@index nested_tag_test} - "
- + "Search tag in pkg.AnotherClass.ModalExclusionType.NO_EXCLUDE",
+ + "#nested%7B@indexnested_tag_test%7D\">nested {@index nested_tag_test} - "
+ + "Search tag in pkg.AnotherClass.ModalExclusionType.NO_EXCLUDE",
"html <span> see </span> - Search "
- + "tag in pkg.AnotherClass.ModalExclusionType.APPLICATION_EXCLUDE",
+ + "#html-span-see-/span-\">html <span> see </span> - Search "
+ + "tag in pkg.AnotherClass.ModalExclusionType.APPLICATION_EXCLUDE",
"quoted"
- + " - Search tag in pkg.AnotherClass.CONSTANT1");
+ + " - Search tag in pkg.AnotherClass.CONSTANT1",
+ "ONE - "
+ + "pkg2.TestEnum",
+ "THREE - "
+ + "pkg2.TestEnum",
+ "TWO - "
+ + "pkg2.TestEnum");
checkOutput("index-all.html", true,
"",
+ + " SearchTagDeprecatedClass",
"");
+ + " method SearchTagDeprecatedMethod");
}
void checkSplitIndex() {
// Test for search tags markup in split index file.
- checkOutput("index-files/index-12.html", true,
+ checkOutput("index-files/index-13.html", true,
""
- + "search phrase - Search tag in pkg1.RegClass",
+ + "search phrase - Search tag in pkg1.RegClass",
""
- + "SearchWordWithDescription - Search tag in pkg1.RegClass.CONSTANT_FIELD_1",
+ + "SearchWordWithDescription - Search tag in pkg1.RegClass.CONSTANT_FIELD_1",
""
- + "search phrase with desc deprecated - Search tag in pkg2.TestAnnotationType",
+ + "search phrase with desc deprecated - Search tag in pkg2.TestAnnotationType",
""
- + "SearchTagDeprecatedClass - Search tag in pkg2.TestClass",
+ + "SearchTagDeprecatedClass - Search tag in pkg2.TestClass",
""
- + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
+ + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
""
- + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
+ + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
""
- + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError",
+ + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError",
""
- + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError",
+ + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError",
""
- + "SingleWord - Search tag in pkg");
- checkOutput("index-files/index-9.html", true,
+ + "SingleWord - Search tag in pkg");
+ checkOutput("index-files/index-10.html", true,
""
- + "phrase with spaces - Search tag in pkg",
+ + "phrase with spaces - Search tag in pkg",
""
- + "pkg - Search tag in pkg",
+ + "pkg - Search tag in pkg",
""
- + "pkg2.5 - Search tag in pkg");
- checkOutput("index-files/index-11.html", true,
+ + "pkg2.5 - Search tag in pkg");
+ checkOutput("index-files/index-12.html", true,
""
- + "r - Search tag in pkg");
+ + "r - Search tag in pkg");
checkOutput("index-files/index-8.html", true,
"nested {@index nested_tag_test} - "
- + "Search tag in pkg.AnotherClass.ModalExclusionType.NO_EXCLUDE");
+ + "#nested%7B@indexnested_tag_test%7D\">nested {@index nested_tag_test} - "
+ + "Search tag in pkg.AnotherClass.ModalExclusionType.NO_EXCLUDE");
checkOutput("index-files/index-5.html", true,
"html <span> see </span> - Search "
- + "tag in pkg.AnotherClass.ModalExclusionType.APPLICATION_EXCLUDE");
- checkOutput("index-files/index-10.html", true,
+ + "#html-span-see-/span-\">html <span> see </span> - Search "
+ + "tag in pkg.AnotherClass.ModalExclusionType.APPLICATION_EXCLUDE");
+ checkOutput("index-files/index-11.html", true,
"quoted"
- + " - Search tag in pkg.AnotherClass.CONSTANT1");
+ + " - Search tag in pkg.AnotherClass.CONSTANT1");
+ checkOutput("index-files/index-9.html", true,
+ "ONE"
+ + " - pkg2.TestEnum");
+ checkOutput("index-files/index-14.html", true,
+ "THREE - "
+ + "pkg2.TestEnum",
+ "TWO - "
+ + "pkg2.TestEnum");
}
void checkIndexNoComment() {
// Test for search tags markup in index file when javadoc is executed with -nocomment.
checkOutput("index-all.html", false,
""
- + "phrase with spaces - Search tag in pkg",
+ + "phrase with spaces - Search tag in pkg",
""
- + "pkg - Search tag in pkg",
+ + "pkg - Search tag in pkg",
""
- + "pkg2.5 - Search tag in pkg",
+ + "pkg2.5 - Search tag in pkg",
""
- + "r - Search tag in pkg",
+ + "r - Search tag in pkg",
""
- + "search phrase - Search tag in pkg1.RegClass",
+ + "search phrase - Search tag in pkg1.RegClass",
""
- + "SearchWordWithDescription - Search tag in pkg1.RegClass.CONSTANT_FIELD_1",
+ + "SearchWordWithDescription - Search tag in pkg1.RegClass.CONSTANT_FIELD_1",
""
- + "search phrase with desc deprecated - Search tag in pkg2.TestAnnotationType",
+ + "search phrase with desc deprecated - Search tag in pkg2.TestAnnotationType",
""
- + "SearchTagDeprecatedClass - Search tag in pkg2.TestClass",
+ + "SearchTagDeprecatedClass - Search tag in pkg2.TestClass",
""
- + "SingleWord - Search tag in pkg",
+ + "SingleWord - Search tag in pkg",
"",
+ + " SearchTagDeprecatedClass",
"");
+ + " method SearchTagDeprecatedMethod");
checkOutput("index-all.html", true,
""
- + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
+ + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
""
- + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError");
+ + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError");
}
void checkIndexNoDeprecated() {
// Test for search tags markup in index file when javadoc is executed using -nodeprecated.
checkOutput("index-all.html", true,
""
- + "phrase with spaces - Search tag in pkg",
+ + "phrase with spaces - Search tag in pkg",
""
- + "search phrase - Search tag in pkg1.RegClass",
+ + "search phrase - Search tag in pkg1.RegClass",
""
- + "SearchWordWithDescription - Search tag in pkg1.RegClass.CONSTANT_FIELD_1",
+ + "SearchWordWithDescription - Search tag in pkg1.RegClass.CONSTANT_FIELD_1",
""
- + "SingleWord - Search tag in pkg");
+ + "SingleWord - Search tag in pkg");
checkOutput("index-all.html", false,
""
- + "search phrase with desc deprecated - Search tag in pkg2.TestAnnotationType",
+ + "search phrase with desc deprecated - Search tag in pkg2.TestAnnotationType",
""
- + "SearchTagDeprecatedClass - Search tag in pkg2.TestClass",
+ + "SearchTagDeprecatedClass - Search tag in pkg2.TestClass",
""
- + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
+ + "search phrase deprecated - Search tag in pkg2.TestEnum.ONE",
""
- + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError",
+ + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError",
"",
+ + " SearchTagDeprecatedClass",
"");
+ + " method SearchTagDeprecatedMethod");
}
void checkJavaFXOutput() {