[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Integrated: 8260468: Wrong behavior of LocalDateTimeStringConverter
From:       Nir Lisker <nlisker () openjdk ! java ! net>
Date:       2021-02-23 18:05:42
Message-ID: PXw8l8C7VjWUVUdEAK-YxCp9527wxR5EggAW95PN0C4=.0475969e-f787-4e25-851f-49140db038a0 () github ! com
[Download RAW message or body]

On Thu, 4 Feb 2021 20:01:10 GMT, Nir Lisker <nlisker@openjdk.org> wrote:

> Fixes a mutability issue for `LocalDateTimeStringConverter` (and \
> `LocalDateStringConverter`) where the chronology can change during the lifetime of \
> the instance and cause an inconsistent state. The following changes were made: 
> * The input is now formatted and parsed directly with the formatter and parser \
> (which are configured with a chronology) without the chronology field value of the \
>                 class.
> * The chronology field value does not change anymore when there is an exception due \
>                 to inability to format the date.
> * Logging on failed formatting was removed as it did not seem useful. The formatter \
> will throw the same exception that the chronology field does anyway, so there is \
> not much use to catching the exception before hand. 
> Added a test that fails without this patch. The test creates a converter with an \
> explicit `Chronology` and `null` parser and formatter. The default formatter that \
> is created with the given chronology formats a legal date (with respect to the \
> chronology) to a string, which the parser should be able to convert back to a date. \
> However, by forcing an exception in the formatting process using an illegal date, \
> the chronology changes, and now when the parser is used it is configured with the \
> new chronology and it can't parse the string correctly.

This pull request has now been integrated.

Changeset: e25d39b0
Author:    Nir Lisker <nlisker@openjdk.org>
URL:       https://git.openjdk.java.net/jfx/commit/e25d39b0
Stats:     44 lines in 2 files changed: 15 ins; 25 del; 4 mod

8260468: Wrong behavior of LocalDateTimeStringConverter

Reviewed-by: kcr, pbansal

-------------

PR: https://git.openjdk.java.net/jfx/pull/393


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic