Regression in JDK8 build 78: javac complains about missing Class#isAnnotationPresent
Uwe Schindler
uschindler at apache.org
Fri Mar 22 16:14:55 PDT 2013
Hi Joe, hi Jonathan,
I installed JDK 8 b82 on our Jenkins machine, the Lucene source code compiles again (and still does after reverting the temporary change "isAnnotationPresent() -> getAnnotation() != null" in our code base).
Thanks for fixing,
Uwe
-----
Uwe Schindler
uschindler at apache.org
Apache Lucene PMC Member / Committer
Bremen, Germany
http://lucene.apache.org/
> -----Original Message-----
> From: Jonathan Gibbons [mailto:jonathan.gibbons at oracle.com]
> Sent: Friday, March 01, 2013 1:04 AM
> To: Uwe Schindler
> Cc: 'Maurizio Cimadamore'; compiler-dev at openjdk.java.net; lambda-
> dev at openjdk.java.net; Robert Muir
> Subject: Re: Regression in JDK8 build 78: javac complains about missing
> Class#isAnnotationPresent
>
> Uwe,
>
> I think you have a good point here.
>
> This is not so much a compiler issue as a compatibility issue regarding changes
> to an API.
>
> The problem in this case is that the impl of a method was *moved* to being a
> default method on an interface. A safer, more compatible solution would
> have been to have added the method to the interface but not delete it from
> its original location.
>
> -- Jon
>
>
> On 02/28/2013 02:36 PM, Uwe Schindler wrote:
> > Thanks Maurizio,
> >
> >
> >
> > that’s true, somebody added the –Xlint:-options tot he ANT build file.
> >
> >
> >
> > This is still no answer to the source of the problem, making again a new
> Oracle Java version unusable to compile millions of open source projects
> (Lucene is just an example) – this status quo seems to repeat on every new
> major version. Last time it was the serious Hotspot bug corrumpting loops in
> Java7 GA. Every public Java project has somewhere in their build file “-target
> 1.6 -source 1.6” (or another older version), because otherwise you cannot
> run the generated class files with older Java versions. Compiling with a
> custom bootclasspath is a good idea to *validate* that your code actually is
> compliant. But if you need to use the bootclasspath, you need to have the
> older JDK version installed - in that case you could compile with it, too.
> >
> >
> >
> > The intention here is to just “test” the class files with newer JDK versions
> which is now impossible, without hacking the whole build in an incompatible
> way. If this is not fixed, we will suggest to users, not to upgrade to JDK8 once
> it is out – because we cannot test the class files with JDK 8 (and we have
> already seen lots of hotspot issues making Apache Lucene crash/fail). The
> same procedure as every year – ahm Java version.
> >
> >
> >
> > Of course to produce Java 6 class file format, one could use only “-target
> 1.6” and don’t pass “-source 1.6” (so let it default to 1.8), but this does not
> help if you build your project with Apache Ant (maybe doesn’t help with
> Maven, too):
> >
> >
> >
> > [javac] Compiling 113 source files to C:\Users\Uwe
> > Schindler\Projects\lucene\trunk-lusolr3\lucene\build\test-framework\cl
> > asses\java
> >
> > [javac]
> >
> > [javac] WARNING
> >
> > [javac]
> >
> > [javac] The -source switch defaults to 1.8 in JDK 1.8.
> >
> > [javac] If you specify -target 1.6 you now must also specify -source 1.6.
> >
> > [javac] Ant will implicitly add -source 1.6 for you. Please change your
> build file.
> >
> >
> >
> > So you no longer have the chance to produce javac 1.6 compliant class files
> without bootclasspath (using common build tools like Apache ANT). This
> makes JDK8 unusable.
> >
> >
> >
> > Sorry for complaining,
> >
> > But that’s a major regression!
> >
> >
> >
> > Uwe
> >
> >
> >
> > -----
> >
> > Uwe Schindler
> >
> > uschindler at apache.org
> >
> > Apache Lucene PMC Member / Committer
> >
> > Bremen, Germany
> >
> > http://lucene.apache.org/
> >
> >
> >
> > From: Maurizio Cimadamore [mailto:maurizio.cimadamore at oracle.com]
> > Sent: Thursday, February 28, 2013 11:15 PM
> > To: Uwe Schindler
> > Cc: 'Joe Darcy'; lambda-dev at openjdk.java.net;
> > compiler-dev at openjdk.java.net
> > Subject: Re: Regression in JDK8 build 78: javac complains about
> > missing Class#isAnnotationPresent
> >
> >
> >
> > On 28/02/13 21:31, Uwe Schindler wrote:
> >
> > I know about this warning and it generally appears on Java 7, but it was
> *not* printed out in that case (8b78)! The log I posted was the complete
> printout from javac.
> >
> > This warning is a Xlint warning - so it's possible that you are compiling the
> project with a custom set of Xlint warnings that doesn't include this category
> (called 'options').
> >
> > Maurizio
> >
> >
More information about the lambda-dev
mailing list