Search

Categories

Links

Referers

b86 compiler fixes

May 25 2006, 01:39:46 AM PDT »Java»Compiler Comments [14]
In Mustang b86, these compiler (related) fixes will be included:

6362178: (JSR 269) APT creates MirroredTypeException eagerly, causing error for Class value() return type.
6391995: (javac) REGRESSION: removal of "rvalue conversion" causes problems
6392998: (javac) REGRESSION/CONFORMANCE: Mustang compiler throws AssertionError (beta2-b71 and higher)
6393539: (javac) CONFORMANCE: no compiler error if method in annotation type is override-equivalent to clone(), etc.
6397934: (javac) tools/javac/T6351767.java fails to get NPE
6399361: (javac) CONFORMANCE: @Override specification and compiler inconsistent
6403459: (javac) JavacProcessingEnvironment should know if parser errors occurred
6403468: (JSR 269) processors raising errors doesn't result in nonzero exit code
6420668: (JSR 269) AbstractProcessor should check initialization status before running methods
6425544: (javac) REGRESSION: NPE in com.sun.tools.javac.util.DefaultFileManager.java:272

Thanks to Brad, Joe, Jon, Scott, Tim, and Wei.

The build cycle is normally a week. However, due to JavaOne, build 85 (b85) was two weeks. Normally, my team only integrates on odd numbered builds but we made an exception with b86 to get more stuff included in beta 2.

Let me provide some details on the noteworthy changes. Joe has fixed a lot of problems with error handling during annotation processing in the compiler. For example, printing an error message will now result in a non-zero exit code from the compiler. Previously, there were situations where that might not happen. At the same time, he ensured that parser errors are fatal (no amount of annotation processing will fix a parser error). This should ease the job of enforcing extralinguistic constraints when using processors as compiler extensions.

As I described before JavaOne, there are some problems with @Override. These have been fixed by revising the specification and the compiler. You can now use @Override in more places.

Finally, I would like to mention that we have made a great improvement for cross-platform compatibility. Previously, all packages in rt.jar are visible at compile time. However, many of the packages in that file are Sun proprietary unsupported implementation details. Some come to mistakenly rely on this which can cause problems when upgrading from one version of Sun's JDK to another (as we don't make any guarantees). Also, it can cause problems when running on other vendors' platforms as they might not have these classes.

To address this problem, undocumented packages (that are new in Mustang) will not be visible at compile time. For example, while the package sun.reflect.misc is in rt.jar, javac will not be able to see it. Later we hope to emit warnings for packages that are undocumented but visible because of legacy from older releases. For example, the package sun.io will remain visible but use of it may lead to a warning.

To hide these packages, javac will not be reading rt.jar anymore. Instead it will read a symbol file (in some unsupported unspecified format: we are planning on adding a real module system in Dolphin). This symbol file idea was pioneered by Tom Ball to speed up compilation (and save memory). However, while this helps in scenarios like app servers, Jackpot, and NetBeans, it may not do much for regular batch compilations. Once we have done some profiling of the file manager in javac, I hope it will be much faster than the Tiger version.

Post a Comment:
Comments are closed for this entry.
Comments:

Hello,
Have anyone been assigned to solve this bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6420152
It lead to some serious UI issues in Netbeans 5.0 and 5.5:
http://www.netbeans.org/issues/show_bug.cgi?id=75955 Thanks

Posted by pcdinh on May 25, 2006 at 09:21 AM PDT #

pcdinh,
I don't think Peter would be response on this side of things. And btw, there is an easy workaround for this issue on NetBeans - they were just being slight reluctant to put it in yet.

Posted by Alex Lam on May 25, 2006 at 10:17 AM PDT #

Looking forward to the nice and new @Override and (hopefully finalised) JSR 269 for Jackpot.

Keep up the good work!

Posted by Alex Lam on May 25, 2006 at 10:19 AM PDT #

Nice! Great work guys. When is Beta 2 for mustang to be released? Is it in June?

Posted by Surya on May 25, 2006 at 01:38 PM PDT #

I can't speculate on release dates.

Posted by Peter von der Ahe on May 25, 2006 at 01:45 PM PDT #

Slides for the javaOne BOF on Enforcing Extralinguistic Constraints are available on rapt project on java.net if anyone is interested.

Posted by Bruce Chapman on May 25, 2006 at 06:37 PM PDT #

Thanks for your answer, Alex. I just downloaded the lastest build (85) and found that the bug fix was not incorporated yet. Wating for the next build. Thanks

Posted by pcdinh on May 26, 2006 at 09:07 AM PDT #

Been playing with Mustang b85 and JDeveloper. Works great except one showstopping bug I think. It is happening when I try to edit an xml, the whole IDE freezes and I need to hit Ctrl Alt Del to kill the process. Wasnt happening when I used JDK 5 though. Possible bug?

Posted by Surya on May 26, 2006 at 01:48 PM PDT #

Hmm sorry it was a JSP file I was editing and not an XML file. I will try to run JDeveloper using Tiger adn see if I can replicate it or not.

Posted by Surya on May 26, 2006 at 01:56 PM PDT #

I'd suggest looking for a regression bug in the bug parade, since it is very possible that this is filed already (at this rather late stage of Mustang development). Otherwise file against JDeveloper then Mustang to have them taken it out ;-)

Posted by Alex Lam on May 26, 2006 at 02:03 PM PDT #

Cheers Alex! I will do as you suggested. I think it is a bug with JDeveloper honestly. But we will see. I will go look for the regression bug. Thanks for the suggestion.

Posted by Surya on May 26, 2006 at 02:44 PM PDT #

I have confirmed it. The bug does not lie with the JDK. It is a problem of the IDE itself. I am off to file a bug for JDeveloper. Very annoying considering I am learning how to do a JSF application and instead I am off finding bugs in the application! :p

Posted by Surya on May 26, 2006 at 03:18 PM PDT #

Question: XStream uses sun.* calls to enhance serialization but now this will longer be possible. Can you *please* post some alternative portable way to instantiate classes without invoking their constructor? URL: http://xstream.codehaus.org/

Posted by Gili on June 07, 2006 at 09:20 PM PDT #

Not every package in sun.* will be hidden. If the API was available in Tiger (JDK 5.0), it will be visible in Mustang. That's what we call compatibility ;-)

Posted by Peter von der Ahe on June 07, 2006 at 09:55 PM PDT #

Java is a trademark of Sun Microsystems, Inc.
Copyright © 2006,2007 Peter von der Ahé