You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ch...@apache.org on 2013/06/17 20:24:54 UTC
git commit: updated refs/heads/master to 202cd15
Updated Branches:
refs/heads/master c88d8fb3a -> 202cd1529
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 <la...@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/master
Commit: 202cd1529054fe60acce0cce54686268797b65bd
Parents: c88d8fb
Author: Laszlo Hornyak <la...@gmail.com>
Authored: Sun Jun 16 10:42:17 2013 +0200
Committer: Chip Childers <ch...@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());