Bug 18789 - GCJ does not fail with omitted import
Summary: GCJ does not fail with omitted import
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.3.3
: P2 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
Keywords: accepts-invalid
Depends on: 28067
  Show dependency treegraph
Reported: 2004-12-02 16:24 UTC by Phil Shaw
Modified: 2007-01-09 20:46 UTC (History)
2 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2004-12-02 20:59:57


Note You need to log in before you can comment on or make changes to this bug.
Description Phil Shaw 2004-12-02 16:24:38 UTC
If a dependent class in another package is not explicitly declared in an import 
statement but the two classes are compiled together, GCJ does not fail.

-- OmittedImport.java

package com.example.bug;

public class OmittedImport {

    public OmittedImport(NotImported notImported) {
        // Empty

-- NotImported.java

package com.example.other;

public class NotImported {

    // Empty

This is using a command lines like:

$ gcj -C -d /out /src/com/example/**/*.java

$ gcj -C -d /out /src/com/example/bug/OmittedImport.java 

If the OmittedImport class is compiled alone, it does fail as one would expect. 
The Sun SDK does not compile the OmittedImport class in any case.
Comment 1 Andrew Pinski 2004-12-02 20:59:57 UTC
Comment 2 Tom Tromey 2007-01-09 20:46:44 UTC
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.