groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dimitry Polivaev (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-8817) MacroMethodsCache.get throws no such method error when runs under Eclipse
Date Sun, 30 Sep 2018 11:01:00 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-8817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dimitry Polivaev updated GROOVY-8817:
-------------------------------------
    Affects Version/s: 2.5.0
                       2.5.1

> MacroMethodsCache.get throws no such method error when runs under Eclipse
> -------------------------------------------------------------------------
>
>                 Key: GROOVY-8817
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8817
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 2.5.0, 2.5.1, 2.5.2
>            Reporter: Dimitry Polivaev
>            Priority: Major
>
>  
> Debugging my application  embedding Groovy 2.5.2 under Eclipse I get following exception
trace:
>  
>  
> {code:java}
> Caused by: java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.memoize.EvictableCache.getAndPut(Ljava/lang/Object;Lorg/codehaus/groovy/runtime/memoize/MemoizeCache$ValueProvider;)Ljava/lang/Object;
>     at org.codehaus.groovy.macro.transform.MacroMethodsCache.get(MacroMethodsCache.java:50)
>     at org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.findMacroMethods(MacroCallTransformingVisitor.java:118)
>     at org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.visitMethodCallExpression(MacroCallTransformingVisitor.java:89)
>     at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:66)
>     at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:71)
>     at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:196)
>     at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
>     at org.codehaus.groovy.ast.MethodCallTransformation.visit(MethodCallTransformation.java:55)
>     at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:321)
>     at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:943)
>     at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:605)
>     at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
>     at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
>     at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
>     at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
> {code}
>  
>  
> When I check the sources I see following:
>  
> {code:java}
> import org.codehaus.groovy.runtime.memoize.EvictableCache;
> ...
> private static final EvictableCache<ClassLoader, Map<String, List<MethodNode>>>
CACHE = new ConcurrentCommonCache<ClassLoader, Map<String, List<MethodNode>>>(new
WeakHashMap<ClassLoader, Map<String, List<MethodNode>>>());
>     public static Map<String, List<MethodNode>> get(final ClassLoader
classLoader) {
>         return CACHE.getAndPut(classLoader, new EvictableCache.ValueProvider<ClassLoader,
Map<String, List<MethodNode>>>() {
>             @Override
>             public Map<String, List<MethodNode>> provide(ClassLoader
key) {
>                 return Collections.unmodifiableMap(getMacroMethodsFromClassLoader(key));
>             }
>         });
> {code}
> EvictableCache does not contain method `getAndPut`, although ConcurrentCommonCache does.
> Problem could be related to https://issues.apache.org/jira/browse/GROOVY-8525
> I have no idea why the issue does not come if I run the app compiled by gradle
> Gradle compiles against groovy 2.4.8 and runs with Gradle 2.5.2 (and 2.5.3-SNAPSHOT)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message