Visitar URL original
[Java] Make non-extensible classes final instead of suppressing CT_CONSTRUCTOR_THROW by mxtymoshyk · Pull Request #40444 · apache/beam · GitHub
Skip to content

[Java] Make non-extensible classes final instead of suppressing CT_CONSTRUCTOR_THROW - #40444

Open
mxtymoshyk wants to merge 2 commits into
apache:masterfrom
mxtymoshyk:spotbugs-final-classes
Open

mxtymoshyk wants to merge 2 commits into
apache:masterfrom
mxtymoshyk:spotbugs-final-classes

Conversation

@mxtymoshyk

Copy link
Copy Markdown
Contributor

Follow-up to #40008. @kennknowles flagged a set of classes there that can be final, so this PR makes them final.

It makes 31 classes final and removes their CT_CONSTRUCTOR_THROW suppressions. None of them has a subclass or a Mockito mock. BoundedTrieData keeps its separate IS2_INCONSISTENT_SYNC suppression.

StatefulDoFnRunner stays non-final because ExecutableStageDoFnOperator creates an anonymous subclass of it.

Main and test code compile, and spotbugsMain passes on the touched modules, including Flink 1.20 and 2.2. I did not run the unit tests locally.

This builds on #40008, so the diff includes its commits until that merges.

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.73%. Comparing base (76f6e6d) to head (931d107).
⚠️ Report is 93 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #40444      +/-   ##
============================================
+ Coverage     56.16%   58.73%   +2.56%     
- Complexity     2288    13913   +11625     
============================================
  Files          1124     2585    +1461     
  Lines        178336   271694   +93358     
  Branches       1489    11243    +9754     
============================================
+ Hits         100170   159573   +59403     
- Misses        75645   106113   +30468     
- Partials       2521     6008    +3487     
Flag Coverage Δ
java 65.26% <ø> (-10.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kennknowles
kennknowles self-requested a review October 7, 2026 19:14
@mxtymoshyk
mxtymoshyk force-pushed the spotbugs-final-classes branch from 0e85cfd to 931d107 Compare October 8, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant