Repository navigation
Conversation
github-actions
Bot
requested review from
SooKim1110,
acktsap,
benelog,
jwChung and
mhyeon-lee
November 19, 2026 07:30
This was referenced Nov 19, 2026
seongahjo
force-pushed
the
refactor/container-element-candidates
branch
from
November 19, 2026 07:51
9a987a6 to
4d78f27
Compare
seongahjo
force-pushed
the
refactor/container-element-candidates
branch
from
November 19, 2026 08:18
4d78f27 to
1c66bc6
Compare
seongahjo
force-pushed
the
refactor/container-element-candidates
branch
from
November 19, 2026 08:31
1c66bc6 to
aa862aa
Compare
- Throw when a set, setLazy or register value is not assignable to the property type - Call a per-element setLazy supplier for each element - Decompose, check and rebuild Optional, Map.Entry and registered setLazy values - Infer the type arguments of Map.Entry and Optional values from their contents - Build Map.Entry nodes for Map.Entry values set into Object properties and containers
- Return element candidates from JvmContainerNodeGenerator instead of nodes - Promote and resolve element candidates the same way as object property candidates - Take a candidate's index from its ContainerElementCreationMethod - Leave container element candidates to the Java promoters in KotlinNodePromoter
seongahjo
force-pushed
the
refactor/container-element-candidates
branch
from
November 19, 2026 08:45
aa862aa to
4f4db69
Compare
This branch has not been deployed
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.
Summary
Object properties become nodes through candidates and promoters, but container elements were created as nodes directly by the
JvmContainerNodeGenerators. AMap.Entryelement therefore needed its own step after type resolution to become aMap.Entrynode.Generators now return element candidates, and the transformer promotes and resolves them with the same step as object property candidates. The candidate factory and the promoters alone decide whether a node is a plain,
Mapelement orMap.Entrynode.This is the last of four stacked PRs, based on #1398:
(Optional): Description
Generators return element candidates (object-farm-api)
JvmContainerNodeGenerator.generateContainerElementsreturnsList<JvmNodeCandidate>instead ofList<JvmNode>.JavaNodeCandidateFactory, so an element of aMap.Entrytype gets aMap.Entrycandidate.JavaMapNodeCandidates, promoted byJavaMapNodePromoter, which nothing used before.ContainerPropertyGeneratorNodeGenerator, which bridges user-registeredContainerPropertyGenerators, returns candidates too.JvmContainerNodeGeneratorthrough the fixture-monkey API, onlyContainerPropertyGenerators, so this does not change the user-facing API.One step for object properties and container elements
JvmNodeTreeTransformer.promoteAndResolveCandidateselects the candidate to promote from the set value's type, promotes it and resolves its type, for object property and container element candidates alike.resolveContainerElementTypes,promoteElementToMapEntryIfNeeded,resolveElementSharingContainerPath) are removed.Optional, shares its parent's path and is resolved without the parent's path resolvers, as before.JvmNodeTree, like object property nodes.Element index
JvmNodeCandidate.getIndex()returns the index of a candidate created by aContainerElementCreationMethod, and null otherwise.KotlinNodePromoterleaves container element candidates to the Java promoters, so element types and nullability stay as the generators decide.How Has This Been Tested?
Added
containerElementsArePromotedFromGeneratedCandidatestoJvmNodeTreeTransformerTest: the elements of aList<String>have their index, their name and their source candidateAdded
sampleOptionalOfEntrytoContainerTypeTest:Optional<Map.Entry<String, Integer>>is generated with an entryExisting tests cover list, set, array, map and
Optionalelements, andMap.Entryelements (ContainerTypeTest.sampleListOfEntries,SetOptionalAndEntryDecompositionTest.setSetOfEntriesToObjectProperty)Ran
object-farm-api,fixture-monkey,fixture-monkey-kotlin,java-tests,java-17-testsandkotlin-testswith checkstyle, Checker Framework and ktlintBenchmarks before and after this change, quick mode (
-Pjmh.quick), fork 1, run one after another, AverageTime in ms/op:AdapterBenchmark.warmWithAdapterAdapterBenchmark.warmWithAdapterWithSetAdapterBenchmark.warmWithAdapterWithThenApplyObjectGenerationBenchmark.builderGenerateOrderSheetWithFixtureMonkeyAll confidence intervals overlap, but every average is slower (2.5% to 5.9%). Each element now costs a candidate, a promoter lookup and a candidate-to-node mapping, which
JvmNodeTreecopies. Which of these costs most was not measured.Is the Document updated?
No documentation change is needed.