fix: reject null array in BitonicSort with IllegalArgumentException - #7551
Closed
zeeshanzzz788 wants to merge 1 commit into
Closed
fix: reject null array in BitonicSort with IllegalArgumentException#7551zeeshanzzz788 wants to merge 1 commit into
zeeshanzzz788 wants to merge 1 commit into
Conversation
Null arrays previously failed with an incidental NPE when reading length. Validate explicitly and add a regression test. Fixes TheAlgorithms#7549
zeeshanzzz788
requested review from
DenizAltunkapan,
alxkm and
yanglbme
as code owners
August 2, 2026 02:08
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7551 +/- ##
=========================================
Coverage 80.43% 80.44%
- Complexity 7456 7459 +3
=========================================
Files 815 815
Lines 24053 24055 +2
Branches 4731 4732 +1
=========================================
+ Hits 19346 19350 +4
Misses 3944 3944
+ Partials 763 761 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
already solved |
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.
Description
BitonicSort.sortpreviously dereferenced a null array when readingarray.length, producing an incidentalNullPointerException.Validate null input first, throw a clear
IllegalArgumentException, and add a regression test.Fixes #7549