OK, so that should be
if(snapshotInfoReturn==null){
throw new ResourceAllocationException("Take snapshot for VolumeId:
"
+ volumeId + " failed.", ResourceType.snapshot);
}
So I get null - I should raise an exception.
Alex Hitchins | 07788 423 969 | 01892 523 587
---------------------------------------------
-----Original Message-----
From: Daan Hoogland [mailto:[email protected]]
Sent: 11 April 2014 18:33
To: dev
Cc: Alex Hitchins; Edison Su; Laszlo Hornyak
Subject: Re: Review Request 19616: Added check for null return.
On Fri, Apr 11, 2014 at 9:50 AM, Alex Hitchins <[email protected]>
wrote:
>
> if(snapshotInfoReturn.equals(null)){
> throw new ResourceAllocationException("Take snapshot for VolumeId:
"
> + volumeId + " failed.", ResourceType.snapshot);
> }
This will never throw a ResourceAllocationException. It will throw a
NullPointerException or pass, as you call a method on an Object to see if it
is null (no object).
--
Daan