You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/05/16 16:03:51 UTC

[groovy] 01/02: Trivial refactoring: Make field final and add `@Override` to method declaration

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 136933231ab711df1158212e8442bf162b0a04d9
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat May 16 23:31:48 2020 +0800

    Trivial refactoring: Make field final and add `@Override` to method declaration
    
    (cherry picked from commit 84fc123705b9646e8e5161591dfa2e2c46a2bf27)
---
 src/main/java/org/codehaus/groovy/runtime/GStringImpl.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/GStringImpl.java b/src/main/java/org/codehaus/groovy/runtime/GStringImpl.java
index b6f0a2c..4b660b1 100644
--- a/src/main/java/org/codehaus/groovy/runtime/GStringImpl.java
+++ b/src/main/java/org/codehaus/groovy/runtime/GStringImpl.java
@@ -29,7 +29,7 @@ import groovy.lang.GString;
  */
 public class GStringImpl extends GString {
     private static final long serialVersionUID = 3581289038662723858L;
-    private String[] strings;
+    private final String[] strings;
 
     /**
      * Create a new GString with values and strings.
@@ -56,6 +56,7 @@ public class GStringImpl extends GString {
      * the values will result in changes of the GString. It is not recommended
      * to do so.
      */
+    @Override
     public String[] getStrings() {
         return strings;
     }