RFR: 8283237: CallSite should be a sealed class

Rémi Forax forax at openjdk.java.net
Thu Mar 17 06:50:31 UTC 2022


On Wed, 16 Mar 2022 13:09:30 GMT, liach <duke at openjdk.java.net> wrote:

> Change `CallSite` to a sealed class, as `CallSite` is an abstract class which does not allow direct subclassing by users per its documentation. Since I don't have a JBS account, I posted the content for the CSR in a GitHub Gist at https://gist.github.com/150d5aa7f8b13a4deddf95969ad39d73 and wish someone can submit a CSR for me.

src/java.base/share/classes/java/lang/invoke/CallSite.java line 88:

> 86:  */
> 87: public
> 88: abstract sealed class CallSite permits ConstantCallSite, VolatileCallSite, MutableCallSite {

Nitpicking with my JSR 292 hat,
given that the permits clause is reflected in the javadoc,
the order should be ConstantCS, MutableCS and VolatileCS,
it's both in the lexical order and in the "memory access" of setTarget() order , from stronger access to weaker access.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7840


More information about the core-libs-dev mailing list