I agree that there can be confusion with aliasing imports, but like any language feature, used with diligence it can work well. I hoped that the example I cited was illustrative of that.

I certainly prefer aliasing types over polluting their name globally. There's a balance if course, and if you found yourself constantly aliasing a type then perhaps that's a problem. I'm unconvinced that is the case here though.

Sent from my iPhone

> On 11 Nov 2013, at 11:51 pm, James Roper <notifications@github.com> wrote:
> 
> In documentation/manual/javaGuide/main/ws/code/javaguide/ws/JavaWS.java:
> 
> >              // #get-call
> >              // #get-call-and-recover
> > -            Promise<WS.Response> callWithRecover = homePage.recover(new Function<Throwable, WS.Response>() {
> > +            Promise<WSResponse> callWithRecover = homePage.recover(new Function<Throwable, WSResponse>() {
> >                  @Override
> I think aliasing imports is a nice feature for dealing with conflicts, but otherwise they introduce confusion because in order to know what type something is, you need to first scroll to the top of the file to see the imports, and when looking at API docs or other code samples etc you need to mentally transpose the names in the documentation to what your alias is. Hence, our preference should be to avoid situations where you need to alias imports, not create situations where you need to alias imports. Since we control both APIs here, we can easily avoid it.
> 
> —
> Reply to this email directly or view it on GitHub.