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 "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2005/06/23 21:28:09 UTC
[jira] Resolved: (XERCESJ-1078) IdentityConstraint.getSelectorStr() might cause MPE
[ 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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org