User account creation filtered due to spam.

Bug 12788 - bad dependencies for inner classes
Summary: bad dependencies for inner classes
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.3.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 18131
  Show dependency treegraph
 
Reported: 2003-10-27 14:12 UTC by Thomas Neumann
Modified: 2005-07-23 22:39 UTC (History)
2 users (show)

See Also:
Host: i386-mingw32msvc
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-07-23 05:24:48


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Neumann 2003-10-27 14:12:05 UTC
When using gcj to produce dependencies (-MMD) for Java code with inner classes, 
it adds the source file _and_ the .class file of the inner class. While this is 
technically correct, it should not be done as it creates cyclic dependencies.

E.g. given the two files
A.java: class A { public interface AA {} B.BB b; }
B.java: class B { public interface BB { } A.AA a; }

compiling these files with (has to be compiled twice):
gcj -MMD -C A.java
gcj -MMD -C B.java
gcj -MMD -C A.java
gcj -MMD -C B.java

results in the dependencies
./A$$AA.class ./A.class: A.java ./B.java ./B$$BB.class
./B$$BB.class ./B.class: B.java ./A.java ./A$$AA.class

This creates a cyclic dependency, which makes the dependencies more or less 
worthless. The nicer behaviour would be to ommit the .class files in the 
dependency lists, as they are already implied by their .java files (of course 
this is only possible if the .java files are actually available).
Comment 1 Andrew Pinski 2003-10-27 17:13:58 UTC
I can confirm this on the mainline (20031018).