RFR: 8367005: ImageReader refactor caused performance regressions for startup and footprint [v8]
Alan Bateman
alanb at openjdk.org
Tue Sep 16 11:49:30 UTC 2025
On Tue, 16 Sep 2025 10:06:21 GMT, David Beaumont <duke at openjdk.org> wrote:
>> Fair enough. I'll look at the callers and see if there's any route by which an "invalid" module name could appear. Though I already have to assume nobody uses "modules" or "packages" as the module name.
>
> It looks like ModuleDescriptor.Builder could be used in non-strict mode to get a module with a '/' in its name which might be passed to this code. And as this is a public class (albeit internal) it's possible someone does this.
> So adding an IAE would make things blow up in a way it didn't before. I assume you're happy with this.
The strict mode is for the API, it is aligned with the language, so can't have modules named "package" or modules with "/" in the name. It's more lenient in class files where you can use any name or character. There are a few exceptions (@ : and control chars) that require escaping. This is the "non-strict" mode that you see in the code.
In practical terms it would require changes in several areas to support module names containing "/" in the name. The launcher is just one of several places that would be tripped up. We can create an issue in JBS to track that but is low priority.
For now, I think it's okay to reject module name containing "/".
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27203#discussion_r2352169434
More information about the core-libs-dev
mailing list