Commit c42a2fc
committed
fix(ChatMessage): restore IllegalArgumentException on null parts list
Commit f97c85d (spotbugs RCN cleanup) removed the null branch inside
requireNonEmpty under the assumption that the JSpecify @nonnull default
made parts==null unreachable. The deliberately type-cast call site in
MultimodalMessagesTest.nullPartsListIsRejected bypasses that static
check at compile time, so the runtime path now NPEs inside
requireNonEmpty(parts).isEmpty() instead of throwing the documented
IllegalArgumentException.
Restore the contract by validating null at the public-constructor
boundary (the right place for external-input validation) and keep the
private requireNonEmpty focused on the empty case.1 parent 647f517 commit c42a2fc
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| |||
0 commit comments