Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonFormat timezone attribute effect overwritten if pattern attribute present #98

Open
gviczai opened this issue Aug 16, 2018 · 4 comments
Labels
2.15 good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project need-test-case Reproduction of the problem requires a test case

Comments

@gviczai
Copy link

gviczai commented Aug 16, 2018

In JacksonJodaDateFormat:

public JacksonJodaDateFormat with(JsonFormat.Value ann) {
        JacksonJodaDateFormat format = this;
        format = format.withLocale(ann.getLocale());
        format = format.withTimeZone(ann.getTimeZone());
        format = format.withFormat(ann.getPattern().trim());

The withFormat() call overwrites the DateTimeFormatter created by withTimeZone() call.
So the resulting object in the _formatter field of JacksonJodaDateFormat will have the iZone field value set to null.

@cowtowncoder cowtowncoder added 2.9 active Issue being actively investigated and/or worked on labels Aug 22, 2018
@cowtowncoder
Copy link
Member

Hmmh. This may be tricky one, due to tight coupling of format and timezone by JDK. But I'll have a look.
Thank you for reporting this.

@cowtowncoder cowtowncoder added 2.10 good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project and removed 2.9 active Issue being actively investigated and/or worked on labels Oct 3, 2019
@cowtowncoder
Copy link
Member

Seems like new contributor friendly, will label as such.

@cowtowncoder cowtowncoder changed the title JsonFormat timezone attribute effect overwritten if pattern attribute present JsonFormat timezone attribute effect overwritten if pattern attribute present Oct 3, 2019
@cowtowncoder cowtowncoder added 2.11 need-test-case Reproduction of the problem requires a test case and removed 2.10 good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project labels Apr 16, 2020
@cowtowncoder
Copy link
Member

I just realized that I would need a test case here to see what the problem is: description is not enough to see what is going wrong.

@cowtowncoder cowtowncoder removed the 2.11 label Apr 16, 2020
@cowtowncoder cowtowncoder added 2.12 good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project labels Aug 19, 2020
@cowtowncoder
Copy link
Member

I think this might still be doable, wrt investigation: description suggests how to possibly create the unit test.

@cowtowncoder cowtowncoder added 2.14 and removed 2.12 need-test-case Reproduction of the problem requires a test case labels Jul 9, 2021
@cowtowncoder cowtowncoder added 2.15 need-test-case Reproduction of the problem requires a test case and removed 2.14 labels Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.15 good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project need-test-case Reproduction of the problem requires a test case
Projects
None yet
Development

No branches or pull requests

2 participants