Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2008-05-05 17:36:06 -0400
committerCurtis Windatt2008-05-05 17:36:06 -0400
commit056d3a1cde6d536d4c673252c69f80ffbacf6f7b (patch)
tree6c992633bafb2266f3a34cfa5a3cae26a0014c2c /org.eclipse.debug.core
parent866fdc075ea7b8d4bedcf71c5cd317a630fa025e (diff)
downloadeclipse.platform.debug-056d3a1cde6d536d4c673252c69f80ffbacf6f7b.tar.gz
eclipse.platform.debug-056d3a1cde6d536d4c673252c69f80ffbacf6f7b.tar.xz
eclipse.platform.debug-056d3a1cde6d536d4c673252c69f80ffbacf6f7b.zip
Bug 229266 - NPE while debugging
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java31
1 files changed, 6 insertions, 25 deletions
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 f54a05ba6..a7381f5d2 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 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
@@ -296,7 +296,7 @@ public class DebugPlugin extends Plugin {
/**
* Event filters, or <code>null</code> if none.
*/
- private ListenerList fEventFilters = null;
+ private ListenerList fEventFilters = new ListenerList();
/**
* Whether this plug-in is in the process of shutting
@@ -592,10 +592,8 @@ public class DebugPlugin extends Plugin {
}
fEventListeners.clear();
+ fEventFilters.clear();
- if (fEventFilters != null) {
- fEventFilters = null;
- }
SourceLookupUtils.shutdown();
setDefault(null);
ResourcesPlugin.getWorkspace().removeSaveParticipant(this);
@@ -859,9 +857,6 @@ public class DebugPlugin extends Plugin {
* @since 2.0
*/
public void addDebugEventFilter(IDebugEventFilter filter) {
- if (fEventFilters == null) {
- fEventFilters = new ListenerList();
- }
fEventFilters.add(filter);
}
@@ -874,12 +869,7 @@ public class DebugPlugin extends Plugin {
* @since 2.0
*/
public void removeDebugEventFilter(IDebugEventFilter filter) {
- if (fEventFilters != null) {
- fEventFilters.remove(filter);
- if (fEventFilters.size() == 0) {
- fEventFilters = null;
- }
- }
+ fEventFilters.remove(filter);
}
/**
@@ -1008,15 +998,6 @@ public class DebugPlugin extends Plugin {
}
/**
- * Returns whether any event filters are registered
- *
- * @return whether any event filters are registered
- */
- private boolean hasEventFilters() {
- return fEventFilters != null && fEventFilters.size() > 0;
- }
-
- /**
* Executes runnables after event dispatch is complete.
*
* @since 3.0
@@ -1098,9 +1079,9 @@ public class DebugPlugin extends Plugin {
*/
void dispatch(DebugEvent[] events) {
fEvents = events;
- if (hasEventFilters()) {
+ Object[] filters = fEventFilters.getListeners();
+ if (filters.length > 0) {
fMode = NOTIFY_FILTERS;
- Object[] filters = fEventFilters.getListeners();
for (int i = 0; i < filters.length; i++) {
fFilter = (IDebugEventFilter)filters[i];
SafeRunner.run(this);

Back to the top