Few java.dyn API and JavaDoc observations
forax at univ-mlv.fr
Sat Aug 1 04:01:55 PDT 2009
Le 01/08/2009 09:54, Attila Szegedi a écrit :
> Hi folks,
> few minor observations regarding JavaDoc and API for java.dyn:
> 1. Linkage.registerBootstrapMethod JavaDoc says "Register a bootstrap
> method to use when linking a given caller class. It must be a method
> handle of a type equivalent to CallSite.CallSite(java.lang.Object,
> java.lang.String, java.dyn.MethodType). " In reality, the first
> argument should be java.lang.Class instead.
Yes, this part of the doc is not up to date.
The doc of BOOTSTRAP_METHOD_TYPE is more accurate.
> 2. With regard to that, why is the first arg to CallSite ctor an
> Object, and not a Class?
Object => token to be used for invalidation.
> 3. CallSite.nameComponents() returns Object - why not String?
Personally, I don't like this method.
I think it has nothing to do with a CallSite
but It's more something that a MOP should provide.
Furthermore, it implied that CallSite have to store the name
of an invokedynamic call even if this name was already provided
to the user by the bootstrap method.
In my opinion, a CallSite should store neither the method name
nor the declaring class and if a developer wants this info,
it should provide a subclass of CallSite to store these info.
PS: I will try to answer to your mail about MOP this afternoon :)
More information about the mlvm-dev