groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [1/2] groovy git commit: Trivial refactoring for "Safe number parsing methods for more convenient XML parsing with GPathResult(closes #494)"
Date Wed, 14 Mar 2018 14:47:33 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 178a13b37 -> 2b08e39c4


Trivial refactoring for "Safe number parsing methods for more convenient XML parsing with
GPathResult(closes #494)"

(cherry picked from commit 500f613)


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 2b08e39c48a950d81f1d8dcfc9865022965c282c
Parents: d35d6b8
Author: danielsun1106 <realbluesun@hotmail.com>
Authored: Wed Mar 14 22:44:59 2018 +0800
Committer: danielsun1106 <realbluesun@hotmail.com>
Committed: Wed Mar 14 22:47:29 2018 +0800

----------------------------------------------------------------------
 .../src/main/java/groovy/util/slurpersupport/GPathResult.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/2b08e39c/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 8a0f08c..0020c67 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
@@ -349,7 +349,8 @@ public abstract class GPathResult extends GroovyObjectSupport implements
Writabl
     }
 
     private boolean textIsEmptyOrNull() {
-        return text() == null || text().equals("");
+        String t = text();
+        return null == t || 0 == t.length();
     }
 
     /**


Mime
View raw message