RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE)
huizhe.wang at oracle.com
Wed Jul 24 06:59:04 UTC 2013
On 7/23/2013 11:00 PM, Daniel Fuchs wrote:
> Hi Joe,
> This looks reasonable.
> Out of curiosity - could it be that it was fSAXParser that was null,
> and not fSecurityPropertyMgr?
> JAXPSAXParser has a no arg public constructor that could have lead to
That was my suspicion as well. I thought NetBeans was referencing the
internal class directly since the new JAXPSAXParser(this) inside
SAXParserImpl was the only call in the entire jaxp code. I was therefore
thinking it really should have been a private class. Of course, once
NetBeans bugzilla became accessible (it was down at the time), I was
able to get the error stacktrace.
There is still something strange since XMLReaderManager.getXMLReader
calls XMLReaderFactory which should have returned SAXParser since it's
hardcoded default. In a manual test, I could only get a JAXPSAXParser if
I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm asking
the NetBeans reporter and haven't heard from him yet.
> I have only one remark:
> It looks as if fSecurityPropertyMgr could be declared final in both
> classes - and I think it
> would be better if it were: it would make it clear that it's never
> replaced in fSAXParser
> and that therefore your new code is strictly equivalent to the old in
> that respect.
> best regards,
> -- daniel
> On 7/24/13 4:01 AM, huizhe wang wrote:
>> Hi Lance, Chris,
>> Looking at the affected class , and the error stack trace  , it
>> appeared that in SAXParserImpl$JAXPSAXParser , line 545,
>> fSAXParser.fSecurityPropertyMgr is null when setProperty is called.
>> fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor
>> after JAXPSAXParser was. I can see a chance where the NetBeans got a
>> copy of JAXPSAXParser instance with fSecurityPropertyMgr not
>> initialized. The fix is to remove the reference of
>> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when
>> JAXPSAXParser is created.
>> Here is the webrev:
>> Caused by: java.lang.NullPointerException
>> ... 43 more
>> javax.xml.transform.TransformerException: java.lang.NullPointerException
More information about the core-libs-dev