TransfomerImpl.transformNode() Fails to throw some errors due to
NullPointerException
--------------------------------------------------------------------------------------
Key: XALANJ-2462
URL: https://issues.apache.org/jira/browse/XALANJ-2462
Project: XalanJ2
Issue Type: Bug
Security Level: No security risk; visible to anyone (Ordinary problems in
Xalan projects. Anybody can view the issue.)
Components: Xalan
Affects Versions: 2.7.1
Environment: WinXp, using FOP to build PDF from xml and xlst files.
Reporter: Brendan
(Maybe related to bug: XALANJ-2314)
internal to the transformNode(int node) method,
If a TransformerException is thrown,
but the error has no SAXSourceLocator (occurs on FOP processing if a node is
missing its close tag in the xslt file)
then the method doesnot reach the line
m_serializationHandler.fatalError(SAXParseException e) as a
NullPointerException occurs.
Fix is....
[Find and remove the following]
- SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() );
- m_serializationHandler.fatalError(new
org.xml.sax.SAXParseException(te.getMessage(), sl, te));
[Replace with]
+ SourceLocator locator=te.getLocator();
+ if (locator==null) {
+ m_serializationHandler.fatalError(new
org.xml.sax.SAXParseException(te.getMessage(), null, te));
+ } else {
+ SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() );
+ m_serializationHandler.fatalError(new
org.xml.sax.SAXParseException(te.getMessage(), sl, te));
+ }
...now why there is no locator throw is another bug...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]