Sorry for the late response. Haven't seen you answer in my mailbox. I 
filled in a ticket at sourceforge 
https://sourceforge.net/tracker2/?func=detail&aid=2495455&group_id=97367&atid=617889

> This may be a bug. It looks like it might not grab the fields from the 
> appended formatter properly. Perhaps you could raise a bug report, so we 
> don't lose this?
> Stephen
>
> Bjoern Ricks wrote:
>   
>> Hi,
>>
>> I am trying to use joda-time for xml schema duration type parsing. After 
>> creating some junit tests I wasn't able to parse the value 
>> "PT1003199059S" with "new 
>> PeriodFormatterBuilder().rejectSignedValues(true).append(ISOPeriodFormat.standard()
>>  
>> ).toFormatter();" Therefore I played around with the 
>> PeriodFormatterBuilder and built a new test which is:
>>
>>   public void testPeriod() {
>>
>>       PeriodFormatterBuilder pfmtbuilder1 = new 
>> PeriodFormatterBuilder().rejectSignedValues(true)
>>    .appendLiteral("P")
>>    .appendYears()
>>    .appendSuffix("Y")
>>    .appendMonths()
>>    .appendSuffix("M")
>>    .appendWeeks()
>>    .appendSuffix("W")
>>    .appendDays()
>>    .appendSuffix("D")
>>    .appendSeparatorIfFieldsAfter("T")
>>    .appendHours()
>>    .appendSuffix("H")
>>    .appendMinutes()
>>    .appendSuffix("M")
>>    .appendSecondsWithOptionalMillis()
>>    .appendSuffix("S");
>>
>>       PeriodFormatterBuilder pfmtbuilder2 = new 
>> PeriodFormatterBuilder().rejectSignedValues(true);             
>> PeriodFormatter pfmt1 = pfmtbuilder1.toFormatter();
>>    PeriodFormatter pfmt2 = 
>> pfmtbuilder2.append(ISOPeriodFormat.standard() ).toFormatter();
>>
>>    pfmt1.parsePeriod("PT1003199059S");
>>    pfmt2.parsePeriod("PT1003199059S");
>> }
>>
>>
>> In my opinion both PeriodFormatters should be equal because I copied the 
>> code of pfmtbuilder1 from ISOPeriodFormat.standard() but 
>> pfmt2.parsePeriod("PT1003199059S") always fails.
>>
>> Is this a bug of joda-time or is this behaviour intented? My version of 
>> joda-time is 1.6.
>>
>>
>>     
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Joda-interest mailing list
> Joda-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>   

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to