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

RoundDispatcher swallows exception

Open
#2,396 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 10h
Merged PRs (30d)
49

Description

There is code in RoundDispatcher supposed to handle exceptions thrown in processors. However, it seems that the code is counter-intuitive and reports the exception as compile problem only.

https://github.com/eclipse-jdt/eclipse.jdt.core/blob/54b0bc24aab4614caf57a678d40d103de2c6ebdd/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundDispatcher.java#L169-L171

Here is the output we see:
```
....java:0: error: Internal compiler error: java.lang.Exception: java.lang.ExceptionInInitializerError at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:171)

/*

^

1 problem (1 error)
```

The original exception seems to be not printed.

I wonder if there is something else in the call chain that catches `AbortCompilation` and does this?

Contributor guide

Open the contributing guide

Research direction

Start at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.java lines 169-171 and reproduce the reported processor exception output. Trace the call chain for AbortCompilation to find where the original exception is lost, then verify that the resulting compiler diagnostic preserves the underlying exception details.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.