groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Trivial refactoring for `GString`
Date Fri, 05 Jan 2018 14:30:57 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 033acfb42 -> fece39d61


Trivial refactoring for `GString`


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/fece39d6
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/fece39d6
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/fece39d6

Branch: refs/heads/master
Commit: fece39d617570e6778141b2416d4e8363250777d
Parents: 033acfb
Author: sunlan <sunlan@apache.org>
Authored: Fri Jan 5 22:30:47 2018 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Fri Jan 5 22:30:47 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/fece39d6/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;
 


Mime
View raw message