aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2021-07-04 17:36:27 +0200
committerMartin Stockhammer <martin_s@apache.org>2021-07-04 17:36:27 +0200
commit04a35ef27958782fc73db6429bf8a235298ca021 (patch)
tree0bffc3c3d045d9033f0e757e77a94f9b828d056a /archiva-modules
parent11d469489e533a0e038b0a44e732595efcd082ed (diff)
downloadarchiva-04a35ef27958782fc73db6429bf8a235298ca021.tar.gz
archiva-04a35ef27958782fc73db6429bf8a235298ca021.zip
Code cleanup
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/group/BasicRepositoryGroupValidator.java8
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/managed/BasicManagedRepositoryValidator.java4
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 );
}