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

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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: