Author: veithen
Date: Sat Dec 17 15:01:33 2011
New Revision: 1215506
URL: http://svn.apache.org/viewvc?rev=1215506&view=rev
Log:
AXIOM-398: Also normalize the result of OMElement#getDefaultNamespace().
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=1215506&r1=1215505&r2=1215506&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
Sat Dec 17 15:01:33 2011
@@ -190,8 +190,7 @@ public class OMElementImpl extends OMNod
// Special case: no namespace; we need to generate a namespace
declaration only if
// there is a conflicting namespace declaration (i.e. a
declaration for the default
// namespace with a non empty URI) is in scope
- OMNamespace defaultNamespace = getDefaultNamespace();
- if (defaultNamespace != null &&
defaultNamespace.getNamespaceURI().length() > 0) {
+ if (getDefaultNamespace() != null) {
declareDefaultNamespace("");
}
return null;
@@ -409,7 +408,7 @@ public class OMElementImpl extends OMNod
public OMNamespace getDefaultNamespace() {
OMNamespace defaultNS;
if (namespaces != null && (defaultNS = (OMNamespace)
namespaces.get("")) != null) {
- return defaultNS;
+ return defaultNS.getNamespaceURI().length() == 0 ? null :
defaultNS;
}
if (parent instanceof OMElementImpl) {
return ((OMElementImpl) parent).getDefaultNamespace();