[ http://issues.apache.org/jira/browse/XERCESJ-1078?page=all ]
Michael Glavassevich resolved XERCESJ-1078:
-------------------------------------------
Resolution: Fixed
Though the XML Schema API does not say what value should be returned when the
schema is invalid clearly we shouldn't be throwing an NPE. I've checked a fix
into CVS.
> IdentityConstraint.getSelectorStr() might cause MPE
> ---------------------------------------------------
>
> Key: XERCESJ-1078
> URL: http://issues.apache.org/jira/browse/XERCESJ-1078
> Project: Xerces2-J
> Type: Bug
> Components: XML Schema Structures
> Versions: 2.6.2
> Environment: Xerces2-J CVS HEAD (Mai 12, 2005)
> Reporter: Kurt Riede
> Attachments: attP006.xsd, patch.txt
>
> in case of an invalid schema file with the error "s4s-elt-must-match.2"
> (The content of 'identity constraint' must match (annotation?, selector,
> field+). Not enough elements were found.) the attribute fSelector might be
> null and thus the method getSelectorStr() causes a NPE.
> In my case, anylsing invalid schema files (as good as possible) it is
> important not to have this exception, so I'm working with my own patched
> version of Xerces2-J. It would be nice if you would fix this somewhen.
> Example from schema test suite to preproduce:
> msxsdtest\identityConstraint\idB059.xsd
> My fix is quite simple: just check on null:
> Old:
> return fSelector.toString();
> New:
> return fSelector == null ? null : fSelector.toString();
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]