Fwd: [jvm-l] Newly introduced OpenJDK javac bug?

Rémi Forax forax at univ-mlv.fr
Thu Jun 9 08:23:13 PDT 2011

On 06/09/2011 04:36 PM, Charles Oliver Nutter wrote:
> I accept this analysis as written. I do however have a few 
> questions/comments.
> * This seems like it only affects cases where you have primitives 
> butting up against a varargs Object..., correct? Only in those cases 
> do you have a method invocation conversion from a type that does not 
> subclass Object. Edge-casey.
> * It is unexpected, albeit correct according to specification. A few 
> reasons:
> ** The int => Object conversion is via Integer, which *is* a subtype 
> relationship. I know the spec does not provide for reevaluating 
> specificity after a method invocation conversion...but perhaps it should.

int => Object is a not a subtyping conversion, remember that
subtype as defined by Liskov is a relation between objects.
int is not an object type in Java.

> ** int *is* more specific than Object from a programmer/development 
> perspective. Another way of looking at specificity would be "fewer 
> combinations of argument types apply". That's clearly the case here.

more specific means is the a most specific subtype, so int is not more 
specific than Object here
because there is not subtype/supertype relation between int and Object 
in Java.

> I suspect I won't be the only one to run into this new behavior. As it 
> stands, the methods in question in JRuby no longer need the varargs 
> forms, so I'm removing them.
> - Charlie


More information about the compiler-dev mailing list