From 71932b2de5ef53c334353d2f6280766f66fe0657 Mon Sep 17 00:00:00 2001 From: Geoff Macartney Date: Wed, 23 Mar 2016 16:54:21 +0000 Subject: [PATCH] Skip to next bundle on predicate failure. Without this change, if the predicate fails, the code flow just picks the next predicate to check, when really we want to skip to checking the next bundle. --- .../main/java/org/apache/brooklyn/util/core/osgi/Osgis.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/main/java/org/apache/brooklyn/util/core/osgi/Osgis.java b/core/src/main/java/org/apache/brooklyn/util/core/osgi/Osgis.java index c2598ad484..75c33df773 100644 --- a/core/src/main/java/org/apache/brooklyn/util/core/osgi/Osgis.java +++ b/core/src/main/java/org/apache/brooklyn/util/core/osgi/Osgis.java @@ -184,9 +184,7 @@ public List findAll() { for (Bundle b: framework.getBundleContext().getBundles()) { if (symbolicName!=null && !symbolicName.equals(b.getSymbolicName())) continue; if (version!=null && !Version.parseVersion(version).equals(b.getVersion())) continue; - for (Predicate predicate: predicates) { - if (!predicate.apply(b)) continue; - } + if (!Predicates.and(predicates).apply(b)) continue; // check url last, because if it isn't mandatory we should only clear if we find a url // for which the other items also match