cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburwell <...@git.apache.org>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-9095 : Hypervisor changes to s...
Date Fri, 04 Dec 2015 05:21:36 GMT
Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1142#discussion_r46650221
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
---
    @@ -1276,6 +1277,53 @@ public String toString() {
             }
         }
     
    +    public static class MetadataDef {
    +        Map<String, Object> customNodes = new HashMap<>();
    +
    +        public <T> T getMetadataNode(Class<T> fieldClass) {
    +            T field = (T) customNodes.get(fieldClass.getName());
    +            if (field == null) {
    +                try {
    +                    field = fieldClass.newInstance();
    +                    customNodes.put(field.getClass().getName(), field);
    +                } catch (InstantiationException e) {
    +                } catch (IllegalAccessException e) {
    --- End diff --
    
    Consolidate to multi-catch and log the exception details to ``DEBUG`` explaining why the
exceptions were ignored.


---
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