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

java --describe-module failed with non-ASCII module name under non-UTF8 environment

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11, 14, 15
    • Fix Version/s: 15
    • Component/s: tools
    • Labels:
    • Environment:

      Windows Server 2016 Japanese

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

      Description

      FULL PRODUCT VERSION :
      openjdk version "15-ea" 2020-09-15
      OpenJDK Runtime Environment (build 15-ea+19-827)
      OpenJDK 64-Bit Server VM (build 15-ea+19-827, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows Server 2016 Japanese

      A DESCRIPTION OF THE PROBLEM :
      Under non-UTF8 environment, such as Windows Japanese or Chinese,
      "--describe-module" option with non-ASCII module name cannot find the module.

      In the example below, we used "Hiragana letter A", U+3042, in the module name.

      This is separated from javac's issue JDK-8233829.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Source codes are below.
      1. > javac -d . test.java module-info.java
      2. > java --module-path . --describe-module あ_module

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected:
      >java --module-path . --describe-module あ_module
      あ_module file:///C:/module/src/./
      exports com.test
      requires java.base mandated

      Actual:
      >java --module-path . --describe-module あ_module
      ??_modu not found (in Japanese)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      --- module-info.java ---
      module あ_module {
          exports com.test;
      }
      ------------------------
      --- test.java ---
      package com.test;

      public class test{
          public static void main(String[] args) {
              System.out.println("hello");
          }
      }
      -----------------

      ---------- END SOURCE ---------- 

      Additional Information:
      --list-modules option can list correctly.
      > java.exe --list-modules -p .
      (snip)
      jdk.unsupported@15-ea
      jdk.unsupported.desktop@15-ea
      jdk.xml.dom@15-ea
      jdk.zipfs@15-ea
      あ_module file:///C:/module/src/./

        Attachments

          Activity

            People

            • Assignee:
              tnakamura Toshio Nakamura
              Reporter:
              tnakamura Toshio Nakamura
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: