Community
Participate
Working Groups
In the following example Sub.java compiles under jdk 1.3.1_01 (1.3.0 as well) but not under eclipse (tried out multiple configurations) Error: The method publicMethod() from the type service.Super.SuperInner is not visible // file: service/Super.java package service; public class Super { /** * This inner class should not be visible outside the package service, * except whithin other classes derived from Super, so it is protected. */ protected static class SuperInner { /** * Visible to everyone, who can see SuperInner. */ public void publicMethod() { } } } // file: client/Sub.java package client; import service.Super; class Sub extends Super { void usesSuperInnerWithinSub(SuperInner superInner) { // ok: compiles superInner.publicMethod(); } /** * In this inner class everything should be visible that is visible within Sub. */ private static class SubInner { /** * SuperInner is visible here: no comile error in declaration. */ void usesSuperInnerWithinSubInner(SuperInner superInner) { // because SuperInner is visible and publicMethod is public within SuperInner, it should be accessible. // but: // ok in jdk 1.3.1_01: compiles // not ok in eclipse 2.0: "Error: The method publicMethod() from the type service.Super.SuperInner is not visible" superInner.publicMethod(); } } }
I was unable to reproduce this problem in 2.0 or 2.0 + latest patches... Thomas can you please double check the example classes.
Created attachment 1813 [details] Example Project reproducing the bung on Windows NT and 2000
That is the identical testcase... but it does not fail in R2.0 (at least not when I try it). Does it fail for you?
Created attachment 1819 [details] Yes it does fail. Have a look at this screenshot.
Hi Kent, as I understand Eclipse uses its own (internal) compiler and does not use the configured jdk for compilation. Is this correct? If it is Thomas and I are a bit stuck trying to figure out possible differeneces between your and our configuration. Can you list the factors which influence compilation?
Essentially its just the compliance level of the compiler... Window- >Preferences->Java->Compiler->JDK Compliance. If Auto-build is enabled, then problems should be added and removed immediately. If it is off, then project rebuilds will change the problem list. I'm using a R2.0 workspace so Auto-build is on and my compliance level is 1.3. I've tried changing to 1.4.1 and still couldn't cause the problem. Just to double check: which build are you running? Have you installed any patches?
Hi Kent, I gave it another try. This time: * fresh download of R2.0 from the eclipse web page * version linux-gtk * started, imported bug project attached to this entry * I get the Error We also tried experimenting with the settings before but had no luck.
Was able to reproduce problem at first attempt (Kent did you put Sub.java in package client?). Investigating.
This is a duplicate of bug 21116. Either get a newer 2.0 integration build, or get the latest JDT/Core patch from http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-core- home/patches/org.eclipse.jdt.core_2.0.0.zip). *** This bug has been marked as a duplicate of 21116 ***
Gone with the wind. Thanks.
Verified