You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Andreas Hartmann (JIRA)" <xa...@xml.apache.org> on 2005/06/22 11:20:27 UTC

[jira] Created: (XALANJ-2154) [XSLTC] Parser: NullPointerException when _locator is null

[XSLTC] Parser: NullPointerException when _locator is null
----------------------------------------------------------

         Key: XALANJ-2154
         URL: http://issues.apache.org/jira/browse/XALANJ-2154
     Project: XalanJ2
        Type: Bug
  Components: XSLTC  
    Reporter: Andreas Hartmann


The exception is caused by the following change (it works with Xalan 2.6.0):

http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java?r1=1.64&r2=1.65&diff_format=h

===================================================================
RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- Parser.java	2004/02/23 10:29:35	1.64
+++ Parser.java	2004/05/21 20:29:28	1.65
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 /*
- * $Id: Parser.java,v 1.64 2004/02/23 10:29:35 aruny Exp $
+ * $Id: Parser.java,v 1.65 2004/05/21 20:29:28 santiagopg Exp $
  */
 
 package org.apache.xalan.xsltc.compiler;
@@ -965,7 +965,10 @@
 		    }
 		}
 	    }
-	    if (node == null) node = new LiteralElement();
+	    if (node == null) {
+                node = new LiteralElement();
+                node.setLineNumber(_locator.getLineNumber());
+            }
 	}
 	if ((node != null) && (node instanceof LiteralElement)) {
 	    ((LiteralElement)node).setQName(qname);

+++++++++++++++++++++++++

Unfortunately I'm not familiar enough with the code to know if a "_locator != null" check would be sufficient.


Stack trace:

org.apache.xalan.xsltc.TransletException: java.lang.NullPointerException
	at org.apache.xalan.xsltc.dom.SAXImpl.shallowCopy(SAXImpl.java:1735)
	at org.apache.xalan.xsltc.dom.DOMAdapter.shallowCopy(DOMAdapter.java:314)
	at page2xslt.applyTemplates()
	at page2xslt.applyTemplates()
	at page2xslt.applyTemplates()
	at page2xslt.applyTemplates()
	at page2xslt.applyTemplates()
	at page2xslt.transform()
	at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:592)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2154) [XSLTC] Parser: NullPointerException when _locator is null

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2154?page=comments#action_12315533 ] 

Brian Minchau commented on XALANJ-2154:
---------------------------------------

Andreas,
the code change was clearly to add a bit more location information about where the literal element is in the stylesheet.

For what ever reason _locator is null.  It would be easy to add that check 
before calling node.setLineNumber(_locator.getLineNumber()); 

A testcase would be nice, but this one seems trivial enough to fix.


> [XSLTC] Parser: NullPointerException when _locator is null
> ----------------------------------------------------------
>
>          Key: XALANJ-2154
>          URL: http://issues.apache.org/jira/browse/XALANJ-2154
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Reporter: Andreas Hartmann

>
> The exception is caused by the following change (it works with Xalan 2.6.0):
> http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java?r1=1.64&r2=1.65&diff_format=h
> ===================================================================
> RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
> retrieving revision 1.64
> retrieving revision 1.65
> diff -u -r1.64 -r1.65
> --- Parser.java	2004/02/23 10:29:35	1.64
> +++ Parser.java	2004/05/21 20:29:28	1.65
> @@ -14,7 +14,7 @@
>   * limitations under the License.
>   */
>  /*
> - * $Id: Parser.java,v 1.64 2004/02/23 10:29:35 aruny Exp $
> + * $Id: Parser.java,v 1.65 2004/05/21 20:29:28 santiagopg Exp $
>   */
>  
>  package org.apache.xalan.xsltc.compiler;
> @@ -965,7 +965,10 @@
>  		    }
>  		}
>  	    }
> -	    if (node == null) node = new LiteralElement();
> +	    if (node == null) {
> +                node = new LiteralElement();
> +                node.setLineNumber(_locator.getLineNumber());
> +            }
>  	}
>  	if ((node != null) && (node instanceof LiteralElement)) {
>  	    ((LiteralElement)node).setQName(qname);
> +++++++++++++++++++++++++
> Unfortunately I'm not familiar enough with the code to know if a "_locator != null" check would be sufficient.
> Stack trace:
> org.apache.xalan.xsltc.TransletException: java.lang.NullPointerException
> 	at org.apache.xalan.xsltc.dom.SAXImpl.shallowCopy(SAXImpl.java:1735)
> 	at org.apache.xalan.xsltc.dom.DOMAdapter.shallowCopy(DOMAdapter.java:314)
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.transform()
> 	at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:592)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Resolved: (XALANJ-2154) [XSLTC] Parser: NullPointerException when _locator is null

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2154?page=all ]
     
