fix(java): drop one trailing null/undefined argument on this-calls - #65
Merged
Conversation
The generated Java surface is uniformly (required..., Object... optionals),
and a bare trailing null is ambiguous to javac ('non-varargs call of varargs
method with inexact argument type for last parameter') - 8 warning sites in
ccxt generated cores, inventoried in ccxt/ccxt#29617.
Omission is behaviorally identical to the current emission: both terminal
varargs readers on the ccxt java side (Helpers.getArg and SafeMethods.opt)
treat a null varargs array and an empty one the same. Interior nulls and
non-this calls are untouched; the implicit-API path is unaffected (it packs
arguments into an explicit Object[] via printWrappedUnknownThisProperty and
never had the ambiguity).
kroitor
pushed a commit
that referenced
this pull request
Aug 9, 2026
The package entry points are the committed dist bundles and git-dependency installs have no prepare hook, so #65 was inert downstream until this rebuild.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the
non-varargs call of varargs method with inexact argument type for last parameterjavac warning class in ccxt's generated Java cores — 8 sites inventoried in ccxt/ccxt#29617 (PacificaCore ×2, pro/HyperliquidCore, BitfinexCore, prediction/LimitlessCore, prediction/HyperliquidCore ×2, ZebpayCore); the ninth (hand-written example) was fixed directly in ccxt/ccxt#29681.Mechanism: the generated Java surface is uniformly
(required..., Object... optionals)— 364 varargs signatures inBaseExchange.java— so a transpiledthis.method(..., undefined)emits a bare trailingnullthat javac can't disambiguate between one-null-argument and null-varargs-array.Fix: a Java-scoped
printArgsForCallExpressionoverride (slot was free — no prior java override) drops exactly one trailingNullKeyword/undefinedargument when the receiver isthis. Design notes:Helpers.getArg:v == null || v.length <= index → def;SafeMethods.opt:dv == null || dv.length == 0 → null) treat a null array and an empty array the same, sof(x, null)≡f(x)at runtime today.undefinedinto a required trailing param) fails loudly at:lib:compileJava, never silently.printWrappedUnknownThisPropertypacks an explicitObject[]and never had the ambiguity).Tests: 3 new cases (safe-family + parse + handleParam shapes, single-drop/interior-null preservation, non-this negative). Full java suite 100/100; cross-language suites python+cs 93/93, php+go 72/72 — zero regressions.
Follow-up on the ccxt side after the version bump: verify zero warnings in a clean
:lib:compileJava, then consider-Werroron the category so the class can't regrow.