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

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

XMLWordPrintable

    • b22
    • x86_64
    • windows

        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/./

              tnakamura Toshio Nakamura
              tnakamura Toshio Nakamura
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: