Skip to content

Explicitly pass TemurinDistribution in distribution-factory for adopt/adopt-hotspot#3

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/update-distribution-factory-to-temurin
Open

Explicitly pass TemurinDistribution in distribution-factory for adopt/adopt-hotspot#3
Copilot wants to merge 4 commits into
mainfrom
copilot/update-distribution-factory-to-temurin

Conversation

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown

distribution-factory.ts was constructing AdoptDistribution for adopt/adopt-hotspot without passing a TemurinDistribution, leaving it to AdoptDistribution's internal constructor fallback. This makes the Temurin wiring implicit and untested at the factory level.

Changes:

  • src/distributions/distribution-factory.ts — explicitly pass new TemurinDistribution(installerOptions, TemurinImplementation.Hotspot) to AdoptDistribution for adopt and adopt-hotspot cases:
    case JavaDistribution.Adopt:
    case JavaDistribution.AdoptHotspot:
      return new AdoptDistribution(
        installerOptions,
        AdoptImplementation.Hotspot,
        new TemurinDistribution(installerOptions, TemurinImplementation.Hotspot)
      );
  • __tests__/distributors/distribution-factory.test.ts (new) — factory tests covering correct instance types for all distributions, and specifically asserting that adopt/adopt-hotspot wire in a TemurinDistribution with Hotspot, while adopt-openj9 does not.

Description:
The factory now owns the responsibility of composing AdoptDistribution with TemurinDistribution, rather than delegating that silently to the inner constructor.

Related issue:
N/A

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@johnoliver

johnoliver commented Jun 17, 2026

Copy link
Copy Markdown
Owner

@copilot move the pr to merge to the fix-adopt branch

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