Skip to content

Commit da305c5

Browse files
committed
patch
1 parent 9457318 commit da305c5

File tree

1 file changed

+20
-4
lines changed
  • plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/credentials

1 file changed

+20
-4
lines changed

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/credentials/CodeWhispererClientAdaptor.kt

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,11 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
427427
it.timestamp(Instant.now())
428428
it.suggestionReferenceCount(suggestionReferenceCount)
429429
it.generatedLine(lineCount)
430-
it.customizationArn(requestContext.customizationArn)
430+
requestContext.customizationArn?.let { arn ->
431+
if (arn.isNotBlank()) {
432+
it.customizationArn(arn)
433+
}
434+
}
431435
it.numberOfRecommendations(numberOfRecommendations)
432436
it.acceptedCharacterCount(acceptedCharCount)
433437
}
@@ -473,7 +477,11 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
473477
it.timestamp(Instant.now())
474478
it.suggestionReferenceCount(suggestionReferenceCount)
475479
it.generatedLine(lineCount)
476-
it.customizationArn(requestContext.customizationArn)
480+
requestContext.customizationArn?.let { arn ->
481+
if (arn.isNotBlank()) {
482+
it.customizationArn(arn)
483+
}
484+
}
477485
it.numberOfRecommendations(numberOfRecommendations)
478486
it.acceptedCharacterCount(acceptedCharCount)
479487
}
@@ -495,7 +503,11 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
495503
requestBuilder.telemetryEvent { telemetryEventBuilder ->
496504
telemetryEventBuilder.codeCoverageEvent {
497505
it.programmingLanguage { languageBuilder -> languageBuilder.languageName(language.toCodeWhispererRuntimeLanguage().languageId) }
498-
it.customizationArn(customizationArn)
506+
customizationArn?.let { arn ->
507+
if (arn.isNotBlank()) {
508+
it.customizationArn(arn)
509+
}
510+
}
499511
it.acceptedCharacterCount(acceptedTokenCount.toInt())
500512
it.totalCharacterCount(totalTokenCount.toInt())
501513
it.timestamp(Instant.now())
@@ -523,7 +535,11 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
523535
it.programmingLanguage { languageBuilder ->
524536
languageBuilder.languageName(language.toCodeWhispererRuntimeLanguage().languageId)
525537
}
526-
it.customizationArn(customizationArn)
538+
customizationArn?.let { arn ->
539+
if (arn.isNotBlank()) {
540+
it.customizationArn(arn)
541+
}
542+
}
527543
// deprecated field, service side should not use this % anymore
528544
it.modificationPercentage(0.0)
529545
it.timestamp(Instant.now())

0 commit comments

Comments
 (0)