Skip to content

Conversation

@iloveeclipse
Copy link
Member

After 0dbe296 &
15c8bfb JDT UI may report errors where none should be reported because it is supposed to be "silent cancellation".

This change uses standard Java "cause" in the AbortCompilation and removes two different public fields used to keep exceptions before.

An extra change will be needed in at least one place in the UI, where org.eclipse.jdt.core.manipulation.CoreASTProvider.createAST(ITypeRoot, IProgressMonitor) should be able to inspect the provided "cause" of the RuntimeException and handle it in same way as
OperationCanceledException.

Note: AbortCompilation itself is not visible outside compiler code, so this type can't be used in UI for any checks.

Fixes eclipse-jdt/eclipse.jdt.ui#2769

After 0dbe296 &
15c8bfb JDT UI may report errors where
none should be reported because it is supposed to be "silent
cancellation".

This change uses standard Java "cause" in the `AbortCompilation` and
removes two different public fields used to keep exceptions before.

An extra change will be needed in at least one place in the UI, where
`org.eclipse.jdt.core.manipulation.CoreASTProvider.createAST(ITypeRoot,
IProgressMonitor)` should be able to inspect the provided "cause" of the
`RuntimeException` and handle it in same way as
`OperationCanceledException`.

Note: `AbortCompilation` itself is not visible outside compiler code, so
this type can't be used in UI for any checks.

Fixes eclipse-jdt/eclipse.jdt.ui#2769
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.ui that referenced this pull request Jan 29, 2026
Regression from
eclipse-jdt/eclipse.jdt.core#4451 &
eclipse-jdt/eclipse.jdt.core#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).

This change depends on the PR from JDT core below:
eclipse-jdt/eclipse.jdt.core#4807

See eclipse-jdt#2769
@iloveeclipse
Copy link
Member Author

@stephan-herrmann : since you were involved in #4302 change, could you please check this one?

The UI part needed for the fix is eclipse-jdt/eclipse.jdt.ui#2770.

@stephan-herrmann
Copy link
Contributor

@stephan-herrmann : since you were involved in #4302 change, could you please check this one?

The UI part needed for the fix is eclipse-jdt/eclipse.jdt.ui#2770.

Connecting the dots for posterity:

In the end, this current PR will probably be closed without merging.

@iloveeclipse
Copy link
Member Author

Let close this PR for now, however I highly dislike code that exposes public instance fields...

eclipse-jdt/eclipse.jdt.ui#2769 should be fixed by #4808.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CoreASTProvider.createAST reports errors on interruption

2 participants