1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

java warnings

This commit is contained in:
Alena Laskavaia 2010-05-06 16:01:29 +00:00
parent 3e77d51532
commit 221d891570
2 changed files with 41 additions and 33 deletions

View file

@ -15,24 +15,29 @@ package org.eclipse.cdt.debug.gdbjtag.core.jtagdevice;
import java.util.Collection;
/**
* @author ajin
* Default implementation of the "jtag device"
*
*/
public class DefaultGDBJtagDeviceImpl implements IGDBJtagDevice {
/**
* @since 7.0
*/
protected static final String LINESEP = System.getProperty("line.separator"); //$NON-NLS-1$
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#doDelay(int, java.util.Collection)
*/
public void doDelay(int delay, Collection commands) {
String cmd = "monitor delay " + String.valueOf(delay * 1000);
public void doDelay(int delay, Collection<String> commands) {
String cmd = "monitor delay " + String.valueOf(delay * 1000); //$NON-NLS-1$
addCmd(commands, cmd);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#doReset(java.util.Collection)
*/
public void doReset(Collection commands) {
String cmd = "monitor reset run";
public void doReset(Collection<String> commands) {
String cmd = "monitor reset run"; //$NON-NLS-1$
addCmd(commands, cmd);
}
@ -46,42 +51,42 @@ public class DefaultGDBJtagDeviceImpl implements IGDBJtagDevice {
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#doRemote(java.lang.String, int, java.util.Collection)
*/
public void doRemote(String ip, int port, Collection commands) {
String cmd = "target remote " + ip + ":" + String.valueOf(port);
public void doRemote(String ip, int port, Collection<String> commands) {
String cmd = "target remote " + ip + ":" + String.valueOf(port); //$NON-NLS-1$ //$NON-NLS-2$
addCmd(commands, cmd);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#doHalt(java.util.Collection)
*/
public void doHalt(Collection commands) {
String cmd = "monitor halt";
public void doHalt(Collection<String> commands) {
String cmd = "monitor halt"; //$NON-NLS-1$
addCmd(commands, cmd);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#doContinue(java.util.Collection)
*/
public void doContinue(Collection commands) {
String cmd = "continue";
public void doContinue(Collection<String> commands) {
String cmd = "continue"; //$NON-NLS-1$
addCmd(commands, cmd);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#doLoadImage(java.lang.String, java.lang.String, java.util.Collection)
*/
public void doLoadImage(String imageFileName, String imageOffset, Collection commands) {
public void doLoadImage(String imageFileName, String imageOffset, Collection<String> commands) {
String file = escapeScpaces(imageFileName);
String cmd = "restore " + file + " " + imageOffset;
String cmd = "restore " + file + " " + imageOffset; //$NON-NLS-1$ //$NON-NLS-2$
addCmd(commands, cmd);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#doLoadSymbol(java.lang.String, java.lang.String, java.util.Collection)
*/
public void doLoadSymbol(String symbolFileName, String symbolOffset, Collection commands) {
public void doLoadSymbol(String symbolFileName, String symbolOffset, Collection<String> commands) {
String file = escapeScpaces(symbolFileName);
String cmd = "add-sym " + file + " " + symbolOffset;
String cmd = "add-sym " + file + " " + symbolOffset; //$NON-NLS-1$ //$NON-NLS-2$
addCmd(commands, cmd);
}
@ -93,38 +98,38 @@ public class DefaultGDBJtagDeviceImpl implements IGDBJtagDevice {
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#doSetPC(java.lang.String, java.util.Collection)
*/
public void doSetPC(String pc, Collection commands) {
String cmd = "set $pc=0x" + pc;
public void doSetPC(String pc, Collection<String> commands) {
String cmd = "set $pc=0x" + pc; //$NON-NLS-1$
addCmd(commands, cmd);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#doStopAt(java.lang.String, java.util.Collection)
*/
public void doStopAt(String stopAt, Collection commands) {
String cmd = "tbreak " + stopAt;
public void doStopAt(String stopAt, Collection<String> commands) {
String cmd = "tbreak " + stopAt; //$NON-NLS-1$
addCmd(commands, cmd);
}
/*
* addCmd Utility method to format commands
*/
protected void addCmd(Collection commands, String cmd) {
commands.add(cmd + System.getProperty("line.separator"));
protected void addCmd(Collection<String> commands, String cmd) {
commands.add(cmd + LINESEP);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#getDefaultIpAddress()
*/
public String getDefaultIpAddress() {
return "localhost";
return "localhost"; //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#getDefaultPortNumber()
*/
public String getDefaultPortNumber() {
return "10000";
return "10000"; //$NON-NLS-1$
}
}

View file

@ -24,9 +24,9 @@ public interface IGDBJtagDevice {
/**
* Device reset command
* @param commands ommands collection
* @param commands collection
*/
public void doReset(Collection commands);
public void doReset(Collection<String> commands);
/**
* Default device delay in millisecond
@ -39,7 +39,7 @@ public interface IGDBJtagDevice {
* @param delay delay in second
* @param commands device specific delay commands
*/
public void doDelay(int delay, Collection commands);
public void doDelay(int delay, Collection<String> commands);
/**
* Target needs to be in pause mode in order to do
@ -47,15 +47,16 @@ public interface IGDBJtagDevice {
* MMU takes control
* @param commands device specific pause commands
*/
public void doHalt(Collection commands);
public void doHalt(Collection<String> commands);
/**
* Commands to connect to remote JTAG device
* @param ip host name of IP address of JTAG device
* @param port TCP socket port number of JTAG device
* @param commands remote connection commands
*/
public void doRemote(String ip, int port, Collection commands);
public void doRemote(String ip, int port, Collection<String> commands);
/**
* Commands to download the executable binary to target
@ -63,7 +64,7 @@ public interface IGDBJtagDevice {
* @param imageOffset executable binary memory offset
* @param commands executable binary download commands
*/
public void doLoadImage(String imageFileName, String imageOffset, Collection commands);
public void doLoadImage(String imageFileName, String imageOffset, Collection<String> commands);
/**
* Commands to download the symbols file to target
@ -71,37 +72,39 @@ public interface IGDBJtagDevice {
* @param symbolOffset symbols file memory offset
* @param commands symbols file download command
*/
public void doLoadSymbol(String symbolFileName, String symbolOffset, Collection commands);
public void doLoadSymbol(String symbolFileName, String symbolOffset, Collection<String> commands);
/**
* Commands to set initial program counter
* @param pc program counter
* @param commands set program counter commands
*/
public void doSetPC(String pc, Collection commands);
public void doSetPC(String pc, Collection<String> commands);
/**
* Commands to set initial breakpoint
* @param stopAt initial breakpoint location
* @param commands set breakpoint commands
*/
public void doStopAt(String stopAt, Collection commands);
public void doStopAt(String stopAt, Collection<String> commands);
/**
* De-freeze the target in order to start debugging
* @param commands commands to continue the target
*/
public void doContinue(Collection commands);
public void doContinue(Collection<String> commands);
/**
* Device specific default hostname of IP address
* @return default hostname of IP address
*/
public String getDefaultIpAddress();
/**
* Device specific default port number
* @return default port number
*/
public String getDefaultPortNumber();