mirror of
https://github.com/apache/jclouds.git
synced 2025-02-16 15:08:28 +00:00
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")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Future<Set<? extends Reservation<? extends RunningInstance>>> apply(String from) {
|
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));
|
return castToSpecificTypedFuture(client.getInstanceServices().describeInstancesInRegion(from));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +105,6 @@ public class EC2ListNodesStrategy implements ListNodesStrategy {
|
|||||||
return concat(concat(reservations));
|
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")
|
@SuppressWarnings("unchecked")
|
||||||
private static <T> Future<T> castToSpecificTypedFuture(Future<? extends T> input) {
|
private static <T> Future<T> castToSpecificTypedFuture(Future<? extends T> input) {
|
||||||
return (Future<T>) input;
|
return (Future<T>) input;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user