findbugs volumeInfo is known to not be null

Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #515
This commit is contained in:
Daan Hoogland 2015-06-23 22:39:51 +02:00
parent e8984d16ed
commit 8a99df77b6

View File

@ -235,8 +235,8 @@ public class ElastistorPrimaryDataStoreDriver extends CloudStackPrimaryDataStore
long usedBytes = storagePool.getUsedBytes();
long capacityIops = storagePool.getCapacityIops();
usedBytes -= volumeInfo != null ? volumeInfo.getSize() : 0;
capacityIops += volumeInfo != null ? volumeInfo.getMaxIops() : 0;
usedBytes -= volumeInfo.getSize();
capacityIops += volumeInfo.getMaxIops();
storagePool.setUsedBytes(usedBytes < 0 ? 0 : usedBytes);
storagePool.setCapacityIops(capacityIops < 0 ? 0 : capacityIops);