RFR:JDK-8148949:DateTimeFormatter pattern letters 'A','n','N'

Stephen Colebourne scolebourne at joda.org
Tue May 3 15:07:23 UTC 2016


The current behaviour is to use NORMAL for "A" and NOT_NEGATIVE for
"AA", "AAA" and so on. The sensible behaviour going forward is to use
NOT_NEGATIVE for all these, simply because the values do not make
sense to be negative. Given how these fields are nigh-on useless as
currently defined, this seems reasonable.

Stephen


On 3 May 2016 at 15:37, Roger Riggs <Roger.Riggs at oracle.com> wrote:
> Hi Nadeesh,
>
> src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder:1522-1524
>
> Is the switch from SignStyle.NOT_NEGATIVE to NORMAL intentional?
>
> The ValueRange of MilliOfDay for example is (0, 86400000-1), so negative
> values would be out of range.
>
> Similarly, NanoOfSecond and NanoOfDay are non-negative.   (Otherwise, there
> should be test cases for negative values).
>
> Thanks, Roger
>
>
>
> On 4/28/2016 4:04 PM, nadeesh tv wrote:
>
> Hi all,
> Thanks Stephen for the comments.
> Please see the updated webrev
> http://cr.openjdk.java.net/~ntv/8148949/webrev.02/
>
> Regards,
> Nadeesh
>
>
> On 4/28/2016 7:58 PM, Stephen Colebourne wrote:
>
> I'd like to see the test cases in test_secondsPattern() check the
> result of the parse (by passing more arguments from
> data_secondsPattern)
>
> Otherwise looks good.
> Stephen
>
> On 28 April 2016 at 14:12, nadeesh tv <nadeesh.tv at oracle.com> wrote:
>
> Hi all,
> Please see the updated webrev
> http://cr.openjdk.java.net/~ntv/8148949/webrev.01/
>
> Regards,
> Nadeesh TV
>
> On 4/25/2016 8:08 PM, nadeesh tv wrote:
>
> HI all,
> Please  review a fix for
> Bug ID - https://bugs.openjdk.java.net/browse/JDK-8148949
>
> Issue - Pattern letters 'A'  does not match the intent of LDML/CLDR
>
> Solution -  Changed the definition of pattern letters 'A','n','N'
>
> Webrev -  http://cr.openjdk.java.net/~ntv/8148949/webrev.00/
>
>
> --
> Thanks and Regards,
> Nadeesh TV
>
>
>



More information about the core-libs-dev mailing list