You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Gary Gregory (JIRA)" <xe...@xml.apache.org> on 2010/12/08 23:44:01 UTC

[jira] Created: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
----------------------------------------------------------------------

                 Key: XERCESJ-1488
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
             Project: Xerces2-J
          Issue Type: Bug
    Affects Versions: 2.11.0
         Environment: Java version: 1.6.0_23
Java home: C:\Program Files\Java\jdk1.6.0_23\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
            Reporter: Gary Gregory
            Priority: Blocker


The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.

NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  

Note that the second argument is null in the call:

{noformat}
if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
	null, defaultValue)) {
{noformat}
at

XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	

Which means that at this point in the call chain:

{noformat}
Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
	DOMParser.parse(InputSource) line: 230	
	DocumentBuilderImpl.parse(InputSource) line: 298	
	XmlValidator.validate(InputSource) line: 279	
	XmlValidator.validate(URL) line: 317	
	XmlValidator.validate(String) line: 300	
	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	FrameworkMethod$1.runReflectiveCall() line: 44	
	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
	InvokeMethod.evaluate() line: 20	
	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
	ParentRunner$3.run() line: 193	
	ParentRunner$1.schedule(Runnable) line: 52	
	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
	ParentRunner$2.evaluate() line: 184	
	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
	TestExecution.run(ITestReference[]) line: 38	
	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
	RemoteTestRunner.runTests(TestExecution) line: 683	
	RemoteTestRunner.run() line: 390	
	RemoteTestRunner.main(String[]) line: 197	
{noformat}
	
The "return null;" runs at:

XSSimpleTypeDecl.normalize(Object, short) line: 2255	

{noformat}
        if (content == null)
            return null;
{noformat}
			
Which then causes:

{noformat}
java.lang.NullPointerException
	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
{noformat}
because the null value is passed all the way down the call chain until it causes the implosion.




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Sandy Gao (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004719#comment-13004719 ] 

Sandy Gao commented on XERCESJ-1488:
------------------------------------

Mukul, thanks for looking into this.

You are quite right. I should have been more specific. I was only referring to the assertion facet, and not that under complex types. And by "treated", I didn't mean how they are represented in XSModel, but how and when they are evaluated. Currently all the other facets are handled in XSSimpleType.validate(). This helps to determine the member type when unions are involved. Performing assertion facet checking at a much later point may cause issues in determining the member type.

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408267#comment-13408267 ] 

Michael Glavassevich commented on XERCESJ-1488:
-----------------------------------------------

So we're sure that this NPE no longer occurs even in XML Schema 1.1 validation mode? Was such a long discussion I lost track of whether we confirmed that or not.
                
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary D. Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004471#comment-13004471 ] 

Mukul Gandhi commented on XERCESJ-1488:
---------------------------------------

Hi Sandy,
    Regarding following point,

<quote>
I don't know the details of how assertions are implemented, but I think they need to be treated as a normal facet and be processed when the other facets are processed.
</quote>

Here are the details relevant to Xerces,

In case of xs:assertion as child of xs:simpleType -> xs:restriction for example, 'assertion' is considered as a facet (a multivalued facet like xs:pattern and xs:enumeration) -- so this complies to facet design as you've said. In case of complexType definitions xs:assert is a component of complexType (where it's not a facet).

Regards,
Mukul

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Khaled Noaman (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971704#action_12971704 ] 

Khaled Noaman commented on XERCESJ-1488:
----------------------------------------

I still do not understand why you need to call
    XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), attrValue, null).

We have already validated the value (the line just above it) and knows that the value is valid. Otherwise, an exception would have been thrown from
    actualValue = attDV.validate(attrValue, fValidationState, fValidatedInfo);

So, why do we have to re-validate again in the case of a union type?

If you need to set the fisAtomicValueValid, then you should use the result of the actual validation to determine its value.

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] [Resolved] (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mukul Gandhi resolved XERCESJ-1488.
-----------------------------------

    Resolution: Fixed

I think, the resolution discussed in this bug thread reflects that the problem was resolved but was not closed due to some reason.

I feel, we can close this issue. The OP may reopen, if that's appropriate.
                
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary D. Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004938#comment-13004938 ] 

Mukul Gandhi commented on XERCESJ-1488:
---------------------------------------

Hi Sandy,
     Thanks for the ideas. Your points are quite helpful.

You're quite right I believe. Since we represent xs:assertion as facet in XSModel, therefore it should be possible to evaluate assertion facets as well at a point where other facets are evaluated (in XSSimpleType.validate() as you've said) [1] -- and this is the goal we should aim at.

