Repository navigation
Commit 70a9811
Fixed a potential
When the `Builder` entries length does not match the `size` and `orderEntriesByValue` is used in combination with `buildKeepingLast` and there are no duplicate keys, then the size used for sorting incorrectly becomes the length of the entries array instead of the size tracked by the `Builder`. This can lead to the `sort` method trying to access null entries from the array.
RELNOTES=`collect`: Fixed a potential `NullPointerException` in `ImmutableMap.Builder` on a rare code path.
PiperOrigin-RevId: 629407343NullPointerException in ImmutableMap.Builder on a rare code path.1 parent e075e89 commit 70a9811
3 files changed
Lines changed: 33 additions & 3 deletions
File tree
- android/guava-tests/test/com/google/common/collect
- guava-tests/test/com/google/common/collect
- guava/src/com/google/common/collect
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
265 | 275 | | |
266 | 276 | | |
267 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
292 | 302 | | |
293 | 303 | | |
294 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
566 | | - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
567 | 570 | | |
568 | 571 | | |
569 | 572 | | |
| |||
640 | 643 | | |
641 | 644 | | |
642 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
643 | 653 | | |
644 | 654 | | |
645 | 655 | | |
| |||
649 | 659 | | |
650 | 660 | | |
651 | 661 | | |
652 | | - | |
| 662 | + | |
653 | 663 | | |
654 | 664 | | |
655 | 665 | | |
| |||
0 commit comments