public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/21436] New: imports not remembered for previously compiled files
@ 2005-05-07  7:14 bonzini at gcc dot gnu dot org
  2005-05-07  9:23 ` [Bug java/21436] " bonzini at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-05-07  7:14 UTC (permalink / raw)
  To: java-prs

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-08-17 14:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
2005-05-07  9:23 ` [Bug java/21436] " bonzini at gcc dot gnu dot org
2005-05-07 10:58 ` bonzini at gcc dot gnu dot org
2005-05-09 10:03 ` bonzini at gcc dot gnu dot org
2005-05-10 13:24 ` cvs-commit at gcc dot gnu dot org
2005-05-10 13:55 ` bonzini at gcc dot gnu dot org
2005-06-05  7:46 ` pinskia at gcc dot gnu dot org
2005-08-17 12:57 ` cvs-commit at gcc dot gnu dot org
2005-08-17 12:58 ` bonzini at gcc dot gnu dot org
2005-08-17 14:57 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).