Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-11-04 03:57:22 -0500
committerUwe Stieber2013-11-04 03:57:22 -0500
commit7e17bdd2f6e30fb59b204312e2a7ebd3d8f6a27c (patch)
tree77724fd94e5e143ed4f6d5438f6d538548a89d36 /target_explorer
parentff253d796de13c77029a568c0cf0a21f8d145b36 (diff)
downloadorg.eclipse.tcf-7e17bdd2f6e30fb59b204312e2a7ebd3d8f6a27c.tar.gz
org.eclipse.tcf-7e17bdd2f6e30fb59b204312e2a7ebd3d8f6a27c.tar.xz
org.eclipse.tcf-7e17bdd2f6e30fb59b204312e2a7ebd3d8f6a27c.zip
Target Explorer: Fix findbugs warnings
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java26
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/ProcessComparator.java4
3 files changed, 21 insertions, 15 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java
index 423ed62a5..353ff01ed 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java
@@ -59,13 +59,14 @@ public class PathMapService extends AbstractService implements IPathMapService {
Assert.isTrue(!Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
Assert.isNotNull(context);
- // Acquire the lock before accessing the path mappings
- lock.lock();
-
PathMapRule[] rules = null;
- List<PathMapRule> rulesList = new ArrayList<PathMapRule>();
try {
+ // Acquire the lock before accessing the path mappings
+ lock.lock();
+
+ List<PathMapRule> rulesList = new ArrayList<PathMapRule>();
+
// Get the launch configuration for that peer model
ILaunchConfiguration config = (ILaunchConfiguration) Platform.getAdapterManager().getAdapter(context, ILaunchConfiguration.class);
if (config == null) {
@@ -114,13 +115,14 @@ public class PathMapService extends AbstractService implements IPathMapService {
Assert.isNotNull(source);
Assert.isNotNull(destination);
- // Acquire the lock before accessing the path mappings
- lock.lock();
-
PathMapRule rule = null;
- List<PathMapRule> rulesList = new ArrayList<PathMapRule>();
try {
+ // Acquire the lock before accessing the path mappings
+ lock.lock();
+
+ List<PathMapRule> rulesList = new ArrayList<PathMapRule>();
+
// Get the launch configuration for that peer model
ILaunchConfigurationWorkingCopy config = (ILaunchConfigurationWorkingCopy) Platform.getAdapterManager().getAdapter(context, ILaunchConfigurationWorkingCopy.class);
if (config == null) {
@@ -177,12 +179,12 @@ public class PathMapService extends AbstractService implements IPathMapService {
Assert.isNotNull(context);
Assert.isNotNull(rule);
- // Acquire the lock before accessing the path mappings
- lock.lock();
+ try {
+ // Acquire the lock before accessing the path mappings
+ lock.lock();
- List<PathMapRule> rulesList = new ArrayList<PathMapRule>();
+ List<PathMapRule> rulesList = new ArrayList<PathMapRule>();
- try {
// Get the launch configuration for that peer model
ILaunchConfigurationWorkingCopy config = (ILaunchConfigurationWorkingCopy) Platform.getAdapterManager().getAdapter(context, ILaunchConfigurationWorkingCopy.class);
if (config == null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
index 2db351e91..574b13fd9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
@@ -255,7 +255,7 @@ public class RuntimeModelUpdateService extends AbstractModelService<IRuntimeMode
// Update the system monitor context object (if necessary)
ISysMonitor.SysMonitorContext s1 = dst.getSysMonitorContext();
ISysMonitor.SysMonitorContext s2 = src.getSysMonitorContext();
- if ((s1 == null && s2 != null) || (s1 != null && s2 == null) || !s1.equals(s2)) {
+ if ((s1 == null && s2 != null) || (s1 != null && s2 == null) || (s1 != null && !s1.equals(s2))) {
dst.setSysMonitorContext(src.getSysMonitorContext());
dstNodeChanged |= true;
}
@@ -263,7 +263,7 @@ public class RuntimeModelUpdateService extends AbstractModelService<IRuntimeMode
// Update the process context object (if necessary)
IProcesses.ProcessContext p1 = dst.getProcessContext();
IProcesses.ProcessContext p2 = src.getProcessContext();
- if ((p1 == null && p2 != null) || (p1 != null && p2 == null) || !p1.equals(p2)) {
+ if ((p1 == null && p2 != null) || (p1 != null && p2 == null) || (p1 != null && !p1.equals(p2))) {
dst.setProcessContext(src.getProcessContext());
dstNodeChanged |= true;
}
@@ -297,7 +297,7 @@ public class RuntimeModelUpdateService extends AbstractModelService<IRuntimeMode
// Update the nodes only if the id's are matching
String dstContextId = dst.getStringProperty(IProcessContextNodeProperties.PROPERTY_ID);
String srcContextId = src.getStringProperty(IProcessContextNodeProperties.PROPERTY_ID);
- if ((dstContextId == null && srcContextId != null) || (dstContextId != null && srcContextId == null) || !dstContextId.equals(srcContextId)) {
+ if ((dstContextId == null && srcContextId != null) || (dstContextId != null && srcContextId == null) || (dstContextId != null && !dstContextId.equals(srcContextId))) {
return;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/ProcessComparator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/ProcessComparator.java
index e7d4fcb9e..3cdec6ba1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/ProcessComparator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/ProcessComparator.java
@@ -14,6 +14,7 @@ import java.util.Comparator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
import org.eclipse.tcf.te.tcf.processes.ui.navigator.runtime.LabelProviderDelegate;
@@ -54,6 +55,9 @@ public class ProcessComparator implements Comparator<IProcessContextNode> , Seri
if (text1 != null && text2 == null) return 1;
if (text1 == null && text2 != null) return -1;
+ Assert.isNotNull(text1);
+ Assert.isNotNull(text2);
+
// Convert the labels to compare to lowercase if the sorting is case-insensitive
if (!isCaseSensitve()) {
text1 = text1.toLowerCase();

Back to the top