ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Beerbower (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AMBARI-4541) NPE for View instance with no properties.
Date Thu, 06 Feb 2014 00:40:09 GMT
Tom Beerbower created AMBARI-4541:
-------------------------------------

             Summary: NPE for View instance with no properties.
                 Key: AMBARI-4541
                 URL: https://issues.apache.org/jira/browse/AMBARI-4541
             Project: Ambari
          Issue Type: Bug
            Reporter: Tom Beerbower
            Assignee: Tom Beerbower


The method getProperties()  of the class org.apache.ambari.server.view.configuration.InstanceConfig
returns null if no properties are specified for a view instance.  For example ...

{code}
<view>
  <name>SOME_VIEW</name>
  <label>Some View</label>
  <version>1.0.0</version>
  <resource>
    <name>someresource</name>
    <plural-name>someresources</plural-name>
    <id-property>id</id-property>
    <resource-class>org.apache.ambari.view.SomeResource</resource-class>
    <provider-class>org.apache.ambari.view.SomeResourceProvider</provider-class>
    <service-class>org.apache.ambari.view.SomeService</service-class>
  </resource>
  <instance>
    <name>INSTANCE1</name>
  </instance>
</view>
{code}

Any code consuming the instance configuration will likely NPE.
Better to return an empty list.





--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message