The basic parser should fail. Without separators, parsed dates could be 
ambiguous.

2001123: Is this 2001-01-23 or 2001-12-03 or is is 200-11-23?

Stephen Colebourne wrote:
> But what should the basic parsers do?
>
> 20060204  (2006-02-04)
> 2006024  ????
>
> Currently the second one parses the same as the first.
>
> Stephen
>
>
> Stephen Colebourne wrote:
>   
>> I'm slowly moving to your position. Especially as that is what the code 
>> has done for years and no one has complained.
>>
>> I am sure that there are some people that want strict parsing, but as 
>> you say, some basic length checks would work.
>>
>> There is a bug in the millisecond parsing, but that can be dealt with 
>> separately.
>>
>> Stephen
>>
>>
>> Brian S O'Neill wrote:
>>     
>>> Should the parsers be lenient? I think they should. Making a lenient 
>>> parse strict is fairly easy in that you can compare the original input 
>>> to the well-formed output. Starting with a strict parser and making it 
>>> lenient is much more difficult.
>>>
>>> Also consider other uses for the parser. You might see a web form that 
>>> asks for a date to be supplied in this format. How many users will omit 
>>> the leading zeros? Answer: most. If the parser is strict, all developers 
>>> who create such a web form need to build and test their own lenient parser.
>>>
>>> Here's another comparison: Integer.parseInt() is also fairly lenient, as 
>>> is Double.parseDouble(). Both accept non-canonical forms of input.
>>>
>>> Stephen Colebourne wrote:
>>>       
>>>> Hi,
>>>> During testing I have found that ISODateTimeFormat parsing isn't quite 
>>>> as expected:
>>>>
>>>> Currently the following will all parse:
>>>> 2006-06-01
>>>> 2006-06-1
>>>> 2006-6-01
>>>> 2006-6-1
>>>>
>>>> Only the first is a correct ISO format.
>>>> Similar problems affect time parsing and the basic formats.
>>>>
>>>> Should this be changed so only the first of the four parses?
>>>> Or is this too radical a change now?
>>>>
>>>> Stephen
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.net email is sponsored by: Microsoft
>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>> _______________________________________________
>>>> Joda-interest mailing list
>>>> Joda-interest@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/joda-interest
>>>>
>>>>   
>>>>         
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> Joda-interest mailing list
>>> Joda-interest@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/joda-interest
>>>
>>>       
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Joda-interest mailing list
>> Joda-interest@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/joda-interest
>>
>>     
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Joda-interest mailing list
> Joda-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to