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 
/src/com/example/other/NotImported.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.

-- 
           Summary: GCJ does not fail with omitted import
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: phil at mkdoc 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=18789

Reply via email to