Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2013-09-04 19:23:53 +0000
committerGerrit Code Review @ Eclipse.org2013-09-19 20:03:15 +0000
commitcba5f1573967f78933c7f77f55b3209b0ae130c4 (patch)
treedbcc804a1db76512f5924a2110ab5509b085bea7 /plugins/org.eclipse.osee.framework.core.model
parent58684e9a972496a9ceec69908820194d826a807e (diff)
downloadorg.eclipse.osee-cba5f1573967f78933c7f77f55b3209b0ae130c4.tar.gz
org.eclipse.osee-cba5f1573967f78933c7f77f55b3209b0ae130c4.tar.xz
org.eclipse.osee-cba5f1573967f78933c7f77f55b3209b0ae130c4.zip
bug[ats_12LYT]: Make Merge Manager UI consistent
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.model')
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/BranchCache.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/BranchCache.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/BranchCache.java
index 26e86ececff..b6822f6f974 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/BranchCache.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/BranchCache.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.cache;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@@ -54,6 +55,35 @@ public class BranchCache extends AbstractOseeCache<String, Branch> {
return toReturn;
}
+ public MergeBranch findFirstMergeBranch(Branch sourceBranch) throws OseeCoreException {
+ Conditions.checkNotNull(sourceBranch, "source branch");
+ MergeBranch toReturn = null;
+ for (Branch branch : getAll()) {
+ if (branch instanceof MergeBranch) {
+ MergeBranch mergeBranch = (MergeBranch) branch;
+ if (sourceBranch.equals(mergeBranch.getSourceBranch())) {
+ toReturn = mergeBranch;
+ break;
+ }
+ }
+ }
+ return toReturn;
+ }
+
+ public List<MergeBranch> findAllMergeBranches(Branch sourceBranch) throws OseeCoreException {
+ Conditions.checkNotNull(sourceBranch, "source branch");
+ List<MergeBranch> toReturn = new ArrayList<MergeBranch>();
+ for (Branch branch : getAll()) {
+ if (branch instanceof MergeBranch) {
+ MergeBranch mergeBranch = (MergeBranch) branch;
+ if (sourceBranch.equals(mergeBranch.getSourceBranch())) {
+ toReturn.add(mergeBranch);
+ }
+ }
+ }
+ return toReturn;
+ }
+
public synchronized List<Branch> getBranches(BranchFilter branchFilter) throws OseeCoreException {
Collection<Branch> allBranches = getRawValues();
List<Branch> branches = new LinkedList<Branch>();

Back to the top