|
From: Merrill, A. <Mer...@ca...> - 2004-06-09 19:43:48
|
Background: As you may know, there is a bug in javac (not DrJava) that
results in the compiler throwing an OutOfMemoryError when compiling even
very short files that contain undeclared variables. For example, try to
compile:
=20
class BugClass
{
void method1()
{
x =3D a + b;
}
}
=20
If you compile this using javac (not DrJava), you see the following
messages:
=20
C:\Documents\Java>javac BugClass.java
BugClass.java:5: cannot resolve symbol
symbol : variable x
location: class BugClass
x =3D a + b;
^
BugClass.java:5: cannot resolve symbol
symbol : variable a
location: class BugClass
x =3D a + b;
^
BugClass.java:5: cannot resolve symbol
symbol : variable b
location: class BugClass
x =3D a + b;
^
=20
The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError
=20
=20
However, if you try to compile this in DrJava, the only error you see
is:
=20
1 error found:
File: (no associated file) [line: (no source location)]
Error: Compile exception: java.lang.OutOfMemoryError
=20
Notice that all of the "cannot resolve symbol" errors are not displayed!
In a long program, this makes it very difficult to find the real problem
- all you know is that there is an undeclared variable somewhere in
perhaps thousands of lines of code. =20
=20
DrJava should display all of the output from the java compiler, even if
the java compiler crashes while trying to compile a program. I use
DrJava in the high school classes that I teach, and students frequently
use variables they forget to declare. =20
=20
Andrew Merrill
Computer Science
Catlin Gabel School
=20
=20
=20
=20
|