Bug 517740: [Launch Group] Externalisation of strings broke Group Launch
UI

Change-Id: I2acb3933ccc9ccfe2a90fd73014dc1ef0ecffb3d
Signed-off-by: Noopur Gupta <noopur_gupta@in.ibm.com>
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
index 6b402a8..c931854 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
@@ -43,7 +43,7 @@
 	public static String GroupLaunchConfigurationDelegate_None;
 	public static String GroupLaunchConfigurationDelegate_Wait_until_terminated;
 	public static String GroupLaunchConfigurationDelegate_Waiting_for_termination;
-	public static String GroupLaunchElement_inherit_launch_mode;
+	public static String GroupLaunchElement_inherit_launch_mode_label;
 	public static String GroupLaunchElement_outputRegexp;
 	public static String LaunchConfiguration_0;
 	public static String LaunchConfiguration_11;
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
index b2a918a..988bdef 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
@@ -37,7 +37,7 @@
 GroupLaunchConfigurationDelegate_None=None
 GroupLaunchConfigurationDelegate_Wait_until_terminated=Wait until terminated
 GroupLaunchConfigurationDelegate_Waiting_for_termination=Waiting for termination of ''{0}''
-GroupLaunchElement_inherit_launch_mode=inherit
+GroupLaunchElement_inherit_launch_mode_label=Inherit
 GroupLaunchElement_outputRegexp=Wait for console output (regexp)
 SystemPropertyResolver_0=System property not specified
 InputStreamMonitor_label=Input Stream Monitor
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchElement.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchElement.java
index 4c3eed6..edc9c2f 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchElement.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchElement.java
@@ -21,7 +21,7 @@
  * @since 3.11
  */
 public class GroupLaunchElement {
-	public static final String MODE_INHERIT = DebugCoreMessages.GroupLaunchElement_inherit_launch_mode;
+	public static final String MODE_INHERIT = "inherit"; //$NON-NLS-1$
 
 	/**
 	 * Describes the possible post-launch actions for each
diff --git a/org.eclipse.debug.tests/forceQualifierUpdate.txt b/org.eclipse.debug.tests/forceQualifierUpdate.txt
index 50fcd81..0bbe452 100644
--- a/org.eclipse.debug.tests/forceQualifierUpdate.txt
+++ b/org.eclipse.debug.tests/forceQualifierUpdate.txt
@@ -1,2 +1,3 @@
 # To force a version qualifier update, add the bug here
 Bug 516076 - Fix comparator errors caused by GVT47 : Non-externalized strings in Launch mode drop down list
+Bug 517740: [Launch Group] Externalisation of strings broke Group Launch UI
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
index ee4eb68..34fbfca 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
@@ -27,6 +27,7 @@
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchConfigurationType;
 import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.core.DebugCoreMessages;
 import org.eclipse.debug.internal.core.groups.GroupLaunchConfigurationDelegate;
 import org.eclipse.debug.internal.core.groups.GroupLaunchElement;
 import org.eclipse.debug.internal.core.groups.GroupLaunchElement.GroupElementPostLaunchAction;
@@ -164,10 +165,9 @@
 				continue;
 			}
 
-			String label = launchGroup.getLabel();
-			label = DebugUIPlugin.removeAccelerators(label);
-			if (!modes.containsKey(label)) {
-				modes.put(label, launchGroup);
+			String modeName = launchGroup.getMode();
+			if (!modes.containsKey(modeName)) {
+				modes.put(modeName, launchGroup);
 			}
 		}
 
@@ -220,12 +220,15 @@
 		Label label = new Label(comp, SWT.NONE);
 		label.setText(DebugUIMessages.GroupLaunchConfigurationSelectionDialog_4);
 
-		Map<String, String> capitalized = new LinkedHashMap<>();
-		modes.keySet().forEach(m -> capitalized.put(m.substring(0, 1).toUpperCase() + m.substring(1), m));
+		Map<String, String> labelToMode = new LinkedHashMap<>();
+		modes.forEach((modeName, launchGrp) -> {
+			String launchGrpLabel = DebugUIPlugin.removeAccelerators(launchGrp.getLabel());
+			labelToMode.put(launchGrpLabel, modeName);
+		});
 
 		Combo cvMode = new Combo(comp, SWT.READ_ONLY);
 		GridDataFactory.fillDefaults().applyTo(cvMode);
-		cvMode.setItems(capitalized.keySet().toArray(new String[capitalized.size()]));
+		cvMode.setItems(labelToMode.keySet().toArray(new String[labelToMode.size()]));
 
 		// initial selection to the current mode.
 		int index = 0;
@@ -240,7 +243,7 @@
 		cvMode.addSelectionListener(new SelectionAdapter() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				mode = capitalized.get(cvMode.getText());
+				mode = labelToMode.get(cvMode.getText());
 				validate();
 			}
 		});
@@ -467,7 +470,7 @@
 
 		@Override
 		public String getLabel() {
-			return null;
+			return DebugCoreMessages.GroupLaunchElement_inherit_launch_mode_label;
 		}
 
 		@Override