poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Murphy <jmarkmur...@gmail.com>
Subject Re: Question about Java style
Date Sun, 13 Mar 2016 04:01:43 GMT
Just a switch with an enum, I will put it in.

On Sat, Mar 12, 2016 at 2:08 PM, Nick Burch <apache@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-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message