JDK 10 RFR of 8147615: (fc) FileChannelImpl has no finalizer

Brian Burkhalter brian.burkhalter at oracle.com
Tue Sep 5 22:02:34 UTC 2017


Hi Roger,

On Sep 5, 2017, at 2:51 PM, Roger Riggs <Roger.Riggs at Oracle.com> wrote:

>> Yes, I have thought about that also. Currently JavaIOFileDescriptorAccess only contains accessor and mutator methods. I do not know whether this implies that it would be unsafe to add methods there which actually perform some function such as closing.
> Adding public methods would increase the chance of mis-use and potential incompatibilities so
> they can/should only be introduced as package private to be used in the java.io package
> or via the SharedSecrets interface/mechanism.

I understand. I have not looked through all the jdk.internal.misc.Java<Subcomponent/><ClassName/>Access classes, but it seems like in general the methods defined allow only modification of the state of an instance of <ClassName/> and not the state of an instance of some other class to which the instance of <ClassName/> refers. Having some sort of close() on a FileDescriptor which could be invoked via JavaIOFileDescriptorAccess would allow any attached FIS/FOS/RAF to be closed as well and it was not clear to me whether this sort of behavior was intended.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20170905/401996db/attachment.html>


More information about the nio-dev mailing list