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

Java adapters don't have facility to call super methods

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 8
    • core-libs
    • None
    • b106
    • generic
    • generic
    • Verified

      Currently, it's not possible to do an equivalent of "super.foo()" from the body of a Java class adapter. E.g. in this example where we want a filter writer that capitalizes its output:

      var cap = new java.io.FilterWriter(w) {
          write: function(s, off, len) {
              cap.super$write(capitalize(s), off, len)
          }
      }

      function capitalize(s) { ... } // capitalizes a string

      The basic idea is to add methods prefixed with "super$" for every non-abstract overridable method from the adapter's superclass.

            attila Attila Szegedi
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: