changeset 44296:e9bbaeab6f49

8176794: javadoc search results sorted incorrectly on packages Reviewed-by: jjg, ksrini
author bpatel
date Wed, 15 Mar 2017 14:18:28 -0700
parents f147ed497558
children e03f5fb3714b
files langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js	Wed Mar 15 13:02:54 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js	Wed Mar 15 14:18:28 2017 -0700
@@ -229,8 +229,7 @@
                     pkg = (item.m)
                             ? (item.m + "/" + item.l)
                             : item.l;
-                    var s = nestedName(item);
-                    if (exactMatcher.test(s)) {
+                    if (exactMatcher.test(item.l)) {
                         presult.unshift(item);
                         pCount++;
                     } else if (camelCaseMatcher.test(pkg)) {
--- a/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java	Wed Mar 15 13:02:54 2017 -0700
+++ b/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java	Wed Mar 15 14:18:28 2017 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8141492 8071982 8141636 8147890 8166175 8168965
+ * @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794
  * @summary Test the search feature of javadoc.
  * @author bpatel
  * @library ../lib
@@ -489,6 +489,8 @@
                 "camelCaseMatcher.test(item.l)",
                 "var secondaryresult = new Array();",
                 "function nestedName(e) {",
-                "function sortAndConcatResults(a1, a2) {");
+                "function sortAndConcatResults(a1, a2) {",
+                "if (exactMatcher.test(item.l)) {\n"
+                + "                        presult.unshift(item);");
     }
 }