diff options
author | Ryan D. Brooks | 2016-05-06 18:25:17 +0000 |
---|---|---|
committer | Angel Avila | 2016-05-06 18:25:17 +0000 |
commit | 8f751897631cabd6a015edc9c5bf728dd7983aea (patch) | |
tree | 0e0502e8b8d89ae267619aa590d2e5a3432bf5e5 /plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core | |
parent | c4d8fe628fcfcd7fb1b585e94b3a974d06feb8ae (diff) | |
download | org.eclipse.osee-8f751897631cabd6a015edc9c5bf728dd7983aea.tar.gz org.eclipse.osee-8f751897631cabd6a015edc9c5bf728dd7983aea.tar.xz org.eclipse.osee-8f751897631cabd6a015edc9c5bf728dd7983aea.zip |
refactor: Use functional interface with BranchFilter
Change-Id: I0b62590c067d9f6902a4fe8679d994f5dfe88b6c
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core')
2 files changed, 5 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProvider.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProvider.java index 75cd8db1708..bbd26a5ab3a 100644 --- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProvider.java +++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProvider.java @@ -42,6 +42,7 @@ public final class DeletedBranchProvider implements BranchProvider { List<Branch> branches = branchCache.getBranches(branchFilter); Collection<BranchReadable> branchesToReturn = new LinkedHashSet<>(); + branchesToReturn.addAll(branches); for (Branch branch : branches) { branch.getChildBranches(branchesToReturn, true, branchFilter); diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/MultiBranchProvider.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/MultiBranchProvider.java index 475a527c59e..f8531892567 100644 --- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/MultiBranchProvider.java +++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/provider/MultiBranchProvider.java @@ -13,9 +13,8 @@ package org.eclipse.osee.orcs.core.internal.branch.provider; import java.util.Collection; import java.util.HashSet; import java.util.Set; -import org.eclipse.osee.framework.core.model.Branch; +import java.util.function.Predicate; import org.eclipse.osee.framework.core.model.BranchReadable; -import org.eclipse.osee.framework.core.model.cache.BranchFilter; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.jdk.core.util.Conditions; @@ -26,9 +25,9 @@ public class MultiBranchProvider implements BranchProvider { private final boolean recursive; private final Set<BranchReadable> branches; - private final BranchFilter filter; + private final Predicate<BranchReadable> filter; - public MultiBranchProvider(boolean recursive, Set<BranchReadable> branches, BranchFilter filter) { + public MultiBranchProvider(boolean recursive, Set<BranchReadable> branches, Predicate<BranchReadable> filter) { this.recursive = recursive; this.branches = branches; this.filter = filter; @@ -38,7 +37,7 @@ public class MultiBranchProvider implements BranchProvider { Set<BranchReadable> children = new HashSet<>(); branch.getChildBranches(children, true, filter); - if (filter.matches(branch)) { + if (filter.test(branch)) { children.add(branch); } return children; |