Skip to content

fix: reject null array in BitonicSort with IllegalArgumentException - #7551

Closed
zeeshanzzz788 wants to merge 1 commit into
TheAlgorithms:masterfrom
zeeshanzzz788:fix/bitonicsort-null-check
Closed

fix: reject null array in BitonicSort with IllegalArgumentException#7551
zeeshanzzz788 wants to merge 1 commit into
TheAlgorithms:masterfrom
zeeshanzzz788:fix/bitonicsort-null-check

Conversation

@zeeshanzzz788

Copy link
Copy Markdown

Description

BitonicSort.sort previously dereferenced a null array when reading array.length, producing an incidental NullPointerException.

Validate null input first, throw a clear IllegalArgumentException, and add a regression test.

Fixes #7549

Null arrays previously failed with an incidental NPE when reading
length. Validate explicitly and add a regression test.

Fixes TheAlgorithms#7549
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.44%. Comparing base (1f4e2f8) to head (90d8260).

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.
📢 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.

@DenizAltunkapan

Copy link
Copy Markdown
Member

already solved

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.

BitonicSort should reject a null array explicitly

3 participants