Author: akazakov
Date: 2012-01-04 20:37:04 -0500 (Wed, 04 Jan 2012)
New Revision: 37650
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
Log:
https://issues.jboss.org/browse/JBIDE-10585 Deadlock when building JSF project
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2012-01-05
00:17:16 UTC (rev 37649)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2012-01-05
01:37:04 UTC (rev 37650)
@@ -266,7 +266,7 @@
if(markers.isEmpty()) {
markerArray = EMPTY_MARKER_ARRAY;
} else {
- markerArray = markers.toArray(new IMarker[0]);
+ markerArray = markers.toArray(new IMarker[markers.size()]);
}
}
return markerArray;
@@ -293,17 +293,22 @@
/**
* Removes all markers from this EL.
*/
- public synchronized void deleteMarkers() {
- initMarkers();
- for (IMarker marker : markers) {
+ public void deleteMarkers() {
+ IMarker[] aMarkers = null;
+ synchronized (this) {
+ initMarkers();
+ aMarkers = getMarkers();
+ markers.clear();
+ markerArray = null;
+ }
+
+ for (IMarker marker : aMarkers) {
try {
marker.delete();
} catch (CoreException e) {
ELCorePlugin.getDefault().logError(e);
}
}
- markers.clear();
- markerArray = null;
}
/**