Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-04-25 15:42:40 +0000
committerUwe Stieber2012-04-25 15:42:40 +0000
commit1e31f3baac0df6efb685fb849575f5156dc0a85f (patch)
tree1f4b31809c098a5fa97d7520af4a01967e5f22b6 /target_explorer/plugins/org.eclipse.tcf.te.core
parent422c0633487a8bc5b3e27acaba1d1e99832df006 (diff)
downloadorg.eclipse.tcf-1e31f3baac0df6efb685fb849575f5156dc0a85f.tar.gz
org.eclipse.tcf-1e31f3baac0df6efb685fb849575f5156dc0a85f.tar.xz
org.eclipse.tcf-1e31f3baac0df6efb685fb849575f5156dc0a85f.zip
Target Explorer: Fixed FindBugs warnings
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/adapters/ModelNodePersistableURIProvider.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/adapters/ModelNodePersistableURIProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/adapters/ModelNodePersistableURIProvider.java
index 07fbb5e46..b9b9963d7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/adapters/ModelNodePersistableURIProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/adapters/ModelNodePersistableURIProvider.java
@@ -129,20 +129,18 @@ public class ModelNodePersistableURIProvider implements IPersistableURIProvider
// Try the bundles state location first (not available if launched with -data @none).
try {
IPath path = Platform.getStateLocation(CoreBundleActivator.getContext().getBundle()).append(".store"); //$NON-NLS-1$
- if (!path.toFile().exists()) {
- path.toFile().mkdirs();
- }
- if (path.toFile().canRead() && path.toFile().isDirectory()) {
+ boolean exists = path.toFile().exists();
+ if (!exists) exists = path.toFile().mkdirs();
+ if (exists && path.toFile().canRead() && path.toFile().isDirectory()) {
location = path;
}
} catch (IllegalStateException e) {
// Workspace less environments (-data @none)
// The users local target definition persistence directory is $HOME/.tcf/.store.
IPath path = new Path(System.getProperty("user.home")).append(".tcf/.store"); //$NON-NLS-1$ //$NON-NLS-2$
- if (!path.toFile().exists()) {
- path.toFile().mkdirs();
- }
- if (path.toFile().canRead() && path.toFile().isDirectory()) {
+ boolean exists = path.toFile().exists();
+ if (!exists) exists = path.toFile().mkdirs();
+ if (exists && path.toFile().canRead() && path.toFile().isDirectory()) {
location = path;
}
}

Back to the top