diff options
2 files changed, 3 insertions, 9 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/group/BasicRepositoryGroupValidator.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/group/BasicRepositoryGroupValidator.java index 209499ffc..e0dd00d4d 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/group/BasicRepositoryGroupValidator.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/group/BasicRepositoryGroupValidator.java @@ -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 ); } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/managed/BasicManagedRepositoryValidator.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/managed/BasicManagedRepositoryValidator.java index 745ed9d85..15ea9ee44 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/managed/BasicManagedRepositoryValidator.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/managed/BasicManagedRepositoryValidator.java @@ -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 ); } |