You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/12/03 20:14:00 UTC
[jira] [Assigned] (GROOVY-10302) StackOverflowError on Java 16+ for override method that delegates to super
[ https://issues.apache.org/jira/browse/GROOVY-10302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-10302:
------------------------------------
Assignee: Eric Milles
> StackOverflowError on Java 16+ for override method that delegates to super
> --------------------------------------------------------------------------
>
> Key: GROOVY-10302
> URL: https://issues.apache.org/jira/browse/GROOVY-10302
> Project: Groovy
> Issue Type: Bug
> Components: jdk conflict
> Affects Versions: 4.0.0-beta-1
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
>
> Consider the following:
> {code:groovy}
> void test() {
> def list = []
> def loader = new GroovyClassLoader() {
> @Override
> protected Class<?> findClass(String name) throws ClassNotFoundException {
> list.add(name); super.findClass(name)
> }
> }
> Class result = loader.findClass('foo.bar.Baz')
> }
> {code}
> When executed on Java 16+ it produces a StackOverflowError when resolving "super.findClass(name)".
> {code}
> java.lang.StackOverflowError
> at org.codehaus.groovy.runtime.memoize.LRUCache.getAndPut(LRUCache.java:63)
> at org.codehaus.groovy.vmplugin.v8.CacheableCallSite.getAndPut(CacheableCallSite.java:48)
> at org.codehaus.groovy.vmplugin.v8.IndyInterface.lambda$fromCache$2(IndyInterface.java:298)
> at org.codehaus.groovy.vmplugin.v8.IndyInterface.doWithCallSite(IndyInterface.java:367)
> at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:295)
> at TestScript0$1.findClass(TestScript0.groovy:8)
> at java.base/jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:567)
> at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:116)
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1424)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1140)
> at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:146)
> at TestScript0$1.findClass(TestScript0.groovy:8)
> at java.base/jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:567)
> at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:116)
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1424)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1140)
> at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:146)
> at TestScript0$1.findClass(TestScript0.groovy:8)
> at java.base/jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:567)
> at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:116)
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1424)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1140)
> at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:146)
> at TestScript0$1.findClass(TestScript0.groovy:8)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)