function types syntax

Alex Buckley Alex.Buckley at Sun.COM
Wed Jan 6 13:57:30 PST 2010


Osvaldo Doederlein wrote:
> You mean, like we fixed the 5% of important generics issues (e.g.
> warning-free new X<T>[]) in JDK 6? Oh, no we didn't; like we are fixing them
> now in JDK 7? Nope... perhaps in JDK 8? Some release before I retire?...

new X<T>[] gives a warning because X<T> is not a reifiable type (JLS3 
4.7) unless T is an unbounded wildcard, which I'll assume it isn't. The 
warning is therefore necessary to indicate possible heap pollution (JLS3 
4.12.2.1). The warning can only be removed if the possibility of heap 
pollution is removed, which in turn requires reified generics (which 
really just moves the problem) or an astoundingly clever dataflow 
analysis. So as irritating as the warnings are, the fix is not a minor 
last-5%-of-the-work tidying-up issue.

Alex


More information about the lambda-dev mailing list