avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Hammant <Paul_Hamm...@yahoo.com>
Subject toString()
Date Thu, 13 Sep 2001 13:35:49 GMT

Re recent diffs....

Generally I am against overriding toString() in classes.  The only way 
you can get the true object reference for debugging is to do a toString 
: "org.apache.Thing@a3b2c3"  That is useful when you are hunting 
problems with multiple instances of a thing or the wrong instance of 
thing.  Of course I am talking of traditional debugging  - 
System.out.println("blah blah " + m_thing).  By overriding toString() 
that is not longer possible.  Perhaps another method name for what you 
are trying to do?  "String debug()"

- Paul

To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org

View raw message