Skip to content

added SET_PROPERTY_CREATOR_AS_DEFAULT MapperFeature#1634

Merged
cowtowncoder merged 2 commits intoFasterXML:masterfrom
lpandzic:#1631
Jun 7, 2017
Merged

added SET_PROPERTY_CREATOR_AS_DEFAULT MapperFeature#1634
cowtowncoder merged 2 commits intoFasterXML:masterfrom
lpandzic:#1631

Conversation

@lpandzic
Copy link
Copy Markdown
Contributor

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

@cowtowncoder
Copy link
Copy Markdown
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
Copy Markdown
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.

*/
INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIES(true),

SET_PROPERTY_CREATOR_AS_DEFAULT(false),
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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