Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Joe Darcy
On Wed, 29 Mar 2023 08:13:06 GMT, Per Minborg wrote: > Non-instantiable utility classes should be declared `final` and have a > private constructors. > > See Effective Java, Third Edition, Joshua Bloch (for example, Item 19 or Item > 22). > There are numerous examples in the JDK where we h

Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Raffaello Giulietti
On Wed, 29 Mar 2023 08:13:06 GMT, Per Minborg wrote: > Non-instantiable utility classes should be declared `final` and have a > private constructors. > > See Effective Java, Third Edition, Joshua Bloch (for example, Item 19 or Item > 22). In some future, one could mistakenly instantiate the

Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Roger Riggs
On Wed, 29 Mar 2023 16:09:18 GMT, Raffaello Giulietti wrote: > > Would it make sense to throw an `AssertionError` in the constructor? Just in > case... It hardly seems worth the bytecode; the constructor could only be invoked by breaking in using reflection and the result would be an inst

Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Roger Riggs
On Wed, 29 Mar 2023 08:13:06 GMT, Per Minborg wrote: > Non-instantiable utility classes should be declared `final` and have a > private constructors. > > See Effective Java, Third Edition, Joshua Bloch (for example, Item 19 or Item > 22). The CSR implies that java.util.Arrays has a non-priva

Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Raffaello Giulietti
On Wed, 29 Mar 2023 08:13:06 GMT, Per Minborg wrote: > Non-instantiable utility classes should be declared `final` and have a > private constructors. > > See Effective Java, Third Edition, Joshua Bloch (for example, Item 19 or Item > 22). Would it make sense to throw an `AssertionError` in t

Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Pavel Rappo
On Wed, 29 Mar 2023 09:03:58 GMT, Alan Bateman wrote: > > I thought the change would trigger a change in the public API as the > > modifiers are changed for the class. This would likely be picked up by > > compatibility checks and so, a CSR would be needed? > > It's not a compatibility issue b

Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Brian Burkhalter
On Wed, 29 Mar 2023 08:13:06 GMT, Per Minborg wrote: > Non-instantiable utility classes should be declared `final` and have a > private constructors. > > See Effective Java, Third Edition, Joshua Bloch (for example, Item 19 or Item > 22). Marked as reviewed by bpb (Reviewer). -

Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Roger Riggs
On Wed, 29 Mar 2023 08:13:06 GMT, Per Minborg wrote: > Non-instantiable utility classes should be declared `final` and have a > private constructors. > > See Effective Java, Third Edition, Joshua Bloch (for example, Item 19 or Item > 22). Marked as reviewed by rriggs (Reviewer). ---

Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Alan Bateman
On Wed, 29 Mar 2023 08:59:50 GMT, Per Minborg wrote: > I thought the change would trigger a change in the public API as the > modifiers are changed for the class. This would likely be picked up by > compatibility checks and so, a CSR would be needed? It's not a compatibility issue but a CSR is

Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Per Minborg
On Wed, 29 Mar 2023 08:24:38 GMT, Alan Bateman wrote: > Look fine, it can't be subclassed anyway so there is no compatibility impact. I thought the change would trigger a change in the public API as the modifiers are changed for the class. This would likely be picked up by compatibility checks

Re: RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Alan Bateman
On Wed, 29 Mar 2023 08:13:06 GMT, Per Minborg wrote: > Non-instantiable utility classes should be declared `final` and have a > private constructors. > > See Effective Java, Third Edition, Joshua Bloch (for example, Item 19 or Item > 22). Look fine, it can't be subclassed anyway so there is

RFR: 8305157: The java.util.Arrays class should be declared final

2023-03-29 Thread Per Minborg
Non-instantiable utility classes should be declared `final` and have a private constructors. See Effective Java, Third Edition, Joshua Bloch (for example, Item 19 or Item 22). - Commit messages: - Make java.util.Arrays final Changes: https://git.openjdk.org/jdk/pull/13221/files