Summary
The java.util.Arrays
class should be declared final.
Problem
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).
Solution
Declare the class 'final'.
Specification
The class should be declared 'final'. This means, any attempt to create a sub-class will fail. The Arrays
class only contains static methods which can be shadowed but not overridden.
- csr of
-
JDK-8305157 The java.util.Arrays class should be declared final
- Resolved