Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.7
-
None
-
None
Description
When a TransfomerException is thrown, a NullpointerException occurs if its locator is null:
Look at at line 1407 of org.apache.xalan.transformer.TransformerImpl in method 'transformNode':
else if(se instanceof TransformerException)
{ TransformerException te = ((TransformerException)se); SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() ); m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te)); }te.getLocator() may be null, and the SAXSourceLocator constructor fails with NPE.
It results in the fact that the foolowing line is not call and the regular SAXParseException is not raised.
Then, the parsing fails silently.
I suggest:
TransformerException te = ((TransformerException)se);
SAXSourceLocator sl = null;
if (te.getLocator() !=null )
m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te));
(SAXParseException accepts null SAXSourceLocator in its constructor)