ws-dev mailing list archives

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


Hudson commented on AXIOM-375:

SUCCESS: Integrated in Jenkins build axiom-trunk #2878 (See [])
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/
* (edit) axiom/src/site/markdown/release-notes/
* (edit) axiom/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/
* (add) axiom/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/
* (delete) axiom/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/

> Simplify the OMElement#declareNamespace(String, String) API
> -----------------------------------------------------------
>                 Key: AXIOM-375
>                 URL:
>             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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message