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 2019/08/12 08:33:38 UTC

[groovy] branch master updated: Make inner class `MethodIndex` `static`

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

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


The following commit(s) were added to refs/heads/master by this push:
     new a955189  Make inner class `MethodIndex` `static`
a955189 is described below

commit a955189d90c3a16340338db8fe87eaf3dad86130
Author: Daniel Sun <su...@apache.org>
AuthorDate: Mon Aug 12 15:46:02 2019 +0800

    Make inner class `MethodIndex` `static`
    
    A static inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class.
---
 src/main/java/groovy/lang/MetaClassImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/groovy/lang/MetaClassImpl.java b/src/main/java/groovy/lang/MetaClassImpl.java
index ee4f01e..4283b97 100644
--- a/src/main/java/groovy/lang/MetaClassImpl.java
+++ b/src/main/java/groovy/lang/MetaClassImpl.java
@@ -3981,7 +3981,7 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
         }
     };
 
-    class MethodIndex extends Index {
+    static class MethodIndex extends Index {
         public MethodIndex(boolean b) {
             super(false);
         }