Skip to content

Commit b2ea840

Browse files
committed
updating chat messaging for java 17 and removing redundancy
1 parent 7dfa80e commit b2ea840

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"type": "Feature",
3-
"description": "Amazon Q Code Transformation feature: allow Java 17 projects to be transformed"
3+
"description": "Code Transform: Enable support for Java 17 projects."
44
}

packages/core/src/amazonqGumby/chat/controller/messenger/messengerUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ export default class MessengerUtils {
4242
} else if (os.platform() === 'darwin') {
4343
const jdkVersion = transformByQState.getSourceJDKVersion()
4444
if (jdkVersion === JDKVersion.JDK8) {
45-
javaHomePrompt += ` ${CodeWhispererConstants.macJava8HomeHelpChatMessage}`
45+
javaHomePrompt += ` ${CodeWhispererConstants.macJavaVersionHomeHelpChatMessage(1.8)}`
4646
} else if (jdkVersion === JDKVersion.JDK11) {
47-
javaHomePrompt += ` ${CodeWhispererConstants.macJava11HomeHelpChatMessage}`
47+
javaHomePrompt += ` ${CodeWhispererConstants.macJavaVersionHomeHelpChatMessage(11)}`
4848
} else if (jdkVersion === JDKVersion.JDK17) {
49-
javaHomePrompt += ` ${CodeWhispererConstants.macJava17HomeHelpChatMessage}`
49+
javaHomePrompt += ` ${CodeWhispererConstants.macJavaVersionHomeHelpChatMessage(17)}`
5050
}
5151
} else {
5252
javaHomePrompt += ` ${CodeWhispererConstants.linuxJavaHomeHelpChatMessage}`

packages/core/src/codewhisperer/models/constants.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ export const buildSucceededNotification =
496496
export const absolutePathDetectedMessage = (numPaths: number, buildFile: string, listOfPaths: string) =>
497497
`I detected ${numPaths} potential absolute file path(s) in your ${buildFile} file: **${listOfPaths}**. Absolute file paths might cause issues when I build your code. Any errors will show up in the build log.`
498498

499-
export const unsupportedJavaVersionChatMessage = `Sorry, currently I can only upgrade Java 8 or Java 11 projects. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
499+
export const unsupportedJavaVersionChatMessage = `Sorry, currently I can only upgrade Java 8, 11, or 17 projects. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
500500

501501
export const failedToStartJobChatMessage =
502502
"Sorry, I couldn't begin the transformation. Please try starting the transformation again."
@@ -564,9 +564,9 @@ export const jobPartiallyCompletedChatMessage =
564564
export const jobPartiallyCompletedNotification =
565565
'Amazon Q upgraded part of your code to Java 17. You can review the diff to see my proposed changes and accept or reject them. The transformation summary has details about the files I updated and the errors that prevented a complete transformation.'
566566

567-
export const noPomXmlFoundChatMessage = `Sorry, I couldn\'t find a project that I can upgrade. I couldn\'t find a pom.xml file in any of your open projects. Currently, I can only upgrade Java 8 or Java 11 projects built on Maven. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
567+
export const noPomXmlFoundChatMessage = `Sorry, I couldn\'t find a project that I can upgrade. I couldn\'t find a pom.xml file in any of your open projects. Currently, I can only upgrade Java 8, 11, or 17 projects built on Maven. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
568568

569-
export const noPomXmlFoundNotification = `None of your open projects are supported by Amazon Q Code Transformation. Amazon Q could not find a pom.xml file in any of your open projects. Currently, Amazon Q can only upgrade Java 8 or Java 11 projects built on Maven. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
569+
export const noPomXmlFoundNotification = `None of your open projects are supported by Amazon Q Code Transformation. Amazon Q could not find a pom.xml file in any of your open projects. Currently, Amazon Q can only upgrade Java 8, 11, or 17 projects built on Maven. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
570570

571571
export const noJavaHomeFoundChatMessage = `Sorry, I couldn\'t locate your Java installation. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
572572

@@ -604,9 +604,9 @@ export const changesAppliedChatMessage = 'I applied the changes to your project.
604604

605605
export const changesAppliedNotification = 'Amazon Q applied the changes to your project.'
606606

607-
export const noOpenProjectsFoundChatMessage = `Sorry, I couldn\'t find a project that I can upgrade. Currently, I can only upgrade Java 8 or Java 11 projects built on Maven. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
607+
export const noOpenProjectsFoundChatMessage = `Sorry, I couldn\'t find a project that I can upgrade. Currently, I can only upgrade Java 8, 11 or 17 projects built on Maven. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
608608

609-
export const noJavaProjectsFoundChatMessage = `Sorry, I couldn\'t find a project that I can upgrade. Currently, I can only upgrade Java 8 or Java 11 projects built on Maven. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
609+
export const noJavaProjectsFoundChatMessage = `Sorry, I couldn\'t find a project that I can upgrade. Currently, I can only upgrade Java 8, 11 or 17 projects built on Maven. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
610610

611611
export const linkToDocsHome = 'https://docs.aws.amazon.com/amazonq/latest/aws-builder-use-ug/code-transformation.html'
612612

@@ -631,14 +631,8 @@ export const projectPromptChatMessage =
631631
export const windowsJavaHomeHelpChatMessage =
632632
'To find the JDK path, run the following commands in a new terminal: `cd "C:/Program Files/Java"` and then `dir`. If you see your JDK version, run `cd <version>` and then `cd` to show the path.'
633633

634-
export const macJava8HomeHelpChatMessage =
635-
'To find the JDK path, run the following command in a new terminal: `/usr/libexec/java_home -v 1.8`'
636-
637-
export const macJava11HomeHelpChatMessage =
638-
'To find the JDK path, run the following command in a new terminal: `/usr/libexec/java_home -v 11`'
639-
640-
export const macJava17HomeHelpChatMessage =
641-
'To find the JDK path, run the following command in a new terminal: `/usr/libexec/java_home -v 17`'
634+
export const macJavaVersionHomeHelpChatMessage = (version: number) =>
635+
`To find the JDK path, run the following command in a new terminal: \`/usr/libexec/java_home -v ${version}\``
642636

643637
export const linuxJavaHomeHelpChatMessage =
644638
'To find the JDK path, run the following command in a new terminal: `update-java-alternatives --list`'

0 commit comments

Comments
 (0)