Repository navigation
Private constructors for static-only classes - #10
Conversation
ArrayUtils, BinarySearch, Combinatorics, Geometry, Measurement, Numbers, NumberTheory, Statistics and StringUtils only have static methods, so they get a private constructor like Sequences. The eight shouldCreateInstance tests that only existed to cover the implicit public constructor are removed; JaCoCo leaves private empty constructors out of coverage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
✅ No blocking issues noticed
No blocking findings were identified. Functional tests are present, but constructor visibility and unaffected instantiable classes lack explicit automated coverage.
About this PR
- Add automated tests covering constructor visibility for the utility classes and confirming that the intended object-oriented classes remain instantiable.
Test suggestions
- Verify utility classes do not expose public constructors
- Run existing functional tests for each utility class
- Verify Reader and SampleBuilder remain instantiable
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify utility classes do not expose public constructors
2. Verify Reader and SampleBuilder remain instantiable
Make this review better
TIP Add a ticket key to the branch or title so the reviewer can check the PR against it. Or tell us which ticket tracker you use here.
TIP Add Codacy review.md instructions or an AGENTS.md so the reviewer knows your conventions.
TIP How was this review? Give us feedback
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10 +/- ##
============================================
+ Coverage 94.09% 94.17% +0.08%
+ Complexity 264 256 -8
============================================
Files 24 24
Lines 593 584 -9
Branches 94 94
============================================
- Hits 558 550 -8
+ Misses 17 16 -1
Partials 18 18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Follow-up to #9, making the other static-only classes match
Sequences.ArrayUtils,BinarySearch,Combinatorics,Geometry,Measurement,Numbers,NumberTheory,StatisticsandStringUtilsonly have static methods (checked withjavap), so each gets aprivateconstructor. They can no longer be instantiated by mistake.shouldCreateInstancetests existed only to cover the implicit public constructor, so they're removed. JaCoCo leaves private empty constructors out of coverage, so nothing is hidden or excluded.ReaderandSampleBuilderkeep theirshouldCreateInstancetests, since those create real objects.Nothing outside those eight tests instantiated these classes.
Test plan
./mvnw verify: 574 tests (582 − 8), coverage floors met (line 97.3%, branch 91.0%)🤖 Generated with Claude Code