Review Request for JDK-8003992: File and other classes in java.io do not handle embedded nulls properly
Alan Bateman
Alan.Bateman at oracle.com
Wed Feb 27 10:40:21 UTC 2013
On 27/02/2013 02:31, Dan Xu wrote:
> Thank you, Mike.
>
> The reason not to throw out an exception is for the backward
> compatibility. Due to that, the constructorof File object with NUL
> willnever fail.While in NIO, it is defined in the spec to throw out
> exceptions when invalid NUL character is found.
>
> -Dan
Right, we can't change the constructor to throw an exception,
particularly if this fix is going to be back-ported to 7u. For NIO then
it's not an issue because getPath was specified from the begining to
throw the unexpected InvalidPathException when it is given garbage.
-Alan.
More information about the core-libs-dev
mailing list