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

added SET_PROPERTY_CREATOR_AS_DEFAULT MapperFeature #1634

Merged
merged 2 commits into from
Jun 7, 2017

Conversation

lpandzic
Copy link
Contributor

Fixes #1631.
The tests for this are in the parameter names module.

@cowtowncoder
Copy link
Member

I'm sorry but I don't think this makes sense. This would enable auto-detection of all constructors, without annotation.

@lpandzic
Copy link
Contributor Author

Only for those for which creator data is created. This solves the issue of not providing @JsonCreator when using parameter names module and since it's disabled by default, there's no bc issue.

@@ -213,6 +213,8 @@
*/
INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIES(true),

SET_PROPERTY_CREATOR_AS_DEFAULT(false),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need javadoc, including both explanation and since 2.9 indicator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added javadoc

@cowtowncoder
Copy link
Member

Ah. Ok. So only gets called if "creator-ness" is first decided. Makes sense.

I think it'd be good to have a test case in jackson-databind itself if at all possible, since detection of cross-component breakages is bit more primitive at this point (Travis does have dependencies but it is easy to get detached, and seems to occasionally get false positives -- basically meaning some breakages are not immediately noticed).

@lpandzic
Copy link
Contributor Author

I agree that there should be a test, but I'm not sure what use case to cover without ParameterNamesModule. Constructor with JsonProperty parameters and without JsonCreator won't work.
Maybe a unit test?

@cowtowncoder
Copy link
Member

@lpandzic Right, a unit test could work. There are couple of tests that implement mock AnnotationIntrospector to imitate parameter names module (and Scala module's name handling functionality). I'll merge this and see if I can create a test.

@cowtowncoder cowtowncoder merged commit d6b78ae into FasterXML:master Jun 7, 2017
@lpandzic lpandzic deleted the #1631 branch June 11, 2017 07:44
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