Commit 07cabfb
committed
spotbugs(WEM+UVA) Batches 4+5: leaf-class enrichments + array→varargs (10 cleared)
Batch 4 — leaf-class WEM (5 sites):
- ChatMessage.requireNonEmpty: message now distinguishes
null vs size=0 input
- ChatRequest.setMaxToolRounds: message now includes the
rejected value
- ContentPart.imageBytes: message now includes bytes.length so the
operator knows which call failed
- LlamaLoader.getNativeResourcePath: message now includes the active
classLoader so the operator can debug class-loading issues
- LlamaPublisher.subscribe: message now references reactive-streams
§1.9 and includes the calling thread name (the spec rule citation
helps callers, the thread name is the WEM runtime expression)
Batch 5 — UVA array → varargs (5 sites):
- InferenceParameters.setPenaltyPrompt(int[]) -> int...
- LlamaModel.decode(int[]) -> int...
- LlamaModel.decodeBytes(int[]) -> int... (native)
- LlamaModel.handleDetokenize(int[]) -> int... (native)
- ParameterJsonSerializer.buildIntArray(int[]) -> int...
Varargs is source-compatible with all existing array call sites; the
new call shape f(1, 2, 3) is additionally allowed. Bytecode signature
stays [I with the ACC_VARARGS bit flipped on — JNI doesn't enforce
the bit, so native method signatures are unchanged on the C side.
Test impact (LlamaPublisherTest.nullSubscriberThrows):
- Previously: assertEquals("subscriber", ...) — exact-match assertion.
- Now: assertTrue(msg.startsWith("reactive-streams §1.9: subscriber
must not be null"), ...) — prefix-match so the runtime thread-name
suffix doesn't break the assertion across environments.
Test slice green: 162 tests across ChatMessageTest (2),
ChatRequestTest, ContentPartTest (14), LlamaLoaderTest (21),
LlamaPublisherTest (4), InferenceParametersTest (86),
ParameterJsonSerializerTest (35).
SpotBugs Max+Low: WEM goes 5 -> 0, UVA goes 5 -> 0.
Total jllama: 34 -> 25.1 parent 311f8d6 commit 07cabfb
9 files changed
Lines changed: 20 additions & 11 deletions
File tree
- src
- main/java/net/ladenthin/llama
- json
- test/java/net/ladenthin/llama
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| |||
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
703 | | - | |
| 703 | + | |
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
0 commit comments