ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1686092 - in /webservices/axiom/branches/attrs-aspects: ./ implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/ testing/axiom-testsuite/src/main/java/...
Date Wed, 17 Jun 2015 19:00:52 GMT
Author: veithen
Date: Wed Jun 17 19:00:51 2015
New Revision: 1686092

URL: http://svn.apache.org/r1686092
Log:
Merge latest changes from trunk.

Removed:
    webservices/axiom/branches/attrs-aspects/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/attribute/TestEqualsHashCode.java
Modified:
    webservices/axiom/branches/attrs-aspects/   (props changed)
    webservices/axiom/branches/attrs-aspects/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareAttribute.java
    webservices/axiom/branches/attrs-aspects/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMAttributeImpl.java
    webservices/axiom/branches/attrs-aspects/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java

Propchange: webservices/axiom/branches/attrs-aspects/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jun 17 19:00:51 2015
@@ -10,4 +10,4 @@
 /webservices/axiom/branches/JAXB2_DS:1366463-1367737
 /webservices/axiom/branches/namespaceURIInterning:1293148-1293587
 /webservices/axiom/branches/osgi-redesign:1180368-1180596
-/webservices/axiom/trunk:1685218-1685887
+/webservices/axiom/trunk:1685218-1686091

Modified: webservices/axiom/branches/attrs-aspects/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareAttribute.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/attrs-aspects/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareAttribute.java?rev=1686092&r1=1686091&r2=1686092&view=diff
==============================================================================
--- webservices/axiom/branches/attrs-aspects/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareAttribute.java
(original)
+++ webservices/axiom/branches/attrs-aspects/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareAttribute.java
Wed Jun 17 19:00:51 2015
@@ -77,73 +77,6 @@ public final class NSAwareAttribute exte
                 + ":" + localName;
     }
 
-    /**
-     * An instance of <code>AttrImpl</code> can act as an <code>OMAttribute</code>
and as well as an
-     * <code>org.w3c.dom.Attr</code>. So we first check if the object to compare
with (<code>obj</code>)
-     * is of type <code>OMAttribute</code> (this includes instances of <code>OMAttributeImpl</code>
or
-     * <code>AttrImpl</code> (instances of this class)). If so we check for the
equality
-     * of namespaces first (note that if the namespace of this instance is null then for
the <code>obj</code>
-     * to be equal its namespace must also be null). This condition solely doesn't determine
the equality.
-     * So we check for the equality of names and values (note that the value can also be
null in which case
-     * the same argument holds as that for the namespace) of the two instances. If all three
conditions are
-     * met then we say the two instances are equal.
-     *
-     * <p>If <code>obj</code> is of type <code>org.w3c.dom.Attr</code>
then we perform the same equality check
-     * as before. Note that, however, the implementation of the test for equality in this
case is little different
-     * than before.
-     *
-     * <p>If <code>obj</code> is neither of type <code>OMAttribute</code>
nor of type <code>org.w3c.dom.Attr</code>
-     * then we return false.
-     *
-     * @param obj The object to compare with this instance
-     * @return True if the two objects are equal or else false. The equality is checked as
explained above.
-     */
-    public boolean equals(Object obj) {
-        OMNamespace namespace = getNamespace();
-        String localName = getLocalName();
-        String attrValue = getValue();
-        if (obj instanceof OMAttribute) { // Checks equality of an OMAttributeImpl or an
AttrImpl with this instance
-            OMAttribute other = (OMAttribute) obj;
-            return (namespace == null ? other.getNamespace() == null :
-                    namespace.equals(other.getNamespace()) &&
-                    localName.equals(other.getLocalName()) &&
-                    (attrValue == null ? other.getAttributeValue() == null :
-                            attrValue.toString().equals(other.getAttributeValue())));
-        } else if (obj instanceof Attr) {// Checks equality of an org.w3c.dom.Attr with this
instance
-            Attr other = (Attr)obj;
-            String otherNs = other.getNamespaceURI();
-            if (namespace == null) { // I don't have a namespace
-                if (otherNs != null) {
-                    return false; // I don't have a namespace and the other has. So return
false
-                } else {
-                    // Both of us don't have namespaces. So check for name and value equality
only
-                    return (localName.equals(other.getLocalName()) &&
-                            (attrValue == null ? other.getValue() == null :
-                                    attrValue.toString().equals(other.getValue())));
-                }
-            } else { // Ok, now I've a namespace
-                String ns = namespace.getNamespaceURI();
-                String prefix = namespace.getPrefix();
-                String otherPrefix = other.getPrefix();
-                // First check for namespaceURI equality. Then check for prefix equality.
-                // Then check for name and value equality
-                return (ns.equals(otherNs) && (prefix == null ? otherPrefix == null
: prefix.equals(otherPrefix)) &&
-                        (localName.equals(other.getLocalName())) &&
-                        (attrValue == null ? other.getValue() == null :
-                                attrValue.toString().equals(other.getValue())));
-            }
-        }
-        return false;
-    }
-
-    public int hashCode() {
-        OMNamespace namespace = getNamespace();
-        String localName = getLocalName();
-        String attrValue = getValue();
-        return localName.hashCode() ^ (attrValue != null ? attrValue.toString().hashCode()
: 0) ^
-                (namespace != null ? namespace.hashCode() : 0);
-    }
-
     @Override
     final ParentNode shallowClone(OMCloneOptions options, ParentNode targetParent, boolean
namespaceRepairing) {
         // Note: targetParent is always null here

Modified: webservices/axiom/branches/attrs-aspects/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMAttributeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/attrs-aspects/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMAttributeImpl.java?rev=1686092&r1=1686091&r2=1686092&view=diff
==============================================================================
--- webservices/axiom/branches/attrs-aspects/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMAttributeImpl.java
(original)
+++ webservices/axiom/branches/attrs-aspects/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMAttributeImpl.java
Wed Jun 17 19:00:51 2015
@@ -60,47 +60,6 @@ public class OMAttributeImpl extends Att
         coreSetType(OMConstants.XMLATTRTYPE_CDATA);
     }
 
