Code Monkey home page Code Monkey logo

Comments (7)

cowtowncoder avatar cowtowncoder commented on July 30, 2024

Yes, that seems wrong.

from jackson-modules-java8.

cowtowncoder avatar cowtowncoder commented on July 30, 2024

Unfortunately I can not reproduce this against 2.9.2. But I vaguely remember something like this, which was due to refactoring of type id handling in 2.9. So one thing to check is to make 100% sure that dependencies for jackson-core (especially) and jackson-databind are 2.9.2 and not, say, 2.9.0.
(jackson-annotations is fine to be 2.9.0 -- this jar never changes in patches).

from jackson-modules-java8.

unintended avatar unintended commented on July 30, 2024

I made a test project for it https://github.com/unintended/localdatetest
All the dependencies are 2.9.2, but it still fails:

$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building localdate-test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ localdate-test ---
[INFO] com.jackson.test:localdate-test:jar:1.0-SNAPSHOT
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.9.2:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.2:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.2:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.9.2:compile
[INFO] +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.2:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.2:compile
[INFO] \- junit:junit:jar:4.12:test
[INFO]    \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.990 s
[INFO] Finished at: 2017-12-07T11:59:41+03:00
[INFO] Final Memory: 14M/309M
[INFO] ------------------------------------------------------------------------

The strange thing is that in console log it's logged as double and triple brackets:

testLocalDateSerialization(com.jackson.test.ObjectMapperTest)  Time elapsed: 0.299 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<...va.time.LocalDate":[[2017,12,5]]}}> but was:<...va.time.LocalDate":[[[2017,12,5]]]}}>

In IDEA still:

org.junit.ComparisonFailure: 
Expected :{"localDate":[2017,12,5],"object":{"java.time.LocalDate":[2017,12,5]}}
Actual   :{"localDate":[2017,12,5],"object":{"java.time.LocalDate":[[2017,12,5]]}}

from jackson-modules-java8.

unintended avatar unintended commented on July 30, 2024

2.8.10 works well btw

from jackson-modules-java8.

cowtowncoder avatar cowtowncoder commented on July 30, 2024

Hmmh. Well that is odd. Will try to see if I can reproduce it locally then.
As I said, problem itself does sound familiar, I just do not remember where. Another thing that is different is inclusion of parameter names module, but I don't think that should matter here.

from jackson-modules-java8.

unintended avatar unintended commented on July 30, 2024

It’s just a copy-paste from my main project, so I forgot to remove parameter module from dependencies, but during experiments I tried to remove it, and it didn’t make any difference.

from jackson-modules-java8.

cowtowncoder avatar cowtowncoder commented on July 30, 2024

Oh lol. My test failed to fail because it wasn't being run. Once that is resolved it fails as expected.
And I think I can see why now; it is not overriding default polymorphic type handling from base implementation, which assumers scalar representation.

from jackson-modules-java8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.