On Thu, 11 Sep 2025 09:56:30 GMT, David Beaumont <d...@openjdk.org> wrote:

>> If something shouldn't happen, I would prefer an explicit exception or at 
>> least an assert.
>
> Not 100% sure it's impossible to tickle this with current callers (e.g. 
> "jrt:/module//path" leaving the trailing path starting with a '/') so I'd 
> rather not risk triggering IAE in existing code.

Thinking about it, it might be sufficient to test that the module name doesn't 
contain '/'. I'm not sure that rejecting a leading '/' in the path matters for 
correctness (the implied resource name would be "/&lt;mod&gt;//&lt;path&gt;" 
and these never exist anyway).

What I'm trying to protect against is having the concatentation of:
"/" + &lt;mod-name&gt; + "/" + &lt;path&gt;
be unexpectedly a different resource (e.g. module name is "java.base/java", 
path is "lang/Object.class").

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27203#discussion_r2340481195

Reply via email to