This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Not the best error message.
- To: Mo DeJong <mdejong at cygnus dot com>
- Subject: Re: Not the best error message.
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Date: Mon, 07 May 2001 17:23:05 +1200
- CC: java at gcc dot gnu dot org
- References: <Pine.SOL.3.91.1010506184424.16656C-100000@cse.cygnus.com>
Mo DeJong wrote:
> Gcj is giving me this really strange error
> message.
> Any comments on what this sort of error *should* print?
I guess the compilers are getting confused because you have "Crash" declared
in package "foo" and "Crash_Test" in the empty package, yet they are both in
the same directory?
So in this case, the ideal error message should be something like "class
"Crash" was declared in package "foo" but was not found in a directory
called "foo" relative to the base directory for compilation". However, I'm
not sure that a compiler can legally give that error (maybe a warning?),
without checking that parent directory heirarchy is correct for the package
declaration, and that would probibly differ from javac's behaviour.
The "duplicate class" errors are strange but probibly a feature of the way
classes are resolved - the compiler reads Crash.java once and sees that the
class is called foo.Crash, then reads it again after seeing that there is no
class called "Crash" loaded and that there is a file called Crash.java,
since you specified Crash.java on the command line as well. The "type not
found" errors are certainly correct (just not as verbose as they could be).
FWIW, if they are put in the correct package, javac reports the correct
error (Crash_Inner not visible to Crash because it has default access),
while gcj incorrectly compiles the code without an error.
regards
[ bryce ]