diff options
| author | Pawel Piech | 2011-11-04 21:33:25 +0000 |
|---|---|---|
| committer | Pawel Piech | 2011-11-04 21:33:25 +0000 |
| commit | 366ebde49ed41a56e1684ea7be65cf58cafd72ed (patch) | |
| tree | 501e83453c9b37b0307ae6e08c73c8d6b712d4d9 | |
| parent | daec187720d2abcebdda62e9a271c6e226239877 (diff) | |
| download | eclipse.platform.debug-366ebde49ed41a56e1684ea7be65cf58cafd72ed.tar.gz eclipse.platform.debug-366ebde49ed41a56e1684ea7be65cf58cafd72ed.tar.xz eclipse.platform.debug-366ebde49ed41a56e1684ea7be65cf58cafd72ed.zip | |
Bug 345298 - [breakpoints] BreakpointManager deadlocks trying to restorev20111107-1153
breakpoints
| -rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java | 19 | ||||
| -rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java | 7 |
2 files changed, 19 insertions, 7 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java index 3fd04ff38..6ea9afa3e 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java @@ -28,6 +28,7 @@ import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.IBreakpointManager; +import org.eclipse.debug.internal.core.BreakpointManager; import org.eclipse.debug.internal.core.DebugCoreMessages; /** @@ -41,17 +42,21 @@ import org.eclipse.debug.internal.core.DebugCoreMessages; public abstract class Breakpoint extends PlatformObject implements IBreakpoint { - static { - // making sure that the BreakpointManager is correctly initialized - // before any breakpoint marker related operation (see bug 54993) - DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(); - } - /** * Underlying marker. */ private IMarker fMarker= null; - + + /** + * Default constructor used to ensure that breakpoint manager is initialized. + */ + public Breakpoint() { + // making sure that the BreakpointManager is correctly initialized + // before any breakpoint marker related operation (see bug 54993) + ((BreakpointManager)DebugPlugin.getDefault().getBreakpointManager()).ensureBreakpointsInitialized(); + } + + /** * @see IBreakpoint#setMarker(IMarker) */ diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java index 4d631c226..cb666a052 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java @@ -394,6 +394,13 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis } /** + * Calls {@link #initializeBreakpoints()} if breakpoints have not yet been initialized. + */ + public void ensureBreakpointsInitialized() { + getBreakpoints0(); + } + + /** * The BreakpointManager waits to load the breakpoints * of the workspace until a request is made to retrieve the * breakpoints. |
