summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkwilk2012-02-02 19:39:23 (EST)
committer Ryan D. Brooks2012-02-02 19:39:23 (EST)
commite97c68736e7cb243284a8e7bd3e703aa5edc5653 (patch)
tree5d8ecb48598ff9313217bdecd161b9a534a57c8f
parent13d8bd530b482fd98e01777aef73a97da0d9b576 (diff)
downloadorg.eclipse.osee-e97c68736e7cb243284a8e7bd3e703aa5edc5653.zip
org.eclipse.osee-e97c68736e7cb243284a8e7bd3e703aa5edc5653.tar.gz
org.eclipse.osee-e97c68736e7cb243284a8e7bd3e703aa5edc5653.tar.bz2
refactor[ats_22T7P]: Log cast exceptions in BranchCacheUpdateUtil
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java
index d55314a..715ce16 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java
@@ -17,8 +17,10 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import java.util.logging.Level;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.message.internal.Activator;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.BranchFactory;
import org.eclipse.osee.framework.core.model.MergeBranch;
@@ -28,6 +30,7 @@ import org.eclipse.osee.framework.core.model.cache.TransactionCache;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.type.Triplet;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.logging.OseeLog;
/**
* @author Megumi Telles
@@ -89,9 +92,18 @@ public final class BranchCacheUpdateUtil {
for (Triplet<String, String, String> entry : cacheMessage.getMergeBranches()) {
IOseeBranch sourceBranch = Strings.isValid(entry.getFirst()) ? cache.getByGuid(entry.getFirst()) : null;
IOseeBranch destinationBranch = Strings.isValid(entry.getSecond()) ? cache.getByGuid(entry.getSecond()) : null;
- MergeBranch mergeBranch = (MergeBranch) cache.getByGuid(entry.getThird());
- mergeBranch.setSourceBranch(sourceBranch);
- mergeBranch.setDestinationBranch(destinationBranch);
+
+ Branch branch = cache.getByGuid(entry.getThird());
+ MergeBranch mergeBranch = null;
+ try {
+ mergeBranch = (MergeBranch) branch;
+ mergeBranch.setSourceBranch(sourceBranch);
+ mergeBranch.setDestinationBranch(destinationBranch);
+ } catch (ClassCastException ex) {
+ OseeLog.logf(Activator.class, Level.SEVERE,
+ "Problem casting branch [%s] to MergeBranch, source: [%s], dest: [%s]\r\nException: %s", branch,
+ sourceBranch, destinationBranch, ex);
+ }
}
return updatedItems;
}