Bug 7066 - Subclass can't see protected inner class of superclass
Summary: Subclass can't see protected inner class of superclass
Status: RESOLVED DUPLICATE of bug 3368
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-18 14:38 EST by Mark Rose CLA
Modified: 2002-01-11 08:56 EST (History)
0 users

See Also:


Attachments
ZIP file with Java source files exhibiting the bug (639 bytes, application/octet-stream)
2001-12-18 14:39 EST, Mark Rose CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Rose CLA 2001-12-18 14:38:17 EST
The problem is that a subclass can't see the superclass's protected inner 
class. In summary, here's the problem:

public class A {
    public class Inner {
        protected class NestedException {}
    }
}

public class B {
    public class Inner extends A.Inner {
        --- in here, can't see the A.Inner.NestedException type,
            even though we're a subclass of A.Inner ---
    }
}

---

Java files exhibiting the problem follow. They are:
    util/A.java
    client/B.java
Both compile fine with JDK 1.3.1_01, won't compile with Eclipse 2.0 build 
20011206.

--- util/A.java ---
package util;

public class A {
	public abstract static class Inner {
		protected final static class NestedException extends Exception {
            public static void rethrow(final Throwable throwable)
                throws NestedException
            {
              throw (NestedException) throwable;
            }   
		}
	}
}


--- client/B.java ---
package client;

import java.io.Serializable;

import util.A;

public class B
{
    private final static class Inner extends A.Inner
    {
        protected final void construct()
            throws A.Inner.NestedException
        {
			A.Inner.NestedException.rethrow(new Exception());
        }
    }
}
Comment 1 Mark Rose CLA 2001-12-18 14:39:12 EST
Created attachment 192 [details]
ZIP file with Java source files exhibiting the bug
Comment 2 Philipe Mulet CLA 2001-12-19 05:17:16 EST
Thanks for the feedback.
It was resolved in build 20011211.

*** This bug has been marked as a duplicate of 3368 ***