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