array.clone() doesn't work
Remi Forax
forax at univ-mlv.fr
Tue Oct 16 06:01:08 PDT 2012
Tracking a bug in the backport, I've discovered that I forget to have a
special case for Object[].clone(),
the backport currently reports that the method is protected
(Object.clone is protected) thus not accessible.
The latest jdk8 binary also have some trouble with array.clone too.
public class JDKBug {
public static void main(String[] args) throws Throwable {
MethodHandles.lookup().findVirtual(Object[].class, "clone",
MethodType.methodType(Object.class));
}
}
Exception in thread "main" java.lang.InternalError
at java.lang.invoke.MethodHandle.viewAsType(MethodHandle.java:1254)
at
java.lang.invoke.MethodHandles$Lookup.restrictReceiver(MethodHandles.java:1194)
at
java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:1214)
at
java.lang.invoke.MethodHandles$Lookup.getDirectMethod(MethodHandles.java:1198)
at
java.lang.invoke.MethodHandles$Lookup.findVirtual(MethodHandles.java:654)
at fr.umlv.megamorph.JDKBug.main(JDKBug.java:9)
cheers,
Rémi
More information about the mlvm-dev
mailing list