Wire createX() factory methods to the mapper's converter layer instead of builder methods - #7384
Merged
RanVaknin merged 2 commits intoSep 21, 2026
Conversation
createX() factory methods to the mapper's converter layer instead of builder methods
joviegas
approved these changes
Sep 21, 2026
|
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Context
#7039 code generated new factory methods that create
AttributeValues directly and avoid allocations that the Builder pattern adds. in #7073 we wired these new factory methods into the Enhanced client. This PR wires the same thing just for the MapperChanges
This PR does 2 things:
StandardModelFactories.java. This is the layer that creates the AV for the converters engine (the @deprecated Marshaller layer is untouched)Testing
Since we knew about this optimization ahead of time, adequate testing was added early on to catch potential regressions.
Write direction (convert):
StandardModelFactoriesTest(68 tests)StandardModelFactoriesV1Test(18),StandardModelFactoriesV2CompatibleTest(20),StandardModelFactoriesV2Test(21) — same assertions across all three conversion schemasStandardModelFactoriesEdgeCasesTest(14) — null/empty-string/empty-set branches (createNul)Read direction (unconvert):
StandardModelFactoriesV2UnconvertTest(21)shape/ShapeResponseTest— parameterized golden-master; reconstructs POJOs from canned attribute maps againstunmarshall_item_fixture.jsonshape/ShapeResponseBehaviorTest(6)Custom converter interaction:
ConversionToAttributeValuesTestPer-type round-trip integration (save + load):
mapper/V2CompatibleBooleansTest(24) —BOOLand boolean-as-Nmapper/SimpleStringAttributesIntegrationTest(6) —Smapper/SimpleNumericAttributesIntegrationTest(6) —Nmapper/BinaryAttributesIntegrationTest(5) —Bmapper/StringSetAttributesIntegrationTest(4) —SSmapper/NumericSetAttributesIntegrationTest(3) —NSmapper/EmptyBinarySetByteBufferAttributesTest(3) —BS+ empty-set edgeEvery
createXfactory wired in this PR (createS,createN,createB,createSs,createNs,createBs,createBool,createL,createM,createNul) has at least one test asserting its output above.Performance