eclipse-xtext / eclipse-xtext/xtext
Xtend IDE crashes with StackOverflowError
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 831
- Forks
- 330
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
Description
Hi,
I've extracted a minimal example of Xtend code that makes the Xtend IDE (version 2.18) crash with the following message:
org.eclipse.xtext.ui.editor.outline.impl.OutlinePage - Error initializing outline
java.lang.StackOverflowError
Here is the code making the IDE crash:
class Ouch<T> {
def void crazyStuff() {
new CrashMe<T> {
override foo(T t) {
}
}
}
}
abstract class CrashMe<T> extends Ouch<T> {
def void foo(T t)
}
It looks like a case of infinite recursion, here is an extract of the stack trace:
java.lang.StackOverflowError
at org.eclipse.xtext.xbase.typesystem.references.ParameterizedTypeReference.accept(ParameterizedTypeReference.java:857)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.getBoundTypeArgument(TypeParameterSubstitutor.java:154)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:112)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:36)
at org.eclipse.xtext.xbase.typesystem.references.ParameterizedTypeReference.accept(ParameterizedTypeReference.java:857)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.getBoundTypeArgument(TypeParameterSubstitutor.java:154)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:112)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:36)
at org.eclipse.xtext.xbase.typesystem.references.ParameterizedTypeReference.accept(ParameterizedTypeReference.java:857)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.getBoundTypeArgument(TypeParameterSubstitutor.java:154)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:112)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:36)
at org.eclipse.xtext.xbase.typesystem.references.ParameterizedTypeReference.accept(ParameterizedTypeReference.java:857)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.getBoundTypeArgument(TypeParameterSubstitutor.java:154)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:112)
at org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor.doVisitParameterizedTypeReference(TypeParameterSubstitutor.java:36)
at org.eclipse.xtext.xbase.typesystem.references.ParameterizedTypeReference.accept(ParameterizedTypeReference.java:857)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the minimal Xtend example and inspect the outline initialization failure in the stack trace. Read ParameterizedTypeReference.java and TypeParameterSubstitutor.java, especially the recursive calls shown; done means the example no longer raises StackOverflowError and the IDE outline initializes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100