-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.2fcs
-
generic
-
solaris_2.5.1
-
Not verified
I believe javac handles the following code incorrectly:
// file: tmp/temp.java
package tmp;
class tempBase {
void anotherMethod () { }
}
public class temp extends tempBase { }
class bottom extends tmp.pack1.temp
{
void myMethod ()
{
anotherMethod ();
}
public static void main (String [] argv) {
bottom o_temp = new bottom ();
o_temp.myMethod ();
}
}
//file: tmp/pack1/temp.java
package tmp.pack1;
public class temp extends tmp.temp {
}
I believe bottom should not inherit anotherMethod because a class only
inherits from its direct supertypes, and therefore should not inherit any
methods that the super type does not have access to.
// file: tmp/temp.java
package tmp;
class tempBase {
void anotherMethod () { }
}
public class temp extends tempBase { }
class bottom extends tmp.pack1.temp
{
void myMethod ()
{
anotherMethod ();
}
public static void main (String [] argv) {
bottom o_temp = new bottom ();
o_temp.myMethod ();
}
}
//file: tmp/pack1/temp.java
package tmp.pack1;
public class temp extends tmp.temp {
}
I believe bottom should not inherit anotherMethod because a class only
inherits from its direct supertypes, and therefore should not inherit any
methods that the super type does not have access to.
- relates to
-
JDK-4240484 clss06603.html: JLS8.2.1.1 access to method inherited from non-public class
-
- Resolved
-