Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/78#discussion_r57199823
  
    --- Diff: core/src/main/java/org/apache/brooklyn/util/core/osgi/Osgis.java 
---
    @@ -181,11 +181,11 @@ public BundleFinder requiringFromUrl(String url) {
             public List<Bundle> findAll() {
                 boolean urlMatched = false;
                 List<Bundle> result = MutableList.of();
    -            for (Bundle b: framework.getBundleContext().getBundles()) {
    +            allBundles: 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 (!predicate.apply(b)) continue allBundles;
    --- End diff --
    
    Could `Predicates.and` be used instead of the nested loop? Alternatively 
can you extract it in a separate method to avoid dealing with labels.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to