Unused sun.nio.fs.Reflect

Claes Redestad claes.redestad at oracle.com
Mon Apr 4 08:37:56 UTC 2022



On 2022-04-04 09:06, Alan Bateman wrote:
> On 02/04/2022 21:45, Claes Redestad wrote:
>> :
>>
>> There's a sibling 'sun.nio.ch.Reflect' where a couple of methods are
>> still dubiously in use in one place only in
>> sun.nio.ch.InheritedChannel::createChannel to reflectively create a
>> java.io.FileDescriptor. Perhaps that could be refactored to use
>> jdk.internal.access.JavaIOFileDescriptorAccess, in which case we could
>> get rid of both of these. Would be more efficient (if it matters) but
>> also consolidate internal hacking to fewer places.
> There are a number of left overs in ch.Reflect that can be removed. 
> However we have to careful about changing anything sockets based to use 
> JavaIOFileDescriptorAccess as handle != socket on Windows. This area is 
> lower level than java.io and requires direct control of the file 
> descriptors.
> 

What I had in mind was exposing the exact constructor that
InheritedChannel is invoking via reflection to keep semantics identical.
Nothing important though, cleaning out the unused stuff is a good step
for now.

/Claes


More information about the nio-dev mailing list