Brian Minchau resolved XALANJ-2154:
-----------------------------------

    Resolution: Fixed

The patch in this issue was applied to Apache CVS HEAD branch.

> [XSLTC] Parser: NullPointerException when _locator is null
> ----------------------------------------------------------
>
>          Key: XALANJ-2154
>          URL: http://issues.apache.org/jira/browse/XALANJ-2154
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Reporter: Andreas Hartmann
>  Attachments: 2154.Parser.patch.txt
>
> The exception is caused by the following change (it works with Xalan 2.6.0):
> http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java?r1=1.64&r2=1.65&diff_format=h
> ===================================================================
> RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
> retrieving revision 1.64
> retrieving revision 1.65
> diff -u -r1.64 -r1.65
> --- Parser.java	2004/02/23 10:29:35	1.64
> +++ Parser.java	2004/05/21 20:29:28	1.65
> @@ -14,7 +14,7 @@
>   * limitations under the License.
>   */
>  /*
> - * $Id: Parser.java,v 1.64 2004/02/23 10:29:35 aruny Exp $
> + * $Id: Parser.java,v 1.65 2004/05/21 20:29:28 santiagopg Exp $
>   */
>  
>  package org.apache.xalan.xsltc.compiler;
> @@ -965,7 +965,10 @@
>  		    }
>  		}
>  	    }
> -	    if (node == null) node = new LiteralElement();
> +	    if (node == null) {
> +                node = new LiteralElement();
> +                node.setLineNumber(_locator.getLineNumber());
> +            }
>  	}
>  	if ((node != null) && (node instanceof LiteralElement)) {
>  	    ((LiteralElement)node).setQName(qname);
> +++++++++++++++++++++++++
> Unfortunately I'm not familiar enough with the code to know if a "_locator != null" check would be sufficient.
> Stack trace:
> org.apache.xalan.xsltc.TransletException: java.lang.NullPointerException
> 	at org.apache.xalan.xsltc.dom.SAXImpl.shallowCopy(SAXImpl.java:1735)
> 	at org.apache.xalan.xsltc.dom.DOMAdapter.shallowCopy(DOMAdapter.java:314)
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.transform()
> 	at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:592)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Updated: (XALANJ-2154) [XSLTC] Parser: NullPointerException when _locator is null

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2154?page=all ]

Brian Minchau updated XALANJ-2154:
----------------------------------

    Attachment: 2154.Parser.patch.txt

The suggestion by Andreas is correct. Other places in Parser use the private field _locator. Sometimes they check
for null, sometimes they don't. Whether _locator is null or not depends on the set.

There are other places that were also not careful about checking for null, mostly in error message
production, which is code that is very infrequently exercised. However it is bad to get a null pointer
exception when trying to produce an error message for a different reason.

I took Andreas suggestion and added a simple getLineNumber() method 
uses _locator if it is non-null, or returns zero, and used this method throughout.


