Don't report AbortCompilation exceptions from parser#4808
Don't report AbortCompilation exceptions from parser#4808iloveeclipse merged 1 commit intoeclipse-jdt:masterfrom
Conversation
Regression from eclipse-jdt#4451 & eclipse-jdt#4302. If Java Editor interrupts hover computation, nothing should be reported, as it is expected. After changes above two errors are reported into the log (with same stack). Fixes eclipse-jdt/eclipse.jdt.ui#2769
|
This looks well aligned with existing stuff! By debugging tests like org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2.test0521(), I could observe that the very location of your fix may already throw OperationCanceledException, which is wrapped in AbortCompilation in this call stack: So adding another scenario to the same policy looks safe. And in the scenario from eclipse-jdt/eclipse.jdt.ui#2769 this OperationCanceledException will be explicitly caught from the try-catch surrounding:
While looking left and right at other silent AbortCompilation, I wondered if this guy should be improved, too: org.eclipse.jdt.internal.compiler.ProcessTaskManager.removeNextUnits() throws AbortCompilation like this: } catch (InterruptedException interrupt) {
throw new AbortCompilation(true/* silent */, new RuntimeException(interrupt));
}This looks similar to the Parser use case, doesn't it? Could we think of a situation where this I'll leave it to you, if you want to add a change for ProcessTaskManager. Otherwise the proposed change already looks good to me. |
This opens another can of worms. immediately handled here in same method: and the wrapped ... and then it looks like no one handles this exception properly, we have lot of callers here:
|
|
Follow up: #4809 |

Regression from
#4451 & #4302.
If Java Editor interrupts hover computation, nothing should be reported, as it is expected. After changes above two errors are reported into the log (with same stack).
Fixes eclipse-jdt/eclipse.jdt.ui#2769