> @@ -151,5 +160,22 @@ protected ServerInternal(String id, @Nullable String 
> name, java.util.Set<Link> l
>              super(id, name, links, uuid, tenantId, userId, updated, created, 
> hostId, accessIPv4, accessIPv6, status, image, flavor, keyName, configDrive, 
> addresses, metadata, extendedStatus, extendedAttributes, diskConfig);
>           }
>        }
> +
> +      public Server apply(ServerInternalWithoutImage in) {
> +         return in.toBuilder().build();
> +      }
> +
> +      private static class ServerInternalWithoutImage extends Server {

You're right, they are exactly the same. So I tried removing ServerInternal and 
had the following code.

    serverBase = apply((Server) context.deserialize(jsonElement, Server.class));

This caused a lovely StackOverflowError apparently because of the way the Gson 
deserializationContext works. I didn't bother digging to deep into it as it's 
the original code and not part of this change. I suspect the original author 
ran into the the StackOverflowError and ServerInternal was their way around it.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/414/files#r14152582

Reply via email to