Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ final class FinderDelegate {
@Nonnull
Collection<Component> find(@Nonnull ComponentHierarchy h, @Nonnull ComponentMatcher m) {
Set<Component> found = newLinkedHashSet();
for (Component c : rootsOf(h)) {
find(h, m, checkNotNull(c), found);
}
execute(() -> {
for (Component c : rootsOf(h)) {
find(h, m, checkNotNull(c), found);
}
});
return found;
}

Expand All @@ -56,29 +58,31 @@ private void find(@Nonnull ComponentHierarchy h, @Nonnull ComponentMatcher m, @N
@RunsInEDT
@Nonnull private static Collection<Component> childrenOfComponent(final @Nonnull Component c,
final @Nonnull ComponentHierarchy h) {
Collection<Component> children = execute(() -> h.childrenOf(c));
Collection<Component> children = h.childrenOf(c);
return checkNotNull(children);
}

@RunsInEDT
private static boolean isMatching(@Nonnull final Component c, @Nonnull final ComponentMatcher m) {
Boolean matching = execute(() -> m.matches(c));
Boolean matching = m.matches(c);
return checkNotNull(matching);
}

@RunsInEDT
@Nonnull
<T extends Component> Collection<T> find(@Nonnull ComponentHierarchy h, @Nonnull GenericTypeMatcher<T> m) {
Set<T> found = newLinkedHashSet();
for (Component c : rootsOf(h)) {
find(h, m, checkNotNull(c), found);
}
execute(() -> {
for (Component c : rootsOf(h)) {
find(h, m, checkNotNull(c), found);
}
});
return found;
}

@RunsInEDT
@Nonnull private static Collection<? extends Component> rootsOf(final @Nonnull ComponentHierarchy h) {
return checkNotNull(execute(() -> h.roots()));
return checkNotNull(h.roots());
}

@RunsInEDT
Expand All @@ -95,7 +99,7 @@ private <T extends Component> void find(@Nonnull ComponentHierarchy h, @Nonnull
@RunsInEDT
private static <T extends Component> boolean isMatching(final @Nonnull Component c,
final @Nonnull GenericTypeMatcher<T> m) {
Boolean matching = execute(() -> m.matches(c));
Boolean matching = m.matches(c);
return checkNotNull(matching);
}
}