As mentioned here: https://www.redhat.com/archives/fedora-devel-java-list/2005-March/msg00178.html gcj will fail if asked to compile a .jar that contains a given .class twice. At the very least it should emit a better error message.
I think in general, if a .jar is valid for the VM, then we should do our best to compile it without an error. So - we should just ignore (well, issue a warning perhaps) duplicately-named class files in a jar.
I wonder why this check doesn't catch it (jcf-parse.c): if (CLASS_PARSED_P (current_class)) { /* FIXME - where was first time */ fatal_error ("reading class %s for the second time from %s", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))), jcf->filename); } CLASS_PARSED_P (current_class) = 1;
Confirmed.
Subject: Bug 20502 CVSROOT: /cvs/gcc Module name: gcc Changes by: bryce@gcc.gnu.org 2005-03-17 15:54:24 Modified files: gcc/java : ChangeLog jcf-parse.c Log message: 2005-03-17 Bryce McKinlay <mckinlay@redhat.com> PR java/20502 * jcf-parse.c (duplicate_class_warning): New function. (java_parse_file): Call duplicate_class_warning if CLASS_FROM_CURRENTLY_COMPILED_P is already set. (parse_zip_file_entries): Likewise. Also set CLASS_FROM_CURRENTLY_COMPILED_P. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1574&r2=1.1575 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jcf-parse.c.diff?cvsroot=gcc&r1=1.183&r2=1.184
Closing as won't fix as the Java front-end has been removed from the trunk.