Skip to content

Extract duplicate logic to reduce LOC across C++ and Java#82

Merged
bernardladenthin merged 1 commit intomasterfrom
claude/plan-code-refactoring-bBOPQ
Apr 8, 2026
Merged

Extract duplicate logic to reduce LOC across C++ and Java#82
bernardladenthin merged 1 commit intomasterfrom
claude/plan-code-refactoring-bBOPQ

Conversation

@bernardladenthin
Copy link
Copy Markdown
Owner

  • jni_helpers.hpp: deduplicate embedding_to_jfloat_array_impl and tokens_to_jint_array_impl via a shared vec_to_jarray_impl template
  • jllama.cpp: extract require_embedding_support() guard used by embed() and handleEmbeddings()
  • JsonParameters.java: add mapToJsonObject() utility for map-to-JSON serialization, used by both setChatTemplateKwargs implementations
  • InferenceParameters.java: extract buildBiasPairArray() and buildDisablePairArray() helpers to deduplicate four near-identical token bias serialization methods

https://claude.ai/code/session_01AGrb17h4jLeWr1de6RGubX

- jni_helpers.hpp: deduplicate embedding_to_jfloat_array_impl and
  tokens_to_jint_array_impl via a shared vec_to_jarray_impl template
- jllama.cpp: extract require_embedding_support() guard used by
  embed() and handleEmbeddings()
- JsonParameters.java: add mapToJsonObject() utility for map-to-JSON
  serialization, used by both setChatTemplateKwargs implementations
- InferenceParameters.java: extract buildBiasPairArray() and
  buildDisablePairArray() helpers to deduplicate four near-identical
  token bias serialization methods

https://claude.ai/code/session_01AGrb17h4jLeWr1de6RGubX
@bernardladenthin bernardladenthin merged commit d84f8bf into master Apr 8, 2026
14 checks passed
@bernardladenthin bernardladenthin deleted the claude/plan-code-refactoring-bBOPQ branch April 8, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants