[
https://issues.apache.org/jira/browse/GROOVY-9822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christopher Smith updated GROOVY-9822:
--------------------------------------
Description:
This appears similar to GROOVY-9565, but it's happening in a context that is
generics-free as far as I can tell.
{code}
Caused by: java.lang.StackOverflowError
at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.isUsingGenerics
(DecompiledClassNode.java:86)
at
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
(StaticTypeCheckingSupport.java:1880)
at
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
(StaticTypeCheckingSupport.java:1870)
at
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
(StaticTypeCheckingSupport.java:1827)
at
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
(StaticTypeCheckingSupport.java:1816)
at
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
(StaticTypeCheckingSupport.java:1882)
{code}
I managed attempted to trim down the example, but not without referring to the
TinkerPop classes (3.4.8). This code triggers the recursion:
{code:groovy}
import
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy
import org.apache.tinkerpop.gremlin.structure.Graph
import groovy.transform.CompileStatic
@CompileStatic
class Groovy9822 {
static GraphTraversalSource readOnly(Graph graph) {
def i = ReadOnlyStrategy.instance()
graph.traversal().withStrategies(i)
}
}
{code}
Removing the second {{i}} so that the varargs is empty and the instance is not
passed to {{withStrategies}} prevents the error. In case it is relevant, the
{{withStrategies}} method takes a non-generic {{TraversalStrategy...}}, but the
class declaration of {{ReadOnlyStrategy}} is as follows:
{code:java}
public final class ReadOnlyStrategy extends
AbstractTraversalStrategy<TraversalStrategy.VerificationStrategy> implements
TraversalStrategy.VerificationStrategy
{code}
was:
This appears similar to GROOVY-9565, but it's happening in a context that is
generics-free as far as I can tell.
{code}
Caused by: java.lang.StackOverflowError
at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.isUsingGenerics
(DecompiledClassNode.java:86)
at
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
(StaticTypeCheckingSupport.java:1880)
at
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
(StaticTypeCheckingSupport.java:1870)
at
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
(StaticTypeCheckingSupport.java:1827)
at
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
(StaticTypeCheckingSupport.java:1816)
at
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
(StaticTypeCheckingSupport.java:1882)
{code}
I managed attempted to trim down the example, but not without referring to the
TinkerPop classes (3.4.8). This code triggers the recursion:
{code:groovy}
import
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy
import org.apache.tinkerpop.gremlin.structure.Graph
import groovy.transform.CompileStatic
@CompileStatic
class Groovy9822 {
static GraphTraversalSource readOnly(Graph graph) {
def i = ReadOnlyStrategy.instance()
graph.traversal().withStrategies(i)
}
}
{code}
Removing the second {{i}} so that the varargs is empty and the instance is not
passed to {{withStrategies}} prevents the error. In case it is relevant, the
{{withStrategies}} method takes a non-generic {{TraversalStrategy}}, but the
class declaration of {{ReadOnlyStrategy}} is as follows:
{code:java}
public final class ReadOnlyStrategy extends
AbstractTraversalStrategy<TraversalStrategy.VerificationStrategy> implements
TraversalStrategy.VerificationStrategy
{code}
> StackOverflowError in STC
> -------------------------
>
> Key: GROOVY-9822
> URL: https://issues.apache.org/jira/browse/GROOVY-9822
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 3.0.6
> Reporter: Christopher Smith
> Priority: Major
>
> This appears similar to GROOVY-9565, but it's happening in a context that is
> generics-free as far as I can tell.
> {code}
> Caused by: java.lang.StackOverflowError
> at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.isUsingGenerics
> (DecompiledClassNode.java:86)
> at
> org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
> (StaticTypeCheckingSupport.java:1880)
> at
> org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
> (StaticTypeCheckingSupport.java:1870)
> at
> org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
> (StaticTypeCheckingSupport.java:1827)
> at
> org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
> (StaticTypeCheckingSupport.java:1816)
> at
> org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.applyGenericsContext
> (StaticTypeCheckingSupport.java:1882)
> {code}
> I managed attempted to trim down the example, but not without referring to
> the TinkerPop classes (3.4.8). This code triggers the recursion:
> {code:groovy}
> import
> org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource
> import
> org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy
> import org.apache.tinkerpop.gremlin.structure.Graph
> import groovy.transform.CompileStatic
> @CompileStatic
> class Groovy9822 {
> static GraphTraversalSource readOnly(Graph graph) {
> def i = ReadOnlyStrategy.instance()
> graph.traversal().withStrategies(i)
> }
> }
> {code}
> Removing the second {{i}} so that the varargs is empty and the instance is
> not passed to {{withStrategies}} prevents the error. In case it is relevant,
> the {{withStrategies}} method takes a non-generic {{TraversalStrategy...}},
> but the class declaration of {{ReadOnlyStrategy}} is as follows:
> {code:java}
> public final class ReadOnlyStrategy extends
> AbstractTraversalStrategy<TraversalStrategy.VerificationStrategy> implements
> TraversalStrategy.VerificationStrategy
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)