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

incorrect usage of "super" keyword allowed

XMLWordPrintable

    • generic
    • generic



      Name: laC46010 Date: 02/09/99



      The following example shows that javac (ver. 1.2fcs, 1.2.2) allows
      usage of some constructions with "super" keyword which are not
      allowed by java grammar. Earlier versions of javac (1.1.x, 1.2beta4)
      refuses this constructions.

      Test example and javac diagnostics follow:
      -------------------------------------------------------
      novo35% cat test.java
      class test {
          test(byte b) {
              super.super();
          }
          test(short s) {
              super.super.super();
          }
          test(int i) {
              super.super().super();
          }
          test() {
              super.super.super().super().this(0);
          }
      }
      novo35% java -version
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-E, green threads, sunwjit)
      novo35% javac test.java
      novo35%
      -------------------------------------------------------

      ======================================================================

            wmaddoxsunw William Maddox (Inactive)
            leosunw Leo Leo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: