You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[java][bidi] Generated types mishandle special numbers and inbound nulls #18129
Two defects in the generated Java BiDi types, verified on trunk after #17777. Both are Java-only; Python and Ruby already behave correctly.
NumberValue cannot carry a special number. Inbound {"type":"number","value":"NaN"} throws "value must be one of its declared union types"; outbound toMap() emits the raw SpecialNumber enum instead of "NaN". Regression against the hand-written API for any script.evaluate returning NaN or Infinity. Fix: in appendInlineUnionValidation, coerce a String through the enum arm's fromJson; in serializeExpr, add a union branch that calls toWireValue() on an enum arm. Failing test: NumberValueTest (two cases, both directions).
Inbound null handling.{"sharedId":"node","handle":null} decodes without error, though handle is not nullable (ADR 17786 decisions 4 and 7). Info.parent set to null and omitted both give parentSet == false, though the SetOverride plumbing exists. Fix: give every generated type its own fromJson, reject a present-but-null non-nullable field there, and pass Optional.of(map.containsKey(wire)) as the SetOverride argument. Keep ConstructorCoercer untouched; it is shared by all of Selenium Java.
Both tests belong in the generator suite proposed in #18128.
Hi @titusfortner, Can I pick this up? I'd do the NumberValue fix first as its own PR (enum-arm coercion in appendInlineUnionValidation, toWireValue() in serializeExpr, with NumberValueTest covering both directions), then the null handling in a separate PR, since that one changes fromJson for every generated type.
Activity
yashp676 commentedon Oct 9, 2026
Hi @titusfortner, Can I pick this up? I'd do the NumberValue fix first as its own PR (enum-arm coercion in appendInlineUnionValidation, toWireValue() in serializeExpr, with NumberValueTest covering both directions), then the null handling in a separate PR, since that one changes fromJson for every generated type.