2011/8/4 Gilles Sadowski <gil...@harfang.homelinux.org>: >> [...] >> >> The management of the exception messages through String constants and enums >> is >> in my view a very clean thing. Should we do the same for exception context >> keys? Have a big enum holding keys? > > I'd rather not, but I'm afraid that others will think otherwise :-}. > >> Or should we define these keys as >> constant, public fields inside those classes which throw exceptions? Or, are >> we happy with inlining the string, just like in your piece of code? > > If the string appears only once, I'd be happy with inlining. If more than > once, a (private) constant is better (to quiet CheckStyle). > >> [...] >
I'd rather have these fields public (final, static), so that users could use them to retrieve the values associated with the keys. If that's all right with you, of course. Sebastien --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org