> [XSLTC] Parser: NullPointerException when _locator is null
> ----------------------------------------------------------
>
>          Key: XALANJ-2154
>          URL: http://issues.apache.org/jira/browse/XALANJ-2154
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Reporter: Andreas Hartmann
>  Attachments: 2154.Parser.patch.txt
>
> The exception is caused by the following change (it works with Xalan 2.6.0):
> http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java?r1=1.64&r2=1.65&diff_format=h
> ===================================================================
> RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
> retrieving revision 1.64
> retrieving revision 1.65
> diff -u -r1.64 -r1.65
> --- Parser.java	2004/02/23 10:29:35	1.64
> +++ Parser.java	2004/05/21 20:29:28	1.65
> @@ -14,7 +14,7 @@
>   * limitations under the License.
>   */
>  /*
> - * $Id: Parser.java,v 1.64 2004/02/23 10:29:35 aruny Exp $
> + * $Id: Parser.java,v 1.65 2004/05/21 20:29:28 santiagopg Exp $
>   */
>  
>  package org.apache.xalan.xsltc.compiler;
> @@ -965,7 +965,10 @@
>  		    }
>  		}
>  	    }
> -	    if (node == null) node = new LiteralElement();
> +	    if (node == null) {
> +                node = new LiteralElement();
> +                node.setLineNumber(_locator.getLineNumber());
> +            }
>  	}
>  	if ((node != null) && (node instanceof LiteralElement)) {
>  	    ((LiteralElement)node).setQName(qname);
> +++++++++++++++++++++++++
> Unfortunately I'm not familiar enough with the code to know if a "_locator != null" check would be sufficient.
> Stack trace:
> org.apache.xalan.xsltc.TransletException: java.lang.NullPointerException
> 	at org.apache.xalan.xsltc.dom.SAXImpl.shallowCopy(SAXImpl.java:1735)
> 	at org.apache.xalan.xsltc.dom.DOMAdapter.shallowCopy(DOMAdapter.java:314)
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.transform()
> 	at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:592)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Updated: (XALANJ-2154) [XSLTC] Parser: NullPointerException when _locator is null

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2154?page=all ]

Brian Minchau updated XALANJ-2154:
----------------------------------

      Xalan info: [PatchAvailable]
        reviewer: santiago.pericasgeertsen@sun.com
    fix-priority: fp2

Marking patch available, fp2, reviewer to Santiago P.G.

> [XSLTC] Parser: NullPointerException when _locator is null
> ----------------------------------------------------------
>
>          Key: XALANJ-2154
>          URL: http://issues.apache.org/jira/browse/XALANJ-2154
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Reporter: Andreas Hartmann
>  Attachments: 2154.Parser.patch.txt
>
> The exception is caused by the following change (it works with Xalan 2.6.0):
> http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java?r1=1.64&r2=1.65&diff_format=h
> ===================================================================
> RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
> retrieving revision 1.64
> retrieving revision 1.65
> diff -u -r1.64 -r1.65
> --- Parser.java	2004/02/23 10:29:35	1.64
> +++ Parser.java	2004/05/21 20:29:28	1.65
> @@ -14,7 +14,7 @@
>   * limitations under the License.
>   */
>  /*
> - * $Id: Parser.java,v 1.64 2004/02/23 10:29:35 aruny Exp $
> + * $Id: Parser.java,v 1.65 2004/05/21 20:29:28 santiagopg Exp $
>   */
>  
>  package org.apache.xalan.xsltc.compiler;
> @@ -965,7 +965,10 @@
>  		    }
>  		}
>  	    }
> -	    if (node == null) node = new LiteralElement();
> +	    if (node == null) {
> +                node = new LiteralElement();
> +                node.setLineNumber(_locator.getLineNumber());
> +            }
>  	}
>  	if ((node != null) && (node instanceof LiteralElement)) {
>  	    ((LiteralElement)node).setQName(qname);
> +++++++++++++++++++++++++
> Unfortunately I'm not familiar enough with the code to know if a "_locator != null" check would be sufficient.
> Stack trace:
> org.apache.xalan.xsltc.TransletException: java.lang.NullPointerException
> 	at org.apache.xalan.xsltc.dom.SAXImpl.shallowCopy(SAXImpl.java:1735)
> 	at org.apache.xalan.xsltc.dom.DOMAdapter.shallowCopy(DOMAdapter.java:314)
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.transform()
> 	at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:592)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2154) [XSLTC] Parser: NullPointerException when _locator is null

Posted by "Santiago Pericas-Geertsen (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2154?page=comments#action_12315869 ] 

Santiago Pericas-Geertsen commented on XALANJ-2154:
---------------------------------------------------

Patch by Brian looks good: approved.

