Fix findbugs high priority warning VmwareStorageManagerImpl.java:1023, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE, Priority: High Redundant nullcheck of datastoreVolumePath, which is known to be non-null in com.cloud.hypervisor.vmware.manager.VmwareStorageManagerImpl.getVolumePathInDatastore(DatastoreMO, String)

Assertion is not used in runtime, correct way is throw and handle exception without killing app

Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #362
This commit is contained in:
Rafael da Fonseca 2015-06-07 11:38:04 +02:00 committed by Daan Hoogland
parent 9bac84a3f7
commit e8c7069f73
1 changed files with 0 additions and 1 deletions

View File

@ -1019,7 +1019,6 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
private String getVolumePathInDatastore(DatastoreMO dsMo, String volumeFileName) throws Exception {
String datastoreVolumePath = dsMo.searchFileInSubFolders(volumeFileName, true);
assert (datastoreVolumePath != null) : "Virtual disk file missing from datastore.";
if (datastoreVolumePath == null) {
throw new CloudRuntimeException("Unable to find file " + volumeFileName + " in datastore " + dsMo.getName());
}