MethodHandles.adaptArguments() is too complex

Rémi Forax forax at univ-mlv.fr
Wed Oct 1 17:05:00 PDT 2008


After several reading, I'm sorry but i'am not able to fully understand 
how to forge the 'arguments' :)
It's perhaps beacuse it's currently late in the evening in Paris but
i think the idea to use a method handle to convert arguments (all or some)
(as we discuss with blackdrag during the summit) is better.

I prefer to use composition than relying on a list of specific use cases.
So i propose a method like that:

static
MethodHandle adaptArguments(MethodHandle mh, MethodHandle converter, int 
pos);
with converter.type -> Object(int)
        mh.type -> boolean(int,int)
and mh2=adaptArguments(mh,converter,0)
then
  mh2.type -> boolean(Object,int)

the converter type is always a method type that take an argument and 
return an argument.

By the way, currently all method adapt* aren't public ?

cheers,
Rémi



More information about the mlvm-dev mailing list