Fixing HowUniquePredicate

This commit is contained in:
Joakim Erdfelt 2014-11-20 08:48:35 -07:00
parent 9bd0ce1938
commit 1604cffc0b
2 changed files with 14 additions and 5 deletions

View File

@ -34,20 +34,30 @@ public class HowUniquePredicate implements Predicate
@Override
public boolean match(Node<?> node)
{
if (node.getSelections().isEmpty())
{
// Empty selection list (no uniqueness to it)
return false;
}
// Assume no match
boolean ret = false;
for (Selection selection : node.getSelections())
{
if (how.equalsIgnoreCase(selection.getHow()))
{
// Found a match
ret = true;
continue; // this how is always valid.
continue; // this 'how' is always valid.
}
if (selection.isExplicit())
else if (selection.isExplicit())
{
ret = false;
// Automatic failure
return false;
}
}
return ret;
}
}

View File

@ -160,7 +160,6 @@ public class DistTest
execMain(cmds);
Path startIni = basePath.resolve("start.ini");
assertThat("start.ini", startIni, fileExists());
// Now add 'deploy' module.