[9] RFR of 8143394: PushbackReader throws NullPointerException
Brian Burkhalter
brian.burkhalter at oracle.com
Fri Dec 4 00:23:24 UTC 2015
Please review at your convenience.
Issue: https://bugs.openjdk.java.net/browse/JDK-8143394
Patch: http://cr.openjdk.java.net/~bpb/8143394/webrev.00/
The NPE apparently occurred in PushbackReader because a call to close() was made after the conditional at line 72 was evaluated to ‘false’ but before the variable ‘buf’ was dereferenced at line 87. The fix is to change close() to use the ‘lock’ variable as in the other methods. Similar problems were found to exist in CharArrayReader and StringReader. The test reliably reproduces the NPE in all three classes with the NPE in PushbackReader being reproduced frequently and the NPE in the other classes less so.
Thanks,
Brian
More information about the core-libs-dev
mailing list