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 <[email protected]> Authored: Fri Jan 5 22:30:47 2018 +0800 Committer: sunlan <[email protected]> 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;
