Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elvis assignment causes stack overflow in editor #1320

Closed
chrylis opened this issue Dec 16, 2021 · 1 comment
Closed

Elvis assignment causes stack overflow in editor #1320

chrylis opened this issue Dec 16, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@chrylis
Copy link

chrylis commented Dec 16, 2021

In 4.4.0.v202112150033-e2112, using Elvis assignment causes a stack overflow in the editor. Closing the editor allows the workbench to continue. Rewriting the assignment as a conditional prevents the stack overflow.

Offending code:

msg.messageId ?= messageIdGenerator.get()

Working code:

if (!msg.messageId) {
  msg.messageId = messageIdGenerator.get()
}

Error log:

!ENTRY org.eclipse.ui 4 0 2021-12-16 16:35:36.309
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.StackOverflowError
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeTypeForSuper(StaticTypeCheckingVisitor.java:666)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:568)
        at org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:70)
        at org.codehaus.groovy.ast.CodeVisitorSupport.visitPropertyExpression(CodeVisitorSupport.java:340)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1689)
        at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:550)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1676)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpression(StaticTypeCheckingVisitor.java:706)
        at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitPropertyExpression(StaticCompilationVisitor.java:564)
        at org.codehaus.groovy.ast.expr.PropertyExpression.visit(PropertyExpression.java:63)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:762)
        at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:58)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallArguments(StaticTypeCheckingVisitor.java:3124)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallExpression(StaticTypeCheckingVisitor.java:3826)
        at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethodCallExpression(StaticCompilationVisitor.java:414)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.ensureValidSetter(StaticTypeCheckingVisitor.java:1050)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:766)
        at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:58)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallArguments(StaticTypeCheckingVisitor.java:3124)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallExpression(StaticTypeCheckingVisitor.java:3826)
        at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethodCallExpression(StaticCompilationVisitor.java:414)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.ensureValidSetter(StaticTypeCheckingVisitor.java:1050)
        at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:766)
        at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:58)
(repeat)
@chrylis chrylis changed the title Elvis assignment causes stack overflow Elvis assignment causes stack overflow in editor Dec 16, 2021
@eric-milles eric-milles self-assigned this Dec 16, 2021
@eric-milles eric-milles added this to the v4.4.0 milestone Dec 16, 2021
@eric-milles
Copy link
Member

eric-milles added a commit that referenced this issue Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants