I'm an educator. To get the students used to interpreting the compiler error messages, one of our labs involves introducing errors into a simple compilable piece of code. The first error that is introduced is the removal of the final closing curly brace in the class. With release 20080904-r4668 and earlier, the expected compiler message appears about an incomplete class declaration:
Error message: reached end of file while parsing
Error: The class code is incomplete
With the current release, 20090821-r5004, the error is an internal compiler error, that leads me to submit this bug report:
1 error occured! Please submit a bug report containing the information below and an account of the actions that caused the bug (if known) to http://sourceforge.net/projects/drjava. You may wish to save all your work and restart DrJava. Thanks for your help in making DrJava better!
edu.rice.cs.util.UnexpectedException: java.lang.RuntimeException: edu.rice.cs.util.UnexpectedException: java.lang.RuntimeException: Compile exception: com.sun.tools.javac.util.ClientCodeException: edu.rice.cs.util.UnexpectedException: java.lang.RuntimeException: C:\teaching\assign\CompilerErrors.java:21: reached end of file while parsing
at edu.rice.cs.drjava.model.DJError.<init>(DJError.java:72)
at edu.rice.cs.drjava.model.DJError.<init>(DJError.java:82)
at edu.rice.cs.drjava.model.DJError.<init>(DJError.java:87)
at edu.rice.cs.drjava.model.compiler.DefaultCompilerModel._doCompile(DefaultCompilerModel.java:253)
at edu.rice.cs.drjava.model.compiler.DefaultCompilerModel.compileAll(DefaultCompilerModel.java:150)
at edu.rice.cs.drjava.ui.MainFrame._compileAll(MainFrame.java:5396)
at edu.rice.cs.drjava.ui.MainFrame.access$4800(MainFrame.java:117)
at edu.rice.cs.drjava.ui.MainFrame$51.actionPerformed(MainFrame.java:829)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at edu.rice.cs.drjava.ui.DefinitionsPane.processKeyEvent(DefinitionsPane.java:605)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.RuntimeException: edu.rice.cs.util.UnexpectedException: java.lang.RuntimeException: Compile exception: com.sun.tools.javac.util.ClientCodeException: edu.rice.cs.util.UnexpectedException: java.lang.RuntimeException: C:\teaching\assign\CompilerErrors.java:21: reached end of file while parsing
at edu.rice.cs.util.UnexpectedException.<init>(UnexpectedException.java:71)
... 31 more
Caused by:
java.lang.RuntimeException: edu.rice.cs.util.UnexpectedException: java.lang.RuntimeException: Compile exception: com.sun.tools.javac.util.ClientCodeException: edu.rice.cs.util.UnexpectedException: java.lang.RuntimeException: C:\teaching\assign\CompilerErrors.java:21: reached end of file while parsing
at edu.rice.cs.util.UnexpectedException.<init>(UnexpectedException.java:71)
at edu.rice.cs.drjava.model.DJError.<init>(DJError.java:72)
at edu.rice.cs.drjava.model.DJError.<init>(DJError.java:82)
at edu.rice.cs.drjava.model.DJError.<init>(DJError.java:87)
at edu.rice.cs.drjava.model.compiler.DefaultCompilerModel._doCompile(DefaultCompilerModel.java:253)
at edu.rice.cs.drjava.model.compiler.DefaultCompilerModel.compileAll(DefaultCompilerModel.java:150)
at edu.rice.cs.drjava.ui.MainFrame._compileAll(MainFrame.java:5396)
at edu.rice.cs.drjava.ui.MainFrame.access$4800(MainFrame.java:117)
at edu.rice.cs.drjava.ui.MainFrame$51.actionPerformed(MainFrame.java:829)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at edu.rice.cs.drjava.ui.DefinitionsPane.processKeyEvent(DefinitionsPane.java:605)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
System Properties:
DrJava Version drjava-20090821-r5004
DrJava Build Time 20090821-1520
drjava.debug.port = 2290
java.runtime.name = Java(TM) SE Runtime Environment
sun.boot.library.path = C:\Program Files\Java\jre6\bin
java.vm.version = 14.2-b01
java.vm.vendor = Sun Microsystems Inc.
java.vendor.url = http://java.sun.com/
path.separator = ;
java.vm.name = Java HotSpot(TM) Client VM
file.encoding.pkg = sun.io
sun.java.launcher = SUN_STANDARD
user.country = US
sun.os.patch.level = Service Pack 3
java.vm.specification.name = Java Virtual Machine Specification
user.dir = <anonymized user.dir>
java.runtime.version = 1.6.0_16-b01
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs = C:\Program Files\Java\jre6\lib\endorsed
os.arch = x86
java.io.tmpdir = C:\DOCUME~1\<anonymized user.name>\LOCALS~1\Temp\
line.separator = "\u000d\u000a"
java.vm.specification.vendor = Sun Microsystems Inc.
user.variant =
os.name = Windows XP
sun.jnu.encoding = Cp1252
java.library.path = C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\MiKTeX 2.7\miktex\bin;C:\Python26\;C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\Program Files\MATLAB\R2007a Student\bin;C:\Program Files\MATLAB\R2007a Student\bin\win32;C:\Program Files\Common Files\DivX Shared\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Java\jre6\bin
java.specification.name = Java Platform API Specification
java.class.version = 50.0
sun.management.compiler = HotSpot Client Compiler
os.version = 5.1
user.home = <anonymized user.home>
user.timezone = America/Los_Angeles
java.awt.printerjob = sun.awt.windows.WPrinterJob
file.encoding = Cp1252
java.specification.version = 1.6
java.class.path = <anonymized user.dir>\drjava-stable-20090821-r5004.exe
user.name = <anonymized user.name>
java.vm.specification.version = 1.0
java.home = C:\Program Files\Java\jre6
sun.arch.data.model = 32
user.language = en
java.specification.vendor = Sun Microsystems Inc.
awt.toolkit = sun.awt.windows.WToolkit
java.vm.info = mixed mode, sharing
java.version = 1.6.0_16
java.ext.dirs = C:\Program Files\Java\jre6\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
sun.boot.class.path = C:\Program Files\Java\jre6\lib\resources.jar;C:\Program Files\Java\jre6\lib\rt.jar;C:\Program Files\Java\jre6\lib\sunrsasign.jar;C:\Program Files\Java\jre6\lib\jsse.jar;C:\Program Files\Java\jre6\lib\jce.jar;C:\Program Files\Java\jre6\lib\charsets.jar;C:\Program Files\Java\jre6\classes
java.vendor = Sun Microsystems Inc.
file.separator = \
java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
java.rmi.server.hostname = 127.0.0.1
sun.desktop = windows
sun.cpu.isalist = pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
#DrJava configuration file
#Sun Oct 04 23:07:09 PDT 2009
extra.classpath = C:\\teaching\\csc142\\NsccLibrary.jar
lineenum.enabled = true
key.delete.next = [shift DELETE]
key.delete.previous = [shift BACK_SPACE]
recent.files = [C:\\teaching\\assign\\CompilerErrors.java,C:\\teaching\\csc142-m09\\Flag.java,C:\\teaching\\assign\\Snowman.java,C:\\teaching\\assign\\Point.java,C:\\teaching\\assign\\Token.java]
window.height = 570
window.x = 224
window.y = 0
last.dir = C:\\teaching\\assign\\CompilerErrors.java
last.interactions.dir = C:\\teaching\\assign
tabbedpanes.state = 512 300 700 400
dialog.drjava.survey.enabled = false
new.version.notification.last = 1254626925719
drjava.survey.notification.last = 1250275888187
drjava.survey.result.last = http://www.drjava.org/submit-usage.php?rev=4668&os.name=Windows%20XP&os.version=5.1&java.version=1.6.0_15&java.vendor=Sun%20Microsystems%20Inc.
Used memory: about 18.97 megabytes
Free memory: about 9.44 megabytes
Total memory: about 28.42 megabytes
Total memory can expand to: about 63.56 megabytes
Number of processors/cores: 2
This is the file that caused the error shown.
I was able to reproduce this: It only happens with Java 6 compilers.
This is due to a very clumsy collusion of circumstances:
We use a string comparison to determine if an internal compiler error has occurred. This is done by checking whether the compiler error message contains the string "CompilerError".
By naming the file CompilerErrors.java, a false positive is created.
In the Java 5 compiler, this kind of error was not thrown as an exception, so the issue did not come up.
Fixed as of revision 5105. I will later make a new jar available.
I made a new jar available on our "Weekly Jar" website ( http://www.cs.rice.edu/~javaplt/drjavarice/weekly/ )
The direct link is http://www.cs.rice.edu/~javaplt/drjavarice/weekly/files/drjava-weekly-20091006-r5105.jar