Le 13/10/2010 13:33, Christian Thalinger a écrit : > I'm trying to do a conversion in a testcase for a feature I'm working > on: > > MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, "i2b", > MethodType.methodType(byte.class, int.class)); > MethodHandle mh2 = MethodHandles.convertArguments(mh1, > MethodType.methodType(byte.class, byte.class)); > > But it fails with this exception: > > Exception in thread "main" java.lang.IllegalArgumentException: bad > adapter (conversion=0x00000100): type mismatch: returning a int, but > caller expects byte > > I'm not very used to all this argument conversion stuff, so my > question is can I do a conversion like this? Is the exception correct > and excepted to be thrown or is this a bug in the RI? > > -- Christian >
It's a bug in the RI, but the EG decide not too long ago that conversions with loss, here, int -> byte is allowed. Rémi _______________________________________________ mlvm-dev mailing list [email protected] http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
