Skip to content

Commit

Permalink
See if I can knock down the complexity of RepositoryFinderMongo
Browse files Browse the repository at this point in the history
  • Loading branch information
dickschoeller committed Jun 3, 2017
1 parent 101519c commit eab7a43
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,10 @@ public <T extends GedObject> Collection<T> find(final FinderObject owner,
if (repo == null) {
return null;
}
final Root root = (Root) owner;
final RootDocumentMongo rootDocument =
(RootDocumentMongo) toDocConverter.createGedDocument(root);
final Iterable<? extends GedDocument<?>> iterable =
repo.findAll(rootDocument);
final RootDocumentMongo rootDocument = (RootDocumentMongo)
toDocConverter.createGedDocument((Root) owner);
final Collection<T> matches = new ArrayList<>();
for (final GedDocument<?> document : iterable) {
for (final GedDocument<?> document : repo.findAll(rootDocument)) {
matches.add((T) document.getGedObject());
}
logger.info("Ending find all of type");
Expand Down

0 comments on commit eab7a43

Please sign in to comment.