Hi James,
IMHO I can't see the real need for this improvement,
any way, I disagree with this case

BooleanUtils.toBoolean(null, null) = true

Regards

--Filippo

2014-10-09 9:49 GMT+02:00 James Sawle <jamessa...@hotmail.com>:
> I have created a patch for the above issue, which adds a new method signature 
> to simplify the conversion from Strings to Booleans based upon a single true 
> boolean String. This is therefore unlike the other methods, which either take 
> no parameters (use a prebuilt list of true and false values), or require the 
> user to provide a true, false and null value that the parameter must match.
> It has been pointed out by Duncan Jones, that this is jus syntactic sugar, 
> due to it purely wrapping the StringUtils.equals method. Therefore the 
> question is, whether having this simple method would drastically improve 
> readability in calling code, or whether this would just be code bloat for the 
> sake of it.
> Personally, there is another option, which would be to have a version of the 
> method that takes a varargs of true values. This could therefore be more 
> useful in general cases, and could be used to simplify some of the underlying 
> String to boolean conversions. However, it should then be noted that this 
> would just become a contains check, with added protection around null values. 
> This would possibly also be more used to StringUtils with a wrapper method 
> within the BooleanUtils, which again raises the question of code bloat.
> Any comments would be much appreciated.

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

Reply via email to