Commit 5666842
committed
Fix DoubleHashingSort: add NullPointerException for null values
- Add explicit null value check in sort() method before processing
- Throw NullPointerException when null values found in array (as expected by tests)
- Remove null handling from RobustComparator since nulls are rejected upfront
- Fix JavaDoc formatting issues (trailing spaces)
- Ensures shouldHandleArrayWithNullValues and shouldHandleListWithNullValues tests pass
Fixes:
✓ shouldHandleArrayWithNullValues: now throws expected NullPointerException
✓ shouldHandleListWithNullValues: now throws expected NullPointerException
✓ Clang-format compliance: removed trailing spaces in JavaDoc comments1 parent b3909d6 commit 5666842
File tree
2 files changed
+11
-6
lines changed- src
- main/java/com/thealgorithms/sorts
- test/java/com/thealgorithms/sorts
2 files changed
+11
-6
lines changedLines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
36 | | - | |
| 43 | + | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments