Bug 1929 - gcj trying to access wrong class
Summary: gcj trying to access wrong class
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P1 normal
Target Milestone: ---
Assignee: Andrew Cagney
URL:
Keywords:
Depends on:
Blocks: 1839
  Show dependency treegraph
 
Reported: 2005-11-27 17:26 UTC by Andrew Cagney
Modified: 2006-03-26 04:56 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2005-11-27 17:26:36 UTC
This fails:

$ gcj -I . -C -d classes frysk/sys/Wait.java frysk/model/Signal.java
frysk/event/Signal.java frysk/event/SignalEvent.java frysk/proc/LinuxHost.java
frysk/event/SignalEvent.java:3: error: Can't access class ‘frysk.model.Signal’.
Only public classes and interfaces in other packages can be accessed.
       extends Signal
               ^
frysk/event/SignalEvent.java:0: confused by earlier errors, bailing out

(the order of the parameters is very important) given the files:

<< frysk/event/SignalEvent.java >>
package frysk.event;
public abstract class SignalEvent
    extends Signal
{
    public SignalEvent (int signal)
    {
        super (signal);
    }
}
<< frysk/event/Signal.java >>
package frysk.event;
public class Signal
{
    public Signal (int signal)
    {
    }
}
<< frysk/model/Signal.java >>
package frysk.model;
class Signal
{
}
<< frysk/proc/LinuxHost.java >>
package frysk.proc;
import frysk.event.SignalEvent;
import frysk.sys.Wait;
public class LinuxHost
{
    class PollWaitOnSigChld
        extends SignalEvent
    {
        PollWaitOnSigChld ()
        {
            super (0);
        }
        Wait.Observer waitObserver = new Wait.Observer ()
            {
            };
        public final void execute ()
        {
        }
    }
}
<< frysk/sys/Wait.java >>
package frysk.sys;
public final class Wait
{
    public interface Observer
    {
    }
}
cagney@localhost$
Comment 1 Andrew Cagney 2005-11-27 17:27:50 UTC
2005-11-27  Andrew Cagney  <cagney@redhat.com>

        * Makefile.am (wrongclass/gcj.sh): New target.
        * wrongclass/frysk/model/Signal.java: New file.
        * wrongclass/frysk/event/Signal.java: New file.
        * wrongclass/frysk/event/SignalEvent.java: New file.
        * wrongclass/frysk/sys/Wait.java: New file.
        * wrongclass/frysk/proc/LinuxHost.java: New file.

Test case added.
Comment 2 Andrew Cagney 2006-03-26 04:56:47 UTC
Corresponding RHEL 4 bug:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=174310