cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhtyd <...@git.apache.org>
Subject [GitHub] cloudstack pull request: Bug-ID: CLOUDSTACK-8870: Skip external de...
Date Mon, 02 May 2016 10:25:17 GMT
Github user rhtyd commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/846#discussion_r61724005
  
    --- Diff: engine/schema/src/com/cloud/host/dao/HostDaoImpl.java ---
    @@ -1087,4 +1087,11 @@ public HostVO findByPublicIp(String publicIp) {
             sc.addAnd("dataCenterId", SearchCriteria.Op.EQ, zoneId);
             return customSearch(sc, null);
         }
    +
    +    @Override
    +    public List<HostVO> listByType(Host.Type type) {
    +        SearchCriteria<HostVO> sc = TypeSearch.create();
    +        sc.setParameters("type", type);
    +        return listBy(sc);
    --- End diff --
    
    the listByType consumers are not doing != null checks, we can fix it by doing it here
and returning a Collections.emptyList(); this way the methods ensures that no null is returned
    
    Please fix the NPE case, otherwise LGTM


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