Commit e26e1ea
committed
fix(jni): update FindClass FQNs for classes moved in the layered restructure
JNI_OnLoad resolves a handful of Java classes by hardcoded path via
env->FindClass(...). The layered restructure moved two of them into
subpackages, but the C++ paths still pointed at the old flat package, so once
the native library actually loaded (after the LlamaLoader resource-path fix),
JNI_OnLoad failed at load time with
NoClassDefFoundError: net/ladenthin/llama/LogLevel
and every native-backed Java test errored in LlamaModel.<clinit>.
Corrected the stale paths to match the current packages:
- net/ladenthin/llama/LlamaException -> net/ladenthin/llama/exception/LlamaException
- net/ladenthin/llama/LogLevel -> net/ladenthin/llama/value/LogLevel
(FindClass + the four GetStaticFieldID "L...;" field signatures)
LlamaModel (root) and args/LogFormat were already correct; LoadProgressCallback
appears only in a comment in the generated jllama.h (regenerated by javac -h),
not in a FindClass, so it needs no change.
Verified locally: incremental native rebuild + forcing LlamaModel.<clinit>
(System.load -> JNI_OnLoad) now completes with no NoClassDefFoundError — the
JNI class lookups resolve. Same stale-FQN-after-restructure class as the
LlamaLoader resource-path, spotbugs-exclude, PIT-target and CMake-OSInfo repairs.1 parent b4443b1 commit e26e1ea
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
483 | | - | |
| 482 | + | |
| 483 | + | |
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
| |||
0 commit comments