brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: OSGi/catalog improvements
Date Wed, 09 Jul 2014 15:46:44 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/47#discussion_r14717352
  
    --- Diff: core/src/main/java/brooklyn/management/ha/OsgiManager.java ---
    @@ -102,4 +107,24 @@ public void registerBundle(String bundleUrl) {
             return Maybe.absent("Unable to resolve class "+type+": "+bundleProblems);
         }
     
    +    public URL getResource(String name, Iterable<String> bundleUrlsOrNameVersionString)
{
    +        for (String bundleUrlOrNameVersionString: bundleUrlsOrNameVersionString) {
    +            try {
    +                String bundleNameVersion = bundleUrlToNameVersionString.get(bundleUrlOrNameVersionString);
    +                if (bundleNameVersion==null) {
    +                    bundleNameVersion = bundleUrlOrNameVersionString;
    +                }
    +                
    +                Maybe<Bundle> bundle = Osgis.getBundle(framework, bundleNameVersion);
    +                if (bundle.isPresent()) {
    +                    URL result = bundle.get().getResource(name);
    +                    if (result!=null) return result;
    +                }
    +            } catch (Throwable e) {
    --- End diff --
    
    Can we catch `Exception` instead of `Throwable`? Makes no behavioural difference, but
is better practice where possible.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message