Avoid duplicated fromJson by renaming native meta::json::fromJson to fromJsonNative#4848
Open
rafaelbey wants to merge 2 commits into
Open
Avoid duplicated fromJson by renaming native meta::json::fromJson to fromJsonNative#4848rafaelbey wants to merge 2 commits into
rafaelbey wants to merge 2 commits into
Conversation
…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.
Test Results 1 108 files - 18 1 108 suites - 18 3h 27m 16s ⏱️ - 1h 2m 54s 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.
kevin-m-knight-gs
approved these changes
Jun 15, 2026
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.
Problem
meta::json::fromJson(lowercase — a 3-arg native plus a 2-arg Pure wrapper) andmeta::json::fromJSON(uppercase — the 12-overload Pure family) differ only by case. legend-pure serializes each element to a.pelt/.pbrresource keyed by its mangled name (e.g.meta/json/fromJson_String_1__Class_1__T_1_.peltvs…/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_generationfailing withcan'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::fromJsonfamily tometa::json::fromJsonNativeso the two families no longer collide:json.pure(3-arg native) andjsonExtension.pure(2-arg Pure wrapper) definitionsJsonExtensionInterpreted,FromJson)AbstractTopackage_getByUserPathlookupRoot_meta_json_fromJson_…inHelperConnectionBuilderconventions.pure)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 variantfromJson()are left untouched.No behavioural change — pure rename.