brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/2] brooklyn-server git commit: Skip to next bundle on predicate failure.
Date Fri, 25 Mar 2016 10:34:15 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master fafff2dad -> f4be19000


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.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/71932b2d
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/71932b2d
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/71932b2d

Branch: refs/heads/master
Commit: 71932b2de5ef53c334353d2f6280766f66fe0657
Parents: b8211ed
Author: Geoff Macartney <geoff.macartney@cloudsoftcorp.com>
Authored: Wed Mar 23 16:54:21 2016 +0000
Committer: Geoff Macartney <geoff.macartney@cloudsoftcorp.com>
Committed: Thu Mar 24 13:30:25 2016 +0000

----------------------------------------------------------------------
 core/src/main/java/org/apache/brooklyn/util/core/osgi/Osgis.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/71932b2d/core/src/main/java/org/apache/brooklyn/util/core/osgi/Osgis.java
----------------------------------------------------------------------
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 c2598ad..75c33df 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 class Osgis {
             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<? super Bundle> 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


Mime
View raw message