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

Fix for #1154 #1155

Merged
merged 2 commits into from
Mar 12, 2016
Merged

Fix for #1154 #1155

merged 2 commits into from
Mar 12, 2016

Conversation

yrodiere
Copy link
Contributor

@yrodiere yrodiere commented Mar 8, 2016

Fix for #1154. Partially rolls back to pre-#1111 behavior.
We just make sure that the STRING shape is chosen when Shape.ANY (the default) is set on the annotation, but some other annotation attribute was also set (pattern, locale or timezone).
This way of fixing the issue has the added benefit of respecting the user config regarding the default serialization of strings dates when @jsonformat(shape = Shape.ANY) is set on a property.

@cowtowncoder
Copy link
Member

Looks pretty good, but would it be possible to have a unit test that would fail before fix, pass after? Would be great to have something to guard against regression.

I may want to change the logic a little bit, however; if shape is explicitly defined as NUMBER, textual representation should not be enabled even if Locale (etc) happen to be specified: explicit shape value should have precedence. I can make that change, or you can do it, either way is fine.
I'll also need to merge this again 2.7 branch instead of master, to get in 2.7.3.

@yrodiere
Copy link
Contributor Author

yrodiere commented Mar 9, 2016

I'll add a test.

Regarding the "NUMBER" shape, from what I see it's already handled just a few lines above.

Partially roll back to pre-FasterXML#1111 behavior.
We just make sure that the STRING shape is chosen when Shape.ANY (the default) is set on the annotation, but some other annotation attribute was also set (pattern, locale or timezone).
This way of fixing the issue has the added benefit of respecting the user config regarding the default serialization of dates when @jsonformat(shape = Shape.ANY) is set on a property.
@yrodiere
Copy link
Contributor Author

yrodiere commented Mar 9, 2016

Here you go. I took the opportunity to rebase in order to:

  • make the test case appear first (so you can easily test before/after the fix)
  • squash my two fix commits

@cowtowncoder
Copy link
Member

Excellent! I'll be happy to merge this fix then.

One practical thing before merging your first contribution: we need filled Contributor License Agreement (CLA), from:

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

It is the only piece of process we require, and once that one-pager is received nothing more is needed for any contributions to Jackson projects.
The simplest way usually is to print it, fill & sign, scan and email to info at fasterxml dot com.

Thank you once again, looking forward to merging this & including in 2.7.3 patch (which should get out within about week).

@yrodiere
Copy link
Contributor Author

Done: I just sent the CLA.

cowtowncoder added a commit that referenced this pull request Mar 12, 2016
@cowtowncoder cowtowncoder merged commit 37034fc into FasterXML:master Mar 12, 2016
@cowtowncoder cowtowncoder added this to the 2.7.3 milestone Mar 12, 2016
@cowtowncoder
Copy link
Member

Thank you again for the contribution! This will be included in 2.7.3.

cowtowncoder added a commit that referenced this pull request Mar 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants