RFR: Mark not subclassable classes final in java.base exported classes
Jaikiran Pai
jai.forums2013 at gmail.com
Sat Nov 30 04:16:26 UTC 2024
Hello Eirik,
On 27/11/24 2:26 am, Eirik Bjørsnøs wrote:
> On Tue, Nov 26, 2024 at 2:22 PM Eirik Bjørsnøs <eirbjo at gmail.com> wrote:
>
> In addition to simply adding the final modifier, the CSR suggests
> minor updates to the classes DynamicCallSiteDesc, ModuleDescriptor
> and InterfaceAddress to better express them being non-subclassable.
>
>
> The changes to make the InterfaceAddress constructor private has been
> removed from this CSR since it was not considered a specification idea.
>
> It could still be good to consider whether this constructor can be
> made private and its comment block updated to mention that the
> constructor is only accessed via native code, not Java.
>
> I filed https://bugs.openjdk.org/browse/JDK-8345074 to track this.
> Feedback from someone in the network area is welcome.
I had a look at this and like you note, the InterfaceAddress only gets
constructed through the JNI functions in NetworkInterface's code. So I
think it should be OK to me make this constructor private.
-Jaikiran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/net-dev/attachments/20241130/72a3b5cf/attachment.htm>
More information about the net-dev
mailing list