diff options
author | kwilk | 2012-02-03 00:39:23 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2012-02-03 00:39:23 +0000 |
commit | e97c68736e7cb243284a8e7bd3e703aa5edc5653 (patch) | |
tree | 5d8ecb48598ff9313217bdecd161b9a534a57c8f /plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core | |
parent | 13d8bd530b482fd98e01777aef73a97da0d9b576 (diff) | |
download | org.eclipse.osee-e97c68736e7cb243284a8e7bd3e703aa5edc5653.tar.gz org.eclipse.osee-e97c68736e7cb243284a8e7bd3e703aa5edc5653.tar.xz org.eclipse.osee-e97c68736e7cb243284a8e7bd3e703aa5edc5653.zip |
refactor[ats_22T7P]: Log cast exceptions in BranchCacheUpdateUtil
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core')
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java | 18 |
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 d55314a3a77..715ce1691cc 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; } |