mirror of https://github.com/apache/jclouds.git
[issue 461] Replacing a static builder() call with an explicit Builder() creation to prevent and "ambiguous method" compilation error on OpenJDK, Java 7 and others. The compiler can't figure out which static builder() method is the correct one :-(
This commit is contained in:
parent
f7f81d6567
commit
e788f76411
|
@ -423,7 +423,15 @@ public class RestAnnotationProcessor<T> {
|
||||||
requestBuilder = GeneratedHttpRequest.Builder.<T> from(r);
|
requestBuilder = GeneratedHttpRequest.Builder.<T> from(r);
|
||||||
endpoint = r.getEndpoint();
|
endpoint = r.getEndpoint();
|
||||||
} else {
|
} else {
|
||||||
requestBuilder = GeneratedHttpRequest.<T> builder();
|
/*
|
||||||
|
* Can't use GeneratedHttpRequest.<T>builder() because the T is too
|
||||||
|
* general for the compiler to be able to distinguish between
|
||||||
|
* GeneratedHttpRequest.builder() and HttpMessage.builder() - the
|
||||||
|
* latter is available because GHR inherits from HM.
|
||||||
|
*
|
||||||
|
* See http://code.google.com/p/jclouds/issues/detail?id=461
|
||||||
|
*/
|
||||||
|
requestBuilder = new GeneratedHttpRequest.Builder<T>();
|
||||||
requestBuilder.method(getHttpMethodOrConstantOrThrowException(method));
|
requestBuilder.method(getHttpMethodOrConstantOrThrowException(method));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue