Bug in MethodHandles.convertArguments

Rémi Forax forax at univ-mlv.fr
Tue May 11 18:09:06 PDT 2010


Le 12/05/2010 02:20, John Rose a écrit :
> On May 11, 2010, at 4:49 PM, Rémi Forax wrote:
>
>    
>> I only use jdk7 binaries and I haven't found the time to test
>> with the mlvm repository.
>>      
>
> OK.  I'm about to promote some new code to JDK7 and I would like to know ASAP if it breaks or fixes your code.  Can you send me a JAR file to run as a test?
>    

I am not ready to send a jar :)
But the following code is a good test:

command line:
java -server -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic 
-cp classes ConvertBug

public class ConvertBug {
   public static Object foo(Object o1, Object o2) {
     return null;
   }

   public static void main(String[] args) {
     MethodHandle mh = 
MethodHandles.lookup().findStatic(ConvertBug.class, "foo",
         MethodType.methodType( Object.class, Object.class, Object.class));
     mh = MethodHandles.convertArguments(mh,
         MethodType.methodType(Object.class, int.class, Object.class));
     System.out.println("print mh "+mh);
   }
}

> -- John
>    

Rémi
PS: it's 3am here, it's time to find my bed.



More information about the mlvm-dev mailing list