Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-04-22 12:47:21 +0000
committerUwe Stieber2012-04-22 12:47:21 +0000
commiteedeeadbe3ce60666c196ff2a1c5bf8f6c04e6cb (patch)
tree0686ef06615bde199516135aa2f5a47068f1a185 /target_explorer/plugins/org.eclipse.tcf.te.runtime.services
parentcc9c441102b0d923c5d2fd87fd7b4cc8c7cab202 (diff)
downloadorg.eclipse.tcf-eedeeadbe3ce60666c196ff2a1c5bf8f6c04e6cb.tar.gz
org.eclipse.tcf-eedeeadbe3ce60666c196ff2a1c5bf8f6c04e6cb.tar.xz
org.eclipse.tcf-eedeeadbe3ce60666c196ff2a1c5bf8f6c04e6cb.zip
Target Explorer: Fix high level FindBugs warnings
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.services')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java11
1 files changed, 9 insertions, 2 deletions
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 4c4b1f260..2f24f1d06 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
@@ -72,7 +72,7 @@ public abstract class AbstractServiceManager {
// Initialize the id field by reading the <id> extension attribute.
// Throws an exception if the id is empty or null.
- id = config != null ? config.getAttribute("id") : null; //$NON-NLS-1$
+ id = config.getAttribute("id"); //$NON-NLS-1$
if (id == null || (id != null && "".equals(id.trim()))) { //$NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR,
CoreBundleActivator.getUniqueIdentifier(),
@@ -88,6 +88,11 @@ public abstract class AbstractServiceManager {
clazz = children[0].getAttribute("class"); //$NON-NLS-1$
}
}
+ if (clazz == null || (clazz != null && "".equals(clazz.trim()))) { //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ NLS.bind(Messages.Extension_error_missingRequiredAttribute, "class", config.getContributor().getName()))); //$NON-NLS-1$
+ }
// Read the "enablement" sub element of the extension
IConfigurationElement[] children = configElement.getChildren("enablement"); //$NON-NLS-1$
@@ -255,10 +260,12 @@ public abstract class AbstractServiceManager {
}
public boolean equals(IService service) {
- return clazz.equals(service.getClass());
+ Assert.isNotNull(service);
+ return clazz.equals(service.getClass().getCanonicalName());
}
public boolean equals(ServiceProxy proxy) {
+ Assert.isNotNull(proxy);
return clazz.equals(proxy.clazz);
}
}

Back to the top