On Wed, 8 Feb 2023 18:35:51 GMT, Joe Darcy <da...@openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/FdLibm.java line 1215:
>> 
>>> 1213:      *      only sinh(0)=0 is exact for finite x.
>>> 1214:      */
>>> 1215:     static class Sinh {
>> 
>> For clarity, should this not be declared `final`?
>
> Hmm. Wouldn't hurt to do so.
> 
> I was thinking of making a pass over Fdlibm.java at some point to make sure 
> the nested classes had package-level rather than public accessibility and 
> that the classes had private constructors that threw an exception (to prevent 
> instantiation).

It doesn't matter much. It was just a drive-by comment; I don't normally look 
at this part of the code but the PR title attracted my attention (it is not 
everyday you see hyperbolic transcendental PRs in the JDK), and when I skimmed 
through the code, some reflex part of my brain said "utility classes should be 
final".

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

PR: https://git.openjdk.org/jdk/pull/12429

Reply via email to