diff options
author | Igor Fedorenko | 2011-04-18 11:14:35 +0000 |
---|---|---|
committer | Igor Fedorenko | 2011-04-18 11:14:35 +0000 |
commit | 459c9465a07d9a2b7bb75b0d59a87e40fe1b54ff (patch) | |
tree | 5190a764e01da8b5a68f3b31c2f725d482463e4d | |
parent | 0e843b743ab9f57d0122f8f1349a70badb24a0d5 (diff) | |
download | m2e-core-459c9465a07d9a2b7bb75b0d59a87e40fe1b54ff.tar.gz m2e-core-459c9465a07d9a2b7bb75b0d59a87e40fe1b54ff.tar.xz m2e-core-459c9465a07d9a2b7bb75b0d59a87e40fe1b54ff.zip |
342910 synchronize access to context pomFiles
Currently, when workspace autobuild is on (the default), both Maven Builder
and background refresh job will resolve dependencies concurrently, which
may result in repository system callbacks coming from two threads, which may
lead to concurrent modification exceptions.
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r-- | org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/DependencyResolutionContext.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/DependencyResolutionContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/DependencyResolutionContext.java index 71031ae3..54860fd5 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/DependencyResolutionContext.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/DependencyResolutionContext.java @@ -45,11 +45,11 @@ public class DependencyResolutionContext { this.executionRequest = executionRequest; } - public boolean isEmpty() { + public synchronized boolean isEmpty() { return pomFiles.isEmpty(); } - public void forcePomFiles(Set<IFile> pomFiles) { + public synchronized void forcePomFiles(Set<IFile> pomFiles) { this.pomFiles.addAll(pomFiles); this.forcedPomFiles.addAll(pomFiles); } @@ -66,7 +66,7 @@ public class DependencyResolutionContext { return request.isForce() || forcedPomFiles.contains(pom); } - public IFile pop() { + public synchronized IFile pop() { Iterator<IFile> i = pomFiles.iterator(); IFile pom = i.next(); i.remove(); |