MethodType and void as parameter type

Rémi Forax forax at univ-mlv.fr
Fri May 14 03:01:11 PDT 2010


Hi all,
trying to reproduce a bug in insertArguments,
I have found another one in MethodType.

The spec doesn't allow to use void.class as parameter type in MethodType
but the RI throws a NPE.

import java.dyn.MethodType;

public class MethodTypeBug {
   public static void main(String[] args) {
     MethodType.methodType(void.class, void.class);
   }
}


Exception in thread "main" java.lang.NullPointerException
     at java.dyn.MethodType.toString(MethodType.java:540)
     at java.lang.String.valueOf(String.java:2893)
     at java.lang.StringBuilder.append(StringBuilder.java:128)
     at java.dyn.MethodType.checkPtypes(MethodType.java:100)
     at java.dyn.MethodType.<init>(MethodType.java:88)
     at java.dyn.MethodType.makeImpl(MethodType.java:200)
     at java.dyn.MethodType.methodType(MethodType.java:168)
     at MethodTypeBug.main(MethodTypeBug.java:5)

Rémi


More information about the mlvm-dev mailing list