Project

Profile

Help

Bug #3176

closed

NullPointerException when parsing invalid regex

Added by Daniel Schmidt over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2017-03-20
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

When compiling the attached stylesheet (npe.xsl), an internal NullPointerException is thrown:

java.lang.NullPointerException: NullPointerException processing net.sf.saxon.expr.ErrorExpression
        at net.sf.saxon.expr.Expression.getConfiguration(Expression.java:829)
        at net.sf.saxon.expr.Atomizer.getItemType(Atomizer.java:349)
        at net.sf.saxon.expr.parser.TypeChecker.staticTypeCheck(TypeChecker.java:193)
        at net.sf.saxon.expr.instruct.Choose.staticTypeCheck(Choose.java:350)
        at net.sf.saxon.expr.parser.TypeChecker.staticTypeCheck(TypeChecker.java:85)
        at net.sf.saxon.style.SourceBinding.checkAgainstRequiredType(SourceBinding.java:322)
        at net.sf.saxon.style.SourceBinding.postValidate(SourceBinding.java:246)
        at net.sf.saxon.style.XSLGlobalVariable.postValidate(XSLGlobalVariable.java:84)
        at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1563)
        at net.sf.saxon.style.StylesheetPackage.preprocess(StylesheetPackage.java:444)
        at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:180)
        at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:94)
        at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543)
        at net.sf.saxon.Transform.doTransform(Transform.java:601)
        at net.sf.saxon.Transform.main(Transform.java:80)
Fatal error during transformation: java.lang.NullPointerException: NullPointerException processing net.sf.saxon.expr.ErrorExpression

This bug does not exist in Version 9.7.0.15 but in 9.6.0.10

Version 9.7.0.15 generates the correct warning:

Warning at char 61 in xsl:variable/@select on line 10 column 44 of npe.xsl:
  SXWN9000: Evaluation will always throw a dynamic error: The regular expression must not be
  one that matches a zero-length string

Files

npe.xsl (363 Bytes) npe.xsl Daniel Schmidt, 2017-03-20 15:45

Please register to edit this issue

Also available in: Atom PDF