I like these suggestions for method naming. On 11/13/05, Gary Gregory <[EMAIL PROTECTED]> wrote: > Hello: > > I am wondering if a "toXXX" name is not more appropriate since you are > converting rather than getting: > > ExceptionUtils.toMessageNoStackTrace(ex) > > Or simply: > > ExceptionUtils.toMessage(ex) > > Also, I wonder if 'Short' is really useful, if I give it 1000 lines, > it's not short. I think you just omit the bias issue by calling it: > > ExceptionUtils.toMessage (ex, stackFrameCount) > > Here, a descriptive parameter name like stackFrameCount avoids the need > to have a more complicated API name. > > Gary > > > > -----Original Message----- > > From: Stephen Colebourne [mailto:[EMAIL PROTECTED] > > Sent: Saturday, November 12, 2005 4:02 AM > > To: Jakarta Commons Developers List > > Subject: [lang] ExceptionUtils methods > > > > Could I propose some new methods for ExceptionUtils: > > > > - ExceptionUtils.getLogMessageNoStackTrace(ex) > > > > Returns a string of the form: > > IllegalArgumentException: Person must have a surname > > <ClassNameNoPackage>: <Message> > > > > - ExceptionUtils.getLogMessageShortStackTrace(ex, lines) > > > > Returns the same as above but with a short stack trace, eg for 2 > lines: > > IllegalArgumentException: Person must have a surname > > at org.apache.program.ValidatePerson.validate() > > at org.apache.program.Validator.validate() > > > > Potentially a variation on this could filter out certain stack trace > > lines. > > > > > > All code would be carefully null protected and designed for log > > messages. I think this is useful, but maybe it should form part of the > > logging tool (as well!)? > > > > Stephen > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
-- Steven Caswell [EMAIL PROTECTED] (c) 404-693-4148 (o) 404-260-2382 Take back the web - http://www.mozilla.org --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]