mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
Cleanup smells
This commit is contained in:
@@ -44,8 +44,8 @@ import sonia.scm.NotFoundException;
|
||||
public class RepositoryNotFoundException extends NotFoundException
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final long serialVersionUID = -6583078808900520166L;
|
||||
private static final String TYPE_REPOSITORY = "repository";
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
@@ -55,14 +55,14 @@ public class RepositoryNotFoundException extends NotFoundException
|
||||
*
|
||||
*/
|
||||
public RepositoryNotFoundException(Repository repository) {
|
||||
super("repository", repository.getName() + "/" + repository.getNamespace());
|
||||
super(TYPE_REPOSITORY, repository.getName() + "/" + repository.getNamespace());
|
||||
}
|
||||
|
||||
public RepositoryNotFoundException(String repositoryId) {
|
||||
super("repository", repositoryId);
|
||||
super(TYPE_REPOSITORY, repositoryId);
|
||||
}
|
||||
|
||||
public RepositoryNotFoundException(NamespaceAndName namespaceAndName) {
|
||||
super("repository", namespaceAndName.toString());
|
||||
super(TYPE_REPOSITORY, namespaceAndName.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ public final class RepositoryService implements Closeable {
|
||||
|
||||
public Stream<ScmProtocol> getSupportedProtocols() {
|
||||
return protocolProviders.stream()
|
||||
.filter(provider -> provider.getType().equals(getRepository().getType()))
|
||||
.filter(protocolProvider -> protocolProvider.getType().equals(getRepository().getType()))
|
||||
.map(this::createProviderInstanceForRepository);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public abstract class InitializingHttpScmProtocolWrapper implements ScmProtocolP
|
||||
if (!repository.getType().equals(getType())) {
|
||||
throw new IllegalArgumentException("cannot handle repository with type " + repository.getType() + " with protocol for type " + getType());
|
||||
}
|
||||
return new ProtocolWrapper(repository);
|
||||
return new ProtocolWrapper(repository, computeBasePath());
|
||||
}
|
||||
|
||||
private String computeBasePath() {
|
||||
@@ -70,8 +70,8 @@ public abstract class InitializingHttpScmProtocolWrapper implements ScmProtocolP
|
||||
|
||||
private class ProtocolWrapper extends HttpScmProtocol {
|
||||
|
||||
public ProtocolWrapper(Repository repository) {
|
||||
super(repository, computeBasePath());
|
||||
public ProtocolWrapper(Repository repository, String basePath) {
|
||||
super(repository, basePath);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user