What methods should go into a java.util.Objects class in JDK 7?
Joseph D. Darcy
Joe.Darcy at Sun.COM
Fri Oct 9 18:38:40 PDT 2009
Paul Benedict wrote:
> I think java.util.Objects could benefit from the "final" modifier.
> Since its constructor always fails, there is no reason to subclass it
> (i.e., super constructor always fails). I believe Josh's "Effective
> Java" book makes such a point about static utility classes.
Classes with only private constructors, like j.u.Objects, are
effectively final. Adding final is harmless but unnecessary in these
cases. The platform is a bit inconsistent here; j.u.Collections is
*not* marked final while j.l.Math is. In practice, it doesn't matter
very much; I'll consider final-izing j.u.Objects on the next round of edits.
More information about the core-libs-dev