[threeten-dev] Review for parsing 2 to 4 years #218

Stephen Colebourne scolebourne at joda.org
Fri Apr 26 13:00:13 PDT 2013


On 26 Apr 2013 20:32, "roger riggs" <roger.riggs at oracle.com> wrote:
> Start with a hard one.  "yyMMdd" in the case where ReducedValue/NumberPP
is set to lenient.
>
> "76321" could be parsed as (76, 3, 21) or (76, 32, 1)

Should be 7, 63, 21

> "765432" could be parsed several ways.  (76, 5, 432) (76, 54, 32), etc.

76 54 32

The first is variable and the others fixed. Thus lenient could only impact
the first if others are fixed width.
Stephen

> The subsequentWidth mechanism only works for fixed fields
> following a variable width field.  If the parsing is set to lenient
> then what was a fixed field is now variable but the static mechanism
> for lookahead can't anticipate that.
>
> The current mechanism works fine as long as fixed width fields
> have the same width whether lenient or strict.  I think it is unnecessary
> and too big a change to modify NumberPP to extend lenient parsing to
> fixed width fields.
>
> Roger
>
>
>
>
> On 4/26/2013 2:13 PM, Stephen Colebourne wrote:
>>
>> On 26 April 2013 16:14, roger riggs <roger.riggs at oracle.com> wrote:
>>>
>>> Suggestions?
>>
>> I think we should start with a set of test cases we agree on. Then
>> whatever code needs to be changed will have to be changed. It sounds
>> like the adjacent value parsing mechanism will need some tweaking.
>>
>> Stephen
>
>


More information about the threeten-dev mailing list