Details
-
Bug
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
1.8.0
Description
I have been busy serializing Nodemetadata and all other Jclouds constructs and found that VolumeBuilder does a checkNotNull on id. However if .id("id") is not called it remains null for the VolumeImpl that is created when building.
It is a small issue, and the fix is to remove CheckNotNull at VolumeBuilder, which should not break anything.
While this is a really small bug, it means that during building of a volume, the user has to do a separate call and check if id is null before calling VolumeBuilder. The other Jclouds constructs Image/Hardware/NodeMetadata/Location/OperatingSystem can all be created in a single xxBuilder call.
Details:
See VolumeBuilder being used here without id with it not being supplied in many cases:
https://github.com/jclouds/jclouds/blob/4c74b497547e42b8bdc94dbae3d4cd94ff3945d6/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/functions/ServerToNodeMetadataTest.java
Then see VolumeImpl allowing a Nullable id:
https://github.com/jclouds/jclouds/blob/4c74b497547e42b8bdc94dbae3d4cd94ff3945d6/compute/src/main/java/org/jclouds/compute/domain/internal/VolumeImpl.java