Skip to content

Avoid duplicated fromJson by renaming native meta::json::fromJson to fromJsonNative#4848

Open
rafaelbey wants to merge 2 commits into
finos:masterfrom
rafaelbey:bugfix-avoid-duplicated-fromJson
Open

Avoid duplicated fromJson by renaming native meta::json::fromJson to fromJsonNative#4848
rafaelbey wants to merge 2 commits into
finos:masterfrom
rafaelbey:bugfix-avoid-duplicated-fromJson

Conversation

@rafaelbey

Copy link
Copy Markdown
Contributor

Problem

meta::json::fromJson (lowercase — a 3-arg native plus a 2-arg Pure wrapper) and meta::json::fromJSON (uppercase — the 12-overload Pure family) differ only by case. legend-pure serializes each element to a .pelt/.pbr resource keyed by its mangled name (e.g. meta/json/fromJson_String_1__Class_1__T_1_.pelt vs …/fromJSON_String_1__Class_1__T_1_.pelt). On a case-insensitive filesystem these resource paths collide and clobber each other, so a dependent repo can fail to resolve the function — e.g. core_protocol_generation failing with can't find a match for meta::json::fromJSON(String[1], Class<...>[1]) / cannot find resource …fromJSON_String_1__Class_1__T_1_.pelt.

Fix

Rename the lowercase meta::json::fromJson family to meta::json::fromJsonNative so the two families no longer collide:

  • json.pure (3-arg native) and jsonExtension.pure (2-arg Pure wrapper) definitions
  • interpreted + compiled JSON native registrations (JsonExtensionInterpreted, FromJson)
  • the variant AbstractTo package_getByUserPath lookup
  • the compiled-generated call Root_meta_json_fromJson_… in HelperConnectionBuilder
  • the java-generation prohibited-function list (conventions.pure)
  • the String->fromJson(Class[,config]) call sites (graphQL introspection tests, postgres SQL parser, elasticsearch metamodel, JSON tests)

The unrelated meta::external::format::json::functions::fromJson (Class->fromJson($data)) and the no-arg variant fromJson() are left untouched.

No behavioural change — pure rename.

…fromJsonNative

The native meta::json::fromJson (lowercase) family and the Pure
meta::json::fromJSON (uppercase) family differ only by case. legend-pure
serializes each element to a .pelt/.pbr resource keyed by its mangled name, so
on a case-insensitive filesystem these resources collide and clobber each other,
breaking the build (e.g. core_protocol_generation failing to resolve fromJSON).

Rename the lowercase meta::json::fromJson family (3-arg native + 2-arg Pure
wrapper) to fromJsonNative and update all references: the interpreted and
compiled JSON native registrations, the variant AbstractTo lookup, the
compiled-generated call in HelperConnectionBuilder, the java-generation
prohibited-function list, and the String->fromJson(Class[,config]) call sites.
The unrelated meta::external::format::json::functions::fromJson and the no-arg
variant fromJson are left untouched.
@rafaelbey rafaelbey requested a review from a team as a code owner June 14, 2026 03:01
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

Test Results

  1 108 files   -      18    1 108 suites   - 18   3h 27m 16s ⏱️ - 1h 2m 54s
14 508 tests  -    103  14 329 ✔️  -    103  179 💤 ±0  0 ±0 
37 725 runs   - 2 982  37 546 ✔️  - 2 982  179 💤 ±0  0 ±0 

Results for commit b363fbf. ± Comparison against base commit f3c33a3.

♻️ This comment has been updated with latest results.

The native meta::json::fromJson (3-arg) was renamed to fromJsonNative in
ba198e0, but AbstractTestFromJson embeds Pure source as Java strings that
call fromJson(String, Class, JSONDeserializationConfig). These strings compile
at test runtime, so the build passed but TestFromJsonCompiled and
TestFromJsonInterpreted failed with 74 'can't find a match for fromJson' errors
each. Rename the 42 call sites to fromJsonNative to match the renamed native.
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