Changing Xerces design to confirm to idea [1] would require some adjustments how codebase is currently written.

I'll think over two lines,
1) With current way to evaluate assertions facets, I'll try to assign correct member type of union to PSVI (i.e I would not move assertion facet evaluation to XSSimpleType.validate() but only fix assigning correct member type of union to PSVI). If this is done, would you approve this solution (to start with at least!)?

2) Fix the codebase as per your idea. i.e move assertion facet evaluation in XSSimpleType.validate(). This is the final goal, but this will require some heavy adjustments to current internal design and careful testing so none of existing usecases fail. But I'll work to achieve this over time.

Regards,
Mukul  

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] Updated: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Glavassevich updated XERCESJ-1488:
------------------------------------------

    Component/s: XML Schema 1.1 Structures

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Priority: Blocker
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971204#action_12971204 ] 

Mukul Gandhi commented on XERCESJ-1488:
---------------------------------------

Hi Michael,
    I've just now renamed variable fisAtomicValueValid to fisAtomicValueValidForSTVarietyUnion (and have committed this change), which reflects the purpose of this variable better. The variable fisAtomicValueValid (now fisAtomicValueValidForSTVarietyUnion) is used to track validity of atomic value, when validated by a schema simpleType having variety union when that simpleType also has assertion facet(s).

In the class XMLAssertPsychopathImpl.java assertions are evaluated only if value of boolean variable fisAtomicValueValidForSTVarietyUnion is true (whose value is set from XMLSchemaValidator). For simpleType -> union cases if an atomic value is determined to be invalid in XMLSchemaValidator, then there is no need to evaluate assertions in XMLAssertPsychopathImpl. I think this is true by the nature of simpleType -> union type's having assertions.

The logic in question reflects this particular XML schema language design.  

I'm open to having any discussions to make this part of logic better (though I don't forsee any need of such thing now).

Regards,
Mukul

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] [Commented] (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408304#comment-13408304 ] 

Mukul Gandhi commented on XERCESJ-1488:
---------------------------------------

@ Michael : The OP mentioned in his original post, that he saw a code base as following,

<code>

if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(),
null, defaultValue)) { 

</code>

i.e a fixed {null} value was passed as the 2nd argument to this method call.

In the current SVN code base, the signature of this method has changed as well the implementation a bit, than what is reported by the OP (possibly as a result of fixes that were made, in response to the OP's questions and for various suggestions thereafter in this bug thread).

The current SVN code base has a class named as XS11TypeHelper, which has replaced the class XSTypeHelper which used to exist earlier.

If the OP thinks that this problem still exists, a relevant test case would be helpful for us to work on the issue.


Thanks,
Mukul
                
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary D. Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Khaled Noaman (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971382#action_12971382 ] 

Khaled Noaman commented on XERCESJ-1488:
----------------------------------------

I have seen in many places where we have the following code or similar (after we have validated the value):

            if (attDV.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
                if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
                                                              attrValue, null)) {
                    fisAtomicValueValid = false; 
                }
            }

That code seems to be redundant and not needed.

Mukul, would you please explain what you are trying to achieve here?

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008880#comment-13008880 ] 

Mukul Gandhi commented on XERCESJ-1488:
---------------------------------------

I made a commit just now with improvements as per suggestions from Sandy in this bug report. We now have an improved PSVI assignment for simpleType->union cases for assertions as per suggestions from Sandy.

We are still retaining the old way of evaluating assertions for simpleType's (not evaluating currently in XSSimpleType.validate()) as changing this aspect of assertions evaluations seems like a significant risk to me at this moment. But the functional equivalence of current design with desired design suggested by Sandy, seems to be present.

@Sandy: you could review the current change if possible.

Regards,
Mukul

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary D. Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004364#comment-13004364 ] 

Mukul Gandhi commented on XERCESJ-1488:
---------------------------------------

Hi Sandy,
   Thanks for your thoughts.

As a starting point, the current implementation of assertions for simpleType's with variety union was produced (I would admit that I didn't had generation of PSVI in mind while writing this implementation).

