Skip to content

Commit

Permalink
AbstractRepo.completeModules: keep looking in other versions of the s…
Browse files Browse the repository at this point in the history
…ame module until we find the right type of artifact

Otherwise we stopped searching after we found a module of the wrong type and did not collect it
  • Loading branch information
FroMage committed Apr 16, 2014
1 parent 2ea7e34 commit f07511d
Showing 1 changed file with 9 additions and 4 deletions.
Expand Up @@ -225,15 +225,20 @@ private boolean hasChildrenContainingArtifact(Node node, ModuleQuery lookup, Ret

// This allows us to never match the default module, since it's at "/default/default.car" which
// cannot match this rule. Normal modules always have at least one "/name/version/bla.car".
boolean found = false;
for (Node child : node.getChildren()) {
String name = child.getLabel();
// Winner of the less aptly-named method
boolean isFolder = !child.hasBinaries();
if (isFolder && !name.equals(ArtifactContext.DOCS) && containsArtifact(node, child, lookup, ret))
return true;
if (isFolder && !name.equals(ArtifactContext.DOCS) && containsArtifact(node, child, lookup, ret)){
// stop if we found the right type
if(ret.foundRightType)
return true;
// keep looking for the other versions, perhaps we will find the right type
found = true;
}
}
// could not find any
return false;
return found;
}

private boolean containsArtifact(Node moduleNode, Node versionNode, ModuleQuery lookup, Ret ret) {
Expand Down

0 comments on commit f07511d

Please sign in to comment.