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

Wrong error message, should be "hidden", not "override"

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      The compiler generates the wrong error message when presented with this illegal program:

      public class Bar {
        public static void main(String[] args) {
        }
        final static void foo() {
        }
      }

      class Eek extends Bar {
        static void foo() {
        }
      }

      It says:

      javac Bar.java
      Bar.java:9: foo() in Eek cannot override foo() in Bar; overridden method is static final
        static void foo() {
                    ^
      1 error

      The word "overridden" should be replaced by "hidden."

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mcimadamore Maurizio Cimadamore
                Reporter:
                ahe Peter Ahe
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: