aboutsummaryrefslogtreecommitdiffstats
path: root/ddms/app
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2011-12-20 20:20:24 -0800
committerTor Norbye <tnorbye@google.com>2011-12-21 13:36:23 -0800
commitab36f4e7488358dea4ab6b54ee2b7bef3da0232b (patch)
treee6846336e35cd0fb29addf962c9031c68492ed30 /ddms/app
parent4ae7075d188a35298d834bfcd0500b77b08a12ab (diff)
downloadsdk-ab36f4e7488358dea4ab6b54ee2b7bef3da0232b.zip
sdk-ab36f4e7488358dea4ab6b54ee2b7bef3da0232b.tar.gz
sdk-ab36f4e7488358dea4ab6b54ee2b7bef3da0232b.tar.bz2
Update SDK codebase to JDK 6
This changeset makes the SDK codebase compile with source=1.6 (which means it also requires JDK 6). This means that methods implementing an interface requires @Override's. It also means we can start using APIs like the ArrayDeque class and methods like String#isEmpty(). This changeset looks big but the change is trivial: it's basically adding @Override in all the places that need it, along with some other automatic Eclipse cleanup in certain files (such as reordering imports where they were incorrectly ordered (because older versions of Eclipse didn't always handle inner classes right)), as well as cleaning up trailing whitespace and removing some $NON-NLS-1$ markers on lines where there aren't any string literals anymore. This changeset also sets the source and target JDK level to 6 in the Eclipse compiler .settings file, and synchronizes this file to all the other Eclipse SDK projects. Change-Id: I6a9585aa44c3dee9a5c00739ab22fbdbcb9f8275
Diffstat (limited to 'ddms/app')
-rw-r--r--ddms/app/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--ddms/app/src/com/android/ddms/DebugPortProvider.java3
-rw-r--r--ddms/app/src/com/android/ddms/DeviceCommandDialog.java6
-rw-r--r--ddms/app/src/com/android/ddms/Main.java1
-rw-r--r--ddms/app/src/com/android/ddms/PrefsDialog.java1
-rw-r--r--ddms/app/src/com/android/ddms/StaticPortConfigDialog.java1
-rw-r--r--ddms/app/src/com/android/ddms/StaticPortEditDialog.java4
-rw-r--r--ddms/app/src/com/android/ddms/UIThread.java46
8 files changed, 65 insertions, 9 deletions
diff --git a/ddms/app/.settings/org.eclipse.jdt.core.prefs b/ddms/app/.settings/org.eclipse.jdt.core.prefs
index e755df2..9c7cb00 100644
--- a/ddms/app/.settings/org.eclipse.jdt.core.prefs
+++ b/ddms/app/.settings/org.eclipse.jdt.core.prefs
@@ -1,6 +1,14 @@
-#Thu Jun 09 12:26:44 PDT 2011
+#Tue Dec 20 16:31:10 PST 2011
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -9,6 +17,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
@@ -69,3 +78,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/ddms/app/src/com/android/ddms/DebugPortProvider.java b/ddms/app/src/com/android/ddms/DebugPortProvider.java
index 76a86b7..2dcd5d4 100644
--- a/ddms/app/src/com/android/ddms/DebugPortProvider.java
+++ b/ddms/app/src/com/android/ddms/DebugPortProvider.java
@@ -16,8 +16,8 @@
package com.android.ddms;
-import com.android.ddmlib.IDevice;
import com.android.ddmlib.DebugPortManager.IDebugPortProvider;
+import com.android.ddmlib.IDevice;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -61,6 +61,7 @@ public class DebugPortProvider implements IDebugPortProvider {
*
* @see IDebugPortProvider#getPort(IDevice, String)
*/
+ @Override
public int getPort(IDevice device, String appName) {
if (mMap != null) {
Map<String, Integer> deviceMap = mMap.get(device.getSerialNumber());
diff --git a/ddms/app/src/com/android/ddms/DeviceCommandDialog.java b/ddms/app/src/com/android/ddms/DeviceCommandDialog.java
index ce6865d..6775cbb 100644
--- a/ddms/app/src/com/android/ddms/DeviceCommandDialog.java
+++ b/ddms/app/src/com/android/ddms/DeviceCommandDialog.java
@@ -139,6 +139,7 @@ public class DeviceCommandDialog extends Dialog {
shell.setLayout(new GridLayout(2, true));
shell.addListener(SWT.Close, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (!mFinished) {
Log.d("ddms", "NOT closing - cancelling command");
@@ -272,6 +273,7 @@ public class DeviceCommandDialog extends Dialog {
}
mShell.getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
updateForResult(mResult);
}
@@ -281,6 +283,7 @@ public class DeviceCommandDialog extends Dialog {
/**
* Called by executeRemoteCommand().
*/
+ @Override
public void addOutput(byte[] data, int offset, int length) {
Log.v("ddms", "received " + length + " bytes");
@@ -290,6 +293,7 @@ public class DeviceCommandDialog extends Dialog {
// add to text widget; must do in UI thread
mText.getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
mText.append(text);
}
@@ -300,6 +304,7 @@ public class DeviceCommandDialog extends Dialog {
}
}
+ @Override
public void flush() {
// nothing to flush.
}
@@ -307,6 +312,7 @@ public class DeviceCommandDialog extends Dialog {
/**
* Called by executeRemoteCommand().
*/
+ @Override
public boolean isCancelled() {
return mCancel;
}
diff --git a/ddms/app/src/com/android/ddms/Main.java b/ddms/app/src/com/android/ddms/Main.java
index 6fe69c7..a7e0a2b 100644
--- a/ddms/app/src/com/android/ddms/Main.java
+++ b/ddms/app/src/com/android/ddms/Main.java
@@ -48,6 +48,7 @@ public class Main {
* thing down.
*/
private static class UncaughtHandler implements Thread.UncaughtExceptionHandler {
+ @Override
public void uncaughtException(Thread t, Throwable e) {
Log.e("ddms", "shutting down due to uncaught exception");
Log.e("ddms", e);
diff --git a/ddms/app/src/com/android/ddms/PrefsDialog.java b/ddms/app/src/com/android/ddms/PrefsDialog.java
index cdcdd8a..84304df 100644
--- a/ddms/app/src/com/android/ddms/PrefsDialog.java
+++ b/ddms/app/src/com/android/ddms/PrefsDialog.java
@@ -242,6 +242,7 @@ public final class PrefsDialog {
* a preference (e.g. not when the prefs file is loaded).
*/
private static class ChangeListener implements IPropertyChangeListener {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
String changed = event.getProperty();
PreferenceStore prefStore = mStore.getPreferenceStore();
diff --git a/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java b/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java
index d00bc7f..9a8ada3 100644
--- a/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java
+++ b/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java
@@ -129,6 +129,7 @@ public class StaticPortConfigDialog extends Dialog {
mShell.setLayout(new GridLayout(1, true));
mShell.addListener(SWT.Close, new Listener() {
+ @Override
public void handleEvent(Event event) {
event.doit = true;
}
diff --git a/ddms/app/src/com/android/ddms/StaticPortEditDialog.java b/ddms/app/src/com/android/ddms/StaticPortEditDialog.java
index 9191d9f..c9cb044 100644
--- a/ddms/app/src/com/android/ddms/StaticPortEditDialog.java
+++ b/ddms/app/src/com/android/ddms/StaticPortEditDialog.java
@@ -149,6 +149,7 @@ public class StaticPortEditDialog extends Dialog {
mShell.setLayout(new GridLayout(1, false));
mShell.addListener(SWT.Close, new Listener() {
+ @Override
public void handleEvent(Event event) {
}
});
@@ -167,6 +168,7 @@ public class StaticPortEditDialog extends Dialog {
deviceSNText.setText(mDeviceSn);
}
deviceSNText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
mDeviceSn = deviceSNText.getText().trim();
validate();
@@ -182,6 +184,7 @@ public class StaticPortEditDialog extends Dialog {
}
appNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
appNameText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
mAppName = appNameText.getText().trim();
validate();
@@ -197,6 +200,7 @@ public class StaticPortEditDialog extends Dialog {
}
debugPortText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
debugPortText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
mPortNumber = debugPortText.getText().trim();
validate();
diff --git a/ddms/app/src/com/android/ddms/UIThread.java b/ddms/app/src/com/android/ddms/UIThread.java
index a5a3867..0584d82 100644
--- a/ddms/app/src/com/android/ddms/UIThread.java
+++ b/ddms/app/src/com/android/ddms/UIThread.java
@@ -17,20 +17,21 @@
package com.android.ddms;
import com.android.ddmlib.AndroidDebugBridge;
+import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
import com.android.ddmlib.Client;
import com.android.ddmlib.ClientData;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.SyncException;
-import com.android.ddmlib.SyncService;
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
import com.android.ddmlib.ClientData.IHprofDumpHandler;
import com.android.ddmlib.ClientData.MethodProfilingStatus;
+import com.android.ddmlib.IDevice;
+import com.android.ddmlib.Log;
import com.android.ddmlib.Log.ILogOutput;
import com.android.ddmlib.Log.LogLevel;
+import com.android.ddmlib.SyncException;
+import com.android.ddmlib.SyncService;
import com.android.ddmuilib.AllocationPanel;
import com.android.ddmuilib.DdmUiPreferences;
import com.android.ddmuilib.DevicePanel;
+import com.android.ddmuilib.DevicePanel.IUiSelectionListener;
import com.android.ddmuilib.EmulatorControlPanel;
import com.android.ddmuilib.HeapPanel;
import com.android.ddmuilib.ITableFocusListener;
@@ -41,14 +42,12 @@ import com.android.ddmuilib.ScreenShotDialog;
import com.android.ddmuilib.SysinfoPanel;
import com.android.ddmuilib.TablePanel;
import com.android.ddmuilib.ThreadPanel;
-import com.android.ddmuilib.DevicePanel.IUiSelectionListener;
import com.android.ddmuilib.actions.ToolItemAction;
import com.android.ddmuilib.explorer.DeviceExplorer;
import com.android.ddmuilib.handler.BaseFileHandler;
import com.android.ddmuilib.handler.MethodProfilingHandler;
import com.android.ddmuilib.log.event.EventLogPanel;
import com.android.ddmuilib.logcat.LogCatPanel;
-import com.android.ddmuilib.logcat.LogCatReceiver;
import com.android.ddmuilib.logcat.LogColors;
import com.android.ddmuilib.logcat.LogFilter;
import com.android.ddmuilib.logcat.LogPanel;
@@ -186,6 +185,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
private final class FilterStorage implements ILogFilterStorageManager {
+ @Override
public LogFilter[] getFilterFromStore() {
String filterPrefs = PrefsDialog.getStore().getString(
PREFS_FILTERS);
@@ -208,6 +208,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
return list.toArray(new LogFilter[list.size()]);
}
+ @Override
public void saveFilters(LogFilter[] filters) {
StringBuilder sb = new StringBuilder();
for (LogFilter f : filters) {
@@ -219,6 +220,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
PrefsDialog.getStore().setValue(PREFS_FILTERS, sb.toString());
}
+ @Override
public boolean requiresDefaultFilter() {
return true;
}
@@ -278,6 +280,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
private IFocusedTableActivator mCurrentActivator;
+ @Override
public void focusGained(IFocusedTableActivator activator) {
mCurrentActivator = activator;
if (mCopyMenuItem.isDisposed() == false) {
@@ -286,6 +289,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
}
}
+ @Override
public void focusLost(IFocusedTableActivator activator) {
// if we move from one table to another, it's unclear
// if the old table lose its focus before the new
@@ -322,8 +326,10 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
super(parentShell);
}
+ @Override
public void onEndFailure(final Client client, final String message) {
mDisplay.asyncExec(new Runnable() {
+ @Override
public void run() {
try {
displayErrorFromUiThread(
@@ -340,8 +346,10 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
});
}
+ @Override
public void onSuccess(final String remoteFilePath, final Client client) {
mDisplay.asyncExec(new Runnable() {
+ @Override
public void run() {
final IDevice device = client.getDevice();
try {
@@ -375,8 +383,10 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
});
}
+ @Override
public void onSuccess(final byte[] data, final Client client) {
mDisplay.asyncExec(new Runnable() {
+ @Override
public void run() {
promptAndSave(client.getClientData().getClientDescription() + ".hprof", data,
"Save HPROF file");
@@ -454,11 +464,13 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
100, 50, null));
Log.setLogOutput(new ILogOutput() {
+ @Override
public void printAndPromptLog(final LogLevel logLevel, final String tag,
final String message) {
Log.printLog(logLevel, tag, message);
// dialog box only run in UI thread..
mDisplay.asyncExec(new Runnable() {
+ @Override
public void run() {
Shell activeShell = mDisplay.getActiveShell();
if (logLevel == LogLevel.ERROR) {
@@ -470,6 +482,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
});
}
+ @Override
public void printLog(LogLevel logLevel, String tag, String message) {
Log.printLog(logLevel, tag, message);
}
@@ -581,6 +594,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
// add listener for resize/move
shell.addControlListener(new ControlListener() {
+ @Override
public void controlMoved(ControlEvent e) {
// get the new x/y
Rectangle controlBounds = shell.getBounds();
@@ -590,6 +604,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
currentPrefs.setValue(PrefsDialog.SHELL_Y, controlBounds.y);
}
+ @Override
public void controlResized(ControlEvent e) {
// get the new w/h
Rectangle controlBounds = shell.getBounds();
@@ -649,6 +664,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
// add listener for resize/move
shell.addControlListener(new ControlListener() {
+ @Override
public void controlMoved(ControlEvent e) {
// get the new x/y
Rectangle controlBounds = shell.getBounds();
@@ -658,6 +674,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
currentPrefs.setValue(PrefsDialog.EXPLORER_SHELL_Y, controlBounds.y);
}
+ @Override
public void controlResized(ControlEvent e) {
// get the new w/h
Rectangle controlBounds = shell.getBounds();
@@ -720,14 +737,17 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenu(APP_NAME, fileMenu,
new IMenuBarCallback() {
+ @Override
public void printError(String format, Object... args) {
Log.e("DDMS Menu Bar", String.format(format, args));
}
+ @Override
public void onPreferencesMenuSelected() {
PrefsDialog.run(shell);
}
+ @Override
public void onAboutMenuSelected() {
AboutDialog dlg = new AboutDialog(shell);
dlg.open();
@@ -1002,6 +1022,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
// allow resizes, but cap at minPanelWidth
sash.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
Rectangle sashRect = sash.getBounds();
Rectangle panelRect = panelArea.getClientArea();
@@ -1200,6 +1221,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
// allow resizes, but cap at minPanelWidth
sash.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
Rectangle sashRect = sash.getBounds();
Rectangle panelRect = comp.getClientArea();
@@ -1580,23 +1602,28 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
mExplorer.switchDevice(mCurrentDevice);
mExplorerShell.addShellListener(new ShellListener() {
+ @Override
public void shellActivated(ShellEvent e) {
// pass
}
+ @Override
public void shellClosed(ShellEvent e) {
mExplorer = null;
mExplorerShell = null;
}
+ @Override
public void shellDeactivated(ShellEvent e) {
// pass
}
+ @Override
public void shellDeiconified(ShellEvent e) {
// pass
}
+ @Override
public void shellIconified(ShellEvent e) {
// pass
}
@@ -1619,6 +1646,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
public void setStatusLine(final String str) {
try {
mDisplay.asyncExec(new Runnable() {
+ @Override
public void run() {
doSetStatusLine(str);
}
@@ -1644,6 +1672,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
public void displayError(final String msg) {
try {
mDisplay.syncExec(new Runnable() {
+ @Override
public void run() {
MessageDialog.openError(mDisplay.getActiveShell(), "Error",
msg);
@@ -1713,6 +1742,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
*
* @see IUiSelectionListener
*/
+ @Override
public void selectionChanged(IDevice selectedDevice, Client selectedClient) {
if (mCurrentDevice != selectedDevice) {
mCurrentDevice = selectedDevice;
@@ -1750,11 +1780,13 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
}
}
+ @Override
public void clientChanged(Client client, int changeMask) {
if ((changeMask & Client.CHANGE_METHOD_PROFILING_STATUS) ==
Client.CHANGE_METHOD_PROFILING_STATUS) {
if (mCurrentClient == client) {
mDisplay.asyncExec(new Runnable() {
+ @Override
public void run() {
// force refresh of the button enabled state.
enableButtons();