Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Chen2012-02-23 21:42:29 -0500
committerWilliam Chen2012-02-23 21:42:29 -0500
commitddd891e468879efa8ea45848dafba6e2ff83286b (patch)
treede6ad23c43f62ba9569a98770360f7412ebd7728
parent0eba966eb9a1fb5a35730a51f435d9937967e4fc (diff)
downloadorg.eclipse.tcf-ddd891e468879efa8ea45848dafba6e2ff83286b.tar.gz
org.eclipse.tcf-ddd891e468879efa8ea45848dafba6e2ff83286b.tar.xz
org.eclipse.tcf-ddd891e468879efa8ea45848dafba6e2ff83286b.zip
Target Explorer: Fix some warnings found in process.ui by FindBugs.
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/adapters/AdapterFactory.java13
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PIDComparator.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PIDLabelProvider.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PPIDComparator.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/ProcessComparator.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/StateComparator.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/UserComparator.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/dialogs/IntervalConfigDialog.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/ConfigIntervalDynamicContribution.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/TerminateHandler.java2
10 files changed, 28 insertions, 27 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/adapters/AdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/adapters/AdapterFactory.java
index 91b3a1c33..3f4e97291 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/adapters/AdapterFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/adapters/AdapterFactory.java
@@ -25,13 +25,6 @@ public class AdapterFactory implements IAdapterFactory {
// The refresh handler delegate adapter
private IRefreshHandlerDelegate refreshDelegate = new RefreshHandlerDelegate();
- // The adapter class.
- private Class<?>[] adapters = {
- ILabelProvider.class,
- IPeerModel.class,
- IRefreshHandlerDelegate.class
- };
-
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
@@ -56,7 +49,11 @@ public class AdapterFactory implements IAdapterFactory {
*/
@Override
public Class[] getAdapterList() {
- return adapters;
+ return new Class<?>[] {
+ ILabelProvider.class,
+ IPeerModel.class,
+ IRefreshHandlerDelegate.class
+ };
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PIDComparator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PIDComparator.java
index 8259a7ba0..517d7969f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PIDComparator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PIDComparator.java
@@ -9,6 +9,7 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.processes.ui.internal.columns;
+import java.io.Serializable;
import java.util.Comparator;
import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
@@ -16,7 +17,8 @@ import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
/**
* The comparator for the tree column "PID".
*/
-public class PIDComparator implements Comparator<ProcessTreeNode> {
+public class PIDComparator implements Comparator<ProcessTreeNode>, Serializable {
+ private static final long serialVersionUID = 1L;
/*
* (non-Javadoc)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PIDLabelProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PIDLabelProvider.java
index d6ec023fb..36be34a3f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PIDLabelProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PIDLabelProvider.java
@@ -29,8 +29,6 @@ public class PIDLabelProvider extends LabelProvider {
// Pending nodes does not have column texts at all
if (node.type.endsWith("PendingNode")) return ""; //$NON-NLS-1$ //$NON-NLS-2$
String id = Long.toString(node.pid);
- if (id == null) id = node.id;
- if (id != null) return id.startsWith("P") ? id.substring(1) : id; //$NON-NLS-1$
- return ""; //$NON-NLS-1$
+ return id.startsWith("P") ? id.substring(1) : id; //$NON-NLS-1$
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PPIDComparator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PPIDComparator.java
index 010366f61..2eff73757 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PPIDComparator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PPIDComparator.java
@@ -9,6 +9,7 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.processes.ui.internal.columns;
+import java.io.Serializable;
import java.util.Comparator;
import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
@@ -16,8 +17,8 @@ import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
/**
* The comparator for the tree column "PPID".
*/
-public class PPIDComparator implements Comparator<ProcessTreeNode> {
-
+public class PPIDComparator implements Comparator<ProcessTreeNode>, Serializable {
+ private static final long serialVersionUID = 1L;
/*
* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/ProcessComparator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/ProcessComparator.java
index 182aa3da2..b0277f7ff 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/ProcessComparator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/ProcessComparator.java
@@ -9,6 +9,7 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.processes.ui.internal.columns;
+import java.io.Serializable;
import java.util.Comparator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -18,8 +19,8 @@ import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
/**
* The comparator for the tree column "name".
*/
-public class ProcessComparator implements Comparator<ProcessTreeNode> {
-
+public class ProcessComparator implements Comparator<ProcessTreeNode> , Serializable {
+ private static final long serialVersionUID = 1L;
/*
* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
@@ -31,8 +32,8 @@ public class ProcessComparator implements Comparator<ProcessTreeNode> {
if (node1 == null && node2 != null) return -1;
// Get the labels
- String text1 = node1.name;
- String text2 = node2.name;
+ String text1 = node1 == null ? null : node1.name;
+ String text2 = node2 == null ? null : node2.name;
// Normalize labels
if (text1 == null) text1 = ""; //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/StateComparator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/StateComparator.java
index d91ef75dd..d0dfb1f9c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/StateComparator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/StateComparator.java
@@ -9,6 +9,7 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.processes.ui.internal.columns;
+import java.io.Serializable;
import java.util.Comparator;
import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
@@ -16,8 +17,8 @@ import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
/**
* The comparator for the tree column "state".
*/
-public class StateComparator implements Comparator<ProcessTreeNode> {
-
+public class StateComparator implements Comparator<ProcessTreeNode> , Serializable {
+ private static final long serialVersionUID = 1L;
/*
* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/UserComparator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/UserComparator.java
index 9b818c2a9..c2df3c95f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/UserComparator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/UserComparator.java
@@ -9,6 +9,7 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.processes.ui.internal.columns;
+import java.io.Serializable;
import java.util.Comparator;
import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
@@ -16,8 +17,8 @@ import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
/**
* The comparator for the tree column "user".
*/
-public class UserComparator implements Comparator<ProcessTreeNode> {
-
+public class UserComparator implements Comparator<ProcessTreeNode> , Serializable {
+ private static final long serialVersionUID = 1L;
/*
* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/dialogs/IntervalConfigDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/dialogs/IntervalConfigDialog.java
index 5746b95c2..70c3235e4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/dialogs/IntervalConfigDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/dialogs/IntervalConfigDialog.java
@@ -148,7 +148,7 @@ public class IntervalConfigDialog extends StatusDialog implements ModifyListener
/**
* The label provider used to display the speed grades in the combo viewer.
*/
- class GradeLabelProvider extends LabelProvider {
+ static class GradeLabelProvider extends LabelProvider {
@Override
public String getText(Object element) {
if(element instanceof IntervalGrade) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/ConfigIntervalDynamicContribution.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/ConfigIntervalDynamicContribution.java
index af2d2438c..8619869cc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/ConfigIntervalDynamicContribution.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/ConfigIntervalDynamicContribution.java
@@ -48,7 +48,7 @@ public class ConfigIntervalDynamicContribution extends CompoundContributionItem
/**
* The action to allow a most recently used interval to be selected.
*/
- class MRUAction extends Action {
+ static class MRUAction extends Action {
// The process model.
private ProcessModel model;
// The interval of this most recently used item.
@@ -83,7 +83,7 @@ public class ConfigIntervalDynamicContribution extends CompoundContributionItem
/**
* The action to allow a speed grade to be selected.
*/
- class GradeAction extends Action {
+ static class GradeAction extends Action {
// The process model.
private ProcessModel model;
// The interval time represented by this grade.
@@ -119,7 +119,7 @@ public class ConfigIntervalDynamicContribution extends CompoundContributionItem
/**
* The action to allow defining a custom interval.
*/
- class CustomAction extends Action {
+ static class CustomAction extends Action {
/**
* Constructor
*
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/TerminateHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/TerminateHandler.java
index e7b1ece1a..d741b0539 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/TerminateHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/TerminateHandler.java
@@ -64,7 +64,7 @@ public class TerminateHandler extends AbstractHandler {
* The callback to be invoked after the selected processes are successfully terminated
* to update the tree viewer or display errors.
*/
- class TerminateCallback extends Callback {
+ static class TerminateCallback extends Callback {
private ProcessTreeNode node;
public TerminateCallback(ProcessTreeNode node) {
this.node = node;

Back to the top