Bug 509095 - Remote Java Application page: missing mnemonics

Change-Id: I5bf0cd1fc81eb87c2648e3bde880829c40b2100f
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaConnectTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaConnectTab.java
index b344005..978ff91 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaConnectTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaConnectTab.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,6 +32,7 @@
 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
 import org.eclipse.jdt.launching.IVMConnector;
 import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jface.action.LegacyActionTools;
 import org.eclipse.jface.preference.BooleanFieldEditor;
 import org.eclipse.jface.preference.ComboFieldEditor;
 import org.eclipse.jface.preference.FieldEditor;
@@ -362,7 +363,11 @@
 			if (editor instanceof StringFieldEditor) {
 				String value = ((StringFieldEditor)editor).getStringValue();
 				if (!arg.isValid(value)) {
-					setErrorMessage(arg.label() + LauncherMessages.JavaConnectTab__is_invalid__5);
+					StringBuffer label = new StringBuffer(LegacyActionTools.removeMnemonics(arg.label()));
+					if (label.lastIndexOf(":") == label.length() - 1) { //$NON-NLS-1$
+						label = label.deleteCharAt(label.length() - 1);
+					}
+					setErrorMessage(label.toString() + LauncherMessages.JavaConnectTab__is_invalid__5);
 					return false;
 				}
 			}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/ConnectMessages.properties b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/ConnectMessages.properties
index a10c8bd..d3ecf1e 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/ConnectMessages.properties
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/ConnectMessages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2016 IBM Corporation and others.
+# Copyright (c) 2000, 2018 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -14,9 +14,9 @@
 PacketReceiveManager_Got_IOException_from_Virtual_Machine_2=Got IOException from Virtual Machine
 PacketSendManager_Got_IOException_from_Virtual_Machine_1=Got IOException from Virtual Machine
 SocketAttachingConnectorImpl_Machine_name_to_which_to_attach_for_VM_connections_1=Machine name to which to attach for VM connections
-SocketAttachingConnectorImpl_Host_2=Host:
+SocketAttachingConnectorImpl_Host_2=&Host:
 SocketAttachingConnectorImpl_Port_number_to_which_to_attach_for_VM_connections_3=Port number to which to attach for VM connections
-SocketAttachingConnectorImpl_Port_4=Port:
+SocketAttachingConnectorImpl_Port_4=Po&rt:
 SocketAttachingConnectorImpl_1=Connection Timeout
 SocketAttachingConnectorImpl_2=Connection Timeout:
 SocketAttachingConnectorImpl_Attaches_by_socket_to_other_VMs_5=Attaches by socket to other VMs
@@ -40,14 +40,14 @@
 SocketLaunchingConnectorImpl_Necessary_connection_argument_is_null_15=Necessary connection argument is null
 SocketLaunchingConnectorImpl_Connection_argument_is_not_a_number_16=Connection argument is not a number
 SocketListeningConnectorImpl_Port_number_at_which_to_listen_for_VM_connections_1=Port number at which to listen for VM connections
-SocketListeningConnectorImpl_Port_2=Port:
+SocketListeningConnectorImpl_Port_2=Po&rt:
 SocketListeningConnectorImpl_Timeout_before_accept_returns_3=Timeout before accept returns
 SocketListeningConnectorImpl_Timeout_4=Timeout:
 SocketListeningConnectorImpl_Accepts_socket_connections_initiated_by_other_VMs_5=Accepts socket connections initiated by other VMs
 SocketListeningConnectorImpl_Connection_argument_is_not_of_the_right_type_6=Connection argument is not of the right type
 SocketListeningConnectorImpl_Necessary_connection_argument_is_null_7=Necessary connection argument is null
 SocketListeningConnectorImpl_Connection_argument_is_not_a_number_8=Connection argument is not a number
-SocketListeningConnectorImpl_Limit=Connection limit:
+SocketListeningConnectorImpl_Limit=Connection &limit:
 SocketListeningConnectorImpl_Limit_incoming_connections=Limit incoming connections (0 = no limit)
 SocketListeningConnectorImpl_ListeningConnector_Socket_Port=ListeningConnector Socket Port=
 SocketRawLaunchingConnectorImpl_Raw_command_to_start_the_debugged_application_VM_1=Raw command to start the debugged application VM