Details
-
Bug
-
Resolution: Fixed
-
P2
-
8
-
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.
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
- relates to
-
JDK-8023630 Implement Java.super() as the preferred way to call super methods
- Resolved