I'll revisit this part of Xerces design as per your suggestions, related to PSVI and will write to the list (and change implementation asap) when I've something concrete in mind.

Regards,
Mukul

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] Assigned: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Glavassevich reassigned XERCESJ-1488:
---------------------------------------------

    Assignee: Khaled Noaman

Khaled, since you've been keeping up with the XML Schema 1.1 dev more than I have can you take a look at this one?

Some observations / questions from my quick review:

1) fisAtomicValueValid  is being set to false when XSTypeHelper.isAtomicValueValidForAnUnion() returns true. That seems backwards.
2) fisAtomicValueValid  isn't being initialized in reset(). Might be a bug.
3) Why are we calling isAtomicValueValidForAnUnion() anyway? We've just validated the value and seems that method calls the DVs a second time.
4) Why are we trying to call isAtomicValueValidForAnUnion() for the lexical form of the default value? Note that's where the NPE is. We're passing in null right now, but even if we were to pass the lexical value that was in the schema that doesn't seem right (e.g. trying to revalidate a defaulted QName value from its lexical form wouldn't work).

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971024#action_12971024 ] 

Michael Glavassevich commented on XERCESJ-1488:
-----------------------------------------------

Yes and also in that class isSchemaTypesIdentical() should be called areSchemaTypesIdentical().

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969587#action_12969587 ] 

Michael Glavassevich commented on XERCESJ-1488:
-----------------------------------------------

org.apache.xerces.impl.xs.util.XSTypeHelper only exists in the XML Schema 1.1 experimental release of 2.11.0.  Are you also experiencing this problem with the main (stable) 2.11.0 release?

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Priority: Blocker
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Gary Gregory (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971011#action_12971011 ] 

Gary Gregory commented on XERCESJ-1488:
---------------------------------------

The name isAtomicValueValidForAnUnion should really be "isAtomicValueValidForAUnion", "a union" (correct) vs. "an union" 

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972031#action_12972031 ] 

Mukul Gandhi commented on XERCESJ-1488:
---------------------------------------

Hi Khaled,
    Here are few examples illustrating why the code-base in question is written currently like it is now.

XML Instance document:

<Example attr="2010-08-25" />

XML Schema 1.1 document:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   
     <xs:element name="Example">
           <xs:complexType>
	        <xs:attribute name="attr">
	             <xs:simpleType>
	                  <xs:union memberTypes="xs:int MYDATE" />
	             </xs:simpleType>
	        </xs:attribute>
           </xs:complexType>
     </xs:element>
   
     <xs:simpleType name="MYDATE">
           <xs:restriction base="xs:date">
	       <xs:assertion test="$value gt xs:date('2010-08-25')" />
           </xs:restriction>
     </xs:simpleType>

</xs:schema>

There are two cases I want to consider for the above example, which probably would clarify the doubts in this thread.

Case 1:

The simpleType's union description is following,

<xs:union memberTypes="xs:int MYDATE" />

The call attDV.validate(attrValue, fValidationState, fValidatedInfo) returns true.

In this case assertion evaluations from memberTypes of union do not contribute to reported validity of the above result. Therefore we must do few extra checks after the above call to consider the effect of assertion evaluations on the final instance document validity; which is thereafter accomplished by the call XSTypeHelper.isAtomicValueValidForAnUnion(..) -- this returns false and variable fisAtomicValueValidForSTVarietyUnion remains true, and assertions are then evaluated in XMLAssertPsychopathImpl which then cause overall failure of the validation episode. 

Case 2:

The simpleType's union description is following (we are adding a member type xs:date which would obviously cause the instance validation to pass),

<xs:union memberTypes="xs:int MYDATE xs:date" />

The call attDV.validate(attrValue, fValidationState, fValidatedInfo) returns true.

and the call XSTypeHelper.isAtomicValueValidForAnUnion(..) after this returns true, and variable fisAtomicValueValidForSTVarietyUnion becomes false and assertions are then not evaluated in XMLAssertPsychopathImpl.  

Since the call XSTypeHelper.isAtomicValueValidForAnUnion(..) considers effect of assertions, therefore all of above algorithmic steps seems to correctly refelect the desired processing needed in these cases.

To summarizing I would say, since the call attDV.validate(attrValue, fValidationState, fValidatedInfo) returns true in both of the above cases we needed something like XSTypeHelper.isAtomicValueValidForAnUnion(..) after this call for simpleType -> union cases.

At the moment I'm seemingly convinced that all of such processing may be correct.

I'm also curious to look at the sample test cases which the originator of this bug report had tried which has caused the NullPointerException. That would help us to debug the cause of NullPointerException better.

I hope this makes the things more clear. Please let me know, if I can answer any more questions.

Regards,
Mukul

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971540#action_12971540 ] 

Mukul Gandhi commented on XERCESJ-1488:
---------------------------------------

Hi Khaled,
   The main purpose of this code was to ensure, that assertion facets need not be evaluated if an atomic value was validated successfully (prior to assertions evaluation) with any of memberTypes of simpleType -> union.

You might be right that this part of code-base might have a bug (either this part of code is not needed, or this may have a bug).

I'll relook at this particular logic and would update the dev list, and the code-base as appropriate in next few days.

Regards,
Mukul

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972354#action_12972354 ] 

Mukul Gandhi commented on XERCESJ-1488:
---------------------------------------

Hi Khaled,
    Thanks for your comments. They would be quite useful for us to work on these issues further.

I'm replying to your following comments. I would analyze your other comments and would reply to them asap.

<quote>
In case1, <xs:union memberTypes="xs:int MYDATE" />, MYDate was used to validate the attribute value, then we call XSTypeHelper.isAtomicValueValidForAnUnion which will return false, so we do not change the value of fisAtomicValueValidForSTVarietyUnion and evaluate the assertion(s).

In case 2, <xs:union memberTypes="xs:int MYDATE xs:date" />, MYDate was also used to validate the attribute value, but the call to XSTypeHelper.isAtomicValueValidForAnUnion will return true, so we set fisAtomicValueValidForSTVarietyUnion to false and do not evaluate the assertion(s).

This is inconsistent. Also, if we just take the case of an atomic type (e.g. the attribute type is just MYDATE), we will evaluate the assertion(s). 
</quote>

It seems the XML Schema 1.1 spec doesn't explicitly specify any special treatment for assertion evaluations for "simpleType -> union" cases. The schema language spec only specifies assertion facets on "simpleType -> restriction" cases. The above design for which you've raised comments is a custom design built for Xerces, since it is not explicitly required by the spec; and therefore I believe that such aspects of XML schema validator implementation are implementation defined/dependent. 

I also request you to please look at the validation use-cases I attached with this JIRA issue and requesting comments whether from schema language point of view, would these use-cases be correct (and what kind of validation failure error messages we would like Xerces to produce for such cases)? After which we could try to correct the Xerces schema validator implementation in this regard.

Regards,
Mukul


> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971004#action_12971004 ] 

Michael Glavassevich commented on XERCESJ-1488:
-----------------------------------------------

So I've been reviewing the code and can see that there were several calls to XSTypeHelper.isAtomicValueValidForAnUnion() added to XMLSchemaValidator, each of them related to the assertions feature. While I don't really understand yet what they're for these blocks of code should only be executed in XML Schema 1.1 mode, so I've added a guard which checks that. This isn't a fix yet, but at least it prevents XML Schema 1.0 validation from being affected by this bug.

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Priority: Blocker
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mukul Gandhi updated XERCESJ-1488:
----------------------------------

    Attachment: XERCESJ-1488_samples.zip

I'm attaching few test cases that demonstrate why following code is needed in Xerces code-base.

if (attDV.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
      if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), attrValue, null)) {
             fisAtomicValueValid = false;
       }
} 

(the variable fisAtomicValueValid is now been renamed)

If we remove the above code fragment from Xerces code-base, the attached test cases fail the validation, which in fact all must pass.

The filenames in the attached archive are self explanatory to apply appropriate schema validations.

I therefore believe that the current code-base in Xerces SVN is correct.

Any further comments are welcome please.

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Issue Comment Edited: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Khaled Noaman (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971704#action_12971704 ] 

Khaled Noaman edited comment on XERCESJ-1488 at 12/15/10 10:24 AM:
-------------------------------------------------------------------

I still do not understand why you need to call
    XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), attrValue, null).

We have already validated the value (the line just above it) and know that the value is valid. Otherwise, an exception would have been thrown from
    actualValue = attDV.validate(attrValue, fValidationState, fValidatedInfo);

So, why do we have to re-validate again in the case of a union type?

If you need to set the fisAtomicValueValid, then you should use the result of the actual validation to determine its value.

      was (Author: knoaman@ca.ibm.com):
    I still do not understand why you need to call
    XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), attrValue, null).

We have already validated the value (the line just above it) and knows that the value is valid. Otherwise, an exception would have been thrown from
    actualValue = attDV.validate(attrValue, fValidationState, fValidatedInfo);

So, why do we have to re-validate again in the case of a union type?

If you need to set the fisAtomicValueValid, then you should use the result of the actual validation to determine its value.
  
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Gary Gregory (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969601#action_12969601 ] 

Gary Gregory commented on XERCESJ-1488:
---------------------------------------

Thank you for your prompt reply.

Yes, I am using the XML Schema 1.1 beta. 

No, it does not happen in the stable 2.11 release.


> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Priority: Blocker
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Khaled Noaman (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972126#action_12972126 ] 

Khaled Noaman commented on XERCESJ-1488:
----------------------------------------

Hi Mukul,

I am even more confused now :-).

I do not understand why the special handling in the case of a union. It seems to me we are being inconsistent here. From your 2 examples above we are behaving differently though the same type was used to validate the attribute value.

In case1, <xs:union memberTypes="xs:int MYDATE" />, MYDate was used to validate the attribute value, then we call XSTypeHelper.isAtomicValueValidForAnUnion which will return false, so we do not change the value of fisAtomicValueValidForSTVarietyUnion and evaluate the assertion(s).

In case 2, <xs:union memberTypes="xs:int MYDATE xs:date" />, MYDate was also used to validate the attribute value, but the call to  XSTypeHelper.isAtomicValueValidForAnUnion will return true, so we set fisAtomicValueValidForSTVarietyUnion to false and do not evaluate the assertion(s).

This is inconsistent. Also, if we just take the case of an atomic type (e.g. the attribute type is just MYDATE), we will evaluate the assertion(s).

So, why are we treating the union case differently. Also, in XSTypeHelper.isAtomicValueValidForAnUnion, you are only validating against built-in types (you skip over the user-defined ones). As well as, you totally ignore the type that was used to validate the value itself.

I still do not see why we need to make that extra check for the union case.

Regards,
Khaled

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1488) NullPointerException caused by XMLSchemaValidator.addDefaultAttributes

Posted by "Sandy Gao (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004202#comment-13004202 ] 

Sandy Gao commented on XERCESJ-1488:
------------------------------------

I'm not sure whether this discussion has come to a conclusion. Adding my $0.02.

I think we not only need to focus on whether assertions are checked properly for union-typed values, but also to make sure the result is correctly reflected in PSVI. Take the example: <xs:union memberTypes="xs:int MYDATE xs:date" />. Without checking for assertions, we use "MYDATE" as the [member type definition] for the attribute "attr", and store it in the PSVI. After assertions are checked, we realize that "attr" is not valid with respect to "MYDATE", and we should have used "xs:date" as the [member type definition].

Does the current code handle this case correctly? i.e. update PSVI so [member type definition] is "xs:date"?

I don't know the details of how assertions are implemented, but I think they need to be treated as a normal facet and be processed when the other facets are processed, so that at least for this union case we will get the correct [member type definition]. This makes the "check assertions after all the rest is done" approach questionable, which seems to be what's happening today, based on the above discussion.

> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1488
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1488
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>         Environment: Java version: 1.6.0_23
> Java home: C:\Program Files\Java\jdk1.6.0_23\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Khaled Noaman
>            Priority: Blocker
>         Attachments: XERCESJ-1488_samples.zip
>
>
> The following is a regression from 2.10 because our unit tests run OK with 2.10 and blow up with 2.11.
> NullPointerException caused by XMLSchemaValidator.addDefaultAttributes  
> Note that the second argument is null in the call:
> {noformat}
> if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(), 
> 	null, defaultValue)) {
> {noformat}
> at
> XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> Which means that at this point in the call chain:
> {noformat}
> Thread [main] (Suspended (breakpoint at line 2255 in XSSimpleTypeDecl))	
> 	XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> 	XSSimpleTypeDecl.getActualValue(Object, ValidationContext, ValidatedInfo, boolean) line: 2053	
> 	XSSimpleTypeDecl.validate(String, ValidationContext, ValidatedInfo) line: 1742	
> 	XSTypeHelper.isValueValidForASimpleType(String, XSSimpleType) line: 135	
> 	XSTypeHelper.isAtomicValueValidForAnUnion(XSObjectList, String, ValidatedInfo) line: 108	
> 	XMLSchemaValidator.addDefaultAttributes(QName, XMLAttributes, XSAttributeGroupDecl) line: 3385	
> 	XMLSchemaValidator.handleStartElement(QName, XMLAttributes, Augmentations) line: 2375	
> 	XMLSchemaValidator.startElement(QName, XMLAttributes, Augmentations) line: 815	
> 	XMLNSDocumentScannerImpl.scanStartElement() line: 283	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook() line: 733	
> 	XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: 1754	
> 	XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 324	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(boolean) line: 515	
> 	IntegratedParserConfiguration(DTDConfiguration).parse(XMLInputSource) line: 571	
> 	DOMParser(XMLParser).parse(XMLInputSource) line: 108	
> 	DOMParser.parse(InputSource) line: 230	
> 	DocumentBuilderImpl.parse(InputSource) line: 298	
> 	XmlValidator.validate(InputSource) line: 279	
> 	XmlValidator.validate(URL) line: 317	
> 	XmlValidator.validate(String) line: 300	
> 	XmlValidatorTestCase.validateXmlSchema1_0_2(String) line: 187	
> 	XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2() line: 126	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	FrameworkMethod$1.runReflectiveCall() line: 44	
> 	FrameworkMethod$1(ReflectiveCallable).run() line: 15	
> 	FrameworkMethod.invokeExplosively(Object, Object...) line: 41	
> 	InvokeMethod.evaluate() line: 20	
> 	BlockJUnit4ClassRunner.runNotIgnored(FrameworkMethod, EachTestNotifier) line: 79	
> 	BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 71	
> 	BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 49	
> 	ParentRunner$3.run() line: 193	
> 	ParentRunner$1.schedule(Runnable) line: 52	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 191	
> 	ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 42	
> 	ParentRunner$2.evaluate() line: 184	
> 	BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236	
> 	JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 49	
> 	TestExecution.run(ITestReference[]) line: 38	
> 	RemoteTestRunner.runTests(String[], String, TestExecution) line: 467	
> 	RemoteTestRunner.runTests(TestExecution) line: 683	
> 	RemoteTestRunner.run() line: 390	
> 	RemoteTestRunner.main(String[]) line: 197	
> {noformat}
> 	
> The "return null;" runs at:
> XSSimpleTypeDecl.normalize(Object, short) line: 2255	
> {noformat}
>         if (content == null)
>             return null;
> {noformat}
> 			
> Which then causes:
> {noformat}
> java.lang.NullPointerException
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
> 	at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(XSSimpleTypeDecl.java:2105)
> 	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(XSSimpleTypeDecl.java:1742)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(XSTypeHelper.java:135)
> 	at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(XSTypeHelper.java:108)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:3385)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2375)
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:815)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:515)
> 	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:571)
> 	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
> 	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:279)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:317)
> 	at com.seagullsw.toolbox.xml.XmlValidator.validate(XmlValidator.java:300)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.validateXmlSchema1_0_2(XmlValidatorTestCase.java:187)
> 	at com.seagullsw.toolbox.xml.XmlValidatorTestCase.testSimpleXsd_XmlSchema1_0_2(XmlValidatorTestCase.java:126)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
> because the null value is passed all the way down the call chain until it causes the implosion.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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