This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug extending inner class from subclass of its outer class.


Here it is:

public class Outer {
    protected class Inner {
        //blah
    }
}

and

public class Outer2 extends Outer {
    protected class Inner2 extends Inner {
        //blah
    }
}

and IBM's javac works:

mjr::test$ javac *.java
mjr::test$

but not yours:

mjr::test$ gcj -c *.java
Outer2.java:2: Can't access protected nested class Outer$Inner. Only public classes and interfaces in other packages can be accessed.
       protected class Inner2 extends Inner {
                                      ^
1 error
mjr::test$

This bug does not occur if the inner class is public.


-- 
Mark Roberts
mjr@statesmean.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]