Just a switch with an enum, I will put it in. On Sat, Mar 12, 2016 at 2:08 PM, Nick Burch <apa...@gagravarr.org> wrote:
> On Sat, 12 Mar 2016, Mark Murphy wrote: > >> My new class org.apache.poi.ss.util.CellBorders has some private methods >> that respond to a subset of enum values being passed in. If the methods >> were private, I would throw an exception if an invalid enum value was >> passed, but since the methods are private, is that necessary? Well, it >> isn't necessary, but should I validate the parameter anyway even though it >> is always called with an explicit value within the class. >> > > At the time of writing the code, it'll be private, all written by one > person, and safe. However, several years later when a different committer > is reviewing a patch from a new community member, those assumptions could > be broken... > > Unless it has a bad performance penalty, I'd suggest playing safe, as the > code could live on for a long time! > > Nick > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org > For additional commands, e-mail: dev-h...@poi.apache.org > >