Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Incremental Compiler bug when accessing a protected attribute?
Incremental Compiler bug when accessing a protected attribute? [message #200318] Mon, 23 February 2004 18:22 Go to next message
Eclipse UserFriend
I'm working on some code similar to below and I'm experiencing
differences between the Sun java compiler and the Eclipse incremental
compiler in how they see protected attributes of a class.

In Eclipse, I get the error "Type myPrivateClass.Goober is not
visible." on all accesses to x, y, and z. But when I compile the code
using 1.4.2_01 of the Sun SDK I only receive 2 errors one on x and the
other on z.

The reason I ask is because some code I'm working on has thousands of
instances similar to the scenario accessing y and obviously Eclipse is
giving me boat loads of errors. Is this a bug in the Eclipse
compiler, or a known discrepancy between Eclipse & Sun?

Shane

-8< file: myPrivateClass.java ----------------------------
package myPackage;
public final class myPrivateClass {

private class Goober {
private int x;
protected int y;
public int z;
}
Goober goober = new Goober();
}

-8< file: myTestClass.java ------------------------------
package myPackage;
public class myTestClass {
public void lmnop() {
myPrivateClass x = new myPrivateClass();
x.goober.x = 0; // private not accessable via javac
x.goober.y = 1; // protected accessable via javac
x.goober.z = 2; // public not accessable via javac
}
}
-8< file: build.xml ------------------------------
<project name="stuff" default="default" basedir=".">
<property name="build.dest" value="./bin" />
<target name="default">
<mkdir dir="${build.dest}"/>
<javac srcdir="."
destdir="${build.dest}"
/>
</target>
</project>
Re: Incremental Compiler bug when accessing a protected attribute? [message #200398 is a reply to message #200318] Mon, 23 February 2004 19:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: John_Arthorne.oti.com_

I recommend entering a bug in bugzilla under JDT > Core. It looks like
one of the two compilers isn't behaving according to spec.
--

sholder@chipdata.com wrote:
> I'm working on some code similar to below and I'm experiencing
> differences between the Sun java compiler and the Eclipse incremental
> compiler in how they see protected attributes of a class.
>
> In Eclipse, I get the error "Type myPrivateClass.Goober is not
> visible." on all accesses to x, y, and z. But when I compile the code
> using 1.4.2_01 of the Sun SDK I only receive 2 errors one on x and the
> other on z.
>
> The reason I ask is because some code I'm working on has thousands of
> instances similar to the scenario accessing y and obviously Eclipse is
> giving me boat loads of errors. Is this a bug in the Eclipse
> compiler, or a known discrepancy between Eclipse & Sun?
>
> Shane
>
> -8< file: myPrivateClass.java ----------------------------
> package myPackage;
> public final class myPrivateClass {
>
> private class Goober {
> private int x;
> protected int y;
> public int z;
> }
> Goober goober = new Goober();
> }
>
> -8< file: myTestClass.java ------------------------------
> package myPackage;
> public class myTestClass {
> public void lmnop() {
> myPrivateClass x = new myPrivateClass();
> x.goober.x = 0; // private not accessable via javac
> x.goober.y = 1; // protected accessable via javac
> x.goober.z = 2; // public not accessable via javac
> }
> }
> -8< file: build.xml ------------------------------
> <project name="stuff" default="default" basedir=".">
> <property name="build.dest" value="./bin" />
> <target name="default">
> <mkdir dir="${build.dest}"/>
> <javac srcdir="."
> destdir="${build.dest}"
> />
> </target>
> </project>
>
Re: Incremental Compiler bug when accessing a protected attribute? [message #200868 is a reply to message #200398] Tue, 24 February 2004 10:14 Go to previous message
Eclipse UserFriend
John Arthorne <John_Arthorne@oti.com_> writes:

> I recommend entering a bug in bugzilla under JDT > Core. It looks
> like one of the two compilers isn't behaving according to spec.

Will do.

Shane
Previous Topic:Eclipse under Tru64
Next Topic:New Folder, File
Goto Forum:
  


Current Time: Fri Apr 25 19:24:16 EDT 2025

Powered by FUDForum. Page generated in 0.06352 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top