[ 
https://issues.apache.org/jira/browse/GROOVY-11770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18024678#comment-18024678
 ] 

Eric Milles commented on GROOVY-11770:
--------------------------------------

In order to determine {{LowestUpperBound(Job,Pod)}} it is trying to fill in the 
type args for {{Editable}} which requires {{LUB(JobBuilder,PodBuilder)}}.  This 
in turn is trying to fill in {{VisitableBuilder}} and requires {{LUB(Job,Pod)}} 
to do so.

The loop prevention is not deep.  It describes the case for {{Comparable}}:
{code:java}
            ClassNode t1 = upperBound(agt[i]);
            ClassNode t2 = upperBound(bgt[i]);
            ClassNode basicType;
            if (areEqualWithGenerics(t1, isPrimitiveType(a)?getWrapper(a):a) && 
areEqualWithGenerics(t2, isPrimitiveType(b)?getWrapper(b):b)) {
                // "String implements Comparable<String>" and "StringBuffer 
implements Comparable<StringBuffer>"
                basicType = fallback; // do not loop
            } else {
                basicType = lowestUpperBound(t1, t2);
            }
{code}

> StackOverflowError processing generics for kubernetes-client library
> --------------------------------------------------------------------
>
>                 Key: GROOVY-11770
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11770
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Paul King
>            Priority: Major
>
> When processing a file using the kubernetes-client library, the Groovy 
> compiler recurses endlessly parsing the generics.
> Repo:
> https://github.com/paulk-asert/kubernetes_client_stackoverflow
> This is just a reproducer which excludes Grails from this Grails issue/repo:
> https://github.com/apache/grails-core/issues/15082
> https://github.com/jdaugherty/grails-issue-stackoverflow-on-compile



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to