Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8213716

javadoc search not working with Japanese and Chinese locales

    Details

    • Subcomponent:
    • Resolved In Build:
      b22
    • CPU:
      x86_64
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      The problem has occurred since Java 9.

      A DESCRIPTION OF THE PROBLEM :
      The problem occurs when a JavaDoc is generated in the Japanese and, as far as I know, Chinese locale.
      When searching for a member in a class, the suggestions are displayed as "undefined.undefined.membername".
      When searching for a class, the suggestions are displayed as "classname" (without package prefix).
      Weather of the cases you cannot move to pages in spite of clicking these suggestions.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Generate JavaDoc from the attached source code in the Japanese[ja_JP] or Chinese[zh_CN] locale.
      A command line example is following:
      javadoc -J-Duser.country=JP -J-Duser.language=ja -d docs src/javadoctest/TestObject.java -encoding UTF-8 -html5

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      If you type "test" in the search box, you should see "javadoctest.TestObject" in Types category and "javadoctest.TestObject.getName()" and other members in Members category.
      ACTUAL -
      You will see "TestObject" in Types category and "undefined.undefined.TestObject()" in Members category; "getName()" method no longer hits.
      This is due to the missing package and class information that should be written in the index file "member-search-index.js" used to search for members.
      Similarly, package information is missing from "type-search-index.js" as well.

      ---------- BEGIN SOURCE ----------
      package javadoctest;

      /**
       * Object for JavaDoc generating test.
       */
      public class TestObject {
          /** value */
          int value = 0;
          /** name */
          String name = "";

          /**
           * get the value.
           *
           * @return value
           */
          public int getValue() {
              return value;
          }

          /**
           * set the value.
           *
           * @param value value
           */
          public void setValue(int value) {
              this.value = value;
          }

          /**
           * get the name.
           *
           * @return name
           */
          public String getName() {
              return name;
          }

          /**
           * set the name.
           *
           * @param name name
           */
          public void setName(String name) {
              this.name = name;
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The problem doesn't occur in the English-speaking locales.
      To avoid the problem, therefore, either just generate JavaDoc in an English-speaking locale or copy index files to the JavaDoc generated in the Japanese locale.

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              hannesw Hannes Wallnoefer
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: