Code cleanup

This commit is contained in:
Martin Stockhammer 2021-07-04 17:36:27 +02:00
parent 11d469489e
commit 04a35ef279
2 changed files with 3 additions and 9 deletions

View File

@ -92,13 +92,9 @@ public class BasicRepositoryGroupValidator extends AbstractRepositoryValidator<R
if (StringUtils.isBlank( repositoryGroup.getName() )) {
errors = appendError( errors, "name", ISEMPTY );
} else
} else if ( !REPOSITORY_NAME_VALID_EXPRESSION_PATTERN.matcher( repositoryGroup.getName( ) ).matches( ) )
{
matcher = REPOSITORY_NAME_VALID_EXPRESSION_PATTERN.matcher( repositoryGroup.getName( ) );
if ( !matcher.matches( ) )
{
errors = appendError( errors, "name", INVALID_CHARS, repoGroupId, REPOSITORY_NAME_ALLOWED );
}
errors = appendError( errors, "name", INVALID_CHARS, repoGroupId, REPOSITORY_NAME_ALLOWED );
}

View File

@ -95,9 +95,7 @@ public class BasicManagedRepositoryValidator extends AbstractRepositoryValidator
if ( StringUtils.isBlank( managedRepository.getName() ) )
{
errors = appendError( errors, "name", ISEMPTY );
}
if ( !REPOSITORY_NAME_VALID_EXPRESSION_PATTERN.matcher( managedRepository.getName() ).matches( ) )
} else if ( !REPOSITORY_NAME_VALID_EXPRESSION_PATTERN.matcher( managedRepository.getName( ) ).matches( ) )
{
errors = appendError( errors, "name", INVALID_CHARS, managedRepository.getName( ), REPOSITORY_NAME_ALLOWED );
}