Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-04-18 07:14:35 -0400
committerIgor Fedorenko2011-04-18 07:14:35 -0400
commit459c9465a07d9a2b7bb75b0d59a87e40fe1b54ff (patch)
tree5190a764e01da8b5a68f3b31c2f725d482463e4d
parent0e843b743ab9f57d0122f8f1349a70badb24a0d5 (diff)
downloadm2e-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.java6
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();

Back to the top