My final comment on this trifling matter is regarding the documentation. I don't think private methods/fields are included in the JDK's javadoc. If the private constructor will not appear, I recommend adding "final" and/or documenting the class as not instantiable/subclassable. Now that I know the compiler will warn about this issue (thank you Bob), the next consideration is for those who are reading the docs online.
Paul On Fri, Oct 9, 2009 at 9:07 PM, Bob Lee <crazy...@crazybob.org> wrote: > On Fri, Oct 9, 2009 at 6:55 PM, Paul Benedict <pbened...@apache.org> wrote: >> >> Understood, but the keyword (pun) here is "effectively". Why let a >> developer wait until runtime to find out his code will fail? At least >> by marking the class as final, anybody who wishes to subclass it will >> receive a compiler error. Rain on the parade early :-) > > Paul, this is caught at compile time, since you can't call the private > constructor. The "final" would be redundant. > Bob