RFR(JDK 12/java.xml) 8213734: SAXParser.parse(File, ..) does not close resources when Exception occurs.

Lance Andersen lance.andersen at oracle.com
Thu Nov 29 20:32:30 UTC 2018

Looks OK Joe!

> On Nov 29, 2018, at 3:25 PM, Joe Wang <huizhe.wang at oracle.com> wrote:
> Thanks Lance. Changed the for loop to a while loop:
> http://cr.openjdk.java.net/~joehw/jdk12/8213734/webrev_02/
> previous:
> http://cr.openjdk.java.net/~joehw/jdk12/8213734/webrev_01/
> -Joe
> On 11/29/18, 11:17 AM, Joe Wang wrote:
>> Hi,
>> Please review a fix for the issue as reported that the SAXParser does not close the underlying reader. This code always existed in Xerces, but it was somehow removed as the comment for the closeReaders method showed. The comment stated "readers are closed in the endEntity method", that is true in general. However when the parsing is interrupted, as in this case by an Exception, the endEntity method won't get called, but closeReaders does through the Parser's cleanup process. This patch recovers the original Xerces' code.
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8213734
>> webrev: http://cr.openjdk.java.net/~joehw/jdk12/8213734/webrev/
>> Thanks,
>> Joe

 <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif>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 <mailto:Lance.Andersen at oracle.com>

More information about the core-libs-dev mailing list