fix: reject negative input in SumOfSquares and add tests#7543
Merged
alxkm merged 2 commits intoJul 26, 2026
Merged
Conversation
lieutenant-Rohit
requested review from
DenizAltunkapan,
alxkm and
yanglbme
as code owners
July 26, 2026 01:37
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7543 +/- ##
============================================
- Coverage 80.32% 80.31% -0.01%
+ Complexity 7406 7405 -1
============================================
Files 812 812
Lines 23914 23916 +2
Branches 4706 4707 +1
============================================
Hits 19208 19208
Misses 3945 3945
- Partials 761 763 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
lieutenant-Rohit
marked this pull request as draft
July 26, 2026 01:50
lieutenant-Rohit
marked this pull request as ready for review
July 26, 2026 01:50
lieutenant-Rohit
marked this pull request as draft
July 26, 2026 01:51
lieutenant-Rohit
marked this pull request as ready for review
July 26, 2026 01:51
alxkm
approved these changes
Jul 26, 2026
alxkm
left a comment
Member
There was a problem hiding this comment.
Looks good, thank you for the contribution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #7538
Added input validation to throw IllegalArgumentException for negative values.
Updated unit tests to confirm behavior.
I have read CONTRIBUTING.md.
This pull request is all my own work -- I have not plagiarized it.
All filenames are in PascalCase.
All functions and variable names follow Java naming conventions.
All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
All new algorithms include a corresponding test class that validates their functionality.
All new code is formatted with
clang-format -i --style=file path/to/your/file.java