> [XSLTC] Parser: NullPointerException when _locator is null
> ----------------------------------------------------------
>
>          Key: XALANJ-2154
>          URL: http://issues.apache.org/jira/browse/XALANJ-2154
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Reporter: Andreas Hartmann
>  Attachments: 2154.Parser.patch.txt
>
> The exception is caused by the following change (it works with Xalan 2.6.0):
> http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java?r1=1.64&r2=1.65&diff_format=h
> ===================================================================
> RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
> retrieving revision 1.64
> retrieving revision 1.65
> diff -u -r1.64 -r1.65
> --- Parser.java	2004/02/23 10:29:35	1.64
> +++ Parser.java	2004/05/21 20:29:28	1.65
> @@ -14,7 +14,7 @@
>   * limitations under the License.
>   */
>  /*
> - * $Id: Parser.java,v 1.64 2004/02/23 10:29:35 aruny Exp $
> + * $Id: Parser.java,v 1.65 2004/05/21 20:29:28 santiagopg Exp $
>   */
>  
>  package org.apache.xalan.xsltc.compiler;
> @@ -965,7 +965,10 @@
>  		    }
>  		}
>  	    }
> -	    if (node == null) node = new LiteralElement();
> +	    if (node == null) {
> +                node = new LiteralElement();
> +                node.setLineNumber(_locator.getLineNumber());
> +            }
>  	}
>  	if ((node != null) && (node instanceof LiteralElement)) {
>  	    ((LiteralElement)node).setQName(qname);
> +++++++++++++++++++++++++
> Unfortunately I'm not familiar enough with the code to know if a "_locator != null" check would be sufficient.
> Stack trace:
> org.apache.xalan.xsltc.TransletException: java.lang.NullPointerException
> 	at org.apache.xalan.xsltc.dom.SAXImpl.shallowCopy(SAXImpl.java:1735)
> 	at org.apache.xalan.xsltc.dom.DOMAdapter.shallowCopy(DOMAdapter.java:314)
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.transform()
> 	at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:592)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Updated: (XALANJ-2154) [XSLTC] Parser: NullPointerException when _locator is null

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2154?page=all ]

Brian Minchau updated XALANJ-2154:
----------------------------------

    Fix Version: 2.7

> [XSLTC] Parser: NullPointerException when _locator is null
> ----------------------------------------------------------
>
>          Key: XALANJ-2154
>          URL: http://issues.apache.org/jira/browse/XALANJ-2154
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Reporter: Andreas Hartmann
>      Fix For: 2.7
>  Attachments: 2154.Parser.patch.txt
>
> The exception is caused by the following change (it works with Xalan 2.6.0):
> http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java?r1=1.64&r2=1.65&diff_format=h
> ===================================================================
> RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
> retrieving revision 1.64
> retrieving revision 1.65
> diff -u -r1.64 -r1.65
> --- Parser.java	2004/02/23 10:29:35	1.64
> +++ Parser.java	2004/05/21 20:29:28	1.65
> @@ -14,7 +14,7 @@
>   * limitations under the License.
>   */
>  /*
> - * $Id: Parser.java,v 1.64 2004/02/23 10:29:35 aruny Exp $
> + * $Id: Parser.java,v 1.65 2004/05/21 20:29:28 santiagopg Exp $
>   */
>  
>  package org.apache.xalan.xsltc.compiler;
> @@ -965,7 +965,10 @@
>  		    }
>  		}
>  	    }
> -	    if (node == null) node = new LiteralElement();
> +	    if (node == null) {
> +                node = new LiteralElement();
> +                node.setLineNumber(_locator.getLineNumber());
> +            }
>  	}
>  	if ((node != null) && (node instanceof LiteralElement)) {
>  	    ((LiteralElement)node).setQName(qname);
> +++++++++++++++++++++++++
> Unfortunately I'm not familiar enough with the code to know if a "_locator != null" check would be sufficient.
> Stack trace:
> org.apache.xalan.xsltc.TransletException: java.lang.NullPointerException
> 	at org.apache.xalan.xsltc.dom.SAXImpl.shallowCopy(SAXImpl.java:1735)
> 	at org.apache.xalan.xsltc.dom.DOMAdapter.shallowCopy(DOMAdapter.java:314)
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.transform()
> 	at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:592)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2154) [XSLTC] Parser: NullPointerException when _locator is null

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2154?page=comments#action_12319263 ] 

Brian Minchau commented on XALANJ-2154:
---------------------------------------

Andreas,
this fix made it into the 2.7 release of Xalan-J. Please confirm that this problem is fixed to your satisfaction so that we can close this issue.

