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

XMLWordPrintable

    • generic
    • generic

      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."

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: