Mark ApprovalCopier, ApprovalsUtil and LabelNormalizer as singleton

These have no per-request state and are held by several REST API views
that are themselves singletons.  Instead of making one copy per REST
view, make these singletons for the server.

Change-Id: I2f343d29c4bed8a862b3794323916ca46b8b1f99
This commit is contained in:
Shawn Pearce
2014-05-28 18:07:32 -07:00
parent afc949a5d3
commit d1624692bf
3 changed files with 6 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ import com.google.gerrit.server.project.ProjectState;
import com.google.gerrit.server.query.change.ChangeData;
import com.google.gwtorm.server.OrmException;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
@@ -56,6 +57,7 @@ import java.util.TreeMap;
* database at submit time, or refreshed on demand, as when reading approvals
* from the notedb.
*/
@Singleton
public class ApprovalCopier {
private final GitRepositoryManager repoManager;
private final ProjectCache projectCache;