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

Java adapters don't have facility to call super methods

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: