[ 
https://issues.apache.org/jira/browse/JCLOUDS-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14060539#comment-14060539
 ] 

Werner Buck commented on JCLOUDS-625:
-------------------------------------

Pull request is at https://github.com/jclouds/jclouds/pull/437

> VolumeBuilder does not allow null id while VolumeImpl allows it to be nullable
> ------------------------------------------------------------------------------
>
>                 Key: JCLOUDS-625
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-625
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-core
>    Affects Versions: 1.8.0
>            Reporter: Werner Buck
>            Priority: Trivial
>              Labels: builder, volumes
>             Fix For: 1.8.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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
> I
> https://github.com/jclouds/jclouds/blob/4c74b497547e42b8bdc94dbae3d4cd94ff3945d6/compute/src/main/java/org/jclouds/compute/domain/VolumeBuilder.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



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to