Skip to content

Adds test that asserts that Static @JsonCreator method does work - refs #229 #230

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

Conversation

mbknor
Copy link
Member

@mbknor mbknor commented Nov 2, 2015

This PR adds a test that shows that #229 does not work

@nbauernfeind
Copy link
Member

Thanks for providing a test. I will look at this within the week.


import com.fasterxml.jackson.annotation.JsonCreator;

import java.util.Objects;
Copy link
Member

Choose a reason for hiding this comment

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

This is an unused import - please remove.

@nbauernfeind
Copy link
Member

The good news is that this test passes in my 2.7.2 branch. The bad news is that I have no idea how quickly we'll be able to get it released =). If you update your PR (per my simple comment) we can merge the test in to prevent regressions.

@nbauernfeind
Copy link
Member

I suppose I can try and see if I can find the issue for earlier versions of jackson as well. Do you know which version of jackson you're using?

@mbknor
Copy link
Member Author

mbknor commented Feb 19, 2016

Unused import is removed in PR.

The test case in PR is using version 2.6.3, but we have seen this problem for 2.6.x

@nbauernfeind
Copy link
Member

This particular test seems to work for 2.6.0-1, 2.6.1, 2.6.2, 2.6.3, and the 2.6.4 snapshot. I have no doubt that there is an issue preventing dropwizard from working properly (per #229), but it must need more than this to trigger. I'll merge the test in and look into the other issue from another angle.

nbauernfeind added a commit that referenced this pull request Feb 22, 2016
…ic-creator-method

Adds test that asserts that Static @JsonCreator method does work - refs #229
@nbauernfeind nbauernfeind merged commit d01c5b2 into FasterXML:master Feb 22, 2016
@mbknor
Copy link
Member Author

mbknor commented Feb 22, 2016

After you said that the test-case worked for all 2.6.x versions, I did some more testing:

Looks like everything works fine as longe as you are using Java 1.6.

If the Java-class using the @JsonCreator is compiled using Java 1.8, the test case breaks.

This is how I can reproduce the issue using 1.6.3:

On command-line, prepare for using Java 1.6
start SBT and run CLEAN and TEST and see that everything works OK.
Then in intelliJ, where I have imported the same SBT projbect - BUT is using Java 1.8:
If you run the CreatorTest now, it works fine - because it is using the Java 1.6 compiled code.

Then add a line to the ValueHolder-class, then make the project so that only that file is recompiled.

If you now re-run the CreatorTest-test (which is still compiled using Java 1.6 with the rest of the module), then you will see that the test fails.

@nbauernfeind
Copy link
Member

Excellent, thanks for being patient and explaining how to reproduce it.

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