Skip to content

Genereralize codegen classes; keep builder model processor-side (#369) - #370

Merged
AndreasIgel merged 19 commits into
java-helpers:mainfrom
igel-devin-ai:devin/1792758878-genericize-codegen-seams
Oct 23, 2026
Merged

AndreasIgel merged 19 commits into
java-helpers:mainfrom
igel-devin-ai:devin/1792758878-genericize-codegen-seams

Conversation

@igel-devin-ai

Copy link
Copy Markdown
Contributor

What

Implements #369 — genericizes the builder-named seams in the codegen layer before the #349 model move lands, so simple-codegen carries only framework-agnostic vocabulary.

Commits (one per change)

  1. model: rename ResolvedBuilder to ResolvedGeneratedType — the record TypeMappingContext.resolveGeneratedType returns becomes builder-free (typeName, funcForEmptyInstance, funcForPrefilledInstance, resultMethodName).
  2. model: rename BuilderInstantiation to TypeInstantiation — sealed instantiation-strategy family genericized: AnchorFactoryCall → NestedFactoryCall, PrefillCall components now generatedType/sourceType/methodPrefix/fieldMethodFor.
  3. analysis: rename GeneratedBuilders to GeneratedTypes — generated-types registry (typesByTarget, findGenerated).

Boundary decisions

  • Builder vocabulary that stays processor-side: BuilderConfiguration, BuilderDefinitionDto, BuilderMethodDto, BuilderNestedTypeDto, BuilderToGenerationTypeMapper — and builder-side API names like resolveUsableBuilderType/resetGeneratedBuilders (they describe builder semantics; the generic types they produce are what codegen sees).
  • Untouched: template variable names ($builderType:T, addArgument("builderType", ...)) — they render into generated source and renaming would break byte-identity.
  • TypeName.resolvedBuilder → resolvedGeneratedType (+getGeneratedType); TypeNameGeneric.elementResolvedBuilder → elementResolvedGeneratedType.

Verification

  • 509 processor + 32 example tests green
  • Regenerated example/generated-example-builder is byte-identical to the committed output
  • Zero behavior change — renames + javadoc only

After this merges, #349's model move is reworked to carry only the generic subset (GenerationTargetClassDto, TypeName family, FieldDto, MethodDto, ResolvedGeneratedType, TypeInstantiation, GeneratedTypes); the builder-domain types never leave processor/model.

@AndreasIgel AndreasIgel changed the title Genericize codegen seams; keep builder model processor-side (#369) Genereralize codegen classes; keep builder model processor-side (#369) Oct 23, 2026
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@AndreasIgel
AndreasIgel merged commit bdf11af into java-helpers:main Oct 23, 2026
6 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/1792758878-genericize-codegen-seams branch November 22, 2026 14:24
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