Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X efc9f68ee -> f2ad43d2d
Minor refactoring (cherry picked from commit ae7b947) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/f2ad43d2 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/f2ad43d2 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/f2ad43d2 Branch: refs/heads/GROOVY_2_6_X Commit: f2ad43d2d6d2ea0b3b631bc985c88ff8cc0476fd Parents: efc9f68 Author: sunlan <[email protected]> Authored: Wed Dec 6 11:02:25 2017 +0800 Committer: sunlan <[email protected]> Committed: Wed Dec 6 11:02: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/f2ad43d2/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);
