Commit 347bdd1
chore: make SpotBugs (effort=Max, threshold=Low) clean again
SpotBugs is already enabled at effort=Max/threshold=Low (fb-contrib + findsecbugs) and bound to the
verify phase — but the model-backed CI jobs run mvn test / mvn package, which never reach verify, so
the audit Tier-1–3 fixes (merged in #258) introduced 6 findings that went uncaught. Resolve all 6:
- ITC_INHERITANCE_TYPE_CHECKING (JsonParameters.withScalar): replace the instanceof Float +
instanceof Double pair with a single `instanceof Number && !Double.isFinite(...)` check (also tidier).
- EI_EXPOSE_REP (ChatMessage.getToolCalls): return a fresh Collections.unmodifiableList view instead of
the stored list, mirroring getParts — the internal list is never exposed.
- THROWS_METHOD_THROWS_RUNTIMEEXCEPTION x3 (LlamaModel.completeBatch / completeBatchWithStats /
chatBatch): the re-throw of the captured first failure is intentional — narrow <Match> suppression
with rationale in spotbugs-exclude.xml.
- OCP_OVERLY_CONCRETE_COLLECTION_PARAMETER (ChatMessage public constructor): the List<ToolCall> param is
the deliberate public-API type; widening to Collection would be a binary-incompatible change — narrow
<Match> suppression with rationale.
`mvn spotbugs:check` is green; 152 affected Java tests, Spotless, Javadoc clean. TODO.md updated
(the "flip the pom / ~65 findings" note was stale; notes that verify is not reached by the test jobs).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 90f95d0 commit 347bdd1
4 files changed
Lines changed: 47 additions & 9 deletions
File tree
- src/main/java/net/ladenthin/llama
- parameters
- value
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
439 | 447 | | |
440 | 448 | | |
441 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
350 | 380 | | |
351 | 381 | | |
352 | 382 | | |
| |||
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
149 | 147 | | |
150 | 148 | | |
151 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
| |||
0 commit comments