JDK-8323815 : Source launcher should find classes with $ in names
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 22,23
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2024-01-16
  • Updated: 2024-01-30
  • Resolved: 2024-01-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 23
23 b07Fixed
Related Reports
Relates :  
Description
The following two-file setup of `Prog.java` and `Helper$123.java` reading:

Prog.java

    class Prog {
        public static void main(String[] args) { System.out.println(Helper$123.class); }
    }

Helper$123.java

    class Helper$123 {}

yields:

Exception in thread "main" java.lang.NoClassDefFoundError: Helper$123
        at Prog.main(Prog.java:2)
Caused by: java.lang.ClassNotFoundException: Helper$123
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        at jdk.compiler/com.sun.tools.javac.launcher.MemoryClassLoader.loadClass(MemoryClassLoader.java:125)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        at Prog.main(Prog.java:2)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.execute(SourceLauncher.java:264)
        at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.run(SourceLauncher.java:153)
        at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.main(SourceLauncher.java:78)


Comments
Changeset: c702dcab Author: Christian Stein <cstein@openjdk.org> Date: 2024-01-24 19:05:15 +0000 URL: https://git.openjdk.org/jdk/commit/c702dcabf8befc2db2baf53655f20391ee5d2d09
24-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17526 Date: 2024-01-23 07:06:41 +0000
23-01-2024