You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2017/12/05 08:20:13 UTC

groovy git commit: Revert "Refine GPathResult's equals and hashCode"

Repository: groovy
Updated Branches:
  refs/heads/master be099d301 -> 662f96a6d


Revert "Refine GPathResult's equals and hashCode"

This reverts commit be099d3


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/662f96a6
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/662f96a6
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/662f96a6

Branch: refs/heads/master
Commit: 662f96a6d5591ca65bbd46df8fdfacdff51d83b6
Parents: be099d3
Author: sunlan <su...@apache.org>
Authored: Tue Dec 5 16:20:06 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Tue Dec 5 16:20:06 2017 +0800

----------------------------------------------------------------------
 .../groovy/util/slurpersupport/GPathResult.java     | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/662f96a6/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
index f4d0c54..5aca4b6 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
@@ -43,7 +43,6 @@ import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Stack;
 
 /**
@@ -370,18 +369,11 @@ public abstract class GPathResult extends GroovyObjectSupport implements Writabl
         return this;
     }
 
-    @Override
-    public int hashCode() {
-        return Objects.hash(text());
-    }
-
-    @Override
+    /* (non-Javadoc)
+    * @see java.lang.Object#equals(java.lang.Object)
+    */
     public boolean equals(Object obj) {
-        if (!(obj instanceof GPathResult)) {
-            return false;
-        }
-
-        return text().equals(((GPathResult) obj).text());
+        return text().equals(obj.toString());
     }
 
     /**