Details
-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b80
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8135814 | emb-9 | Joe Wang | P3 | Resolved | Fixed | team |
JDK-8149263 | 8u101 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8134528 | 8u92 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8155398 | emb-8u101 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8144815 | 7u101 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8144816 | 6u115 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
Description
TestTrans.java
import java.io.File;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class TestTrans {
public static void main(String[] args) throws Exception {
Transformer transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new File("librarySet01.xsl")));
transformer.transform(new StreamSource(new File("librarySet01.xml")), new StreamResult("test1.out"));
}
}
librarySet01.xsl :
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:set="http://exslt.org/sets"
exclude-result-prefixes="set">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<out>
<test desc="the second should be empty, but not null">
<xsl:copy-of select="set:leading(/doc/*, /doc/non-existing)"/>
</test>
</out>
</xsl:template>
</xsl:stylesheet>
librarySet01.xml:
<?xml version="1.0" encoding="UTF-8"?>
<doc>
<num>1</num>
<str>a</str>
<num>2</num>
</doc>
Program output:
java TestTrans
ERROR: ''
Exception in thread "main" javax.xml.transform.TransformerException: java.lang.NullPointerException
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:754)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:359)
at TestTrans.main(TestTrans.java:16)
Caused by: java.lang.NullPointerException
at com.sun.org.apache.xalan.internal.lib.ExsltSets.leading(ExsltSets.java:63)
at librarySet01.template$dot$0()
at librarySet01.applyTemplates()
at librarySet01.transform()
at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:619)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:747)
... 2 more
---------
java.lang.NullPointerException
at com.sun.org.apache.xalan.internal.lib.ExsltSets.leading(ExsltSets.java:63)
at librarySet01.template$dot$0()
at librarySet01.applyTemplates()
at librarySet01.transform()
at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:619)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:747)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:359)
at TestTrans.main(TestTrans.java:16)
In XSL, select /doc/non-existing shoud returns an empty nodelist instance, but returns null actually, that causes NPE.
Attachments
Issue Links
- backported by
-
JDK-8134528 NPE may be thrown when xsltc select a non-existing node after JDK-8062518
- Resolved
-
JDK-8135814 NPE may be thrown when xsltc select a non-existing node after JDK-8062518
- Resolved
-
JDK-8144815 NPE may be thrown when xsltc select a non-existing node after JDK-8062518
- Resolved
-
JDK-8144816 NPE may be thrown when xsltc select a non-existing node after JDK-8062518
- Resolved
-
JDK-8149263 NPE may be thrown when xsltc select a non-existing node after JDK-8062518
- Resolved
-
JDK-8155398 NPE may be thrown when xsltc select a non-existing node after JDK-8062518
- Resolved
- relates to
-
JDK-8062518 AIOBE occurs when accessing to document function in extended function in JAXP
- Resolved