8025690: Default FileHandler constructor doesn't throw NullPointerException if pattern is empty and count > 1
Lance Andersen
lance.andersen at oracle.com
Tue Sep 30 19:09:49 UTC 2014
Hi Daniel,
Shouldn't the other constructors indicate that an NPE will occur similar to the default constructor if the pattern is null?
Just curious why you chose to put the check into openFiles() if the issue is just with the default constructor?
Best,
Lance
On Sep 30, 2014, at 10:04 AM, Daniel Fuchs <daniel.fuchs at oracle.com> wrote:
> Hi,
>
> Please find below a fix for
>
> 8025690: Default FileHandler constructor doesn't
> throw NullPointerException if pattern is empty and count > 1
> https://bugs.openjdk.java.net/browse/JDK-8025690
>
> The default constructor of FileHandler is specified to throw
> a NullPointerException if the pattern property string is an
> empty string.
> (see <http://docs.oracle.com/javase/8/docs/api/java/util/logging/FileHandler.html#FileHandler-->)
> However it strangely does so only when count=1
>
> The fix adds an additional check in openFiles() to verify that
> the pattern is not empty. At this point the other constructors
> (which take a pattern as parameter) will already have thrown an
> IAE if the pattern was empty (or an NPE if it was null).
>
> http://cr.openjdk.java.net/~dfuchs/webrev_8025690/webrev.00
>
> best regards,
>
> -- daniel
Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com
More information about the core-libs-dev
mailing list