On Sun, Dec 28, 2014 at 4:33 PM, Felix Schumacher <
felix.schumacher@internetallee.de> wrote:
> Hi all,
>
> I have two questions about getCalendar(Object, Calendar) in Converter.
>
> 1)
> Documentation says the default value would be the current date, while the
> code shows it will be defaultValue (second parameter). I will correct the
> documentation. (Well not really a question then :)
>
OK
>
> 2)
> The code is quite deep because of the exception handling. I think it
> would be nicer to use a for loop to iterate the possible formats. Should I
> do so? (Now that is a question)
>
Yes, but as you say in 3) code seems a bit weird
>
> 3)
> While the first (really the second) conversion uses date.toString() to
> convert date to a String, the following conversions assume that date is a
> String (using (String) date casts). That would be handled by a correct
> implementation for 2), or could be handled separately. Should I do so? (If
> so, by using for loop for 2, or just a simple toString() call?)
>
Code seems buggy or at least not clear for me, looking at callers it seems
parameter can be date or string. So if it's not date, it is string and I
don't understand in this case the toString
>
> Regards
> Felix
>
--
Cordialement.
Philippe Mouawad.
|