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

Elements.hides(m1, m2) should return false if m2 is a static method of an interface

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 23
    • 21
    • core-libs
    • None

      In this example, Elements.hides(D::m, C::m) returns true:

      % cat pkg/{D,C}.java
      package pkg;

      public interface D extends C {

          public static void m() { }
      }
      package pkg;

      public interface C {

          public static void m() { }
      }

      From my reading of JLS 8.4.8.2. Hiding (by Class Methods), that should be false: "If A is an interface, m' is an instance method."

            darcy Joe Darcy
            prappo Pavel Rappo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: