Thanks Felix I will use this utility class as well for toString().  It will help make toString() consistent.


On Dec 23, 2007 1:06 PM, Emmanuel Lecharny <> wrote:
> Checkstyle (I can't find, but it'd be anyway just about formatting)? Do you mean CPD (Copy/Paste Detector) ;-)

Yeah, I don't exactly recall all the tools you are using ;) I usually
don't use those tools ;)

> > 4) We should have a toString() method for each class, or at least for
> > each data structure. This is helpful for debugging purpose
> In most cases you just want to show the values of your class fields. If so you may want to have a look at commons-lang
> [1] and especially on its ToStringBuilder [2] function. It simplifies life really. Just add
> public String toString() {
>    return ToStringBuilder.reflectionToString(this);
> }
> to your class and your done.

Thanks for the trick ! I gonna try (and it will save me a lot of time,
for sure ;)

Emmanuel Lécharny