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

javac fails to check cross-package hiding

XMLWordPrintable

    • mantis
    • generic
    • solaris_8
    • Verified

      javac fails the following test. According to the JLS definition
      of hiding, it is possible to hide a method that isn't even a member
      of the superclass.
      /*
       * @test @(#)T4720359a.java 1.1 02/07/26
       * @bug 4720359
       * @summary javac fails to check cross-package hiding
       * @author gafter
       *
       * @compile/fail T4720359a.java T4720359b.java
       */

      package p1;
      public class T4720359a {
          static void m() {}
      }
      class T4720359c extends p2.T4720359b {
          // conflicting return type, even though a.m() not inherited
          public static int m() { return 1; }
      }


      package p2;
      public class T4720359b extends p1.T4720359a {
          public static int m() { return 1; }
      }

            gafter Neal Gafter (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: