mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 07:05:24 +02:00
[238158]][cleanup] Simplify iterating over name validators
This commit is contained in:
parent
6a9ebc1362
commit
3f65e6f954
1 changed files with 7 additions and 9 deletions
|
@ -43,7 +43,7 @@ import org.eclipse.swt.widgets.Text;
|
|||
|
||||
/**
|
||||
* Second page of the New Filter wizard that prompts for the name of the filter.
|
||||
*
|
||||
*
|
||||
* @since 3.0 moved from internal to API
|
||||
*/
|
||||
public class SystemNewFilterWizardNamePage
|
||||
|
@ -362,10 +362,9 @@ public class SystemNewFilterWizardNamePage
|
|||
}
|
||||
if ((errorMessage == null) && (nameValidators != null))
|
||||
{
|
||||
int i = 0;
|
||||
while (errorMessage == null && i < nameValidators.length){
|
||||
errorMessage = nameValidators[i].validate(nameText.getText().trim());
|
||||
i++;
|
||||
String nameToValidate = nameText.getText().trim();
|
||||
for (int i = 0; errorMessage == null && i < nameValidators.length; i++) {
|
||||
errorMessage = nameValidators[i].validate(nameToValidate);
|
||||
}
|
||||
controlInError = nameText;
|
||||
}
|
||||
|
@ -387,10 +386,9 @@ public class SystemNewFilterWizardNamePage
|
|||
{
|
||||
errorMessage= null;
|
||||
if (nameValidators != null){
|
||||
int i = 0;
|
||||
while (errorMessage == null && i < nameValidators.length){
|
||||
errorMessage = nameValidators[i].validate(nameText.getText().trim());
|
||||
i++;
|
||||
String nameToValidate = nameText.getText().trim();
|
||||
for (int i = 0; errorMessage == null && i < nameValidators.length; i++) {
|
||||
errorMessage = nameValidators[i].validate(nameToValidate);
|
||||
}
|
||||
}
|
||||
if ((errorMessage == null) && (filterPoolSelectionValidator != null))
|
||||
|
|
Loading…
Add table
Reference in a new issue