Skip to content

Isolate generator runtime failures so one class cannot abort the round - #197

Merged
AndreasIgel merged 2 commits into
java-helpers:mainfrom
AndreasIgel:feature/175-roaster-mapper-resilience
Jul 19, 2026
Merged

AndreasIgel merged 2 commits into
java-helpers:mainfrom
AndreasIgel:feature/175-roaster-mapper-resilience

Conversation

@AndreasIgel

Copy link
Copy Markdown
Collaborator

Summary

Hardens generator error handling so a single failing class no longer aborts the whole annotation-processing round.

RoasterMapper reports mapping failures via RoasterMapperException, a RuntimeException. During class rendering this escaped the per-element and Jackson resilience loops in BuilderProcessor (which catch only the checked BuilderException), aborting generation for every remaining element.

RoasterCodeGenerator.generateClass(...) now converts RuntimeExceptions thrown while building the class source into a BuilderException, so the existing resilience loops isolate the failure to the offending class (a warning by default) and keep generating the rest.

Other error-handling paths in GeneratorRegistry, RoasterCodeGenerator, and RoasterMapper were reviewed; findings are documented in the linked issue.

Validation

mvn clean verify — green (284 processor tests). New RoasterCodeGeneratorResilienceTest asserts a rendering RoasterMapperException is surfaced as a BuilderException.

Fixes #175

RoasterMapper reports mapping failures via RoasterMapperException, a
RuntimeException. During class rendering this escaped the per-element and
Jackson resilience loops in BuilderProcessor (which catch only
BuilderException), aborting the entire processing round.

Convert RuntimeExceptions thrown while building the class source into the
checked BuilderException in RoasterCodeGenerator.generateClass so callers
isolate the failure to the offending class and keep generating the rest.

Fixes java-helpers#175

Co-Authored-By: Andreas Igel <andreas.igel@computacenter.com>
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@AndreasIgel
AndreasIgel merged commit 7ddd4c1 into java-helpers:main Jul 19, 2026
6 checks passed
@AndreasIgel
AndreasIgel deleted the feature/175-roaster-mapper-resilience branch July 19, 2026 16:41
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.

RoasterMapper RuntimeExceptions bypass per-builder generation resilience

1 participant