cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daan Hoogland <>
Subject [DISCUSS]null pointer returned from daoimpl
Date Fri, 07 Feb 2014 10:30:59 GMT

in PrivateIpDaoImpl a null pointer is returned when no db object can be found:

    public PrivateIpVO allocateIpAddress(long dcId, long networkId,
String requestedIp) {
        PrivateIpVO  vo = lockOneRandomRow(sc, true);
        if (vo == null) {
            return null;
        return vo;

I would expect it to throw a ClodException of some sort and would like
to change it to that but recognize that the null pointer could be of
significance in cases. Is there a policy on how dao's should return

In my opinion a null should never be returned by a dao, at most a vo
containing a null but this seldom makes sense.


View raw message