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 2007/06/07 19:15:26 UTC

[jira] Commented: (XERCESJ-1080) XSAttributeUseImpl.getConstraintValue() might cause NPE

    [ https://issues.apache.org/jira/browse/XERCESJ-1080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502432 ] 

Michael Glavassevich commented on XERCESJ-1080:
-----------------------------------------------

Looks like my fix got trampled by another commit [1].  I'll add it back.

[1] http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java?r1=320528&r2=379204&diff_format=h

> XSAttributeUseImpl.getConstraintValue() might cause NPE
> -------------------------------------------------------
>
>                 Key: XERCESJ-1080
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1080
>             Project: Xerces2-J
>          Issue Type: Bug
>    Affects Versions: 2.6.2
>         Environment: Xerces2-J CVS HEAD (May 12, 2005)
>            Reporter: Kurt Riede
>            Priority: Minor
>         Attachments: attP006.xsd
>
>
> In case of error "a-props-correct.2" (Invalid value constraint value '%1' in attribute '%2'.), attribute fDefault or fDefault.actualValue might be null and the code might result in a NPE.
> How to reproduce: Example from xml schema test suite:
> msxsdtest\attribute\attP006.xsd 
> In my case, when anlysing 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. 
> My fix is quite simple: just check on null: 
> Old: 
>         return getConstraintType() == XSConstants.VC_NONE ?
>                null :
>                fDefault.actualValue.toString();
> New: 
>         return getConstraintType() == XSConstants.VC_NONE ? null :
>             (fDefault == null ? null :
>             (fDefault.actualValue == null ? null :
>             (fDefault.actualValue.toString())));

-- 
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