Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2005-11-23 03:50:32 +0000
committerDarin Wright2005-11-23 03:50:32 +0000
commit0b1a9a5957f521d8d4605100652275aa6b865041 (patch)
treecf0c055e8bf8d420f7f55ec7f228916403c548c9
parentc31caf50532420ef541b8fe1c365f0aae08df679 (diff)
downloadeclipse.platform.debug-0b1a9a5957f521d8d4605100652275aa6b865041.tar.gz
eclipse.platform.debug-0b1a9a5957f521d8d4605100652275aa6b865041.tar.xz
eclipse.platform.debug-0b1a9a5957f521d8d4605100652275aa6b865041.zip
Use new utility listener list
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ListenerList.java137
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java3
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java13
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java11
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java5
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java11
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ListenerList.java137
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AbstractModelProxy.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java2
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java2
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java4
17 files changed, 81 insertions, 324 deletions
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ListenerList.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ListenerList.java
deleted file mode 100644
index 316970737..000000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ListenerList.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.variables;
-
-
-/**
- * Local version of org.eclipse.jface.util.ListenerList (modified)s
- */
-public class ListenerList {
- /**
- * The current number of listeners.
- * Maintains invariant: 0 <= fSize <= listeners.length.
- */
- private int fSize;
-
- /**
- * The list of listeners. Initially <code>null</code> but initialized
- * to an array of size capacity the first time a listener is added.
- * Maintains invariant: listeners != null if and only if fSize != 0
- */
- private Object[] fListeners= null;
-
- /**
- * The empty array singleton instance, returned by getListeners()
- * when size == 0.
- */
- private static final Object[] EmptyArray= new Object[0];
-
- /**
- * Creates a listener list with the given initial capacity.
- *
- * @param capacity the number of listeners which this list can initially accept
- * without growing its internal representation; must be at least 1
- */
- public ListenerList(int capacity) {
- if (capacity < 1) {
- throw new IllegalArgumentException();
- }
- fListeners= new Object[capacity];
- fSize= 0;
- }
-
- /**
- * Adds a listener to the list.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener a listener
- */
- public synchronized void add(Object listener) {
- if (listener == null) {
- throw new IllegalArgumentException();
- }
- // check for duplicates using identity
- for (int i= 0; i < fSize; ++i) {
- if (fListeners[i] == listener) {
- return;
- }
- }
- // grow array if necessary
- if (fSize == fListeners.length) {
- Object[] temp= new Object[(fSize * 2) + 1];
- System.arraycopy(fListeners, 0, temp, 0, fSize);
- fListeners= temp;
- }
- fListeners[fSize++]= listener;
- }
-
- /**
- * Returns an array containing all the registered listeners.
- * The resulting array is unaffected by subsequent adds or removes.
- * If there are no listeners registered, the result is an empty array
- * singleton instance (no garbage is created).
- * Use this method when notifying listeners, so that any modifications
- * to the listener list during the notification will have no effect on the
- * notification itself.
- */
- public synchronized Object[] getListeners() {
- if (fSize == 0) {
- return EmptyArray;
- }
- Object[] result= new Object[fSize];
- System.arraycopy(fListeners, 0, result, 0, fSize);
- return result;
- }
-
- /**
- * Removes a listener from the list.
- * Has no effect if an identical listener was not already registered.
- *
- * @param listener a listener
- */
- public synchronized void remove(Object listener) {
- if (listener == null) {
- throw new IllegalArgumentException();
- }
-
- for (int i= 0; i < fSize; ++i) {
- if (fListeners[i] == listener) {
- if (--fSize == 0) {
- fListeners= new Object[1];
- } else {
- if (i < fSize) {
- fListeners[i]= fListeners[fSize];
- }
- fListeners[fSize]= null;
- }
- return;
- }
- }
- }
-
- /**
- * Removes all the listeners from the list.
- */
- public void removeAll() {
- fListeners= new Object[0];
- fSize= 0;
- }
-
- /**
- * Returns the number of registered listeners
- *
- * @return the number of registered listeners
- */
- public int size() {
- return fSize;
- }
-}
-
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
index 323e84fa9..b2b6ed921 100644
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
+++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
@@ -36,6 +36,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
@@ -187,7 +188,7 @@ public class StringVariableManager implements IStringVariableManager, IPropertyC
* Constructs a new string variable manager.
*/
private StringVariableManager() {
- fListeners = new ListenerList(5);
+ fListeners = new ListenerList();
}
/**
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
index 44d388f7f..bb7b55bc3 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
@@ -36,6 +36,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
@@ -48,7 +49,6 @@ import org.eclipse.debug.internal.core.BreakpointManager;
import org.eclipse.debug.internal.core.DebugCoreMessages;
import org.eclipse.debug.internal.core.ExpressionManager;
import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.core.ListenerList;
import org.eclipse.debug.internal.core.LogicalStructureManager;
import org.eclipse.debug.internal.core.MemoryBlockManager;
import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages;
@@ -408,7 +408,7 @@ public class DebugPlugin extends Plugin {
*/
public void addDebugEventListener(IDebugEventSetListener listener) {
if (fEventListeners == null) {
- fEventListeners = new ListenerList(20);
+ fEventListeners = new ListenerList();
}
fEventListeners.add(listener);
}
@@ -571,8 +571,13 @@ public class DebugPlugin extends Plugin {
}
if (fEventListeners != null) {
- fEventListeners.removeAll();
+ fEventListeners = null;
}
+
+ if (fEventFilters != null) {
+ fEventFilters = null;
+ }
+
SourceLookupUtils.shutdown();
setDefault(null);
ResourcesPlugin.getWorkspace().removeSaveParticipant(this);
@@ -809,7 +814,7 @@ public class DebugPlugin extends Plugin {
*/
public void addDebugEventFilter(IDebugEventFilter filter) {
if (fEventFilters == null) {
- fEventFilters = new ListenerList(2);
+ fEventFilters = new ListenerList();
}
fEventFilters.add(filter);
}
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 1ff3dbd59..751ba5d13 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
@@ -36,6 +36,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
@@ -109,12 +110,12 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* Collection of breakpoint listeners.
*/
- private ListenerList fBreakpointListeners= new ListenerList(6);
+ private ListenerList fBreakpointListeners= new ListenerList();
/**
* Collection of (multi) breakpoint listeners.
*/
- private ListenerList fBreakpointsListeners= new ListenerList(6);
+ private ListenerList fBreakpointsListeners= new ListenerList();
/**
* Singleton resource delta visitor which handles marker
@@ -131,7 +132,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
* Collection of breakpoint manager listeners which are
* notified when this manager's enablement changes.
*/
- private ListenerList fBreakpointManagerListeners= new ListenerList(2);
+ private ListenerList fBreakpointManagerListeners= new ListenerList();
/**
* Constructs a new breakpoint manager.
@@ -220,7 +221,9 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
*/
public void shutdown() {
getWorkspace().removeResourceChangeListener(this);
- fBreakpointListeners.removeAll();
+ fBreakpointListeners = null;
+ fBreakpointsListeners = null;
+ fBreakpointManagerListeners = null;
}
/**
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java
index 2c5e24082..18c5fc6be 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java
@@ -28,6 +28,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.core.runtime.Preferences;
@@ -363,7 +364,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
*/
public void addExpressionListener(IExpressionListener listener) {
if (fListeners == null) {
- fListeners = new ListenerList(2);
+ fListeners = new ListenerList();
}
fListeners.add(listener);
}
@@ -444,7 +445,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
*/
public void addExpressionListener(IExpressionsListener listener) {
if (fExpressionsListeners == null) {
- fExpressionsListeners = new ListenerList(2);
+ fExpressionsListeners = new ListenerList();
}
fExpressionsListeners.add(listener);
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index 15dcd78d7..cb02c8c42 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -67,6 +67,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.core.runtime.Status;
@@ -179,13 +180,13 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* Collection of listeners
*/
- private ListenerList fListeners= new ListenerList(5);
+ private ListenerList fListeners= new ListenerList();
/**
* Collection of "plural" listeners.
* @since 2.1
*/
- private ListenerList fLaunchesListeners = new ListenerList(5);
+ private ListenerList fLaunchesListeners = new ListenerList();
/**
* Visitor used to process resource deltas,
@@ -201,7 +202,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* Launch configuration listeners
*/
- private ListenerList fLaunchConfigurationListeners = new ListenerList(5);
+ private ListenerList fLaunchConfigurationListeners = new ListenerList();
/**
* Table of source locator extensions. Keys
@@ -518,7 +519,9 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* Clears launch configuration types.
*/
public void shutdown() {
- fListeners.removeAll();
+ fListeners = new ListenerList();
+ fLaunchesListeners = new ListenerList();
+ fLaunchConfigurationListeners = new ListenerList();
ILaunch[] launches = getLaunches();
for (int i= 0; i < launches.length; i++) {
ILaunch launch= launches[i];
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ListenerList.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ListenerList.java
deleted file mode 100644
index 0517fb2b0..000000000
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ListenerList.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.core;
-
-
-/**
- * Local version of org.eclipse.jface.util.ListenerList (modified)s
- */
-public class ListenerList {
- /**
- * The current number of listeners.
- * Maintains invariant: 0 <= fSize <= listeners.length.
- */
- private int fSize;
-
- /**
- * The list of listeners. Initially <code>null</code> but initialized
- * to an array of size capacity the first time a listener is added.
- * Maintains invariant: listeners != null if and only if fSize != 0
- */
- private Object[] fListeners= null;
-
- /**
- * The empty array singleton instance, returned by getListeners()
- * when size == 0.
- */
- private static final Object[] EmptyArray= new Object[0];
-
- /**
- * Creates a listener list with the given initial capacity.
- *
- * @param capacity the number of listeners which this list can initially accept
- * without growing its internal representation; must be at least 1
- */
- public ListenerList(int capacity) {
- if (capacity < 1) {
- throw new IllegalArgumentException();
- }
- fListeners= new Object[capacity];
- fSize= 0;
- }
-
- /**
- * Adds a listener to the list.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener a listener
- */
- public synchronized void add(Object listener) {
- if (listener == null) {
- throw new IllegalArgumentException();
- }
- // check for duplicates using identity
- for (int i= 0; i < fSize; ++i) {
- if (fListeners[i] == listener) {
- return;
- }
- }
- // grow array if necessary
- if (fSize == fListeners.length) {
- Object[] temp= new Object[(fSize * 2) + 1];
- System.arraycopy(fListeners, 0, temp, 0, fSize);
- fListeners= temp;
- }
- fListeners[fSize++]= listener;
- }
-
- /**
- * Returns an array containing all the registered listeners.
- * The resulting array is unaffected by subsequent adds or removes.
- * If there are no listeners registered, the result is an empty array
- * singleton instance (no garbage is created).
- * Use this method when notifying listeners, so that any modifications
- * to the listener list during the notification will have no effect on the
- * notification itself.
- */
- public synchronized Object[] getListeners() {
- if (fSize == 0) {
- return EmptyArray;
- }
- Object[] result= new Object[fSize];
- System.arraycopy(fListeners, 0, result, 0, fSize);
- return result;
- }
-
- /**
- * Removes a listener from the list.
- * Has no effect if an identical listener was not already registered.
- *
- * @param listener a listener
- */
- public synchronized void remove(Object listener) {
- if (listener == null) {
- throw new IllegalArgumentException();
- }
-
- for (int i= 0; i < fSize; ++i) {
- if (fListeners[i] == listener) {
- if (--fSize == 0) {
- fListeners= new Object[1];
- } else {
- if (i < fSize) {
- fListeners[i]= fListeners[fSize];
- }
- fListeners[fSize]= null;
- }
- return;
- }
- }
- }
-
- /**
- * Removes all the listeners from the list.
- */
- public synchronized void removeAll() {
- fListeners= new Object[0];
- fSize= 0;
- }
-
- /**
- * Returns the number of registered listeners
- *
- * @return the number of registered listeners
- */
- public int size() {
- return fSize;
- }
-}
-
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
index a88012ade..4919b8ace 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
@@ -16,6 +16,7 @@ import java.io.IOException;
import java.io.InputStream;
import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IStreamListener;
@@ -37,7 +38,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
/**
* A collection of listeners
*/
- private ListenerList fListeners= new ListenerList(1);
+ private ListenerList fListeners= new ListenerList();
/**
* Whether content is being buffered
@@ -97,7 +98,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
thread.join();
} catch (InterruptedException ie) {
}
- fListeners.removeAll();
+ fListeners = new ListenerList();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
index 140f0a556..e48037908 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
@@ -17,6 +17,7 @@ import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint;
@@ -25,7 +26,6 @@ import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.core.model.IValue;
import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.core.ListenerList;
import org.eclipse.debug.internal.ui.views.variables.IndexedVariablePartition;
import org.eclipse.debug.ui.IDebugEditorPresentation;
import org.eclipse.debug.ui.IDebugModelPresentation;
@@ -67,7 +67,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
* Temp holding for listeners - we do not add to presentation until
* it needs to be instantiated.
*/
- protected ListenerList fListeners= new ListenerList(5);
+ protected ListenerList fListeners= new ListenerList();
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugEditorPresentation#removeAnntations(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IThread)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
index 5c9e57cff..e90457839 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
@@ -11,6 +11,7 @@
package org.eclipse.debug.internal.ui.contexts;
import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
@@ -23,7 +24,6 @@ import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.ui.contexts.ISuspendTrigger;
import org.eclipse.debug.ui.contexts.ISuspendTriggerListener;
-import org.eclipse.jface.util.ListenerList;
/**
* @since 3.2
@@ -37,21 +37,25 @@ public class LaunchSuspendTrigger implements ISuspendTrigger, IDebugEventSetList
}
protected void dispose() {
- fListeners.clear();
+ fListeners = null;
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.ISuspendTrigger#addSuspendTriggerListener(org.eclipse.debug.ui.contexts.ISuspendTriggerListener)
*/
public void addSuspendTriggerListener(ISuspendTriggerListener listener) {
- fListeners.add(listener);
+ if (fListeners != null) {
+ fListeners.add(listener);
+ }
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.ISuspendTrigger#removeSuspendTriggerListener(org.eclipse.debug.ui.contexts.ISuspendTriggerListener)
*/
- public void removeSuspendTriggerListener(ISuspendTriggerListener listener) {
- fListeners.remove(listener);
+ public void removeSuspendTriggerListener(ISuspendTriggerListener listener) {
+ if (fListeners != null) {
+ fListeners.remove(listener);
+ }
}
/* (non-Javadoc)
@@ -86,20 +90,23 @@ public class LaunchSuspendTrigger implements ISuspendTrigger, IDebugEventSetList
context = source;
}
final Object temp = context;
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final ISuspendTriggerListener listener = (ISuspendTriggerListener) listeners[i];
- Platform.run(new ISafeRunnable() {
- public void run() throws Exception {
- listener.suspended(launch, temp);
- }
-
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
-
- });
- }
+ ListenerList list = fListeners;
+ if (list != null) {
+ Object[] listeners = list.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final ISuspendTriggerListener listener = (ISuspendTriggerListener) listeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void run() throws Exception {
+ listener.suspended(launch, temp);
+ }
+
+ public void handleException(Throwable exception) {
+ DebugUIPlugin.log(exception);
+ }
+
+ });
+ }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
index 0fb43bc9d..53cb0aed6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
@@ -18,6 +18,7 @@ import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -49,7 +50,6 @@ import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.operation.ModalContext;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.ListenerList;
import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -154,7 +154,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
private ProgressMonitorPart fProgressMonitorPart;
private Cursor waitCursor;
private Cursor arrowCursor;
- private ListenerList changeListeners = new ListenerList(3);
+ private ListenerList changeListeners = new ListenerList();
/**
* The number of 'long-running' operations currently taking place in this dialog
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AbstractModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AbstractModelProxy.java
index eec03e25e..4bf66b25d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AbstractModelProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AbstractModelProxy.java
@@ -1,13 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
package org.eclipse.debug.internal.ui.viewers;
import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.internal.core.ListenerList;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
public abstract class AbstractModelProxy implements IModelProxy {
- protected ListenerList fListeners = new ListenerList(1);
+ protected ListenerList fListeners = new ListenerList();
protected Object[] getListeners() {
synchronized (fListeners) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java
index 4b3deb22d..bb655cb37 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java
@@ -12,12 +12,12 @@ package org.eclipse.debug.ui;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.views.breakpoints.OtherBreakpointCategory;
import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.ListenerList;
import org.eclipse.jface.util.PropertyChangeEvent;
/**
@@ -72,7 +72,7 @@ public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpoint
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
*/
public void dispose() {
- fListeners.clear();
+ fListeners = new ListenerList();
}
/* (non-Javadoc)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
index 713db844f..e84ebe46d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.debug.ui.memory;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.debug.core.DebugException;
@@ -22,7 +23,6 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.ListenerList;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.graphics.Image;
@@ -86,7 +86,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
}
if (fPropertyListeners != null)
- fPropertyListeners.clear();
+ fPropertyListeners = null;
}
/* (non-Javadoc)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java
index 38a417298..cabb1d6a3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java
@@ -11,9 +11,9 @@
package org.eclipse.debug.ui.memory;
import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.util.ListenerList;
/**
* Common function for a dynamic memory rendering bindings provider.
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java
index 2961d649e..f33215075 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java
@@ -12,11 +12,11 @@ package org.eclipse.ui.console;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.ListenerList;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.ui.internal.console.ConsoleMessages;
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
index eeb0a271a..d235c9ecf 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
@@ -22,9 +22,9 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.util.ListenerList;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
@@ -191,7 +191,7 @@ public class ConsoleManager implements IConsoleManager {
*/
public void addConsoleListener(IConsoleListener listener) {
if (fListeners == null) {
- fListeners = new ListenerList(5);
+ fListeners = new ListenerList();
}
fListeners.add(listener);
}

Back to the top