On 27/05/2015 17:01, Xueming Shen wrote:
I'm aware of converting the options to internal flags in unix fs, but
thought that is for the convenience...
We are not saving the options for any future/internal use, simply
checking its value on the spot. Just wonder
really need to make the defensive copy here? The invoker changes the
options during the invocation of this
method?
Yes because otherwise the validation can be bypassed.
ZipFileSystem.newFileChannel is a good example where it is copying the
options (to add CREATE_NEW) after it validates when it should make the
copy first to avoid the options changing under its feet. There may be a
few places in the ZIP provider where this should be done.
-Alan.