eclipse-jdt / eclipse-jdt/eclipse.jdt.core

ASTParser cannot recover this statement that SelectionParser can

Open
#2,155 3 comments 0 reactions 1 assignee Claimed by @datho7561 View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

For `ResolveTests1_5.testBrokenSwitch0` and `ResolveTests1_5.testBrokenSwitch1`, the SelectionParser is able to recover the statements in the method, but the AssistParser isn't. It would be nice to move the hacks from the SelectionParser to the AssistParser so that ASTs created through ASTParser can access the recovered statements.

Here is the class used in the first test case; the second test case is similar.

```java
public class Test {
private static ILog test() {
return new ILog() {
@Override
public void log(String status) {
switch (status.length()) { // here
case
}
}
};
}
}
```

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.