summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-01-12 09:06:27 (EST)
committerCarsten Drossel2009-01-12 09:06:27 (EST)
commit3c5fae3d2d63b294db603a0bf73d496995e5888e (patch)
tree009bd22ad0ca5f79975583a417c1ea72ab64b9c3
parenta186b4f1854d28ffb0115e856f21c9334d7639d1 (diff)
downloadorg.eclipse.riena-3c5fae3d2d63b294db603a0bf73d496995e5888e.zip
org.eclipse.riena-3c5fae3d2d63b294db603a0bf73d496995e5888e.tar.gz
org.eclipse.riena-3c5fae3d2d63b294db603a0bf73d496995e5888e.tar.bz2
fixed findbugs warnings
-rw-r--r--org.eclipse.riena.monitor.client/src/org/eclipse/riena/internal/monitor/client/Aggregator.java12
-rw-r--r--org.eclipse.riena.monitor.client/src/org/eclipse/riena/monitor/client/SimpleStore.java6
2 files changed, 13 insertions, 5 deletions
diff --git a/org.eclipse.riena.monitor.client/src/org/eclipse/riena/internal/monitor/client/Aggregator.java b/org.eclipse.riena.monitor.client/src/org/eclipse/riena/internal/monitor/client/Aggregator.java
index 1f1d198..4b7d26e 100644
--- a/org.eclipse.riena.monitor.client/src/org/eclipse/riena/internal/monitor/client/Aggregator.java
+++ b/org.eclipse.riena.monitor.client/src/org/eclipse/riena/internal/monitor/client/Aggregator.java
@@ -60,7 +60,7 @@ public class Aggregator implements ICollectingAggregator {
protected Aggregator(boolean autoConfig) {
workSignal = new CountDownLatch(1);
workQueue = new LinkedBlockingQueue<Runnable>();
- new Thread(new Worker(), "Client Monitoring Aggregator Worker").start(); //$NON-NLS-1$
+ startWorker();
if (autoConfig) {
Inject
.extension("org.eclipse.riena.monitor.collectors").useType(ICollectorExtension.class).into(this).andStart(Activator.getDefault().getContext()); //$NON-NLS-1$
@@ -71,6 +71,10 @@ public class Aggregator implements ICollectingAggregator {
}
}
+ private void startWorker() {
+ new Thread(new Worker(), "Client Monitoring Aggregator Worker").start(); //$NON-NLS-1$
+ }
+
public synchronized void start() {
if (started) {
return;
@@ -161,11 +165,12 @@ public class Aggregator implements ICollectingAggregator {
* .riena.monitor.common.Collectible)
*/
public synchronized void collect(final Collectible<?> collectible) {
- workQueue.offer(new Runnable() {
+ boolean elementAdded = workQueue.offer(new Runnable() {
public void run() {
store.collect(collectible);
}
});
+ Assert.isTrue(elementAdded);
}
/*
@@ -176,12 +181,13 @@ public class Aggregator implements ICollectingAggregator {
* .String)
*/
public synchronized void triggerTransfer(final String category) {
- workQueue.offer(new Runnable() {
+ boolean elementAdded = workQueue.offer(new Runnable() {
public void run() {
store.prepareTransferables(category);
sender.triggerTransfer(category);
}
});
+ Assert.isTrue(elementAdded);
}
private class Worker implements Runnable {
diff --git a/org.eclipse.riena.monitor.client/src/org/eclipse/riena/monitor/client/SimpleStore.java b/org.eclipse.riena.monitor.client/src/org/eclipse/riena/monitor/client/SimpleStore.java
index 3e11081..08f5698 100644
--- a/org.eclipse.riena.monitor.client/src/org/eclipse/riena/monitor/client/SimpleStore.java
+++ b/org.eclipse.riena.monitor.client/src/org/eclipse/riena/monitor/client/SimpleStore.java
@@ -112,8 +112,10 @@ public class SimpleStore implements IStore, IExecutableExtension {
if (autoConfig) {
cleaner = new Cleaner();
storeFolder = new File(RienaLocations.getDataArea(Activator.getDefault().getBundle()), storeFolderName);
- boolean directoryCreated = storeFolder.mkdirs();
- Assert.isTrue(directoryCreated);
+ if (!storeFolder.isDirectory()) {
+ boolean directoryCreated = storeFolder.mkdirs();
+ Assert.isTrue(directoryCreated);
+ }
try {
encrypt = getCipher(Cipher.ENCRYPT_MODE);
decrypt = getCipher(Cipher.DECRYPT_MODE);