RFR: 8351556: Optimize Location.locationFor/isModuleOrientedLocation [v2]

Aleksey Shipilev shade at openjdk.org
Tue Mar 11 09:22:44 UTC 2025


On Mon, 10 Mar 2025 19:47:32 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Even better, we can move this static utility `computeIsModuleOrientedLocation` into the `new Location` anonymous class and convert it to a local class; that way we define one fewer class as well.
>
> Problem is, I need to reach the compiled `Pattern` from `JavaFileManager.Location.isModuleOrientedLocation`. So I need to make sure there is no extra leakage within the package. A single package-private static method is the smallest hole I can drill. I can take a closer look tomorrow, but it feels more reliable this way.

Yeah, it does not work, really. My attempts in creating a separate class/record for location, attempts to access it from `JavaFileManager`, munging build system to compile the interim javac correctly -- all this uglifies the patch. So I would like to go with the current version. I tidied up some comments, though.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23973#discussion_r1988770939


More information about the compiler-dev mailing list