incubator-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] [Commented] (AMBARI-1480) Comparison predicate should account for null values.
Date Mon, 25 Feb 2013 15:42:12 GMT

    [ https://issues.apache.org/jira/browse/AMBARI-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13585934#comment-13585934
] 

Tom Beerbower commented on AMBARI-1480:
---------------------------------------

Only the equals comparison predicate should allow for nulls. The others should assert value!=null
in the constructor.
                
> Comparison predicate should account for null values.
> ----------------------------------------------------
>
>                 Key: AMBARI-1480
>                 URL: https://issues.apache.org/jira/browse/AMBARI-1480
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: Tom Beerbower
>            Assignee: Tom Beerbower
>             Fix For: 1.3.0
>
>         Attachments: AMBARI-1480.patch
>
>
> ComparisonPredicate does not allow for null values so we will end up with the following
if the predicate is created with a null ...
> {code}
> SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP
container
> java.lang.NullPointerException
> at org.apache.ambari.server.controller.predicate.ComparisonPredicate.compareValueTo(ComparisonPredicate.java:96)
> at org.apache.ambari.server.controller.predicate.EqualsPredicate.evaluate(EqualsPredicate.java:35)
> at org.apache.ambari.server.controller.predicate.AndPredicate.evaluate(AndPredicate.java:68)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceIterator.getNextResource(ClusterControllerImpl.java:472)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceIterator.<init>(ClusterControllerImpl.java:434)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceIterator.<init>(ClusterControllerImpl.java:405)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceIterable.iterator(ClusterControllerImpl.java:398)
> at org.apache.ambari.server.api.query.QueryImpl.execute(QueryImpl.java:139)
> at org.apache.ambari.server.api.handlers.ReadHandler.handleRequest(ReadHandler.java:61)
> at org.apache.ambari.server.api.services.BaseService.handleRequest(BaseService.java:68)
> at org.apache.ambari.server.api.services.HostComponentService.getHostComponents(HostComponentService.java:91)
> {code}
> The API may support "isNull(property)" in the future so the underlying predicates should
be made to allow for nulls.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message