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

Message "The static method .. conflicts with the abstract method .." not suited

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Cannot Reproduce
    • Affects Version/s: 8u31
    • Fix Version/s: 10
    • Component/s: tools
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      A DESCRIPTION OF THE REQUEST :
      When a class inherits a static method from a superclass and inherits an abstract method with the same name and parameters from a superinterface, the compile-time message error thrown is the same as when a class inherits a static method from a superclass but inherits from a default method from a superinterface. So in the latter case the message should be different.

      JUSTIFICATION :
      This is behaviour is quite confusing because in the second case the conflicting method is not an abstract one but a default one.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      So in this situation, the message could be "The static method ... conflicts with the default method in ... ".
      ACTUAL -
      When a class C1 inherits a static method m() from a superclass S and inherits an abstract method m() from a superinterface I, a compile-time message error is thrown : "The static method f() conflicts with the abstract method in I".

      When a class C2 inherits a static method m() from the same superclass S but inherits a default method m() from a superinterface J, a similar compile-time message error is thrown : "The static method f() conflicts with the abstract method in J".



      ---------- BEGIN SOURCE ----------

      public class C1 extends C implements I {

      }

      class C2 extends C implements J {

      }

      class C {
      public static void f() {
      }
      }

      interface I {
      default void f() {
      }
      }

      interface J {
      default void f() {
      }
      }
      ---------- END SOURCE ----------

        Attachments

          Activity

            People

            • Assignee:
              pmuthuswamy Priya Lakshmi Muthuswamy (Inactive)
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: