@@ -36,7 +36,7 @@ export class JdkDownloaderAction {
36
36
private readonly DOWNLOAD_DIR = path . join ( __dirname , 'jdk_downloads' ) ;
37
37
private startTimer : number | null = null ;
38
38
39
- private jdkType ? : string ;
39
+ private jdkType ! : string ;
40
40
private jdkVersion ?: string ;
41
41
private osType ?: string ;
42
42
private machineArch ?: string ;
@@ -132,7 +132,7 @@ export class JdkDownloaderAction {
132
132
133
133
private jdkInstallationManager = async ( ) => {
134
134
const startingInstallationMessage = l10n . value ( "jdk.downloader.message.downloadingAndCompletingSetup" , {
135
- jdkType : this . jdkType ,
135
+ jdkType : JdkDownloaderView . getJdkLabel ( this . jdkType ) ,
136
136
jdkVersion : this . jdkVersion
137
137
} ) ;
138
138
@@ -144,7 +144,7 @@ export class JdkDownloaderAction {
144
144
}
145
145
await this . downloadAndVerify ( ) ;
146
146
const downloadSuccessLabel = l10n . value ( "jdk.downloader.message.downloadCompleted" , {
147
- jdkType : this . jdkType ,
147
+ jdkType : JdkDownloaderView . getJdkLabel ( this . jdkType ) ,
148
148
jdkVersion : this . jdkVersion ,
149
149
osType : this . osType
150
150
} ) ;
@@ -187,7 +187,7 @@ export class JdkDownloaderAction {
187
187
188
188
private downloadAndVerify = async ( ) : Promise < void > => {
189
189
const message = l10n . value ( "jdk.downloader.message.downloadProgressBar" , {
190
- jdkType : this . jdkType ,
190
+ jdkType : JdkDownloaderView . getJdkLabel ( this . jdkType ) ,
191
191
jdkVersion : this . jdkVersion
192
192
} ) ;
193
193
await downloadFileWithProgressBar ( this . downloadUrl ! , this . downloadFilePath ! , message ) ;
@@ -196,7 +196,7 @@ export class JdkDownloaderAction {
196
196
const doesMatch = await this . checksumMatch ( ) ;
197
197
if ( ! doesMatch ) {
198
198
const checksumMatchFailedLabel = l10n . value ( "jdk.downloader.message.downloadFailed" , {
199
- jdkType : this . jdkType ,
199
+ jdkType : JdkDownloaderView . getJdkLabel ( this . jdkType ) ,
200
200
jdkVersion : this . jdkVersion ,
201
201
osType : this . osType
202
202
} ) ;
@@ -230,7 +230,7 @@ export class JdkDownloaderAction {
230
230
} catch ( err ) {
231
231
LOGGER . error ( `Error while extracting JDK: ${ ( err as Error ) . message } ` ) ;
232
232
throw new Error ( l10n . value ( "jdk.downloader.error_message.extractionError" , {
233
- jdkType : this . jdkType ,
233
+ jdkType : JdkDownloaderView . getJdkLabel ( this . jdkType ) ,
234
234
jdkVersion : this . jdkVersion
235
235
} ) ) ;
236
236
}
@@ -250,11 +250,11 @@ export class JdkDownloaderAction {
250
250
const tempDirectoryPath = path . join ( this . DOWNLOAD_DIR , matchingJdkDir [ 0 ] ) ;
251
251
252
252
// If directory with same name is present in the user selected download location then ask user if they want to delete it or not?
253
- const newDirName = `${ this . jdkType ! . split ( ' ' ) . join ( '_' ) } -${ this . jdkVersion } ` ;
253
+ const newDirName = `${ this . jdkType . split ( ' ' ) . join ( '_' ) } -${ this . jdkVersion } ` ;
254
254
const newDirectoryPath = await this . handleJdkPaths ( newDirName , this . installationPath ! , this . osType ! ) ;
255
255
if ( newDirectoryPath === null ) {
256
256
throw new Error ( l10n . value ( 'jdk.downloader.error_message.jdkNewDirectoryIssueCannotInstall' , {
257
- jdkType : this . jdkType ,
257
+ jdkType : JdkDownloaderView . getJdkLabel ( this . jdkType ) ,
258
258
jdkVersion : this . jdkVersion ,
259
259
newDirName
260
260
} ) ) ;
@@ -278,7 +278,7 @@ export class JdkDownloaderAction {
278
278
private installationCleanup = ( tempDirPath : string , newDirPath : string ) => {
279
279
const currentTime = getCurrentUTCDateInSeconds ( ) ;
280
280
const downloadTelemetryEvent : JdkDownloadEventData = {
281
- vendor : this . jdkType ! ,
281
+ vendor : this . jdkType ,
282
282
version : this . jdkVersion ! ,
283
283
os : this . osType ! ,
284
284
arch : this . machineArch ! ,
0 commit comments