From commits-return-5154-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Fri Jan 5 15:31:30 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id B0BC2180647 for ; Fri, 5 Jan 2018 15:31:30 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 99D2A160C19; Fri, 5 Jan 2018 14:31:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DF43D160C14 for ; Fri, 5 Jan 2018 15:31:29 +0100 (CET) Received: (qmail 1769 invoked by uid 500); 5 Jan 2018 14:31:29 -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 1760 invoked by uid 99); 5 Jan 2018 14:31:29 -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; Fri, 05 Jan 2018 14:31:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 02BF1DFDE6; Fri, 5 Jan 2018 14:31:29 +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 Message-Id: <56190a7793cf478aa383a9539d554d25@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: groovy git commit: Trivial refactoring for `GString` Date: Fri, 5 Jan 2018 14:31:29 +0000 (UTC) Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X 3c63bc4e9 -> d5312b7e5 Trivial refactoring for `GString` (cherry picked from commit fece39d) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/d5312b7e Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/d5312b7e Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/d5312b7e Branch: refs/heads/GROOVY_2_6_X Commit: d5312b7e530681b839e445dcd0f7e20fcd548bf7 Parents: 3c63bc4 Author: sunlan Authored: Fri Jan 5 22:30:47 2018 +0800 Committer: sunlan Committed: Fri Jan 5 22:31:20 2018 +0800 ---------------------------------------------------------------------- src/main/groovy/groovy/lang/GString.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/d5312b7e/src/main/groovy/groovy/lang/GString.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/lang/GString.java b/src/main/groovy/groovy/lang/GString.java index 06ad8dd..e752e55 100644 --- a/src/main/groovy/groovy/lang/GString.java +++ b/src/main/groovy/groovy/lang/GString.java @@ -46,10 +46,13 @@ public abstract class GString extends GroovyObjectSupport implements Comparable, private static final String MKP = "mkp"; private static final String YIELD = "yield"; + public static final String[] EMPTY_STRING_ARRAY = new String[0]; + public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; + /** * A GString containing a single empty String and no values. */ - public static final GString EMPTY = new GString(new Object[0]) { + public static final GString EMPTY = new GString(EMPTY_OBJECT_ARRAY) { private static final long serialVersionUID = -7676746462783374250L; @Override @@ -58,8 +61,6 @@ public abstract class GString extends GroovyObjectSupport implements Comparable, } }; - public static final String[] EMPTY_STRING_ARRAY = new String[0]; - public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; private final Object[] values;