groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [4/5] groovy git commit: Minor refactoring (cherry picked from commit f2ad43d)
Date Wed, 06 Dec 2017 03:38:24 GMT
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 <sunlan@apache.org>
Authored: Wed Dec 6 11:02:25 2017 +0800
Committer: sunlan <sunlan@apache.org>
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<String> stringList = new LinkedList<String>(Arrays.asList(getStrings()));
-        List<Object> valueList = new LinkedList<Object>(Arrays.asList(getValues()));
+        List<String> stringList = new ArrayList<String>(Arrays.asList(getStrings()));
+        List<Object> valueList = new ArrayList<Object>(Arrays.asList(getValues()));
 
         List<String> thatStrings = Arrays.asList(that.getStrings());
 
         int stringListSize = stringList.size();
         if (stringListSize > valueList.size()) {
-            thatStrings = new LinkedList<String>(thatStrings);
+            thatStrings = new ArrayList<String>(thatStrings);
             // merge onto end of previous GString to avoid an empty bridging value
             int lastIndexOfStringList = stringListSize - 1;
             String s = stringList.get(lastIndexOfStringList);


Mime
View raw message