Stop leaking data in PatchLineCache keys

As in other persisted caches, references to excess data may stick
around longer than we need them. Particularly in the case of the
intraline diff cache, this can be a significant amount of data. Avoid
this by using non-LoadingCaches. Because these loader implementations
are somewhat complex, we need additional factories and args classes.

Change-Id: Ic5a0543f0b70dbeee7dac47bbbd6f4a4fce0815c
This commit is contained in:
Dave Borowitz
2015-08-06 15:57:13 -07:00
committed by Shawn Pearce
parent 9efcff3124
commit fdbb76233c
14 changed files with 172 additions and 159 deletions

View File

@@ -99,14 +99,14 @@ public final class StoredValues {
PatchSet ps = getPatchSet(engine);
PatchListCache plCache = env.getArgs().getPatchListCache();
Change change = getChange(engine);
Project.NameKey projectKey = change.getProject();
Project.NameKey project = change.getProject();
ObjectId a = null;
ObjectId b = ObjectId.fromString(ps.getRevision().get());
Whitespace ws = Whitespace.IGNORE_NONE;
PatchListKey plKey = new PatchListKey(projectKey, a, b, ws);
PatchListKey plKey = new PatchListKey(a, b, ws);
PatchList patchList;
try {
patchList = plCache.get(plKey);
patchList = plCache.get(plKey, project);
} catch (PatchListNotAvailableException e) {
throw new SystemException("Cannot create " + plKey);
}