-    /**
-     * Checks for the equality of two <code>OMAttribute</code> instances. Thus
the object to compare
-     * this with may be an instance of <code>OMAttributeImpl</code> (an instance
of this class) or
-     * an instance of <code>AttrImpl</code>. The method returns false for any
object of type other
-     * than <code>OMAttribute</code>.
-     *
-     * <p>We check for the equality of namespaces first (note that if the namespace
of this instance is null
-     * then for the <code>obj</code> to be equal its namespace must also be null).
This condition solely
-     * doesn't determine the equality. So we check for the equality of names and values (note
that the value
-     * can also be null in which case the same argument holds as that for the namespace)
of the two instances.
-     * If all three conditions are met then we say the two instances are equal.
-     *
-     * Note: We ignore the owner when checking for the equality. This is simply because the
owner is
-     * introduced just to keep things simple for the programmer and not as part of an attribute
itself.
-     *
-     * @param obj The object to compare with this instance.
-     * @return True if obj is equal to this or else false.
-     */
-    public boolean equals(Object obj) {
-        if (! (obj instanceof OMAttribute)) return false;
-        OMAttribute other = (OMAttribute)obj;
-        OMNamespace namespace = getNamespace();
-        String localName = getLocalName();
-        String value = getAttributeValue();
-        //first check namespace then localName then value to improve performance
-        return (namespace == null ? other.getNamespace() == null :
-                namespace.equals(other.getNamespace()) &&
-                localName.equals(other.getLocalName()) &&
-                (value == null ? other.getAttributeValue() == null :
-                        value.equals(other.getAttributeValue())));
-
-    }
-
-    public int hashCode() {
-        OMNamespace namespace = getNamespace();
-        String localName = getLocalName();
-        String value = getAttributeValue();
-        return localName.hashCode() ^ (value != null ? value.hashCode() : 0) ^
-                (namespace != null ? namespace.hashCode() : 0);
-    }
-
     public OMInformationItem clone(OMCloneOptions options) {
         return new OMAttributeImpl(getLocalName(), getNamespace(), getAttributeValue(), getOMFactory());
     }

Modified: webservices/axiom/branches/attrs-aspects/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/attrs-aspects/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1686092&r1=1686091&r2=1686092&view=diff
==============================================================================
--- webservices/axiom/branches/attrs-aspects/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
(original)
+++ webservices/axiom/branches/attrs-aspects/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
Wed Jun 17 19:00:51 2015
@@ -67,7 +67,6 @@ public class OMTestSuiteBuilder extends
     protected void addTests() {
         addTest(new org.apache.axiom.ts.om.attribute.TestDigestWithNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestDigestWithoutNamespace(metaFactory));
-        addTest(new org.apache.axiom.ts.om.attribute.TestEqualsHashCode(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestGetAttributeTypeDefault(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestGetNamespaceNormalized(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestGetNamespaceURIWithNamespace(metaFactory));



Mime
View raw message