linkedin/parseq — pull request #15 by cpettitt (2012-10-02 21:53:07+00:00)
Title: Add type coercion to Tasks.par(Task<?>...)

This change makes Tasks.par(Task...) match the functionality in
Tasks.seq(Task...). Specifically, we now return typed ParTask (not
wildcarded) based on what the consumer requests.

This change is not backward compatible for cases where the user
explicitly casts the result of Tasks.par(Task...) as in:

final ParTask par = (ParTask)par(task);

For code that makes this cast, remove the cast.

---

@brikis98 @chikit This change is not strictly backward compatible, but the cases where the cases where this breaks backwards compatibility should be rare (see above). The motivation for this change is my work on the wiki. I want to do:

```java
final ParTask contentTypes = Tasks.par(fetcher.getContentType(url1),
fetcher.getContentType(url2),
fetcher.getContentType(url3));
```

but with the current method declaration, I have to do:

```java
final List> urls = new ArrayList>();
urls.add(fetcher.getContentType(url1));
urls.add(fetcher.getContentType(url2));
urls.add(fetcher.getContentType(url3));

final ParTask contentTypes = Tasks.par(urls);
```

This change is compatible with the usage we have for Jim's project. What do you guys think?