On Sep 5, 2014, at 10:23 AM, Vladimir Ivanov <vladimir.x.iva...@oracle.com> 
wrote:

> http://cr.openjdk.java.net/~vlivanov/8057656/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8057656
> 

 854         if (!canConvert(returnType(), newType.returnType()))
 855             return false;
 856         Class<?>[] srcTypes = newType.ptypes;
 857         Class<?>[] dstTypes = ptypes;

Are the src and dst the wrong way around?

   srcTypes = ptypes
   dstTypes = newType.ptypes


 896     private static boolean canCast(Class<?> src, Class<?> dst) {
 897         if (src.isPrimitive() && !dst.isPrimitive()) {
 898             if (dst == Object.class || dst.isInterface())  return true;

How come if the src is primitive and the dst is an interface it returns true 
for any interface? I guess there are subtly different rules here for casting 
and conversion.

Paul.

> There are some corner cases which MT.isCastableTo() & MT.isConvertibleTo() 
> don't treat right (e.g. int->String converstion of return type in 
> MT.isCastableTo()).
> 
> Testing: jdk/java/lang/invoke, jdk/java/util/streams, nashorn, octane w/ "-ea 
> -esa" and COMPILE_THRESHOLD={0,30}.
> 
> Reviewed-by: vlivanov, ?
> Contributed-by: john.r.r...@oracle.com
> 
> Thanks!
> 
> 
> Best regards,
> Vladimir Ivanov

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to