diff options
author | kaguilar | 2010-04-02 17:43:08 +0000 |
---|---|---|
committer | kaguilar | 2010-04-02 17:43:08 +0000 |
commit | b4a686f3d1bd84b858c349d1cb5e3b03e6248a4c (patch) | |
tree | faa0f9e3e2a2404d2ec2208bde162949f594ce68 /plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse | |
parent | 3861bb20d00ecb739f4137699a9e62b215207437 (diff) | |
download | org.eclipse.osee-b4a686f3d1bd84b858c349d1cb5e3b03e6248a4c.tar.gz org.eclipse.osee-b4a686f3d1bd84b858c349d1cb5e3b03e6248a4c.tar.xz org.eclipse.osee-b4a686f3d1bd84b858c349d1cb5e3b03e6248a4c.zip |
fixes to issues flagged by find bugs
Diffstat (limited to 'plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse')
3 files changed, 11 insertions, 6 deletions
diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageReference.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageReference.java index 1cef224339a..5d24e99cfb3 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageReference.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageReference.java @@ -49,7 +49,10 @@ public class MessageReference { }
@Override
- public boolean equals(Object obj) {
+ public boolean equals(Object obj) { + if (obj == null) { + throw new NullPointerException(); + }
MessageReference otherRef = (MessageReference) obj;
return msgClassName.equals(otherRef.msgClassName) && type == otherRef.type && mode == otherRef.mode;
}
diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscription.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscription.java index 6c2e62e1209..c8c44c428d9 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscription.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscription.java @@ -13,6 +13,7 @@ package org.eclipse.osee.ote.client.msg.core.internal; import java.util.HashSet; import java.util.List; import java.util.Set; + import org.eclipse.osee.ote.client.msg.core.IMessageSubscription; import org.eclipse.osee.ote.client.msg.core.ISubscriptionListener; import org.eclipse.osee.ote.client.msg.core.db.AbstractMessageDataBase; @@ -209,7 +210,7 @@ public class MessageSubscription implements IMessageSubscription { }
@Override
- public boolean addSubscriptionListener(ISubscriptionListener listener) {
+ public synchronized boolean addSubscriptionListener(ISubscriptionListener listener) {
boolean result = listeners.add(listener);
if (currentState == null) {
listener.subscriptionCanceled(this);
diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java index d45df6687a1..cea638f46bf 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java @@ -24,6 +24,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.logging.Level; + import org.eclipse.osee.connection.service.IServiceConnector; import org.eclipse.osee.framework.jdk.core.util.network.PortUtil; import org.eclipse.osee.framework.logging.OseeLog; @@ -276,7 +277,7 @@ public class MessageSubscriptionService implements IOteMessageService, IMessageD }
@Override
- public void onDictionaryLoaded(IMessageDictionary dictionary) {
+ public synchronized void onDictionaryLoaded(IMessageDictionary dictionary) {
msgDatabase = messageDbFactory.createMessageDataBase(dictionary);
for (MessageSubscription subscription : subscriptions) {
subscription.attachMessageDb(msgDatabase);
@@ -284,7 +285,7 @@ public class MessageSubscriptionService implements IOteMessageService, IMessageD }
@Override
- public void onDictionaryUnloaded(IMessageDictionary dictionary) {
+ public synchronized void onDictionaryUnloaded(IMessageDictionary dictionary) {
for (MessageSubscription subscription : subscriptions) {
subscription.detachMessageDb(msgDatabase);
}
@@ -292,7 +293,7 @@ public class MessageSubscriptionService implements IOteMessageService, IMessageD }
@Override
- public IFileTransferHandle startRecording(String fileName, List<MessageRecordDetails> list) throws FileNotFoundException, IOException {
+ public synchronized IFileTransferHandle startRecording(String fileName, List<MessageRecordDetails> list) throws FileNotFoundException, IOException {
if (service == null) {
throw new IllegalStateException("can't record: not connected to test server");
}
@@ -319,7 +320,7 @@ public class MessageSubscriptionService implements IOteMessageService, IMessageD }
@Override
- public void stopRecording() throws RemoteException, IOException {
+ public synchronized void stopRecording() throws RemoteException, IOException {
try {
service.stopRecording();
} finally {
|