ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AXIOM-375) Simplify the OMElement#declareNamespace(String, String) API
Date Sun, 04 Jun 2017 10:11:04 GMT

    [ https://issues.apache.org/jira/browse/AXIOM-375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16036239#comment-16036239
] 

Hudson commented on AXIOM-375:
------------------------------

SUCCESS: Integrated in Jenkins build axiom-trunk #2878 (See [https://builds.apache.org/job/axiom-trunk/2878/])
AXIOM-375: Remove the legacy behavior for declareNamespace. (veithen: rev 1797563)
* (edit) axiom/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomElementSupport.aj
* (edit) axiom/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java
* (edit) axiom/src/site/markdown/release-notes/1.3.0.md
* (edit) axiom/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
* (add) axiom/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestDeclareNamespaceWithEmptyPrefix.java
* (delete) axiom/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestDeclareNamespaceWithGeneratedPrefix2.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.0
>
>
> 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 was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


Mime
View raw message