Am 14. März 2012 22:02 schrieb Emmanuel Bourg <ebo...@apache.org>: > Le 14/03/2012 21:52, Benedikt Ritter a écrit : > > >> the subject of this mail is pretty self-explanatory. Why do we need a >> package private validate() method, given the fact, that users can not >> create custom instances (constructor is package private)? You could >> even argue, that no validation is needed at all, since we are in >> control of what formats can be created. However I'd say, the >> validation makes sure that we do not unintentionally create invalid >> formats. But then validate() can be made private and called at the end >> of the constructor. > > > Because the format could temporarily be in an invalid state. Something like > this would break (a bit far fetched, I agree): > > CSVFormat.DEFAULT.withDelimiter('#').withCommentStart('/'); >
okay, I understand. But doesn't that make things worse? Users can create invalid formats, but they can not call validate(), because it is package private. > Emmanuel Bourg > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org