[ https://issues.apache.org/jira/browse/GROOVY-7722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King updated GROOVY-7722: ------------------------------ Description: I put a sample code to GitHub. https://github.com/takahirom/groovy-stackoverflow-bug I can reproduce it following code. And This error hasn't occurred in java8. {code} import java.util.*; interface Action1<T> { void call(T t); } abstract class Subscriber<T> { } interface OnSubscribe<T> extends Action1<Subscriber<? super T>> { } new OnSubscribe<List>() { @Override public void call(Subscriber<? super List> o){ System.out.println("called"); } }.call(null); {code} StackTrace: {noformat} $groovy -d Test.groovy Caught: java.lang.StackOverflowError java.lang.StackOverflowError at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:318) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) {noformat} was: I put a sample code to GitHub. https://github.com/takahirom/groovy-stackoverflow-bug I can reproduce it following code. And This error hasn't occurred in java8. ---- import java.util.*; interface Action1<T> { void call(T t); } abstract class Subscriber<T> { } interface OnSubscribe<T> extends Action1<Subscriber<? super T>> { } new OnSubscribe<List>() { @Override public void call(Subscriber<? super List> o){ System.out.println("called"); } }.call(null); ---- StackTrace: ---- $groovy -d Test.groovy Caught: java.lang.StackOverflowError java.lang.StackOverflowError at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:318) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) at org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) ---- > StackOverflowError when use anonymous class with generics. > ---------------------------------------------------------- > > Key: GROOVY-7722 > URL: https://issues.apache.org/jira/browse/GROOVY-7722 > Project: Groovy > Issue Type: Bug > Components: ast builder > Affects Versions: 2.4.4 > Environment: Groovy Version: 2.4.4 JVM: 1.8.0_51 Vendor: Oracle > Corporation OS: Mac OS X > Reporter: taka men > Original Estimate: 12h > Remaining Estimate: 12h > > I put a sample code to GitHub. > https://github.com/takahirom/groovy-stackoverflow-bug > I can reproduce it following code. And This error hasn't occurred in java8. > {code} > import java.util.*; > interface Action1<T> { > void call(T t); > } > abstract class Subscriber<T> { > } > interface OnSubscribe<T> extends Action1<Subscriber<? super T>> { > } > new OnSubscribe<List>() { > @Override > public void call(Subscriber<? super List> o){ > System.out.println("called"); > } > }.call(null); > {code} > StackTrace: > {noformat} > $groovy -d Test.groovy > Caught: java.lang.StackOverflowError > java.lang.StackOverflowError > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:318) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > at > org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse(GenericsUtils.java:342) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)