mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Generics warnings cleanup (bug 178689).
This commit is contained in:
parent
11aaafc829
commit
caa4c1b355
33 changed files with 318 additions and 45 deletions
|
@ -25,7 +25,8 @@ public class DsfDebugUIPlugin extends AbstractUIPlugin {
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
plugin = this;
|
||||
}
|
||||
|
@ -34,7 +35,8 @@ public class DsfDebugUIPlugin extends AbstractUIPlugin {
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public class DebugViewSelectionRootLayoutNode extends AbstractVMRootLayoutNode
|
|||
boolean potentialMatchFound = false;
|
||||
boolean matchFound = false;
|
||||
|
||||
IDMContext<?> eventDmc = ((IDMEvent)event).getDMContext();
|
||||
IDMContext<?> eventDmc = ((IDMEvent<?>)event).getDMContext();
|
||||
for (IDMContext<?> eventDmcAncestor : DMContexts.toList(eventDmc)) {
|
||||
IDMContext<?> inputDmcAncestor = DMContexts.getAncestorOfType(inputDmc, eventDmcAncestor.getClass());
|
||||
if (inputDmcAncestor != null) {
|
||||
|
@ -129,7 +129,10 @@ public class DebugViewSelectionRootLayoutNode extends AbstractVMRootLayoutNode
|
|||
IStructuredSelection structSelection = (IStructuredSelection)selection;
|
||||
if (structSelection.getFirstElement() instanceof DMVMContext)
|
||||
{
|
||||
return ((DMVMContext)structSelection.getFirstElement()).getDMC();
|
||||
// Correct cast: (AbstractDMVMLayoutNode<?>.DMVMContext) breaks the javac compiler
|
||||
@SuppressWarnings("unchecked")
|
||||
DMVMContext vmc = (DMVMContext)structSelection.getFirstElement();
|
||||
return vmc.getDMC();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -190,6 +190,7 @@ public class StackFramesLayoutNode extends AbstractDMVMLayoutNode<IStack.IFrameD
|
|||
update.setLabel(label.toString(), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleFailedUpdate(IViewerUpdate update) {
|
||||
if (update instanceof ILabelUpdate) {
|
||||
// Avoid repainting the label if it's not available. This only slows
|
||||
|
@ -280,7 +281,7 @@ public class StackFramesLayoutNode extends AbstractDMVMLayoutNode<IStack.IFrameD
|
|||
return;
|
||||
}
|
||||
|
||||
IRunControl.IResumedDMEvent resumedEvent = (IRunControl.IResumedDMEvent)e;
|
||||
IRunControl.IResumedDMEvent resumedEvent = e;
|
||||
if (resumedEvent.getReason() != StateChangeReason.STEP) {
|
||||
// Refresh the list of stack frames only if the run operation is not a step. Also, clear the list
|
||||
// of cached frames.
|
||||
|
|
|
@ -39,7 +39,7 @@ public class StandardLaunchRootLayoutNode extends AbstractVMRootLayoutNode
|
|||
implements IVMRootLayoutNode
|
||||
{
|
||||
public static class LaunchesEvent {
|
||||
public enum Type { ADDED, REMOVED, CHANGED, TERMINATED };
|
||||
public enum Type { ADDED, REMOVED, CHANGED, TERMINATED }
|
||||
public final ILaunch[] fLaunches;
|
||||
public final Type fType;
|
||||
|
||||
|
@ -88,6 +88,7 @@ public class StandardLaunchRootLayoutNode extends AbstractVMRootLayoutNode
|
|||
return flags | super.getDeltaFlags(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createDelta(Object event, final GetDataDone<IModelDelta> done) {
|
||||
/*
|
||||
* Create the root of the delta. Since the launch object is not at the
|
||||
|
@ -121,7 +122,7 @@ public class StandardLaunchRootLayoutNode extends AbstractVMRootLayoutNode
|
|||
new Done() {
|
||||
public void run() {
|
||||
if (isDisposed()) return;
|
||||
if (propagateError(getExecutor(), done, "Failed to create delta.")); //$NON-NLS-1$
|
||||
if (propagateError(getExecutor(), done, "Failed to create delta.")) return; //$NON-NLS-1$
|
||||
done.setData(viewRootDelta);
|
||||
getExecutor().execute(done);
|
||||
}
|
||||
|
|
|
@ -51,14 +51,18 @@ public class StandardProcessLayoutNode extends AbstractVMLayoutNode {
|
|||
fProcess = process;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IVMLayoutNode getLayoutNode() { return StandardProcessLayoutNode.this; }
|
||||
@SuppressWarnings("unchecked") public Object getAdapter(Class adapter) {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object getAdapter(Class adapter) {
|
||||
Object vmcAdapter = super.getAdapter(adapter);
|
||||
if (vmcAdapter != null) {
|
||||
return vmcAdapter;
|
||||
}
|
||||
return fProcess.getAdapter(adapter);
|
||||
}
|
||||
@Override
|
||||
public String toString() { return "IProcess " + fProcess.toString(); } //$NON-NLS-1$
|
||||
|
||||
public String getAttribute(String key) { return fProcess.getAttribute(key); }
|
||||
|
@ -71,9 +75,11 @@ public class StandardProcessLayoutNode extends AbstractVMLayoutNode {
|
|||
public boolean isTerminated() { return fProcess.isTerminated(); }
|
||||
public void terminate() throws DebugException { fProcess.terminate(); }
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
return other instanceof VMC && fProcess.equals(((VMC)other).fProcess);
|
||||
}
|
||||
@Override
|
||||
public int hashCode() { return fProcess.hashCode(); }
|
||||
}
|
||||
|
||||
|
@ -132,7 +138,7 @@ public class StandardProcessLayoutNode extends AbstractVMLayoutNode {
|
|||
}
|
||||
|
||||
// @see org.eclipse.dd.dsf.ui.viewmodel.IViewModelLayoutNode#retrieveLabel(org.eclipse.dd.dsf.ui.viewmodel.IVMContext, org.eclipse.debug.internal.ui.viewers.provisional.ILabelRequestMonitor)
|
||||
public void updateLabel(IVMContext vmc, ILabelRequestMonitor result, String[] columns) {
|
||||
public void updateLabel(@SuppressWarnings("unused")IVMContext vmc, ILabelRequestMonitor result, @SuppressWarnings("unused") String[] columns) {
|
||||
|
||||
/*
|
||||
* The implementation of IAdapterFactory that uses this node should not
|
||||
|
@ -198,7 +204,7 @@ public class StandardProcessLayoutNode extends AbstractVMLayoutNode {
|
|||
parent.addNode(new VMC((IProcess)event.getSource()), IModelDelta.STATE);
|
||||
}
|
||||
|
||||
protected void handleCreate(DebugEvent event, VMDelta parent) {
|
||||
protected void handleCreate(@SuppressWarnings("unused") DebugEvent event, @SuppressWarnings("unused") VMDelta parent) {
|
||||
// do nothing - Launch change notification handles this
|
||||
}
|
||||
|
||||
|
|
|
@ -10,5 +10,6 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
org.eclipse.debug.core,
|
||||
org.eclipse.dd.dsf
|
||||
Eclipse-LazyStart: true
|
||||
Export-Package: org.eclipse.dd.dsf.debug.service
|
||||
Export-Package: org.eclipse.dd.dsf.debug.service,
|
||||
org.eclipse.dd.dsf.debug.service.command
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
|
|
|
@ -42,7 +42,8 @@ public class DsfDebugPlugin extends Plugin {
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
fgBundleContext = context;
|
||||
super.start(context);
|
||||
DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.dd.dsf.debug.debug.service/debug")); //$NON-NLS-1$//$NON-NLS-2$
|
||||
|
@ -52,7 +53,8 @@ public class DsfDebugPlugin extends Plugin {
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
fgPlugin = null;
|
||||
fgBundleContext = null;
|
||||
super.stop(context);
|
||||
|
|
|
@ -75,10 +75,12 @@ public interface IModules extends IDMService {
|
|||
this.fOffset = offset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return fModule.hashCode() + fSection.hashCode() + fOffset.intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof ModuleSectionOffset)) return false;
|
||||
ModuleSectionOffset mso = (ModuleSectionOffset)o;
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Wind River Systems 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:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.dd.dsf.debug.service.command;
|
||||
|
||||
|
||||
/**
|
||||
* Command interface for creating and manipulating GDB/MI commands
|
||||
* for the DSF GDB reference implemenation. The command represents
|
||||
* the GDB/MI request which will be put on the wire to the GDB
|
||||
* backend.
|
||||
*/
|
||||
|
||||
public interface ICommand<V extends ICommandResult> {
|
||||
/**
|
||||
* Takes the supplied command and coalesces it with this one.
|
||||
* The result is a new third command which represent the two
|
||||
* original commands.
|
||||
* <br>Note: the result type associated with the resurned command may be
|
||||
* different than the result type associated with either of the commands
|
||||
* being coalesced.
|
||||
*
|
||||
* @return newly created command, or null if command cannot be coalesced
|
||||
*/
|
||||
public ICommand<? extends ICommandResult> coalesceWith( ICommand<?> command );
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006 Wind River Systems 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:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.service.command;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.GetDataDone;
|
||||
import org.eclipse.dd.dsf.service.IDsfService;
|
||||
|
||||
/**
|
||||
* API for sending commands to the debugger and for receiving command results
|
||||
* and asynchronous events.
|
||||
*/
|
||||
public interface ICommandControl extends IDsfService{
|
||||
|
||||
/**
|
||||
* Adds the specified command to the queue of commands to be processed.
|
||||
*
|
||||
* @param command Specific command to be processed
|
||||
* @param done Completion notification handler
|
||||
* @return None
|
||||
*/
|
||||
<V extends ICommandResult> void queueCommand(ICommand<V> command, GetDataDone<V> done);
|
||||
|
||||
/**
|
||||
* Removes the specified command from the processor queue.
|
||||
*
|
||||
* @param command Specific command to be removed
|
||||
* @return None
|
||||
*/
|
||||
void removeCommand(ICommand<? extends ICommandResult> command);
|
||||
|
||||
/**
|
||||
* Attempts to cancel and already sent command. Some versions
|
||||
* of GDB/MI implement control commands which allow this. The
|
||||
* GDB/MI standard does not currently allow for this.
|
||||
*
|
||||
* @param command Specific command to be removed
|
||||
* @return None
|
||||
*/
|
||||
void cancelCommand(ICommand<? extends ICommandResult> command);
|
||||
|
||||
/**
|
||||
* Adds a notification handler for the Command processor.
|
||||
*
|
||||
* @param command listener to be added
|
||||
* @return None
|
||||
*/
|
||||
void addCommandListener(ICommandListener listener);
|
||||
|
||||
/**
|
||||
* Removes a notification handler for the Command processor.
|
||||
*
|
||||
* @param command listener to be removed
|
||||
* @return None
|
||||
*/
|
||||
void removeCommandListener(ICommandListener listener);
|
||||
|
||||
/**
|
||||
* Adds a notification handler for the Event processor.
|
||||
*
|
||||
* @param event listener to be added
|
||||
* @return None
|
||||
*/
|
||||
void addEventListener(IEventListener listener);
|
||||
|
||||
/**
|
||||
* Removes a notification handler for the Event processor.
|
||||
*
|
||||
* @param event listener to be removed
|
||||
* @return None
|
||||
*/
|
||||
void removeEventListener(IEventListener listener);
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package org.eclipse.dd.dsf.debug.service.command;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.ConfinedToDsfExecutor;
|
||||
|
||||
/**
|
||||
* Synchronous listener to commands being sent and received.
|
||||
* All the registered listeners will be called in the same
|
||||
* dispatch cycle as when the result of the command is submitted.
|
||||
*/
|
||||
|
||||
@ConfinedToDsfExecutor("")
|
||||
public interface ICommandListener {
|
||||
/**
|
||||
* Notifies that the specified command has been added to the Command Queue.
|
||||
* It has not yet been sent. In this state the command can be examined and
|
||||
* possibly withdrawn because it has been coalesced with another command.
|
||||
*
|
||||
* @return None
|
||||
* @param command Command which has been added to the Queue
|
||||
*/
|
||||
public void commandQueued(ICommand<? extends ICommandResult> command);
|
||||
|
||||
/**
|
||||
* Notification that the given command was sent to the debugger. At this
|
||||
* point the command is no longer in the Command Queue and should not be
|
||||
* examined. The only thing which can be done is to try and cancel the
|
||||
* command.
|
||||
*
|
||||
* @return None
|
||||
* @param command
|
||||
*/
|
||||
public void commandSent(ICommand<? extends ICommandResult> command);
|
||||
|
||||
/**
|
||||
* Notifies that the specified command has been removed from the
|
||||
* Command Queue. This notification means that the command has
|
||||
* been removed from the queue and not sent to the backend. The
|
||||
* user has specifically removed it, perhaps because it has been
|
||||
* combined with another. Or some state change has occured and
|
||||
* there is no longer a need to get this particular set of data.
|
||||
*
|
||||
* @return None
|
||||
* @param Command which has been sent to the backend
|
||||
*/
|
||||
public void commandRemoved(ICommand<? extends ICommandResult> command);
|
||||
|
||||
/**
|
||||
* Notifies that the specified command has been completed.
|
||||
*
|
||||
* @return None
|
||||
* @param Command which has been sent to the backend
|
||||
*/
|
||||
public void commandDone(ICommand<? extends ICommandResult> command, ICommandResult result);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Wind River Systems 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:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.dd.dsf.debug.service.command;
|
||||
|
||||
public interface ICommandResult {
|
||||
/**
|
||||
* Returns an ICommandResult which is a subset command result. The command
|
||||
* result which is being passed in is from a coalesced command. The result
|
||||
* which is desired is contained within those results. In this instance we
|
||||
* are processing the command result from the coalesced command to get our
|
||||
* command result.
|
||||
* <i>Note:</i> The type of returned command result must match the type
|
||||
* associated with the subset command that is passed in the argument.
|
||||
*
|
||||
* @return result for this particular command.
|
||||
*/
|
||||
public <V extends ICommandResult> V getSubsetResult( ICommand<V> command );
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.eclipse.dd.dsf.debug.service.command;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.ConfinedToDsfExecutor;
|
||||
|
||||
/**
|
||||
* Synchronous listener for events issued from the debugger. All
|
||||
* registered listeners will be called in the same dispatch cycle.
|
||||
*/
|
||||
|
||||
@ConfinedToDsfExecutor("")
|
||||
public interface IEventListener {
|
||||
/**
|
||||
* Notifies that the given asynchronous output was received from the
|
||||
* debugger.
|
||||
* @param output output that was received from the debugger. Format
|
||||
* of the output data is debugger specific.
|
||||
*/
|
||||
public void eventReceived(Object output);
|
||||
}
|
|
@ -37,7 +37,8 @@ public class DsfUIPlugin extends AbstractUIPlugin {
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
fgBundleContext = context;
|
||||
super.start(context);
|
||||
}
|
||||
|
@ -46,7 +47,8 @@ public class DsfUIPlugin extends AbstractUIPlugin {
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
fgPlugin = null;
|
||||
fgBundleContext = null;
|
||||
super.stop(context);
|
||||
|
|
|
@ -31,7 +31,8 @@ public class SWTDispatchDsfExecutor extends DefaultDsfExecutor
|
|||
{
|
||||
return new Callable<V>()
|
||||
{
|
||||
public V call() throws Exception
|
||||
@SuppressWarnings("unchecked")
|
||||
public V call() throws Exception
|
||||
{
|
||||
final Object[] v = new Object[1];
|
||||
final Throwable[] e = new Throwable[1];
|
||||
|
|
|
@ -412,32 +412,32 @@ abstract public class AbstractVMLayoutNode implements IVMLayoutNode {
|
|||
}
|
||||
|
||||
protected class ElementsCountUpdate extends ViewerUpdate implements IChildrenCountUpdate {
|
||||
private final GetDataDone<Integer> fDone;
|
||||
private final GetDataDone<Integer> fElementCountDone;
|
||||
|
||||
public ElementsCountUpdate(GetDataDone<Integer> done, IModelDelta delta) {
|
||||
super(done, delta);
|
||||
fDone = done;
|
||||
fElementCountDone = done;
|
||||
}
|
||||
|
||||
public void setChildCount(int numChildren) {
|
||||
fDone.setData(numChildren);
|
||||
fElementCountDone.setData(numChildren);
|
||||
}
|
||||
}
|
||||
|
||||
protected class ElementsUpdate extends ViewerUpdate implements IChildrenUpdate {
|
||||
private final List<Object> fChildren = new ArrayList<Object>();
|
||||
private GetDataDone<List<Object>> fDone;
|
||||
private GetDataDone<List<Object>> fElementUpdateDone;
|
||||
|
||||
public ElementsUpdate(GetDataDone<List<Object>> done, IModelDelta delta) {
|
||||
super(done, delta);
|
||||
fDone = done;
|
||||
fDone.setData(fChildren);
|
||||
fElementUpdateDone = done;
|
||||
fElementUpdateDone.setData(fChildren);
|
||||
}
|
||||
|
||||
public ElementsUpdate(GetDataDone<List<Object>> done, TreePath path) {
|
||||
super(done, path);
|
||||
fDone = done;
|
||||
fDone.setData(fChildren);
|
||||
fElementUpdateDone = done;
|
||||
fElementUpdateDone.setData(fChildren);
|
||||
}
|
||||
|
||||
public int getOffset() {
|
||||
|
|
|
@ -543,11 +543,11 @@ abstract public class AbstractVMProvider implements IVMProvider
|
|||
|
||||
class HasElementsUpdate extends ViewerUpdate implements IHasChildrenUpdate {
|
||||
|
||||
final private GetDataDone<Boolean> fDone;
|
||||
final private GetDataDone<Boolean> fHasElemsDone;
|
||||
|
||||
HasElementsUpdate(IHasChildrenUpdate clientUpdate, GetDataDone<Boolean> done) {
|
||||
super(clientUpdate, done);
|
||||
fDone = done;
|
||||
fHasElemsDone = done;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -556,24 +556,24 @@ abstract public class AbstractVMProvider implements IVMProvider
|
|||
}
|
||||
|
||||
public void setHasChilren(boolean hasChildren) {
|
||||
fDone.setData(hasChildren);
|
||||
fHasElemsDone.setData(hasChildren);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void done() {
|
||||
assert fDone.getData() != null || !fDone.getStatus().isOK();
|
||||
assert fHasElemsDone.getData() != null || !fHasElemsDone.getStatus().isOK();
|
||||
super.done();
|
||||
}
|
||||
}
|
||||
|
||||
class ElementsCountUpdate extends ViewerUpdate implements IChildrenCountUpdate {
|
||||
final private GetDataDone<Integer> fDone;
|
||||
final private GetDataDone<Integer> fCountDone;
|
||||
final private TreePath fElementPath;
|
||||
|
||||
ElementsCountUpdate(IViewerUpdate clientUpdate, GetDataDone<Integer> done, TreePath elementPath) {
|
||||
super(clientUpdate, done);
|
||||
fElementPath = elementPath;
|
||||
fDone = done;
|
||||
fCountDone = done;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -582,12 +582,12 @@ abstract public class AbstractVMProvider implements IVMProvider
|
|||
}
|
||||
|
||||
public void setChildCount(int count) {
|
||||
fDone.setData(count);
|
||||
fCountDone.setData(count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void done() {
|
||||
assert fDone.getData() != null || !fDone.getStatus().isOK();
|
||||
assert fCountDone.getData() != null || !fCountDone.getStatus().isOK();
|
||||
super.done();
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,8 @@ abstract public class AbstractVMRootLayoutNode extends AbstractVMLayoutNode impl
|
|||
* There is no use case for a root node implementing this method, but its
|
||||
* easier to just impelemnt it for sake of uniformity of model.
|
||||
*/
|
||||
public void updateLabel(IVMContext vmc, ILabelUpdate update) {
|
||||
public void updateLabel(@SuppressWarnings("unused")
|
||||
IVMContext vmc, ILabelUpdate update) {
|
||||
update.done();
|
||||
}
|
||||
|
||||
|
@ -88,7 +89,7 @@ abstract public class AbstractVMRootLayoutNode extends AbstractVMLayoutNode impl
|
|||
new Done() {
|
||||
public void run() {
|
||||
if (isDisposed()) return;
|
||||
if (propagateError(getExecutor(), done, "Failed to create delta.")); //$NON-NLS-1$
|
||||
if (propagateError(getExecutor(), done, "Failed to create delta.")) return; //$NON-NLS-1$
|
||||
done.setData(rootDelta);
|
||||
getExecutor().execute(done);
|
||||
}
|
||||
|
|
|
@ -127,7 +127,8 @@ public class VMDelta extends ModelDelta {
|
|||
* @param flags change flags for child
|
||||
* @return newly created child delta
|
||||
*/
|
||||
public VMDelta addNode(Object element, int flags) {
|
||||
@Override
|
||||
public VMDelta addNode(Object element, int flags) {
|
||||
VMDelta node = new VMDelta(element, flags);
|
||||
node.setParent(this);
|
||||
addDelta(node);
|
||||
|
@ -144,6 +145,7 @@ public class VMDelta extends ModelDelta {
|
|||
* @param flags change flags
|
||||
* @return newly created child delta
|
||||
*/
|
||||
@Override
|
||||
public VMDelta addNode(Object element, Object replacement, int flags) {
|
||||
VMDelta node = new VMDelta(element, replacement, flags);
|
||||
node.setParent(this);
|
||||
|
@ -160,6 +162,7 @@ public class VMDelta extends ModelDelta {
|
|||
* @param flags change flags
|
||||
* @return newly created child delta
|
||||
*/
|
||||
@Override
|
||||
public VMDelta addNode(Object element, int index, int flags) {
|
||||
VMDelta node = new VMDelta(element, index, flags);
|
||||
node.setParent(this);
|
||||
|
@ -177,6 +180,7 @@ public class VMDelta extends ModelDelta {
|
|||
* @param numChildren the number of children the element has
|
||||
* @return newly created child delta
|
||||
*/
|
||||
@Override
|
||||
public VMDelta addNode(Object element, int index, int flags, int numChildren) {
|
||||
VMDelta node = new VMDelta(element, index, flags, numChildren);
|
||||
node.setParent(this);
|
||||
|
@ -300,6 +304,7 @@ public class VMDelta extends ModelDelta {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta#getChildCount()
|
||||
*/
|
||||
@Override
|
||||
public int getChildCount() {
|
||||
return fChildCount;
|
||||
}
|
||||
|
@ -307,10 +312,12 @@ public class VMDelta extends ModelDelta {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta#accept(org.eclipse.debug.internal.ui.viewers.provisional.IModelDeltaVisitor)
|
||||
*/
|
||||
@Override
|
||||
public void accept(IModelDeltaVisitor visitor) {
|
||||
doAccept(visitor, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doAccept(IModelDeltaVisitor visitor, int depth) {
|
||||
if (visitor.visit(this, depth)) {
|
||||
ModelDelta[] childDeltas = getChildDeltas();
|
||||
|
|
|
@ -79,6 +79,7 @@ abstract public class AbstractDMVMLayoutNode<V extends IDMData> extends Abstract
|
|||
* The IAdaptable implementation. If the adapter is the DM context,
|
||||
* return the context, otherwise delegate to IDMContext.getAdapter().
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object getAdapter(Class adapter) {
|
||||
Object superAdapter = super.getAdapter(adapter);
|
||||
|
@ -91,6 +92,7 @@ abstract public class AbstractDMVMLayoutNode<V extends IDMData> extends Abstract
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (!(other instanceof AbstractDMVMLayoutNode.DMVMContext)) return false;
|
||||
DMVMContext otherVmc = (DMVMContext)other;
|
||||
|
@ -98,10 +100,12 @@ abstract public class AbstractDMVMLayoutNode<V extends IDMData> extends Abstract
|
|||
fDmc.equals(otherVmc.fDmc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return AbstractDMVMLayoutNode.this.hashCode() + fDmc.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return fDmc.toString();
|
||||
}
|
||||
|
@ -134,6 +138,7 @@ abstract public class AbstractDMVMLayoutNode<V extends IDMData> extends Abstract
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
fServicesTracker.dispose();
|
||||
super.dispose();
|
||||
|
@ -339,7 +344,8 @@ abstract public class AbstractDMVMLayoutNode<V extends IDMData> extends Abstract
|
|||
* @see IElementLabelProvider
|
||||
* @see IColumnPresentationFactoryAdapter
|
||||
*/
|
||||
protected void fillColumnLabel(IDMContext<V> dmContext, V dmData, String columnId, int idx, ILabelUpdate update) {
|
||||
protected void fillColumnLabel(@SuppressWarnings("unused") IDMContext<V> dmContext, @SuppressWarnings("unused") V dmData,
|
||||
@SuppressWarnings("unused") String columnId, int idx, ILabelUpdate update) {
|
||||
update.setLabel("", idx); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
@ -347,12 +353,12 @@ abstract public class AbstractDMVMLayoutNode<V extends IDMData> extends Abstract
|
|||
public int getDeltaFlags(Object e) {
|
||||
int flags = 0;
|
||||
if (e instanceof IDMEvent) {
|
||||
flags = getNodeDeltaFlagsForDMEvent((IDMEvent)e);
|
||||
flags = getNodeDeltaFlagsForDMEvent((IDMEvent<?>)e);
|
||||
}
|
||||
return flags | super.getDeltaFlags(e);
|
||||
}
|
||||
|
||||
protected int getNodeDeltaFlagsForDMEvent(IDMEvent<?> e) {
|
||||
protected int getNodeDeltaFlagsForDMEvent(@SuppressWarnings("unused") IDMEvent<?> e) {
|
||||
return IModelDelta.NO_CHANGE;
|
||||
}
|
||||
|
||||
|
@ -364,7 +370,7 @@ abstract public class AbstractDMVMLayoutNode<V extends IDMData> extends Abstract
|
|||
if (DsfSession.isSessionActive(getSession().getId())) {
|
||||
getSession().getExecutor().execute(new DsfRunnable() {
|
||||
public void run() {
|
||||
buildDeltaForDMEvent((IDMEvent)e, parentDelta, nodeOffset, done);
|
||||
buildDeltaForDMEvent((IDMEvent<?>)e, parentDelta, nodeOffset, done);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -80,6 +80,7 @@ abstract public class AbstractDMVMProvider extends AbstractVMProvider
|
|||
}
|
||||
|
||||
/** Called to dispose the provider. */
|
||||
@Override
|
||||
public void dispose() {
|
||||
try {
|
||||
getSession().getExecutor().execute(new Runnable() {
|
||||
|
|
|
@ -42,7 +42,8 @@ public class DsfPlugin extends Plugin {
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
fgBundleContext = context;
|
||||
super.start(context);
|
||||
DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.dd.dsf/debug")); //$NON-NLS-1$//$NON-NLS-2$
|
||||
|
@ -52,7 +53,8 @@ public class DsfPlugin extends Plugin {
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
fgBundleContext = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
|
|
@ -208,6 +208,7 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object getExecutable() { return fRunnable; }
|
||||
|
||||
public void run() {
|
||||
|
@ -234,6 +235,7 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor
|
|||
fCallable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object getExecutable() { return fCallable; }
|
||||
|
||||
public T call() throws Exception {
|
||||
|
|
|
@ -67,6 +67,7 @@ abstract public class Done extends DsfRunnable {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Done: " + getStatus().toString(); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@ public class DsfExecutable {
|
|||
assert ASSERTIONS_ENABLED = true;
|
||||
DEBUG_EXECUTOR = DsfPlugin.DEBUG && "true".equals( //$NON-NLS-1$
|
||||
Platform.getDebugOption("org.eclipse.dd.dsf/debug/executor")); //$NON-NLS-1$
|
||||
assert ASSERTIONS_ENABLED = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -101,10 +101,12 @@ abstract public class DsfQuery<V> extends DsfRunnable
|
|||
return (state & (STATE_DONE | STATE_CANCELLED)) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int tryAcquireShared(int ignore) {
|
||||
return doIsDone()? 1 : -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean tryReleaseShared(int ignore) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -284,6 +284,7 @@ abstract public class DsfSequence extends DsfRunnable implements Future<Object>
|
|||
abortExecution(getStatus());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DsfSequence \"" + fTaskName + "\", result for executing step #" + fStepIdx + " = " + getStatus(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
|
@ -335,7 +336,7 @@ abstract public class DsfSequence extends DsfRunnable implements Future<Object>
|
|||
} else {
|
||||
abortRollBack(getStatus());
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DsfSequence \"" + fTaskName + "\", result for rolling back step #" + fStepIdx + " = " + getStatus(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
@ -450,10 +451,12 @@ abstract public class DsfSequence extends DsfRunnable implements Future<Object>
|
|||
return (state & (STATE_FINISHED | STATE_CANCELLED | STATE_ABORTED)) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int tryAcquireShared(int ignore) {
|
||||
return doIsDone()? 1 : -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean tryReleaseShared(int ignore) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ public abstract class GetDataDone<V> extends Done {
|
|||
*/
|
||||
public V getData() { return fData; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (getData() != null) {
|
||||
return getData().toString();
|
||||
|
|
|
@ -20,6 +20,7 @@ class StackTraceWrapper {
|
|||
|
||||
StackTraceWrapper(StackTraceElement[] elements) { fStackTraceElements = elements; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder(fStackTraceElements.length * 30);
|
||||
for (int i = 0; i < fStackTraceElements.length && i < 10; i++) {
|
||||
|
|
|
@ -103,6 +103,7 @@ abstract public class AbstractDMContext<V extends IDMData> extends PlatformObjec
|
|||
* session is equally important.
|
||||
* @see org.eclipse.runtime.IAdapterManager
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object getAdapter(Class adapterType) {
|
||||
Object retVal = null;
|
||||
|
|
|
@ -26,6 +26,7 @@ public class ServiceDMContext<V extends IDMService> extends AbstractDMContext<V>
|
|||
fServiceDMID = serviceDMID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() { return baseToString() + fServiceDMID; }
|
||||
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ public class DsfServicesTracker {
|
|||
fFilter = filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
// I guess this doesn't have to assume fFilter can be null, but oh well.
|
||||
return other instanceof ServiceKey &&
|
||||
|
@ -64,6 +65,7 @@ public class DsfServicesTracker {
|
|||
(fFilter != null && fFilter.equals(((ServiceKey)other).fFilter)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (fClassName == null ? 0 : fClassName.hashCode()) + (fFilter == null ? 0 : fFilter.hashCode());
|
||||
}
|
||||
|
|
|
@ -195,10 +195,12 @@ public class DsfSession
|
|||
fFilter = filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
return other instanceof ListenerEntry && fListener.equals(((ListenerEntry)other).fListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() { return fListener.hashCode(); }
|
||||
}
|
||||
|
||||
|
@ -278,6 +280,7 @@ public class DsfSession
|
|||
public void dispatchEvent(final Object event, final Dictionary serviceProperties) {
|
||||
getExecutor().submit(new DsfRunnable() {
|
||||
public void run() { doDispatchEvent(event, serviceProperties);}
|
||||
@Override
|
||||
public String toString() { return "Event: " + event + ", from service " + serviceProperties; } //$NON-NLS-1$ //$NON-NLS-2$
|
||||
});
|
||||
}
|
||||
|
@ -317,11 +320,13 @@ public class DsfSession
|
|||
return fAdapters.get(adapterType);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ThreadSafe
|
||||
public boolean equals(Object other) {
|
||||
return other instanceof DsfSession && fId.equals(((DsfSession)other).fId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ThreadSafe
|
||||
public int hashCode() { return fId.hashCode(); }
|
||||
|
||||
|
@ -340,11 +345,12 @@ public class DsfSession
|
|||
return ((IDsfService)o1.fListener).getStartupNumber() - ((IDsfService)o2.fListener).getStartupNumber();
|
||||
}
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return obj == this;
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Build a list of listeners and methods that are registered for this event class.
|
||||
|
|
Loading…
Add table
Reference in a new issue