From b391c9f0cbe2b07a475c048c07db728b35f44990 Mon Sep 17 00:00:00 2001 From: John Flavin Date: Mon, 30 Jan 2017 10:26:07 -0600 Subject: [PATCH 1/2] 603 Only copy volumes if non-null --- .../java/com/spotify/docker/client/messages/VolumeList.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/spotify/docker/client/messages/VolumeList.java b/src/main/java/com/spotify/docker/client/messages/VolumeList.java index de7ca7785..acc43db6e 100644 --- a/src/main/java/com/spotify/docker/client/messages/VolumeList.java +++ b/src/main/java/com/spotify/docker/client/messages/VolumeList.java @@ -47,8 +47,10 @@ public abstract class VolumeList { static VolumeList create( @JsonProperty("Volumes") final List volumes, @JsonProperty("Warnings") final List warnings) { + final ImmutableList volumesCopy = volumes == null + ? null : ImmutableList.copyOf(volumes); final ImmutableList warningsCopy = warnings == null ? null : ImmutableList.copyOf(warnings); - return new AutoValue_VolumeList(ImmutableList.copyOf(volumes), warningsCopy); + return new AutoValue_VolumeList(volumesCopy, warningsCopy); } } From bad09521a1b00f2652fdb00444f58d8c3d0d5d2f Mon Sep 17 00:00:00 2001 From: John Flavin Date: Tue, 31 Jan 2017 11:25:18 -0600 Subject: [PATCH 2/2] Mark volumes as @Nullable --- src/main/java/com/spotify/docker/client/messages/VolumeList.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/spotify/docker/client/messages/VolumeList.java b/src/main/java/com/spotify/docker/client/messages/VolumeList.java index acc43db6e..9063f6e6b 100644 --- a/src/main/java/com/spotify/docker/client/messages/VolumeList.java +++ b/src/main/java/com/spotify/docker/client/messages/VolumeList.java @@ -36,6 +36,7 @@ @JsonAutoDetect(fieldVisibility = ANY, getterVisibility = NONE, setterVisibility = NONE) public abstract class VolumeList { + @Nullable @JsonProperty("Volumes") public abstract ImmutableList volumes();