Access Modifier Issues

Brian Goetz brian.goetz at
Fri Jan 9 16:30:18 UTC 2015

Just to be 100% clear, the "load a class with a funny Foo${T=I} name" is 
exclusively a temporary prototyping hack.  (I wish I didn't have to say 
this, but I do; a few months ago, some "journalist" saw the first SotS 
draft and then reported "Java developers will trigger primitive 
specialization by adding ${T=I} to their class names".  No joke.)

>> Hm, currently there seem to be two ways of triggering specialization.
>> First way is by referencing classes with specialy-crafted names
>> (SomeClass${0=?}) and ClassLoader then contains a hook to dispatch to
>> the specialization logic. The second is used for invoking specialized
>> generic methods, which works with invokedynamic and bootstrap methods.
>> Would theoretically be possible to replace the 1st way (special class
>> names) with the invokedynamic too? Would it be practical? Would it
>> solve access problems?
> The current plan is to use a new mechanism called classdynamic for that
> purpose (this has come up before in this mailing list). I think,
> regardless on which plumbing you use to emit the generated class (either
> funky name + Loader changes, or classdyn), if the specialized class is a
> brand new class which is completely detached from the class it comes
> from, then access (w/o extra accessors) will always be problematic.

More information about the valhalla-dev mailing list