2013/8/14 Adrian Crum <adrian.c...@sandglass-software.com>

>
> On 8/14/2013 1:10 PM, Emmanuel Bourg wrote:
>
>> Le 14/08/2013 20:09, Benedikt Ritter a écrit :
>>
>>  Every factory method an the constructor now take a CSVFormat. How about
>>> using CSVFormat.DEFAULT is null is passed as CSVFormat?
>>>
>>
>> Keeping null is better, using the default format might hide a bug in the
>> calling code, and it could be difficult to figure it was caused by a null
>> value if no NPE is thrown.
>>
>> Emmanuel Bourg
>>
>
> I agree. Calling code needs to be explicit. Using the default would be
> appropriate for a no-arg constructor.


Very late follow up: I've added input parameter validation to all methods
that create CSVParsers. I've also removed the logic in CSVPrinter that used
CSVFormat.DEFAULT as fallback if null was passed in as format.

There is still one method that uses a fallback:

public static CSVParser parse(URL url, Charset charset, final CSVFormat
format)

uses Charset.forName("UTF-8") if null is passed in for charset. Does this
make sense? It may be confusing if this is the only method that uses a
fallback.


>
>
> -Adrian
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> dev-unsubscribe@commons.**apache.org<dev-unsubscr...@commons.apache.org>
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Reply via email to