Unused sun.nio.fs.Reflect
Claes Redestad
claes.redestad at oracle.com
Sat Apr 2 20:45:58 UTC 2022
On 2022-04-02 19:40, Alan Bateman wrote:
> On 02/04/2022 16:56, Andrey Turbanov wrote:
>> Hello.
>> As I can see, the class 'sun.nio.fs.Reflect' is unused in JDK java code.
>> Is it somehow used by VM, or is it just leftovers from some refactorings?
>> I wonder if we can drop it.
>>
> It was needed at one point but if no longer used on any platform then it
> should be okay to remove.
I can't find any usage.
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.
Thanks!
/Claes
More information about the nio-dev
mailing list