RFR 8191416: (bf) DirectByteBuffer extends MappedByteBuffer, confuses instanceof tests
brian.burkhalter at oracle.com
Tue Feb 6 19:41:01 UTC 2018
On Feb 6, 2018, at 8:41 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> On 06/02/2018 01:17, Brian Burkhalter wrote:
>> As suggested in the issue description, change force(), load(), and isLoaded() to be no-ops when there is no backing file instead of throwing UnsupportedOperationException.
> It's an undocumented implementation detail that a direct buffer is a MappedByteBuffer. This dates back to the original implementation, is complicated to change, and maybe we should put the effort re-visiting it.
So skip this mitigation or go ahead with it and follow with a more thorough re-visiting under a separate issue?
> I read this patch as a short term mitigation for those that test if a buffer is a MappedByteBuffer so they can call force. I guess it's okay although I do wonder if this mitigation should be limited to force and don't touch loaded/isLoaded.
These seem harmless however.
> Minor comment is that the other methods uses "mapping" in the name so maybe hasFileMapping might be better.
I’ll change it.
On Feb 6, 2018, at 8:42 AM, Roger Riggs <Roger.Riggs at Oracle.com> wrote:
> (I'm not sure I would describe the behavior as a no-op; since I think they do achieve the invariant as defined).
OK can change the description.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nio-dev