jclouds/jclouds — comment on commit fdb2cdf692997490d889938734b5cde85541e58e
File: core/src/main/java/org/jclouds/http/HttpMessage.java line 59
By demobox:

Surely this was dangerous? From the code the **only** type that can be returned is HttpMessage, so if the type parameter T is any _subtype_ of HttpMessage this will cause a ClassCastException. Since the builder can **only** return HttpMessage it would seem to make sense to declare it as such.

Making it appear as though subtypes of HttpMessage could be built would seem at best confusing and perhaps even dangerous. Subtypes of this Builder may of course be more flexible with the return type but could introduce the necessary type parameters then - see GeneratedHttpRequest.Builder: https://github.com/jclouds/jclouds/blob/issue-795/core/src/main/java/org/jclouds/rest/internal/GeneratedHttpRequest.java