mirror of https://github.com/apache/cloudstack.git
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:
parent
9bac84a3f7
commit
e8c7069f73
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue