From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11846 invoked by alias); 13 Aug 2004 21:07:28 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 11830 invoked by uid 48); 13 Aug 2004 21:07:27 -0000 Date: Fri, 13 Aug 2004 21:07:00 -0000 From: "mckinlay at redhat dot com" To: java-prs@gcc.gnu.org Message-ID: <20040813210724.17021.mckinlay@redhat.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libgcj/17021] New: gij: class resolution throws errors too eagerly X-Bugzilla-Reason: CC X-SW-Source: 2004-q3/txt/msg00243.txt.bz2 List-Id: NoClassDefFoundError should only be thrown if a code path that attempts to use the missing class is actually used. GIJ, however, throws the error too early. This can be seen by compiling the following test case and deleting the class file for "Bar". $ gcj -C Foo.java Bar.java $ rm Bar.class $ gij Foo Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: Foo at java.lang.ClassLoader.resolveClass0(java.lang.Class) (/usr/lib/libgcj.so.4.0.0) at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.4.0.0) at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.4.0.0) ... public class Foo { public boolean missing_class_code_path = false; public static void main(String[] args) { new Foo().j(); } void j() { if (missing_class_code_path) new Bar().x(); } } public class Bar { public void x() {} } -- Summary: gij: class resolution throws errors too eagerly Product: gcc Version: 3.5.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libgcj AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mckinlay at redhat dot com CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17021