Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/findbugs-exclude.xml16
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PPIDLabelProvider.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/dialogs/IntervalConfigDialog.java29
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/AdvancedPropertiesSection.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicContextSection.java17
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicInformationSection.java11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/IDSection.java11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MemorySection.java9
9 files changed, 59 insertions, 44 deletions
diff --git a/admin/findbugs-exclude.xml b/admin/findbugs-exclude.xml
index b4db52592..9d487d414 100644
--- a/admin/findbugs-exclude.xml
+++ b/admin/findbugs-exclude.xml
@@ -59,6 +59,7 @@
<Method name="stop" params="org.osgi.framework.BundleContext" returns="void"/>
<Class name="~.*\.Activator"/>
<Class name="org.eclipse.tcf.te.runtime.properties.PropertiesContainer"/>
+ <Class name="org.eclipse.tcf.te.ui.internal.utils.AbstractSearcher"/>
</Or>
</Match>
@@ -81,7 +82,7 @@
<Or>
<Method name="getAdapterList"/>
<Class name="org.eclipse.tcf.te.tcf.filesystem.core.internal.utils.FileState"/>
- <Package name="~org\.eclipse\.tcf\.te\.tcf\.filesystem\.core\.internal\.operations\..*"/>
+ <Package name="~org\.eclipse\.tcf\.te\.tcf\.filesystem\.core\.internal\.operations"/>
</Or>
</Match>
@@ -92,6 +93,8 @@
<Class name="org.eclipse.tcf.te.ui.views.handler.UpdateActiveExtensionsOperation"/>
<Class name="org.eclipse.tcf.te.ui.views.handler.UpdateActiveFiltersOperation"/>
<Class name="~org\.eclipse\.tcf\.te\.tcf\.terminals\.core\.launcher\.TerminalsStreamsListener.*"/>
+ <Class name="org.eclipse.tcf.te.tcf.filesystem.core.internal.utils.FileState"/>
+ <Package name="~org\.eclipse\.tcf\.te\.tcf\.filesystem\.core\.internal\.operations"/>
</Or>
</Match>
@@ -123,7 +126,7 @@
<!-- Ignore BC_UNCONFIRMED_CAST -->
<Match>
<Bug pattern="BC_UNCONFIRMED_CAST"/>
- <Package name="~org\.eclipse\.tcf\.te\.ui\.trees\..*"/>
+ <Package name="~org\.eclipse\.tcf\.te\.ui\.trees"/>
</Match>
<!-- Ignore DMI_HARDCODED_ABSOLUTE_FILENAME in Host -->
@@ -138,6 +141,15 @@
<Class name="org.eclipse.tcf.te.runtime.processes.ProcessOutputReaderThread"/>
</Match>
+ <!-- Ignore UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR -->
+ <Match>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ <And>
+ <Class name="org.eclipse.tcf.te.ui.internal.utils.BreadthFirstSearcher"/>
+ <Method name="searchNext"/>
+ </And>
+ </Match>
+
<!-- Filters for org.eclipse.tcf bundle -->
<Match>
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java
index c1edcaed9..8cdf00fd9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java
@@ -263,7 +263,7 @@ public abstract class AbstractServiceManager {
@Override
public boolean equals(Object obj) {
if (obj instanceof ServiceProxy) {
- return id.equals(((ServiceProxy)obj).id);
+ return id != null ? id.equals(((ServiceProxy)obj).id) : ((ServiceProxy)obj).id == null;
}
return super.equals(obj);
}
@@ -273,7 +273,7 @@ public abstract class AbstractServiceManager {
*/
@Override
public int hashCode() {
- return id.hashCode();
+ return id != null ? id.hashCode() : super.hashCode();
}
public boolean equals(IService service) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PPIDLabelProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PPIDLabelProvider.java
index d8452aec9..c4c97a205 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PPIDLabelProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/columns/PPIDLabelProvider.java
@@ -28,8 +28,6 @@ public class PPIDLabelProvider extends LabelProvider {
ProcessTreeNode node = (ProcessTreeNode) element;
// Pending nodes does not have column texts at all
if (node.type.endsWith("PendingNode")) return ""; //$NON-NLS-1$ //$NON-NLS-2$
- String ppid = Long.toString(node.ppid);
- if (ppid != null) return ppid;
- return ""; //$NON-NLS-1$
+ return Long.toString(node.ppid);
}
}
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 fef944960..398324080 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
@@ -32,6 +32,7 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.tcf.te.tcf.processes.ui.activator.UIPlugin;
import org.eclipse.tcf.te.tcf.processes.ui.internal.preferences.IPreferenceConsts;
import org.eclipse.tcf.te.tcf.processes.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
/**
* The dialog to configure the refreshing interval of the process list.
@@ -58,7 +59,7 @@ public class IntervalConfigDialog extends StatusDialog implements ModifyListener
shell.setText(Messages.IntervalConfigDialog_DialogTitle);
super.configureShell(shell);
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
@@ -66,17 +67,17 @@ public class IntervalConfigDialog extends StatusDialog implements ModifyListener
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
-
+
Composite comp1 = new Composite(composite, SWT.NONE);
GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
comp1.setLayoutData(data);
GridLayout layout = new GridLayout(3, false);
layout.horizontalSpacing = 0;
comp1.setLayout(layout);
-
+
Label label = new Label(comp1, SWT.RADIO);
label.setText(Messages.IntervalConfigDialog_ChoiceOneLabel);
-
+
text = new Text(comp1, SWT.SINGLE | SWT.BORDER);
text.setTextLimit(Text.LIMIT);
data = new GridData();
@@ -86,22 +87,22 @@ public class IntervalConfigDialog extends StatusDialog implements ModifyListener
text.selectAll();
text.setFocus();
text.addModifyListener(this);
-
+
label = new Label(comp1, SWT.NONE);
label.setText(Messages.IntervalConfigDialog_SECONDS);
-
+
return composite;
}
-
+
/**
* Check if the current input is valid and return an IStatus object to return
* the checking result, containing the message and the validating code.
- *
+ *
* @return A status to indicate if the input is valid.
*/
private IStatus isInputValid() {
String pluginId = UIPlugin.getUniqueIdentifier();
- String txt = text.getText();
+ String txt = SWTControlUtil.getText(text);
if (txt == null || txt.trim().length() == 0) {
return new Status(IStatus.ERROR, pluginId, null);
}
@@ -122,14 +123,14 @@ public class IntervalConfigDialog extends StatusDialog implements ModifyListener
*/
@Override
protected void okPressed() {
- String txt = text.getText().trim();
+ String txt = SWTControlUtil.getText(text).trim();
result = Integer.parseInt(txt);
super.okPressed();
}
-
+
/**
* Get the input result, a time interval.
- *
+ *
* @return The input result.
*/
public int getResult() {
@@ -160,7 +161,7 @@ public class IntervalConfigDialog extends StatusDialog implements ModifyListener
/**
* Get the current the speed grades in an array of Grade.
- *
+ *
* @return The current speed grades.
*/
IntervalGrade[] getGrades(){
@@ -197,7 +198,7 @@ public class IntervalConfigDialog extends StatusDialog implements ModifyListener
/**
* Set the current interval to the text field.
- *
+ *
* @param interval The current interval.
*/
public void setResult(int interval) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/AdvancedPropertiesSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/AdvancedPropertiesSection.java
index f6b4fde1d..1e6d5bec3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/AdvancedPropertiesSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/AdvancedPropertiesSection.java
@@ -91,6 +91,6 @@ public class AdvancedPropertiesSection extends AbstractPropertySection {
*/
@Override
public void refresh() {
- viewer.setInput(properties);
+ if (viewer != null) viewer.setInput(properties);
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicContextSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicContextSection.java
index ce818bbe5..60d1387cf 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicContextSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicContextSection.java
@@ -17,6 +17,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
import org.eclipse.tcf.te.tcf.processes.core.model.ProcessTreeNode;
import org.eclipse.tcf.te.tcf.processes.ui.nls.Messages;
import org.eclipse.tcf.te.tcf.ui.tabbed.BaseTitledSection;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
/**
@@ -37,7 +38,7 @@ public class BasicContextSection extends BaseTitledSection {
protected Text userText;
// The owner group of the process.
protected Text groupText;
-
+
/*
* (non-Javadoc)
* @see org.eclipse.tcf.te.ui.views.tabbed.BaseTitledSection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
@@ -70,12 +71,12 @@ public class BasicContextSection extends BaseTitledSection {
*/
@Override
public void refresh() {
- fileText.setText(context == null ? "" : (context.getFile() == null ? "" : context.getFile())); //$NON-NLS-1$ //$NON-NLS-2$
- workDirText.setText(context == null ? "" : (context.getCurrentWorkingDirectory() == null ? "" : context.getCurrentWorkingDirectory())); //$NON-NLS-1$ //$NON-NLS-2$
- rootText.setText(context == null ? "" : (context.getRoot() == null ? "" : context.getRoot())); //$NON-NLS-1$ //$NON-NLS-2$
- stateText.setText(context == null ? "" : (context.getState() == null ? "" : context.getState())); //$NON-NLS-1$ //$NON-NLS-2$
- userText.setText(context == null ? "" : (context.getUserName() == null ? "" : context.getUserName())); //$NON-NLS-1$ //$NON-NLS-2$
- groupText.setText(context == null ? "" : (context.getGroupName() == null ? "" : context.getGroupName())); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTControlUtil.setText(fileText, context == null ? "" : (context.getFile() == null ? "" : context.getFile())); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTControlUtil.setText(workDirText, context == null ? "" : (context.getCurrentWorkingDirectory() == null ? "" : context.getCurrentWorkingDirectory())); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTControlUtil.setText(rootText, context == null ? "" : (context.getRoot() == null ? "" : context.getRoot())); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTControlUtil.setText(stateText, context == null ? "" : (context.getState() == null ? "" : context.getState())); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTControlUtil.setText(userText, context == null ? "" : (context.getUserName() == null ? "" : context.getUserName())); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTControlUtil.setText(groupText, context == null ? "" : (context.getGroupName() == null ? "" : context.getGroupName())); //$NON-NLS-1$ //$NON-NLS-2$
super.refresh();
}
@@ -85,6 +86,6 @@ public class BasicContextSection extends BaseTitledSection {
*/
@Override
protected String getText() {
- return Messages.BasicContextSection_Title;
+ return Messages.BasicContextSection_Title;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicInformationSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicInformationSection.java
index ac26a9d82..646020d91 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicInformationSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicInformationSection.java
@@ -16,6 +16,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
import org.eclipse.tcf.te.tcf.processes.core.model.ProcessTreeNode;
import org.eclipse.tcf.te.tcf.processes.ui.nls.Messages;
import org.eclipse.tcf.te.tcf.ui.tabbed.BaseTitledSection;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
/**
@@ -62,10 +63,10 @@ public class BasicInformationSection extends BaseTitledSection {
*/
@Override
public void refresh() {
- nameText.setText(node.name == null ? Messages.ProcessLabelProvider_RootNodeLabel : node.name);
- typeText.setText(node.type == null ? "" : node.type); //$NON-NLS-1$
- stateText.setText(node.state == null ? "" : node.state); //$NON-NLS-1$
- userText.setText(node.username == null ? "" : node.username); //$NON-NLS-1$
+ SWTControlUtil.setText(nameText, node != null && node.name != null ? node.name : Messages.ProcessLabelProvider_RootNodeLabel);
+ SWTControlUtil.setText(typeText, node != null && node.type != null ? node.type : ""); //$NON-NLS-1$
+ SWTControlUtil.setText(stateText, node != null && node.state != null ? node.state : ""); //$NON-NLS-1$
+ SWTControlUtil.setText(userText, node != null && node.username != null ? node.username : ""); //$NON-NLS-1$
super.refresh();
}
@@ -75,6 +76,6 @@ public class BasicInformationSection extends BaseTitledSection {
*/
@Override
protected String getText() {
- return Messages.BasicInformationSection_Title;
+ return Messages.BasicInformationSection_Title;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/IDSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/IDSection.java
index 5be3bafb3..7935711f2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/IDSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/IDSection.java
@@ -16,6 +16,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
import org.eclipse.tcf.te.tcf.processes.core.model.ProcessTreeNode;
import org.eclipse.tcf.te.tcf.processes.ui.nls.Messages;
import org.eclipse.tcf.te.tcf.ui.tabbed.BaseTitledSection;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
/**
@@ -62,10 +63,10 @@ public class IDSection extends BaseTitledSection {
*/
@Override
public void refresh() {
- pidText.setText(""+node.pid); //$NON-NLS-1$
- ppidText.setText(""+node.ppid); //$NON-NLS-1$
- ipidText.setText(node.id == null ? "" : node.id); //$NON-NLS-1$
- ippidText.setText(node.parentId == null ? "" : node.parentId); //$NON-NLS-1$
+ SWTControlUtil.setText(pidText, node != null ? Long.toString(node.pid) : ""); //$NON-NLS-1$
+ SWTControlUtil.setText(ppidText, node != null ? Long.toString(node.ppid) : ""); //$NON-NLS-1$
+ SWTControlUtil.setText(ipidText, node != null && node.id != null ? node.id : ""); //$NON-NLS-1$
+ SWTControlUtil.setText(ippidText, node != null && node.parentId != null ? node.parentId : ""); //$NON-NLS-1$
super.refresh();
}
@@ -75,6 +76,6 @@ public class IDSection extends BaseTitledSection {
*/
@Override
protected String getText() {
- return Messages.IDSection_Title;
+ return Messages.IDSection_Title;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MemorySection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MemorySection.java
index 34cc809f4..f90f78a56 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MemorySection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MemorySection.java
@@ -17,6 +17,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
import org.eclipse.tcf.te.tcf.processes.core.model.ProcessTreeNode;
import org.eclipse.tcf.te.tcf.processes.ui.nls.Messages;
import org.eclipse.tcf.te.tcf.ui.tabbed.BaseTitledSection;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
/**
@@ -50,7 +51,7 @@ public class MemorySection extends BaseTitledSection {
*/
@Override
protected String getText() {
- return Messages.MemorySection_Title;
+ return Messages.MemorySection_Title;
}
/*
@@ -70,9 +71,9 @@ public class MemorySection extends BaseTitledSection {
*/
@Override
public void refresh() {
- vsizeText.setText(context == null ? "" : "" + context.getVSize()); //$NON-NLS-1$ //$NON-NLS-2$
- psizeText.setText(context == null ? "" : "" + context.getPSize()); //$NON-NLS-1$ //$NON-NLS-2$
- rssText.setText(context == null ? "" : "" + context.getRSS()); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTControlUtil.setText(vsizeText, context == null ? "" : "" + context.getVSize()); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTControlUtil.setText(psizeText, context == null ? "" : "" + context.getPSize()); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTControlUtil.setText(rssText, context == null ? "" : "" + context.getRSS()); //$NON-NLS-1$ //$NON-NLS-2$
super.refresh();
}
}

Back to the top