Skip to content

codegen: move PrefillCall from generic TypeInstantiation to simple-builder - #389

Merged
AndreasIgel merged 1 commit into
java-helpers:mainfrom
igel-devin-ai:devin/1794265370-prefillcall-builder-side
Nov 10, 2026
Merged

AndreasIgel merged 1 commit into
java-helpers:mainfrom
igel-devin-ai:devin/1794265370-prefillcall-builder-side

Conversation

@igel-devin-ai

Copy link
Copy Markdown
Contributor

Summary

Resolves #371 with the strict boundary (Option B): codegen-core keeps only what other code generators can use.

TypeInstantiation.PrefillCall is produced (BuilderScopeResolver) and consumed (FieldPrefillEnhancer, MethodGeneratorUtil) only by the builder domain, so it leaves codegen-core:

codegen-core   org.javahelpers.codegen.model.type.TypeInstantiation
                 ConstructorCall, StaticFactoryCall, NestedFactoryCall, ValueFactoryCall   (unchanged)
               - sealed
               - PrefillCall
processor      org.javahelpers.simple.builders.processor.model.type.PrefillCall            (new, next to ResolvedBuilder)
                 public record PrefillCall(...) implements TypeInstantiation
  • The record body is moved unchanged (including Field and fieldMethodFor); references change from TypeInstantiation.PrefillCall to PrefillCall.
  • TypeInstantiation is no longer sealed: Java permits sealed subtypes only in the same package, so the move forces it. Nothing switches over the family — all consumers call instantiationCode(..) / methodReference(..) polymorphically, and the two existing type tests (instanceof StaticFactoryCall, PrefillCall.class::isInstance) keep working.
  • A nested record cannot be git mv'd, so PrefillCall shows as removed lines in TypeInstantiation.java plus a new file.

No behavior change: mvn clean install is green (568 tests) and the committed example/generated-example-builder sources are regenerated byte-identical.

Written by Devin

…ilder (java-helpers#371)

PrefillCall is produced and consumed only by the builder domain, so it
leaves codegen-core and becomes a top-level record next to ResolvedBuilder.
TypeInstantiation is no longer sealed: Java permits sealed subtypes only in
the same package, and nothing switches over the family.
@AndreasIgel
AndreasIgel merged commit 984ecdb into java-helpers:main Nov 10, 2026
5 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/1794265370-prefillcall-builder-side 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.

Decide whether TypeInstantiation.PrefillCall stays in the generic codegen family or moves builder-side

2 participants