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