[core] Deal with errors from threads in multithreading mode #4612
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the PR
If an error occurs in multithreading mode, PMD now rethrows this. Such errors indicate a serious problem like incomplete runtime classpath of PMD or other
VM error (out of memory) that shouldn't be swallowed.
When working on #4605 I once had an incomplete runtime classpath (I think guava was missing which jorje needs). The result was, that I didn't see any errors at all, even not with
--debug
. PMD ran fine, but Apex just didn't find anything yet. The fact, that no Apex violations were found was caught by the integration test. But it's not good, if an error is not printed at least to the console.The solution in this PR is the most basic and could be improved it any thinkable way - but this change at least should be enough to see some errors.
Note: This is not about runtime exceptions or something like that - these are already collected in the report as processing errors.
Ready?
./mvnw clean verify
passes (checked automatically by github actions)