# HG changeset patch
# User bpatel
# Date 1479345728 28800
# Node ID 9d3e0f34348c21107892cd62ed08b2152e2a5da5
# Parent 251bfd8289ee895f3e8ec38b2348ac08da017c1f
8147890: Javadoc search does not work with Enums
Reviewed-by: jjg, ksrini
diff -r 251bfd8289ee -r 9d3e0f34348c langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java Wed Nov 16 13:47:25 2016 -0800
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java Wed Nov 16 17:22:08 2016 -0800
@@ -166,6 +166,7 @@
adjustIndexMap(utils.getFields(te));
adjustIndexMap(utils.getMethods(te));
adjustIndexMap(utils.getConstructors(te));
+ adjustIndexMap(utils.getEnumConstants(te));
}
diff -r 251bfd8289ee -r 9d3e0f34348c langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java
--- a/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java Wed Nov 16 13:47:25 2016 -0800
+++ b/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java Wed Nov 16 17:22:08 2016 -0800
@@ -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 @@
// 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() {