On Mon, 4 Dec 2023 07:29:37 GMT, Per Minborg <pminb...@openjdk.org> wrote:

> This PR proposes to reject paths provided to the 
> `SymbolLookup.libraryLookup(Path path, Arena arena)` method if a path is not 
> in the default file system.

src/java.base/share/classes/java/lang/foreign/SymbolLookup.java line 297:

> 295:         Reflection.ensureNativeAccess(Reflection.getCallerClass(),
> 296:                 SymbolLookup.class, "libraryLookup");
> 297:         if (!path.getFileSystem().equals(FileSystems.getDefault())) {

This trusts the custom provider's equals implementation, which might be okay 
but you can use == here instead.

I think I would probably expand the text of the existing IAE description to say 
that IAE is thrown if the path is not associated with the default file system 
or not a path to a valid library.

It's a new testable assertion so I assume we should add a new test and track 
the spec change with a CSR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16944#discussion_r1413475612

Reply via email to