cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gir...@apache.org
Subject [25/50] git commit: updated refs/heads/marvin to df58f51
Date Wed, 29 Jan 2014 08:54:00 GMT
findbugs: retrieve the objects to remove from the collection(s)

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

Branch: refs/heads/marvin
Commit: fe262caa7561c23098cc8fc9674ff8d0e59e1c25
Parents: d7ee7a7
Author: Daan Hoogland <dhoogland@schubergphilis.com>
Authored: Tue Jan 28 15:36:40 2014 +0100
Committer: Daan Hoogland <dhoogland@schubergphilis.com>
Committed: Tue Jan 28 15:36:40 2014 +0100

----------------------------------------------------------------------
 .../deploy/DeploymentPlanningManagerImpl.java   | 23 ++++++++++++--------
 1 file changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fe262caa/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index ec20067..35a0b39 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -165,7 +165,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
     }
 
     public void setStoragePoolAllocators(List<StoragePoolAllocator> storagePoolAllocators)
{
-        this._storagePoolAllocators = storagePoolAllocators;
+        _storagePoolAllocators = storagePoolAllocators;
     }
 
     protected List<HostAllocator> _hostAllocators;
@@ -175,7 +175,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
     }
 
     public void setHostAllocators(List<HostAllocator> hostAllocators) {
-        this._hostAllocators = hostAllocators;
+        _hostAllocators = hostAllocators;
     }
 
     @Inject
@@ -221,7 +221,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
     }
 
     public void setPlanners(List<DeploymentPlanner> planners) {
-        this._planners = planners;
+        _planners = planners;
     }
 
     protected List<AffinityGroupProcessor> _affinityProcessors;
@@ -231,7 +231,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
     }
 
     public void setAffinityGroupProcessors(List<AffinityGroupProcessor> affinityProcessors)
{
-        this._affinityProcessors = affinityProcessors;
+        _affinityProcessors = affinityProcessors;
     }
 
     @Override
@@ -1142,9 +1142,9 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
                 List<StoragePool> suitablePools = new ArrayList<StoragePool>();
                 StoragePool pool = null;
                 if (toBeCreated.getPoolId() != null) {
-                    pool = (StoragePool)this.dataStoreMgr.getPrimaryDataStore(toBeCreated.getPoolId());
+                    pool = (StoragePool)dataStoreMgr.getPrimaryDataStore(toBeCreated.getPoolId());
                 } else {
-                    pool = (StoragePool)this.dataStoreMgr.getPrimaryDataStore(plan.getPoolId());
+                    pool = (StoragePool)dataStoreMgr.getPrimaryDataStore(plan.getPoolId());
                 }
 
                 if (!pool.isInMaintenance()) {
@@ -1156,7 +1156,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
                         if (plan.getDataCenterId() == exstPoolDcId && plan.getPodId()
== exstPoolPodId && plan.getClusterId() == exstPoolClusterId) {
                             canReusePool = true;
                         } else if (plan.getDataCenterId() == exstPoolDcId) {
-                            DataStore dataStore = this.dataStoreMgr.getPrimaryDataStore(pool.getId());
+                            DataStore dataStore = dataStoreMgr.getPrimaryDataStore(pool.getId());
                             if (dataStore != null && dataStore.getScope() != null
&& dataStore.getScope().getScopeType() == ScopeType.ZONE) {
                                 canReusePool = true;
                             }
@@ -1259,9 +1259,14 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
             }
         }
 
-        if (suitableVolumeStoragePools.values() != null) {
-            poolsToAvoidOutput.removeAll(suitableVolumeStoragePools.values());
+        HashSet<Long> toRemove = new HashSet<Long>();
+        for (List<StoragePool> lsp : suitableVolumeStoragePools.values()) {
+            for (StoragePool sp : lsp) {
+                toRemove.add(sp.getId());
+            }
         }
+        poolsToAvoidOutput.removeAll(toRemove);
+
         if (avoid.getPoolsToAvoid() != null) {
             avoid.getPoolsToAvoid().addAll(poolsToAvoidOutput);
         }


Mime
View raw message