diamond operator & implementation strategies (v3)

Rémi Forax forax at univ-mlv.fr
Sat Aug 22 14:32:22 PDT 2009


Le 21/08/2009 20:07, Maurizio Cimadamore a écrit :
> Hi
>    

Hi Maurizio,

[...]

> On the other hand there are situations in which the complex approach
> infers a type which is too specific and is thus incompatible with the
> LHS. Because of that, the amount of failures in the complex approach is
> slightly higher. Consider the following sample snippet (extracted from
> OpenJDK):
>
> from Snapshot.java
>
>      private SoftReference<Vector>  finalizablesCache;
>
>      [...]
>
>      Vector<JavaHeapObject>  finalizables = new Vector<JavaHeapObject>();
>
>      [...]
>
>      finalizablesCache = new SoftReference<Vector>(finalizables); //would
> work with basic but not with complex
>
>      [...]
>
>
> As a final notice, it can be seen that collection classes are the
> 'killer app' for the diamond operator. Moreover the amount of raw
> constructor calls where the target type is a raw collection is
> relatively high across all benchmarks [7] (the 'most generified source'
> award goes to NetBeans).
>    


Just a question, is there code that fails with the complex inference 
algorithm
that doesn't involve raw type/rare type ?

[...]

> Maurizio
>    

Rémi



More information about the coin-dev mailing list