mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 13:05:22 +02:00
[244051] JJ: Environment Variables property page allows duplicates (apply patch from Justin Lin)
This commit is contained in:
parent
586f16b958
commit
cde5c0f2bc
1 changed files with 7 additions and 7 deletions
|
@ -13,6 +13,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
|
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
|
||||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
|
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
|
||||||
|
* Justin Lin (IBM) - [244051] JJ: Environment Variables property page allows duplicates...
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui.widgets;
|
package org.eclipse.rse.ui.widgets;
|
||||||
|
@ -591,16 +592,15 @@ public class EnvironmentVariablesForm extends SystemBaseForm implements Selectio
|
||||||
}
|
}
|
||||||
|
|
||||||
// next check for duplicate env var names
|
// next check for duplicate env var names
|
||||||
int numberFound = 0;
|
|
||||||
int itemCount = envVarTable.getItemCount();
|
int itemCount = envVarTable.getItemCount();
|
||||||
for (int i = 0; i < itemCount; i++) {
|
for (int i = 0; i < itemCount; i++) {
|
||||||
TableItem item = envVarTable.getItem(i);
|
TableItem item = envVarTable.getItem(i);
|
||||||
String itemName = item.getText(0);
|
String itemName = item.getText(0);
|
||||||
if (itemName.equals(name)) numberFound++;
|
if (itemName.equals(name) && i != envVarTable.getSelectionIndex()) {
|
||||||
}
|
|
||||||
if (numberFound > 1) {
|
|
||||||
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_ENVVAR_DUPLICATE);
|
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_ENVVAR_DUPLICATE);
|
||||||
msg.makeSubstitution(name);
|
msg.makeSubstitution(name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue