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:22:10 UTC
groovy git commit: align protected field types between 2.5/2.6 with
3.0 for binary compatibility (port for 2.5/2.6)
Repository: groovy
Updated Branches:
refs/heads/GROOVY_2_5_X 95945fd83 -> 31c183e99
align protected field types between 2.5/2.6 with 3.0 for binary compatibility (port for 2.5/2.6)
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/31c183e9
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/31c183e9
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/31c183e9
Branch: refs/heads/GROOVY_2_5_X
Commit: 31c183e996f655e3e592858247b4175c51156dda
Parents: 95945fd
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:21:35 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/31c183e9/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/31c183e9/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 8581879..116c55d 100644
--- a/src/main/groovy/groovy/lang/GroovyClassLoader.java
+++ b/src/main/groovy/groovy/lang/GroovyClassLoader.java
@@ -81,13 +81,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];
@@ -102,12 +95,12 @@ public class GroovyClassLoader extends URLClassLoader {
* This cache contains mappings of file name to class. It is used
* to bypass compilation.
*/
- protected final ConcurrentCommonCache<String, Class> sourceCache = new ConcurrentCommonCache<String, Class>();
+ protected final EvictableCache<String, Class> sourceCache = new ConcurrentCommonCache<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() {
@@ -320,7 +313,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