Fixes from review

This commit is contained in:
John 2026-06-12 12:07:36 +00:00
parent d8f95befc8
commit b8110ecdf3
2 changed files with 15 additions and 15 deletions

9
dist/setup/index.js vendored
View File

@ -77825,16 +77825,15 @@ class AdoptDistribution extends base_installer_1.JavaBase {
constructor(installerOptions, jvmImpl, temurinDistribution = null) { constructor(installerOptions, jvmImpl, temurinDistribution = null) {
super(`Adopt-${jvmImpl}`, installerOptions); super(`Adopt-${jvmImpl}`, installerOptions);
this.jvmImpl = jvmImpl; this.jvmImpl = jvmImpl;
this.temurinDistribution = temurinDistribution;
if (temurinDistribution !== null && if (temurinDistribution !== null &&
jvmImpl !== AdoptImplementation.Hotspot) { jvmImpl !== AdoptImplementation.Hotspot) {
throw new Error('Only Hotspot JVM is supported by Temurin.'); throw new Error('Only Hotspot JVM is supported by Temurin.');
} }
// Only use the temurin repo for Hotspot JVMs // Only use the temurin repo for Hotspot JVMs
if (temurinDistribution === null && this.temurinDistribution =
jvmImpl === AdoptImplementation.Hotspot) { temurinDistribution !== null && temurinDistribution !== void 0 ? temurinDistribution : (jvmImpl === AdoptImplementation.Hotspot
this.temurinDistribution = new installer_1.TemurinDistribution(installerOptions, installer_1.TemurinImplementation.Hotspot); ? new installer_1.TemurinDistribution(installerOptions, installer_1.TemurinImplementation.Hotspot)
} : null);
} }
findPackageForDownload(version) { findPackageForDownload(version) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {

View File

@ -29,10 +29,12 @@ export enum AdoptImplementation {
} }
export class AdoptDistribution extends JavaBase { export class AdoptDistribution extends JavaBase {
private readonly temurinDistribution: TemurinDistribution | null;
constructor( constructor(
installerOptions: JavaInstallerOptions, installerOptions: JavaInstallerOptions,
private readonly jvmImpl: AdoptImplementation, private readonly jvmImpl: AdoptImplementation,
private readonly temurinDistribution: TemurinDistribution | null = null temurinDistribution: TemurinDistribution | null = null
) { ) {
super(`Adopt-${jvmImpl}`, installerOptions); super(`Adopt-${jvmImpl}`, installerOptions);
@ -44,15 +46,14 @@ export class AdoptDistribution extends JavaBase {
} }
// Only use the temurin repo for Hotspot JVMs // Only use the temurin repo for Hotspot JVMs
if ( this.temurinDistribution =
temurinDistribution === null && temurinDistribution ??
jvmImpl === AdoptImplementation.Hotspot (jvmImpl === AdoptImplementation.Hotspot
) { ? new TemurinDistribution(
this.temurinDistribution = new TemurinDistribution( installerOptions,
installerOptions, TemurinImplementation.Hotspot
TemurinImplementation.Hotspot )
); : null);
}
} }
protected async findPackageForDownload( protected async findPackageForDownload(