playframework/Play20 — pull request #307 by jroper (2012-05-13 20:20:04+00:00)
Title: Modified Java waitAll promise generics to work with promises of different sub types

This change makes waiting on multiple promises with a common super type possible, without the boiler plate of casting to a ungenerified type. For example:

public interface Fruit {}
public class Apple implements Fruit {}
public class Orange implements Fruit {}
...
Promise apple = ...;
Promise orange = ...;
Promise> fruits = Promise.waitAll(apple, orange);

The above code would be a compiler error without the change in this pull request, with the change, it is a compiler warning, but because of the limitations of Java generics, the only way to achieve it without a compiler warning is to map each promise to be a promise of type Ingredient, which is overkill.