diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/graph/HowUniquePredicate.java b/jetty-start/src/main/java/org/eclipse/jetty/start/graph/HowUniquePredicate.java index d91dfbd10c2..b723dbd9eac 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/graph/HowUniquePredicate.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/graph/HowUniquePredicate.java @@ -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; } } \ No newline at end of file diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/DistTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/DistTest.java index ec330467d5b..62ece208bad 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/DistTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/DistTest.java @@ -160,7 +160,6 @@ public class DistTest execMain(cmds); Path startIni = basePath.resolve("start.ini"); - assertThat("start.ini", startIni, fileExists()); // Now add 'deploy' module.