Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4123980

JDK 1.2 Beta3 - javac handles inheritence incorrectly

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.2fcs
    • CPU:
      generic
    • OS:
      solaris_2.5.1
    • Verification:
      Not verified

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tturnidgsunw Todd Turnidge (Inactive)
              Reporter:
              jbenoit Jonathan Benoit (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: