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

javac fails to check cross-package hiding

    Details

    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      generic
    • OS:
      solaris_8
    • Verification:
      Verified

      Description

      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; }
      }

        Attachments

          Activity

            People

            • Assignee:
              gafter Neal Gafter
              Reporter:
              gafter Neal Gafter
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: