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 @Override
public boolean match(Node<?> node) public boolean match(Node<?> node)
{ {
if (node.getSelections().isEmpty())
{
// Empty selection list (no uniqueness to it)
return false;
}
// Assume no match
boolean ret = false; boolean ret = false;
for (Selection selection : node.getSelections()) for (Selection selection : node.getSelections())
{ {
if (how.equalsIgnoreCase(selection.getHow())) if (how.equalsIgnoreCase(selection.getHow()))
{ {
// Found a match
ret = true; 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; return ret;
} }
} }

View File

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