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

Change semantics of @JsonPropertyOrder(alphabetic) to only count true value #840

Closed
cowtowncoder opened this issue Jun 24, 2015 · 0 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

(for background, see: FasterXML/jackson-dataformat-csv#74)

One problem with @JsonPropertyOrder, is that since Java Annotations can not take null values (a clear flaw in Annotation system in Java), or any other optionality, annotation like:

@JsonPropertyOrder(value={ "a", "b" })

will actually mean following, due to (need for) value defaulting:

@JsonPropertyOrder(value={ "a", "b" }, alphabetic=false)

Now: this is ok in general, except for one thing: there is global feature to enable alphabetic sorting, and thus annotation usage may accidentally turn off this sorting. That in turn causes problems for dataformats like CSV and Avro, where position/order of values is critically important.

But since it seems unlikely that setting of alphabetic=false would be of any use to anyone (some other settings might be useful for sorting, but "default" of "whatever JDK offers" is not), it's better to consider such setting to mean "use defaults".

So let's change this for 2.6.

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

No branches or pull requests

1 participant