Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1CC4D200D5D for ; Wed, 6 Dec 2017 04:38:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 180D8160C1D; Wed, 6 Dec 2017 03:38:26 +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 5F4D7160C1C for ; Wed, 6 Dec 2017 04:38:25 +0100 (CET) Received: (qmail 47877 invoked by uid 500); 6 Dec 2017 03:38:24 -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 47695 invoked by uid 99); 6 Dec 2017 03:38:22 -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, 06 Dec 2017 03:38:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DED87F60E4; Wed, 6 Dec 2017 03:38:21 +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, 06 Dec 2017 03:38:24 -0000 Message-Id: <26926891f7214c5885f2573fc60ff9fd@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [4/5] groovy git commit: Minor refactoring (cherry picked from commit f2ad43d) archived-at: Wed, 06 Dec 2017 03:38:26 -0000 Minor refactoring (cherry picked from commit f2ad43d) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/3301d651 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/3301d651 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/3301d651 Branch: refs/heads/GROOVY_2_5_X Commit: 3301d65172134a0dffc9ee466bc445f02c74402b Parents: 64d1fc1 Author: sunlan Authored: Wed Dec 6 11:02:25 2017 +0800 Committer: sunlan Committed: Wed Dec 6 11:36:55 2017 +0800 ---------------------------------------------------------------------- src/main/groovy/lang/GString.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/3301d651/src/main/groovy/lang/GString.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/lang/GString.java b/src/main/groovy/lang/GString.java index 18846de..7a520fe 100644 --- a/src/main/groovy/lang/GString.java +++ b/src/main/groovy/lang/GString.java @@ -27,8 +27,8 @@ import java.io.Serializable; import java.io.StringWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; +import java.util.ArrayList; import java.util.Arrays; -import java.util.LinkedList; import java.util.List; import java.util.regex.Pattern; @@ -93,14 +93,14 @@ public abstract class GString extends GroovyObjectSupport implements Comparable, } public GString plus(GString that) { - List stringList = new LinkedList(Arrays.asList(getStrings())); - List valueList = new LinkedList(Arrays.asList(getValues())); + List stringList = new ArrayList(Arrays.asList(getStrings())); + List valueList = new ArrayList(Arrays.asList(getValues())); List thatStrings = Arrays.asList(that.getStrings()); int stringListSize = stringList.size(); if (stringListSize > valueList.size()) { - thatStrings = new LinkedList(thatStrings); + thatStrings = new ArrayList(thatStrings); // merge onto end of previous GString to avoid an empty bridging value int lastIndexOfStringList = stringListSize - 1; String s = stringList.get(lastIndexOfStringList);