[
https://issues.apache.org/jira/browse/WSCOMMONS-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485013
]
Alexander Veit commented on WSCOMMONS-139:
------------------------------------------
OK, from this point of view it makes sense to allow null namespace prefixes by
contract.
However some code needs to be revisited since it is not always clear under
which circumstances getPrefix() will or won't return null. E.g.
- org.apache.axiom.om.impl.dom.AttrImpl#getQName(),
- org.apache.axiom.om.impl.llom.OMAttributeImpl#getQName(), or
- org.apache.axiom.om.util.ElementHelper#resolveQName(String, boolean)
may throw an IllegalArgumentException if OMNamespace has a null prefix (see
WSCOMMONS-140).
> OMNamespace accepts any namespace URI and prefix; it's not compatible with
> QName
> --------------------------------------------------------------------------------
>
> Key: WSCOMMONS-139
> URL: https://issues.apache.org/jira/browse/WSCOMMONS-139
> Project: WS-Commons
> Issue Type: Bug
> Components: AXIOM
> Reporter: Alexander Veit
> Assigned To: Glen Daniels
>
> OMNamepace does not define a contract on namespace URIs and prefixes. So
> OMNamespace implementations accept null URIs and prefixes and return these
> values in the getNamespaceURI() and getPrefix() methods.
> This leads to errors as in org.apache.axiom.om.impl.dom.AttrImpl#getQName().
> To be compatible with javax.xml.namespace.QName I would suggest to
> - throw an IllegalArgumentException if a null namespace URI is given in an
> OMNamespace constructor,
> - throw an IllegalArgumentException if a null namespace prefix is given in an
> OMNamespace constructor and
> - to assign a constant empty String if an empty namespace prefix is given in
> an OMNamespace constructor or if a constructor without a namespace prefix
> parameter is called.
> Additionally, a hasPrefix() method could help avoiding programming errors.
--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]