diff options
author | Hugo Arès <hugo.ares@ericsson.com> | 2016-05-19 22:12:20 -0400 |
---|---|---|
committer | Hugo Arès <hugo.ares@ericsson.com> | 2016-05-19 22:12:20 -0400 |
commit | e31f463d21e858ea1927ab1a5116dcd8b2090357 (patch) | |
tree | f32957e418b739c9c4d698c8b9dbf594233d3b7a | |
parent | 7c795fa0ddac6dfe8c298156e612690f3d43f860 (diff) | |
parent | 776e004f059d4d4b4d6e3f24490aa0336762f614 (diff) |
Merge branch 'stable-2.11' into stable-2.12
* stable-2.11:
Synchronize MyersDiff and HistogramDiff invocations on local variable
Change-Id: I5f8f047c044d0a5d17d6e4530cadabf37d7c4eee
-rw-r--r-- | gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListLoader.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListLoader.java b/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListLoader.java index e7d86ab722..c10241b718 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListLoader.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListLoader.java @@ -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) { |