Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-10-10 19:55:40 +0000
committerAlexander Kurtakov2019-10-10 19:55:40 +0000
commit46be0de323643a1ae45c6eb284127d025af4e242 (patch)
tree0b07c48d7f83206cef3b489c18316d22570cc6f9
parent5690cf3738a2d8aa1fc29baa7933f2d7effae6c3 (diff)
downloadorg.eclipse.cdt-46be0de323643a1ae45c6eb284127d025af4e242.tar.gz
org.eclipse.cdt-46be0de323643a1ae45c6eb284127d025af4e242.tar.xz
org.eclipse.cdt-46be0de323643a1ae45c6eb284127d025af4e242.zip
Generify ListenerList.
Change-Id: Iee6fcbe412f8d90004d4ecafe6fa3e7513900971 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java23
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java6
2 files changed, 7 insertions, 22 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java
index 087f4d4bc9c..f9f464b7f45 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java
@@ -225,11 +225,11 @@ public class GdbCommandTimeoutManager implements ICommandListener, IPreferenceCh
private BlockingQueue<QueueEntry> fCommandQueue = new LinkedBlockingQueue<>();
private CustomTimeoutsMap fCustomTimeouts = new CustomTimeoutsMap();
- private ListenerList fListeners;
+ private ListenerList<ICommandTimeoutListener> fListeners;
public GdbCommandTimeoutManager(ICommandControl commandControl) {
fCommandControl = commandControl;
- fListeners = new ListenerList();
+ fListeners = new ListenerList<>();
}
public void initialize() {
@@ -263,16 +263,10 @@ public class GdbCommandTimeoutManager implements ICommandListener, IPreferenceCh
fCustomTimeouts.clear();
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.dsf.debug.service.command.ICommandListener#commandQueued(org.eclipse.cdt.dsf.debug.service.command.ICommandToken)
- */
@Override
public void commandQueued(ICommandToken token) {
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.dsf.debug.service.command.ICommandListener#commandSent(org.eclipse.cdt.dsf.debug.service.command.ICommandToken)
- */
@Override
public void commandSent(ICommandToken token) {
if (!isTimeoutEnabled())
@@ -295,16 +289,10 @@ public class GdbCommandTimeoutManager implements ICommandListener, IPreferenceCh
}
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.dsf.debug.service.command.ICommandListener#commandRemoved(org.eclipse.cdt.dsf.debug.service.command.ICommandToken)
- */
@Override
public void commandRemoved(ICommandToken token) {
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.dsf.debug.service.command.ICommandListener#commandDone(org.eclipse.cdt.dsf.debug.service.command.ICommandToken, org.eclipse.cdt.dsf.debug.service.command.ICommandResult)
- */
@Override
public void commandDone(ICommandToken token, ICommandResult result) {
if (!isTimeoutEnabled())
@@ -326,9 +314,6 @@ public class GdbCommandTimeoutManager implements ICommandListener, IPreferenceCh
}
}
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)
- */
@Override
public void preferenceChange(PreferenceChangeEvent event) {
String property = event.getKey();
@@ -381,8 +366,8 @@ public class GdbCommandTimeoutManager implements ICommandListener, IPreferenceCh
commandText = commandText.substring(0, commandText.length() - 1);
printDebugMessage(String.format("Command '%s' is timed out", commandText)); //$NON-NLS-1$
}
- for (Object l : fListeners.getListeners()) {
- ((ICommandTimeoutListener) l).commandTimedOut(token);
+ for (ICommandTimeoutListener l : fListeners) {
+ l.commandTimedOut(token);
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
index 631c9fbfbf3..34837112624 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
@@ -238,7 +238,7 @@ public class MIBreakpointsManager extends AbstractDsfService
private Map<ICBreakpoint, IMarker> fBreakpointMarkerProblems = new HashMap<>();
- private ListenerList fTrackingListeners = new ListenerList();
+ private ListenerList<IMIBreakpointsTrackingListener> fTrackingListeners = new ListenerList<>();
///////////////////////////////////////////////////////////////////////////
// String constants
@@ -569,8 +569,8 @@ public class MIBreakpointsManager extends AbstractDsfService
fBPToPlatformMaps.remove(dmc);
fPlatformToBPThreadsMaps.remove(dmc);
// Notify breakpoints tracking listeners that the tracking is stopped.
- for (Object o : fTrackingListeners.getListeners()) {
- ((IMIBreakpointsTrackingListener) o).breakpointTrackingStopped(dmc);
+ for (IMIBreakpointsTrackingListener o : fTrackingListeners) {
+ o.breakpointTrackingStopped(dmc);
}
rm.done();
}

Back to the top