Merge branch 'stable-2.11' into stable-2.12

* stable-2.11:
  Synchronize MyersDiff and HistogramDiff invocations on local variable

Change-Id: I5f8f047c044d0a5d17d6e4530cadabf37d7c4eee
This commit is contained in:
Hugo Arès
2016-05-19 22:12:20 -04:00

View File

@@ -97,7 +97,6 @@ public class PatchListLoader implements Callable<PatchList> {
private final PatchListKey key; private final PatchListKey key;
private final Project.NameKey project; private final Project.NameKey project;
private final long timeoutMillis; private final long timeoutMillis;
private final Object lock;
@AssistedInject @AssistedInject
PatchListLoader(GitRepositoryManager mgr, PatchListLoader(GitRepositoryManager mgr,
@@ -112,7 +111,6 @@ public class PatchListLoader implements Callable<PatchList> {
diffExecutor = de; diffExecutor = de;
key = k; key = k;
project = p; project = p;
lock = new Object();
timeoutMillis = timeoutMillis =
ConfigUtil.getTimeUnit(cfg, "cache", PatchListCacheImpl.FILE_NAME, ConfigUtil.getTimeUnit(cfg, "cache", PatchListCacheImpl.FILE_NAME,
"timeout", TimeUnit.MILLISECONDS.convert(5, TimeUnit.SECONDS), "timeout", TimeUnit.MILLISECONDS.convert(5, TimeUnit.SECONDS),
@@ -238,7 +236,7 @@ public class PatchListLoader implements Callable<PatchList> {
Future<FileHeader> result = diffExecutor.submit(new Callable<FileHeader>() { Future<FileHeader> result = diffExecutor.submit(new Callable<FileHeader>() {
@Override @Override
public FileHeader call() throws IOException { public FileHeader call() throws IOException {
synchronized (lock) { synchronized (diffEntry) {
return diffFormatter.toFileHeader(diffEntry); return diffFormatter.toFileHeader(diffEntry);
} }
} }
@@ -254,7 +252,7 @@ public class PatchListLoader implements Callable<PatchList> {
+ " comparing " + diffEntry.getOldId().name() + " comparing " + diffEntry.getOldId().name()
+ ".." + diffEntry.getNewId().name()); + ".." + diffEntry.getNewId().name());
result.cancel(true); result.cancel(true);
synchronized (lock) { synchronized (diffEntry) {
return toFileHeaderWithoutMyersDiff(diffFormatter, diffEntry); return toFileHeaderWithoutMyersDiff(diffFormatter, diffEntry);
} }
} catch (ExecutionException e) { } catch (ExecutionException e) {