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

@@ -97,7 +97,7 @@ class Files implements ChildCollection<RevisionResource, FileResource> {
private final Provider<ReviewDb> db;
private final Provider<CurrentUser> self;
private final FileInfoJson fileInfoJson;
private final Provider<Revisions> revisions;
private final Revisions revisions;
private final GitRepositoryManager gitManager;
private final PatchListCache patchListCache;
@@ -105,7 +105,7 @@ class Files implements ChildCollection<RevisionResource, FileResource> {
ListFiles(Provider<ReviewDb> db,
Provider<CurrentUser> self,
FileInfoJson fileInfoJson,
Provider<Revisions> revisions,
Revisions revisions,
GitRepositoryManager gitManager,
PatchListCache patchListCache) {
this.db = db;
@@ -127,7 +127,7 @@ class Files implements ChildCollection<RevisionResource, FileResource> {
PatchSet basePatchSet = null;
if (base != null) {
RevisionResource baseResource = revisions.get().parse(
RevisionResource baseResource = revisions.parse(
resource.getChangeResource(), IdString.fromDecoded(base));
basePatchSet = baseResource.getPatchSet();
}