mirror of https://github.com/apache/jclouds.git
Updated explanation of a potentially unexpected cast to refer to the JDK bug that necessitates it
This commit is contained in:
parent
0ac7ee69ab
commit
d3ab85918e
|
@ -96,6 +96,7 @@ public class EC2ListNodesStrategy implements ListNodesStrategy {
|
|||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Future<Set<? extends Reservation<? extends RunningInstance>>> apply(String from) {
|
||||
// see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7126754
|
||||
return castToSpecificTypedFuture(client.getInstanceServices().describeInstancesInRegion(from));
|
||||
}
|
||||
|
||||
|
@ -104,7 +105,6 @@ public class EC2ListNodesStrategy implements ListNodesStrategy {
|
|||
return concat(concat(reservations));
|
||||
}
|
||||
|
||||
// "hide" this cast (i.e. do not perform inline) from the Java 7 compiler - see http://stackoverflow.com/questions/8637937/why-does-a-generic-cast-of-a-list-extends-set-to-listset-succeed-on-sun
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T> Future<T> castToSpecificTypedFuture(Future<? extends T> input) {
|
||||
return (Future<T>) input;
|
||||
|
|
Loading…
Reference in New Issue