Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayaprakash Arthanareeswaran2014-04-04 01:35:44 -0400
committerJayaprakash Arthanareeswaran2014-05-07 12:19:42 -0400
commit185756bd87751a9ed4b6f02ca043c0fdb13635f0 (patch)
tree334ee49afbe4789d7b91711d78ad8dfb0ee48370
parent3527ed14509f8f8b3ce0a53af901a62b669139c7 (diff)
downloadeclipse.jdt.core-185756bd87751a9ed4b6f02ca043c0fdb13635f0.tar.gz
eclipse.jdt.core-185756bd87751a9ed4b6f02ca043c0fdb13635f0.tar.xz
eclipse.jdt.core-185756bd87751a9ed4b6f02ca043c0fdb13635f0.zip
Fix for Bug 431275 - Deadlock in JavaModelManager$PerProjectInfo andv_A87_R36xR3_6_maintenance
DeltaProcessingState Change-Id: Ie4b347052d109f05b59ccea8d40b0b75403f70cc
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessingState.java46
1 files changed, 26 insertions, 20 deletions
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessingState.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessingState.java
index 6f94386bfe..08beed8e28 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessingState.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessingState.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -178,30 +178,36 @@ public class DeltaProcessingState implements IResourceChangeListener {
return deltaProcessor;
}
- public synchronized ClasspathChange addClasspathChange(IProject project, IClasspathEntry[] oldRawClasspath, IPath oldOutputLocation, IClasspathEntry[] oldResolvedClasspath) {
- ClasspathChange change = (ClasspathChange) this.classpathChanges.get(project);
- if (change == null) {
- change = new ClasspathChange((JavaProject) JavaModelManager.getJavaModelManager().getJavaModel().getJavaProject(project), oldRawClasspath, oldOutputLocation, oldResolvedClasspath);
- this.classpathChanges.put(project, change);
- } else {
- if (change.oldRawClasspath == null)
- change.oldRawClasspath = oldRawClasspath;
- if (change.oldOutputLocation == null)
- change.oldOutputLocation = oldOutputLocation;
- if (change.oldResolvedClasspath == null)
- change.oldResolvedClasspath = oldResolvedClasspath;
+ public ClasspathChange addClasspathChange(IProject project, IClasspathEntry[] oldRawClasspath, IPath oldOutputLocation, IClasspathEntry[] oldResolvedClasspath) {
+ synchronized (this.classpathChanges) {
+ ClasspathChange change = (ClasspathChange) this.classpathChanges.get(project);
+ if (change == null) {
+ change = new ClasspathChange((JavaProject) JavaModelManager.getJavaModelManager().getJavaModel().getJavaProject(project), oldRawClasspath, oldOutputLocation, oldResolvedClasspath);
+ this.classpathChanges.put(project, change);
+ } else {
+ if (change.oldRawClasspath == null)
+ change.oldRawClasspath = oldRawClasspath;
+ if (change.oldOutputLocation == null)
+ change.oldOutputLocation = oldOutputLocation;
+ if (change.oldResolvedClasspath == null)
+ change.oldResolvedClasspath = oldResolvedClasspath;
+ }
+ return change;
}
- return change;
}
- public synchronized ClasspathChange getClasspathChange(IProject project) {
- return (ClasspathChange) this.classpathChanges.get(project);
+ public ClasspathChange getClasspathChange(IProject project) {
+ synchronized (this.classpathChanges) {
+ return (ClasspathChange) this.classpathChanges.get(project);
+ }
}
- public synchronized HashMap removeAllClasspathChanges() {
- HashMap result = this.classpathChanges;
- this.classpathChanges = new HashMap(result.size());
- return result;
+ public HashMap removeAllClasspathChanges() {
+ synchronized (this.classpathChanges) {
+ HashMap result = this.classpathChanges;
+ this.classpathChanges = new HashMap(result.size());
+ return result;
+ }
}
public synchronized ClasspathValidation addClasspathValidation(JavaProject project) {

Back to the top