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

Include method name in 'does not override or implement' diagnostics

XMLWordPrintable

      In examples like the following, it would be helpful to include the method name in 'method does not override or implement a method from a supertype' diagnostics.

      class T {
        @Override
        void f() {}
      }

      Actual:

      T.java:2: error: method does not override or implement a method from a supertype
        @Override
        ^
      1 error

      Suggested:

      method f does not override or implement a method from a supertype

      It is usually easy enough to just read the following context lines in the file to understand which method the diagnostic is referring to, but this could be especially helpful in situations where that isn't trivial, such if the diagnostic is copied/pasted without the original source context as part of a bug or support request, or if the build log shows up in a context where it isn't trivial to view the original source (CI logs).

      Including the method name would be occasionally helpful, and doesn't seem like it would hurt the diagnostic in the common case.

            cushon Liam Miller-Cushon
            cushon Liam Miller-Cushon
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: