ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1697584 - in /webservices/axiom/trunk: implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
Date Tue, 25 Aug 2015 07:26:25 GMT
Author: veithen
Date: Tue Aug 25 07:26:25 2015
New Revision: 1697584

URL: http://svn.apache.org/r1697584
Log:
Fix a namespace declaration issue in LLOM.

Modified:
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=1697584&r1=1697583&r2=1697584&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
Tue Aug 25 07:26:25 2015
@@ -80,13 +80,12 @@ public class OMElementImpl extends OMNod
     /** Method handleNamespace. */
     final OMNamespace handleNamespace(QName qname) {
         forceExpand();
-        OMNamespace ns = null;
 
         // first try to find a namespace from the scope
         String namespaceURI = qname.getNamespaceURI();
         if (namespaceURI.length() > 0) {
             String prefix = qname.getPrefix();
-            ns = findNamespace(namespaceURI, prefix);
+            OMNamespace ns = findNamespace(namespaceURI, prefix);
 
             /**
              * What is left now is
@@ -97,12 +96,18 @@ public class OMElementImpl extends OMNod
                 if ("".equals(prefix)) {
                     prefix = OMSerializerUtil.getNextNSPrefix();
                 }
-                ns = declareNamespace(namespaceURI, prefix);
+                return declareNamespace(namespaceURI, prefix);
+            } else {
+                return ns;
             }
         } else if (qname.getPrefix().length() > 0) {
             throw new IllegalArgumentException("Cannot create a prefixed element with an
empty namespace name");
+        } else {
+            if (getDefaultNamespace() != null) {
+                declareDefaultNamespace("");
+            }
+            return null;
         }
-        return ns;
     }
 
     public void checkChild(OMNode child) {

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1697584&r1=1697583&r2=1697584&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
Tue Aug 25 07:26:25 2015
@@ -447,11 +447,11 @@ public class OMTestSuiteBuilder extends
             if (variant.isSupportsContainer()) {
                 addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope1(metaFactory,
variant));
                 addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope2(metaFactory,
variant));
+                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace2(metaFactory,
variant));
+                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace3(metaFactory,
variant));
             }
             if (variant.isSupportsContainer() && variant.isSupportsDefaultNamespace())
{
                 addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope3(metaFactory,
variant));
-                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace2(metaFactory,
variant));
-                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace3(metaFactory,
variant));
             }
         }
         if (supportsOMSourcedElement) {



Mime
View raw message