Static fields in specialized classes

David Chase david.r.chase at oracle.com
Mon Oct 13 18:26:26 UTC 2014


On 2014-10-13, at 2:19 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> Consider:
> 
> class Foo<any T> {
>    public final static int x = System.currentTimeMillis();
> }
> 
> Regardless of whether our implementation is by specialization or erasure (or both), logically there is just *one* field 'x' for any instantiation Foo<T>.

How sure are you that this is true?  What if the type of static final x happens to be “T”? (nonsensical when erased, but not when reified)

David



More information about the valhalla-dev mailing list