Move more endpoints to singleton scope and remove providers

Ia2ac8cfcc moved some REST endpoints to singleton scope, but missed
to remove providers from these endpoints, where they get injected.

When a singleton injects another singleton, this is only an overhead
to inject it as a provider to singleton and not directly.

Change-Id: I6d6f361cc2c46440845ef13ccacb8ec4f28c9b36
This commit is contained in:
David Ostrovsky
2014-05-29 21:21:24 +02:00
parent b559de9a37
commit 2bea4028e8
41 changed files with 159 additions and 133 deletions

View File

@@ -76,7 +76,7 @@ public class CreateChange implements
private final GitRepositoryManager gitManager;
private final TimeZone serverTimeZone;
private final Provider<CurrentUser> userProvider;
private final Provider<ProjectsCollection> projectsCollection;
private final ProjectsCollection projectsCollection;
private final CommitValidators.Factory commitValidatorsFactory;
private final ChangeInserter.Factory changeInserterFactory;
private final ChangeJson json;
@@ -86,7 +86,7 @@ public class CreateChange implements
GitRepositoryManager gitManager,
@GerritPersonIdent PersonIdent myIdent,
Provider<CurrentUser> userProvider,
Provider<ProjectsCollection> projectsCollection,
ProjectsCollection projectsCollection,
CommitValidators.Factory commitValidatorsFactory,
ChangeInserter.Factory changeInserterFactory,
ChangeJson json) {
@@ -130,7 +130,7 @@ public class CreateChange implements
refName = Constants.R_HEADS + input.branch;
}
ProjectResource rsrc = projectsCollection.get().parse(input.project);
ProjectResource rsrc = projectsCollection.parse(input.project);
Capable r = rsrc.getControl().canPushToAtLeastOneRef();
if (r != Capable.OK) {