Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2015-01-30 03:29:44 -0500
committerTobias Schwarz2015-01-30 03:30:27 -0500
commitc5ae1e21f9a53547862dc540fc96759adc55ba42 (patch)
tree98c60644f03072863e6ffee5106c81eecaf34434
parent08d759f9e2e94c74d4ee4ebaf64c3f3f52a08845 (diff)
downloadorg.eclipse.tcf-c5ae1e21f9a53547862dc540fc96759adc55ba42.tar.gz
org.eclipse.tcf-c5ae1e21f9a53547862dc540fc96759adc55ba42.tar.xz
org.eclipse.tcf-c5ae1e21f9a53547862dc540fc96759adc55ba42.zip
SM: fix connection name generation
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java
index fe2917376..620258b07 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java
@@ -316,9 +316,17 @@ public abstract class AbstractConfigWizardPage extends AbstractFormsWizardPage i
return;
}
// Generate a new proposal
- final String origProposedName = NLS.bind(template, customID != null ? customID : ""); //$NON-NLS-1$
+ String origProposedName = NLS.bind(template, customID != null ? customID : ""); //$NON-NLS-1$
String proposedName = origProposedName;
+ if (usedNames.contains(proposedName.trim().toUpperCase()) && proposedName.matches(".* \\([0-9]*\\)")) { //$NON-NLS-1$
+ int index = proposedName.lastIndexOf(' ');
+ if (index > 0) {
+ origProposedName = proposedName.substring(0, index);
+ proposedName = origProposedName;
+ }
+ }
+
// Unify the proposed name to avoid duplicated configuration names
int count = 0;
while (usedNames.contains(proposedName.trim().toUpperCase())) {

Back to the top