From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8313 invoked by alias); 7 May 2005 07:14:05 -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 8276 invoked by uid 48); 7 May 2005 07:14:02 -0000 Date: Sat, 07 May 2005 07:14:00 -0000 From: "bonzini at gcc dot gnu dot org" To: java-prs@gcc.gnu.org Message-ID: <20050507071353.21436.bonzini@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/21436] New: imports not remembered for previously compiled files X-Bugzilla-Reason: CC X-SW-Source: 2005-q2/txt/msg00383.txt.bz2 List-Id: With a patch to compile libjava on a per-directory basis, I found a bug with imports Take file AWTEvent.java package java.awt; import java.util.EventObject; public abstract class AWTEvent extends EventObject {} and file B.java package java.awt; import java.awt.event.ComponentEvent; public class B { Object[] o = ComponentEvent.class.getFields(); } When processing ComponentEvent in B.java, it finds AWTEvent (the superclass of ComponentEvent) but it cannot resolve the EventObject class there. That's because java_complete_class was not called yet for AWTEvent, and its TYPE_IMPORTS_LIST is not set yet. If I move the setting of TYPE_IMPORS_LIST to create_class, then in maybe_layout_super_class another bug is hit and the TYPE_IMPORTS_LIST of AWTEvent is not used to resolve the EventObject class. I have a patch to fix all this but I have not tested it yet, and it does not allow anyway to finish bootstrap with per-directory builds. I suspect a (theoretically) simpler fix is to call java_complete_class earlier (at least once per file), but I am not sure about what java_complete_class is doing at all. Paolo -- Summary: imports not remembered for previously compiled files Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bonzini at gcc dot gnu dot org 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=21436