You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2018/03/30 08:17:51 UTC

groovy git commit: align protected field types between 2.5/2.6 with 3.0 for binary compatibility

Repository: groovy
Updated Branches:
  refs/heads/master 702b95474 -> a1af00384


align protected field types between 2.5/2.6 with 3.0 for binary compatibility


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

Branch: refs/heads/master
Commit: a1af003841060e3465a0a9a13e0a4d9a0cf654e1
Parents: 702b954
Author: Paul King <pa...@asert.com.au>
Authored: Fri Mar 30 18:17:08 2018 +1000
Committer: Paul King <pa...@asert.com.au>
Committed: Fri Mar 30 18:17:08 2018 +1000

----------------------------------------------------------------------
 gradle/pomconfigurer.gradle                        |  3 +++
 src/main/groovy/groovy/lang/GroovyClassLoader.java | 13 +++----------
 2 files changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a1af0038/gradle/pomconfigurer.gradle
----------------------------------------------------------------------
diff --git a/gradle/pomconfigurer.gradle b/gradle/pomconfigurer.gradle
index 1ebe9ed..d6ee1df 100644
--- a/gradle/pomconfigurer.gradle
+++ b/gradle/pomconfigurer.gradle
@@ -550,6 +550,9 @@ project.ext.pomConfigureClosureWithoutTweaks = {
                 name 'Peter Ledbrook'
             }
             contributor {
+                name 'Scott Stirling'
+            }
+            contributor {
                 name 'Thibault Kruse'
             }
             contributor {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a1af0038/src/main/groovy/groovy/lang/GroovyClassLoader.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/groovy/lang/GroovyClassLoader.java b/src/main/groovy/groovy/lang/GroovyClassLoader.java
index 1beecfe..23c63b2 100644
--- a/src/main/groovy/groovy/lang/GroovyClassLoader.java
+++ b/src/main/groovy/groovy/lang/GroovyClassLoader.java
@@ -82,13 +82,6 @@ import java.util.Map;
  * to keep anything like a "class not found" information for that class name.
  * This includes possible parent loaders. Classes that are not cached are always
  * reloaded.
- *
- * @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
- * @author Guillaume Laforge
- * @author Steve Goetze
- * @author Bing Ran
- * @author <a href="mailto:scottstirling@rcn.com">Scott Stirling</a>
- * @author <a href="mailto:blackdrag@gmx.org">Jochen Theodorou</a>
  */
 public class GroovyClassLoader extends URLClassLoader {
     private static final URL[] EMPTY_URL_ARRAY = new URL[0];
@@ -103,12 +96,12 @@ public class GroovyClassLoader extends URLClassLoader {
      * This cache contains mappings of file name to class. It is used
      * to bypass compilation.
      */
-    protected final StampedCommonCache<String, Class> sourceCache = new StampedCommonCache<String, Class>();
+    protected final EvictableCache<String, Class> sourceCache = new StampedCommonCache<String, Class>();
 
     private final CompilerConfiguration config;
     private String sourceEncoding;
     private Boolean recompile;
-    // use 1000000 as offset to avoid conflicts with names form the GroovyShell
+    // use 1000000 as offset to avoid conflicts with names from the GroovyShell
     private static int scriptNameCounter = 1000000;
 
     private GroovyResourceLoader resourceLoader = new GroovyResourceLoader() {
@@ -321,7 +314,7 @@ public class GroovyClassLoader extends URLClassLoader {
      * @return the main class defined in the given script
      */
     public Class parseClass(final GroovyCodeSource codeSource, boolean shouldCacheSource) throws CompilationFailedException {
-        return sourceCache.getAndPut(
+        return ((StampedCommonCache<String, Class>) sourceCache).getAndPut(
                 codeSource.getName(),
                 new EvictableCache.ValueProvider<String, Class>() {
                     @Override