javac 8/9 inconsistency

Anna Kozlova anna.kozlova at
Wed Feb 18 13:15:24 UTC 2015

Thanks, I’ve saw the issue but was not sure if this sample is covered.
Is it possible to make javac print what bounds it has inferred, what constraints it has processed? 
From: Maurizio Cimadamore [mailto:maurizio.cimadamore at] 
Sent: Wednesday, February 18, 2015 2:03 PM
To: Anna Kozlova; compiler-dev at
Subject: Re: javac 8/9 inconsistency
Hi Anna,
this is an issue we know about; this is the master bug we use to keep track of such issues:

We did a bit of back and forth on this and as a result there is a difference between JDK 8 and JDK 9. The end result will be that this code will compile on both, but the fix used in 8 will be (very) different form the one we'll do in 9.

On 18/02/15 11:29, Anna Kozlova wrote:
abstract class FooBoo {
        map((Class<? extends Annotation> ann) -> getAnnotation(ann)); //error
        map(this::getAnnotation);                                     //error

    abstract <A> A getAnnotation(Class<A> annotationClass);
    abstract <R> void map(Function<Class<? extends Annotation>, ? extends R> mapper);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list