Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2016-01-22 07:51:59 -0500
committerSarika Sinha2016-01-22 07:51:59 -0500
commitb11c99ce0d8d77c7d8f4d6a8c42acc95125a05e8 (patch)
treea69936f5c60f2ab82bc922a381764cf483aa80d8 /org.eclipse.debug.ui/ui/org/eclipse/debug/ui
parenteb152262968725de3dc0014287f621169ba5ca5e (diff)
downloadeclipse.platform.debug-b11c99ce0d8d77c7d8f4d6a8c42acc95125a05e8.tar.gz
eclipse.platform.debug-b11c99ce0d8d77c7d8f4d6a8c42acc95125a05e8.tar.xz
eclipse.platform.debug-b11c99ce0d8d77c7d8f4d6a8c42acc95125a05e8.zip
Bug 486157 - Adapt to ListenerList changesI20160125-0400I20160124-2000
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java36
4 files changed, 33 insertions, 40 deletions
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 913984ff8..fd2e85931 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -30,7 +30,7 @@ import org.eclipse.jface.util.PropertyChangeEvent;
public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpointOrganizerDelegate {
// property change listeners
- private ListenerList fListeners = new ListenerList();
+ private ListenerList<IPropertyChangeListener> fListeners = new ListenerList<>();
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
@@ -77,7 +77,7 @@ public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpoint
*/
@Override
public void dispose() {
- fListeners = new ListenerList();
+ fListeners = new ListenerList<>();
}
/* (non-Javadoc)
@@ -106,9 +106,8 @@ public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpoint
return;
}
final PropertyChangeEvent event = new PropertyChangeEvent(this, P_CATEGORY_CHANGED, category, null);
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IPropertyChangeListener listener = (IPropertyChangeListener) listeners[i];
+ for (IPropertyChangeListener iPropertyChangeListener : fListeners) {
+ final IPropertyChangeListener listener = iPropertyChangeListener;
ISafeRunnable runnable = new ISafeRunnable() {
@Override
public void handleException(Throwable exception) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java
index 15c18d638..e19bd7991 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 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
@@ -28,7 +28,7 @@ public abstract class AbstractDebugContextProvider implements IDebugContextProvi
/**
* Event listeners
*/
- private ListenerList fListeners = new ListenerList();
+ private ListenerList<IDebugContextListener> fListeners = new ListenerList<>();
/**
* Part or <code>null</code>
@@ -74,10 +74,9 @@ public abstract class AbstractDebugContextProvider implements IDebugContextProvi
* @param event debug context event
*/
protected void fire(final DebugContextEvent event) {
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IDebugContextListener listener = (IDebugContextListener) listeners[i];
- SafeRunner.run(new ISafeRunnable() {
+ for (IDebugContextListener iDebugContextListener : fListeners) {
+ final IDebugContextListener listener = iDebugContextListener;
+ SafeRunner.run(new ISafeRunnable() {
@Override
public void run() throws Exception {
listener.debugContextChanged(event);
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 935614696..ab9dcdd90 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2016 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
@@ -58,7 +58,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
private IMemoryBlock fMemoryBlock;
private IMemoryRenderingContainer fContainer;
- private ListenerList fPropertyListeners;
+ private ListenerList<IPropertyChangeListener> fPropertyListeners;
private boolean fVisible = true;
private MenuManager fPopupMenuMgr;
private String fRenderingId;
@@ -218,7 +218,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
public void addPropertyChangeListener(IPropertyChangeListener listener) {
if (fPropertyListeners == null)
- fPropertyListeners = new ListenerList();
+ fPropertyListeners = new ListenerList<>();
fPropertyListeners.add(listener);
}
@@ -390,12 +390,9 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
{
if (fPropertyListeners == null)
return;
-
- Object[] listeners = fPropertyListeners.getListeners();
-
- for (int i=0; i<listeners.length; i++)
- {
- PropertyChangeNotifier notifier = new PropertyChangeNotifier((IPropertyChangeListener)listeners[i], event);
+
+ for (IPropertyChangeListener iPropertyChangeListener : fPropertyListeners) {
+ PropertyChangeNotifier notifier = new PropertyChangeNotifier(iPropertyChangeListener, event);
SafeRunner.run(notifier);
}
}
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 aaec45a6d..f49b04a28 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2016 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
@@ -26,7 +26,7 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
public abstract class AbstractMemoryRenderingBindingsProvider implements IMemoryRenderingBindingsProvider {
// list of binding listeners
- private ListenerList fListeners;
+ private ListenerList<IMemoryRenderingBindingsListener> fListeners;
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#addListener(org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener)
@@ -34,7 +34,7 @@ public abstract class AbstractMemoryRenderingBindingsProvider implements IMemory
@Override
public void addListener(IMemoryRenderingBindingsListener listener) {
if (fListeners == null) {
- fListeners = new ListenerList();
+ fListeners = new ListenerList<>();
}
fListeners.add(listener);
}
@@ -56,22 +56,20 @@ public abstract class AbstractMemoryRenderingBindingsProvider implements IMemory
return;
}
- Object[] listeners = fListeners.getListeners();
-
- for (int i=0; i<listeners.length; i++) {
- if (listeners[i] instanceof IMemoryRenderingBindingsListener) {
- final IMemoryRenderingBindingsListener listener = (IMemoryRenderingBindingsListener)listeners[i];
- ISafeRunnable runnable = new ISafeRunnable () {
- @Override
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- @Override
- public void run() throws Exception {
- listener.memoryRenderingBindingsChanged();
- }};
- SafeRunner.run(runnable);
- }
+ for (IMemoryRenderingBindingsListener iMemoryRenderingBindingsListener : fListeners) {
+ final IMemoryRenderingBindingsListener listener = iMemoryRenderingBindingsListener;
+ ISafeRunnable runnable = new ISafeRunnable() {
+ @Override
+ public void handleException(Throwable exception) {
+ DebugUIPlugin.log(exception);
+ }
+
+ @Override
+ public void run() throws Exception {
+ listener.memoryRenderingBindingsChanged();
+ }
+ };
+ SafeRunner.run(runnable);
}
}
}

Back to the top