You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2011/07/22 11:19:58 UTC
[jira] [Created] (AXIOM-375) Simplify the
OMElement#declareNamespace(String, String) API
Simplify the OMElement#declareNamespace(String, String) API
-----------------------------------------------------------
Key: AXIOM-375
URL: https://issues.apache.org/jira/browse/AXIOM-375
Project: Axiom
Issue Type: Improvement
Components: API
Reporter: Andreas Veithen
Priority: Minor
Fix For: 1.3
OMElement#declareNamespace(String, String) auto-generates a prefix if the prefix is either null or the empty string. There are several issues with this:
1. It is inconsistent with other APIs (in particular OMElement#declareNamespace(OMNamespace) which make a distinction between null (indicating that a prefix should be generated) and the empty string (meaning the default namespace).
2. It is not possible to use OMElement#declareNamespace(String, String) to declare a default namespace. This is especially annoying when the prefix is provided as a variable, in which case one has to write something like this:
if (prefix.length() == 0) {
nextElem.declareDefaultNamespace(uri);
} else {
nextElem.declareNamespace(uri, prefix);
}
3. It is obviously not necessary to support two different ways to indicate that a prefix should be generated. One (prefix == null) should be enough.
This should be changed in the next major release (1.3). To make the transition easier, the Javadoc in 1.2.x should be updated to indicate that using an empty string is deprecated and the code should generate a warning if the method is invoked in this way.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
[jira] [Commented] (AXIOM-375) Simplify the
OMElement#declareNamespace(String, String) API
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIOM-375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069781#comment-13069781 ]
Hudson commented on AXIOM-375:
------------------------------
Integrated in ws-axiom-trunk #453 (See [https://builds.apache.org/job/ws-axiom-trunk/453/])
AXIOM-375: Deprecated the usage of OMElement#declareNamespace(String,String) with prefix="".
veithen :
Files :
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestDeclareNamespaceWithGeneratedPrefix3.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestDeclareNamespaceWithGeneratedPrefix2.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java
> Simplify the OMElement#declareNamespace(String, String) API
> -----------------------------------------------------------
>
> Key: AXIOM-375
> URL: https://issues.apache.org/jira/browse/AXIOM-375
> Project: Axiom
> Issue Type: Improvement
> Components: API
> Reporter: Andreas Veithen
> Priority: Minor
> Fix For: 1.3
>
>
> OMElement#declareNamespace(String, String) auto-generates a prefix if the prefix is either null or the empty string. There are several issues with this:
> 1. It is inconsistent with other APIs (in particular OMElement#declareNamespace(OMNamespace) which make a distinction between null (indicating that a prefix should be generated) and the empty string (meaning the default namespace).
> 2. It is not possible to use OMElement#declareNamespace(String, String) to declare a default namespace. This is especially annoying when the prefix is provided as a variable, in which case one has to write something like this:
> if (prefix.length() == 0) {
> nextElem.declareDefaultNamespace(uri);
> } else {
> nextElem.declareNamespace(uri, prefix);
> }
> 3. It is obviously not necessary to support two different ways to indicate that a prefix should be generated. One (prefix == null) should be enough.
> This should be changed in the next major release (1.3). To make the transition easier, the Javadoc in 1.2.x should be updated to indicate that using an empty string is deprecated and the code should generate a warning if the method is invoked in this way.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org