From commits-return-5842-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Wed Mar 14 15:47:35 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8DED5180654 for ; Wed, 14 Mar 2018 15:47:34 +0100 (CET) Received: (qmail 17455 invoked by uid 500); 14 Mar 2018 14:47:33 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 17442 invoked by uid 99); 14 Mar 2018 14:47:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2018 14:47:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8E416E96F2; Wed, 14 Mar 2018 14:47:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sunlan@apache.org To: commits@groovy.apache.org Date: Wed, 14 Mar 2018 14:47:33 -0000 Message-Id: <14492b75914642809a13bc64763600e8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] groovy git commit: Trivial refactoring for "Safe number parsing methods for more convenient XML parsing with GPathResult(closes #494)" 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 Authored: Wed Mar 14 22:44:59 2018 +0800 Committer: danielsun1106 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(); } /**