> [XSLTC] Parser: NullPointerException when _locator is null
> ----------------------------------------------------------
>
>          Key: XALANJ-2154
>          URL: http://issues.apache.org/jira/browse/XALANJ-2154
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Reporter: Andreas Hartmann
>      Fix For: 2.7
>  Attachments: 2154.Parser.patch.txt
>
> The exception is caused by the following change (it works with Xalan 2.6.0):
> http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java?r1=1.64&r2=1.65&diff_format=h
> ===================================================================
> RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
> retrieving revision 1.64
> retrieving revision 1.65
> diff -u -r1.64 -r1.65
> --- Parser.java	2004/02/23 10:29:35	1.64
> +++ Parser.java	2004/05/21 20:29:28	1.65
> @@ -14,7 +14,7 @@
>   * limitations under the License.
>   */
>  /*
> - * $Id: Parser.java,v 1.64 2004/02/23 10:29:35 aruny Exp $
> + * $Id: Parser.java,v 1.65 2004/05/21 20:29:28 santiagopg Exp $
>   */
>  
>  package org.apache.xalan.xsltc.compiler;
> @@ -965,7 +965,10 @@
>  		    }
>  		}
>  	    }
> -	    if (node == null) node = new LiteralElement();
> +	    if (node == null) {
> +                node = new LiteralElement();
> +                node.setLineNumber(_locator.getLineNumber());
> +            }
>  	}
>  	if ((node != null) && (node instanceof LiteralElement)) {
>  	    ((LiteralElement)node).setQName(qname);
> +++++++++++++++++++++++++
> Unfortunately I'm not familiar enough with the code to know if a "_locator != null" check would be sufficient.
> Stack trace:
> org.apache.xalan.xsltc.TransletException: java.lang.NullPointerException
> 	at org.apache.xalan.xsltc.dom.SAXImpl.shallowCopy(SAXImpl.java:1735)
> 	at org.apache.xalan.xsltc.dom.DOMAdapter.shallowCopy(DOMAdapter.java:314)
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.transform()
> 	at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:592)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2154) [XSLTC] Parser: NullPointerException when _locator is null

Posted by "Andreas Hartmann (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2154?page=comments#action_12315696 ] 

Andreas Hartmann commented on XALANJ-2154:
------------------------------------------

Brian, thank you very much!

> [XSLTC] Parser: NullPointerException when _locator is null
> ----------------------------------------------------------
>
>          Key: XALANJ-2154
>          URL: http://issues.apache.org/jira/browse/XALANJ-2154
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Reporter: Andreas Hartmann
>  Attachments: 2154.Parser.patch.txt
>
> The exception is caused by the following change (it works with Xalan 2.6.0):
> http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java?r1=1.64&r2=1.65&diff_format=h
> ===================================================================
> RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
> retrieving revision 1.64
> retrieving revision 1.65
> diff -u -r1.64 -r1.65
> --- Parser.java	2004/02/23 10:29:35	1.64
> +++ Parser.java	2004/05/21 20:29:28	1.65
> @@ -14,7 +14,7 @@
>   * limitations under the License.
>   */
>  /*
> - * $Id: Parser.java,v 1.64 2004/02/23 10:29:35 aruny Exp $
> + * $Id: Parser.java,v 1.65 2004/05/21 20:29:28 santiagopg Exp $
>   */
>  
>  package org.apache.xalan.xsltc.compiler;
> @@ -965,7 +965,10 @@
>  		    }
>  		}
>  	    }
> -	    if (node == null) node = new LiteralElement();
> +	    if (node == null) {
> +                node = new LiteralElement();
> +                node.setLineNumber(_locator.getLineNumber());
> +            }
>  	}
>  	if ((node != null) && (node instanceof LiteralElement)) {
>  	    ((LiteralElement)node).setQName(qname);
> +++++++++++++++++++++++++
> Unfortunately I'm not familiar enough with the code to know if a "_locator != null" check would be sufficient.
> Stack trace:
> org.apache.xalan.xsltc.TransletException: java.lang.NullPointerException
> 	at org.apache.xalan.xsltc.dom.SAXImpl.shallowCopy(SAXImpl.java:1735)
> 	at org.apache.xalan.xsltc.dom.DOMAdapter.shallowCopy(DOMAdapter.java:314)
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.applyTemplates()
> 	at page2xslt.transform()
> 	at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:592)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org