DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12182>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12182 calling xalan:evaluate on long xpath expression crashes with ArrayIndexOutOfBoundsException Summary: calling xalan:evaluate on long xpath expression crashes with ArrayIndexOutOfBoundsException Product: XalanJ2 Version: 2.4Dx Platform: All URL: http://rawhide.and.av.com/~jkeegan/xalanbug_jlk1/xalanbu g_jlk1.tar.gz OS/Version: All Status: UNCONFIRMED Severity: Blocker Priority: Other Component: javax.xml AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Calling xalan:evaluate on a long xpath expression causes it to abort, throwing an ArrayIndexOutOfBoundsException. The URL points to a gzip'ed tar file containing an example success script and failure script, demonstrating not only the problem but that it's the result of adding one more term to the xpath expression. (Encountered 7/16/2002, dropped the ball and forgot to submit it, so it's been in a bunch of (released) versions of Xalan-J2) Stack trace from more complex example of this problem: ====================== java.lang.ArrayIndexOutOfBoundsException at org.apache.xpath.compiler.Lexer.addToTokenQueue(Lexer.java:593) at org.apache.xpath.compiler.Lexer.tokenize(Lexer.java:348) at org.apache.xpath.compiler.Lexer.tokenize(Lexer.java:139) at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:143) at org.apache.xpath.XPath.<init>(XPath.java:217) at org.apache.xpath.XPath.<init>(XPath.java:248) at org.apache.xalan.lib.Extensions.evaluate(Extensions.java:337) at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.xalan.extensions.ExtensionHandlerJavaClass.callFunction (ExtensionHandlerJavaClass.java:333) at org.apache.xalan.extensions.ExtensionsTable.extFunction (ExtensionsTable.java:257) at org.apache.xpath.functions.FuncExtFunction.execute (FuncExtFunction.java:181) at org.apache.xpath.functions.FuncExtFunction.execute (FuncExtFunction.java:177) at org.apache.xpath.Expression.asIterator(Expression.java:273) at org.apache.xpath.functions.FuncCount.execute(FuncCount.java:92) at org.apache.xpath.operations.Operation.execute(Operation.java:143) at org.apache.xpath.Expression.bool(Expression.java:208) at org.apache.xpath.XPath.bool(XPath.java:388) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:162) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:200) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:200) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:423) at org.apache.xalan.templates.ElemApplyTemplates.execute (ElemApplyTemplates.java:226) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemLiteralResult.execute (ElemLiteralResult.java:678) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemElement.constructNode (ElemElement.java:414) at org.apache.xalan.templates.ElemElement.execute(ElemElement.java:363) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemTemplate.execute (ElemTemplate.java:430) at org.apache.xalan.templates.ElemCallTemplate.execute (ElemCallTemplate.java:279) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:423) at org.apache.xalan.templates.ElemApplyTemplates.execute (ElemApplyTemplates.java:226) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:423) at org.apache.xalan.templates.ElemApplyTemplates.execute (ElemApplyTemplates.java:226) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemElement.constructNode (ElemElement.java:414) at org.apache.xalan.templates.ElemElement.execute(ElemElement.java:363) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemLiteralResult.execute (ElemLiteralResult.java:678) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemElement.constructNode (ElemElement.java:414) at org.apache.xalan.templates.ElemElement.execute(ElemElement.java:363) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemLiteralResult.execute (ElemLiteralResult.java:678) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemLiteralResult.execute (ElemLiteralResult.java:678) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemLiteralResult.execute (ElemLiteralResult.java:678) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:423) at org.apache.xalan.templates.ElemApplyTemplates.execute (ElemApplyTemplates.java:226) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemLiteralResult.execute (ElemLiteralResult.java:678) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemLiteralResult.execute (ElemLiteralResult.java:678) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemLiteralResult.execute (ElemLiteralResult.java:678) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.templates.ElemLiteralResult.execute (ElemLiteralResult.java:678) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:423) at org.apache.xalan.templates.ElemApplyTemplates.execute (ElemApplyTemplates.java:226) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2182) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode (TransformerImpl.java:2008) at org.apache.xalan.transformer.TransformerImpl.transformNode (TransformerImpl.java:1171) at org.apache.xalan.transformer.TransformerImpl.transform (TransformerImpl.java:638) at org.apache.xalan.transformer.TransformerImpl.transform (TransformerImpl.java:1088) at org.apache.xalan.transformer.TransformerImpl.transform (TransformerImpl.java:1066) at com.av.avs.ui.mui.MUI.doTransformCommon(Unknown Source) at com.av.avs.ui.mui.MUI.doTransformFromData(Unknown Source) at com.av.avs.ui.mui.MUI.doCollector(Unknown Source) at com.av.avs.ui.mui.MUI.doGetOrPost(Unknown Source) at com.av.avs.ui.mui.MUI.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.av.avs.service.avhttpd.RequestHandler.callrServlet(Unknown Source) at com.av.avs.service.avhttpd.RequestHandler.handleClient(Unknown Source) at com.av.avs.service.avhttpd.RequestHandler.run(Unknown Source) at java.lang.Thread.run(Thread.java:536) ====================== Succeeds: java org.apache.xalan.xslt.Process -xsl xpath.xsl -in sample.xml -param xpath '//* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //*' -out output Fails: java org.apache.xalan.xslt.Process -xsl xpath.xsl -in sample.xml -param xpath '//* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //* | //*' -out output This occurs on the command line as well as via direct calls in code. ..Jeff Keegan [EMAIL PROTECTED] 978-684-3593
