Could someone take another look at my submitted bug regarding class names?

Archie Cobbs archie.cobbs at gmail.com
Mon Feb 20 17:54:47 UTC 2023


On Mon, Feb 20, 2023 at 10:39 AM Ethan McCue <ethan at mccue.dev> wrote:

> To throw a unicode wrench in the mix.
>

Hah!

Here's the root cause:

$ cat FileSystem.java
import java.nio.file.*;
public class FileSystem {

    public static void main(String[] args) {
        String s = "cafe\u0301";
        showUTF(s);
        String t = FileSystems.getDefault().getPath(s).toString();
        showUTF(t);
    }

    public static void showUTF(String s) {
        StringBuilder buf = new StringBuilder(s.length() * 3);
        for (int i = 0; i < s.length(); i++) {
            if (i > 0)
                buf.append(' ');
            buf.append(String.format("%04x", (int)s.charAt(i)));
        }
        System.out.println(buf);
    }
}
$ javac FileSystem.java && java FileSystem
0063 0061 0066 0065 0301
0063 0061 0066 00e9

Looks like this happens on MacOS because
MacOSXFileSystem.normalizeNativePath() invokes
MacOSXNativeDispatcher.normalizepath().

Should this be considered a bug?

-Archie

-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20230220/c65630fa/attachment.htm>


More information about the compiler-dev mailing list