addFieldError( "repository.id", "Unable to add new repository with id [" + repoId
+ "], that id already exists as a remote repository." );
}
-
+ else if( config.getRepositoryGroupsAsMap().containsKey( repoId ) )
+ {
+ addFieldError( "repository.id", "Unable to add new repository with id [" + repoId
+ + "], that id already exists as a repository group." );
+ }
+
if ( !validator.validate( repository.getRefreshCronExpression() ) )
{
addFieldError( "repository.refreshCronExpression", "Invalid cron expression." );
addFieldError( "repository.id", "Unable to add new repository with id [" + repoId
+ "], that id already exists as a remote repository." );
}
+ else if( config.getRepositoryGroupsAsMap().containsKey( repoId ) )
+ {
+ addFieldError( "repository.id", "Unable to add new repository with id [" + repoId
+ + "], that id already exists as a repository group." );
+ }
}
public RemoteRepositoryConfiguration getRepository()
if ( configuration.getRepositoryGroupsAsMap().containsKey( repoGroupId ) )
{
addActionError( "Unable to add new repository group with id [" + repoGroupId
- + "], that id already exists." );
+ + "], that id already exists as a repository group." );
+ return ERROR;
+ }
+ else if ( configuration.getManagedRepositoriesAsMap().containsKey( repoGroupId ) )
+ {
+ addActionError( "Unable to add new repository group with id [" + repoGroupId
+ + "], that id already exists as a managed repository." );
+ return ERROR;
+ }
+ else if ( configuration.getRemoteRepositoriesAsMap().containsKey( repoGroupId ) )
+ {
+ addActionError( "Unable to add new repository group with id [" + repoGroupId
+ + "], that id already exists as a remote repository." );
return ERROR;
}