Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-625

VolumeBuilder does not allow null id while VolumeImpl allows it to be nullable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.8.0
    • 1.8.0
    • jclouds-core

    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

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            wernerbu Werner Buck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified