INRIA / INRIA/spoon

Spoon throws StackOverflowError

Open
#3,570 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

Hello, I wanted to report another common issue I am encountering during my research. For instance, while parsing [https://github.com/stanfordnlp/CoreNLP/commit/b95cd18ce7e865bcb7cc3f3ade2c2e08295c6d6f](https://github.com/stanfordnlp/CoreNLP/commit/b95cd18ce7e865bcb7cc3f3ade2c2e08295c6d6f) using Spoon as a library, I get this error:

```
16:56:41 [main] DEBUG Could not find declaration for variable Language at (/home/fenn/data/repos/CoreNLP/src/edu/stanford/nlp/pipeline/CoreNLPProtos.java:161).
16:56:41 [main] DEBUG Could not find declaration for variable Sentiment at (/home/fenn/data/repos/CoreNLP/src/edu/stanford/nlp/pipeline/CoreNLPProtos.java:288).
16:56:41 [main] DEBUG Could not find declaration for variable NaturalLogicRelation at (/home/fenn/data/repos/CoreNLP/src/edu/stanford/nlp/pipeline/CoreNLPProtos.java:433).
16:56:48 [main] DEBUG Freed memory of version: 1-b95cd18ce7e865bcb7cc3f3ade2c2e08295c6d6f
Exception in thread "main" java.lang.StackOverflowError
at spoon.reflect.visitor.CtScanner.visitCtBinaryOperator(CtScanner.java:287)
at spoon.support.reflect.code.CtBinaryOperatorImpl.accept(CtBinaryOperatorImpl.java:34)
at spoon.reflect.visitor.CtScanner.scan(CtScanner.java:177)
at spoon.reflect.visitor.AstParentConsistencyChecker.scan(AstParentConsistencyChecker.java:33)
at spoon.reflect.visitor.CtScanner.scan(CtScanner.java:169)
at spoon.reflect.visitor.CtScanner.visitCtBinaryOperator(CtScanner.java:290)
at spoon.support.reflect.code.CtBinaryOperatorImpl.accept(CtBinaryOperatorImpl.java:34)
at spoon.reflect.visitor.CtScanner.scan(CtScanner.java:177)
at spoon.reflect.visitor.AstParentConsistencyChecker.scan(AstParentConsistencyChecker.java:33)
at spoon.reflect.visitor.CtScanner.scan(CtScanner.java:169)
at spoon.reflect.visitor.CtScanner.visitCtBinaryOperator(CtScanner.java:290)
at spoon.support.reflect.code.CtBinaryOperatorImpl.accept(CtBinaryOperatorImpl.java:34)
at spoon.reflect.visitor.CtScanner.scan(CtScanner.java:177)
[...]
```

Environment:
```
environment.setEncoding(StandardCharsets.UTF_8);
environment.disableConsistencyChecks();
environment.setComplianceLevel(9);
environment.setIgnoreDuplicateDeclarations(true);
environment.setCommentEnabled(false);
environment.setNoClasspath(true);
environment.setShouldCompile(false);
```

Java:
```
openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7-Ubuntu-1ubuntu1)
OpenJDK 64-Bit Server VM (build 14.0.1+7-Ubuntu-1ubuntu1, mixed mode, sharing)
```

Thank you for your help.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.