[
https://issues.jboss.org/browse/DROOLS-1622?page=com.atlassian.jira.plugi...
]
Matteo Mortari commented on DROOLS-1622:
----------------------------------------
Some investigation results.
This is about {{com.thoughtworks.xstream.io.xml.StaxReader}}
method {{public String getAttribute(final String name)}}.
When called with openjdk, this calls
{{com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl}}
which respects the javadoc specs:
{code:java}
String javax.xml.stream.XMLStreamReader.getAttributeValue(String namespaceURI, String
localName)
Returns the normalized attribute value of the attribute with the namespace and localName
If the namespaceURI is null the namespace is not checked for equality
Parameters:
namespaceURI the namespace of the attribute
localName the local name of the attribute, cannot be null
{code}
while on IBM JDK it calls
{{com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl$XMLStreamReaderProxy}} which in turns
calls
{code:java}
String com.ibm.xml.xlxp.api.stax.XMLStreamReaderImpl.getAttributeValue(String s, String
s2)
{code}
which in turn calling
{code:java}
/* */ public XMLString getAttributeValue(final int n, final int n2) {
/* */
/* 1817 */ if (((SimpleScannerHelper)this).fIsNamespaceAware) {
/* 1818 */ for (int i = 0; i < ((SimpleScannerHelper)this).fAttributeCount;
++i) {
/* 1819 */ final com.ibm.xml.xlxp.scan.util.QName attributeName =
this.attributeName(i);
/* 1820 */ if (n2 == attributeName.localHandle && n ==
attributeName.nsHandle) {
/* 1821 */ return this.normalizedAttributeValue(i);
/* */ }
/* */ }
/* */ }
/* */ else {
/* 1826 */ for (int j = 0; j < ((SimpleScannerHelper)this).fAttributeCount;
++j) {
/* */
/* 1828 */ if (n2 == this.attributeName(j).handle) {
/* 1829 */ return this.normalizedAttributeValue(j);
/* */ }
/* */ }
/* */ }
/* 1833 */ return null;
/* */ }
{code}
and we can see it *forcibly* check the namespace for the attribute corresponds, in this
case null = 0, so it check the attribute namespace is null.
This is not compliant with the Java JDK javadoc specs.
NPE when compiling DMN file from test DMNRuntimeTest.testNoPrefix on
IBM JDK
----------------------------------------------------------------------------
Key: DROOLS-1622
URL:
https://issues.jboss.org/browse/DROOLS-1622
Project: Drools
Issue Type: Bug
Components: dmn engine
Affects Versions: 7.0.0.Final
Reporter: Tibor Zimányi
Assignee: Matteo Mortari
Labels: reported-by-qe
Fix For: 7.1.0.Final
When running test [1] on IBM JDK, the test fails with this output [2].
[1]
https://github.com/kiegroup/drools/blob/32822e243a237cf26f26830a895035b97...
[2]
https://gist.github.com/baldimir/969bd8f72665ff0e4244350abaed1ef4
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)