cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject [32/50] [abbrv] git commit: updated refs/heads/disk_io_throttling to 691bc9d
Date Tue, 18 Jun 2013 07:58:32 GMT
NPE fix

- fixes an NPE in case the pool.scope = null
- replaces null checks around toString with ObjectUtils.toString call

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/202cd152
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/202cd152
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/202cd152

Branch: refs/heads/disk_io_throttling
Commit: 202cd1529054fe60acce0cce54686268797b65bd
Parents: c88d8fb
Author: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Authored: Sun Jun 16 10:42:17 2013 +0200
Committer: Chip Childers <chip.childers@gmail.com>
Committed: Mon Jun 17 19:19:43 2013 +0100

----------------------------------------------------------------------
 .../com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/202cd152/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
index 6d0cde1..f2b9525 100644
--- a/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
@@ -25,6 +25,7 @@ import javax.inject.Inject;
 import com.cloud.capacity.Capacity;
 import org.apache.cloudstack.api.response.StoragePoolResponse;
 import org.apache.cloudstack.engine.subsystem.api.storage.ScopeType;
+import org.apache.commons.lang.ObjectUtils;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -79,17 +80,12 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO,
Lo
         poolResponse.setZoneId(pool.getZoneUuid());
         poolResponse.setZoneName(pool.getZoneName());
         poolResponse.setZoneType(pool.getZoneType());
-        if (pool.getPoolType() != null) {
-            poolResponse.setType(pool.getPoolType().toString());
-        }
+        poolResponse.setType(ObjectUtils.toString(pool.getPoolType(), null));
         poolResponse.setPodId(pool.getPodUuid());
         poolResponse.setPodName(pool.getPodName());
         poolResponse.setCreated(pool.getCreated());
-        poolResponse.setScope(pool.getScope().toString());
-        if (pool.getHypervisor() != null) {
-            poolResponse.setHypervisor(pool.getHypervisor().toString());
-        }
-
+        poolResponse.setScope(ObjectUtils.toString(pool.getScope(), null));
+        poolResponse.setHypervisor(ObjectUtils.toString(pool.getHypervisor(), null));
 
         long allocatedSize = pool.getUsedCapacity() +  pool.getReservedCapacity();
         poolResponse.setDiskSizeTotal(pool.getCapacityBytes());


Mime
View raw message