RFR: 8358958: (aio) AsynchronousByteChannel.read/write should throw IAE if buffer is thread-confined [v2]

Alan Bateman alanb at openjdk.org
Thu Jun 12 06:37:25 UTC 2025


On Wed, 11 Jun 2025 07:31:05 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Alan Bateman has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Missing update to TestAsyncSocketChannels
>
> test/jdk/java/nio/channels/etc/MemorySegments.java line 663:
> 
>> 661:         Arena arena = arenaSupplier.get();
>> 662: 
>> 663:         Path file = Files.createTempFile(Path.of(""), "foo", ".dat");
> 
> Is the use of an empty `Path` instead of `Path.of(".")` intentional here? The documentation of `Path` states:
> 
> 
>> Accessing a file using an <i>empty path</i> is equivalent to accessing the default directory of the file system.
> 
> Unlike the current working directory, I couldn't find the definition of default directory. Are they the same for the default filesystem?

Path.of("") is intentional here, using Path.of(".") would work the same way. The default directory has always been the current working directory (user.dir). Maybe the docs could be clearer on this but it would be significant work to review changes to long standing API docs.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25691#discussion_r2141820293


More information about the nio-dev mailing list