Git Product home page Git Product logo

Comments (8)

jhalterman avatar jhalterman commented on July 22, 2024

Yea, if you could post/attach/e-mail a JUnit test that would be great.

from modelmapper.

timohirt avatar timohirt commented on July 22, 2024

E-Mail sent. Could not attach it here.

from modelmapper.

timohirt avatar timohirt commented on July 22, 2024

Maybe fixed in versions > 0.5.4

from modelmapper.

jhalterman avatar jhalterman commented on July 22, 2024

The test actually passes for me with versions >= 0.4.0

from modelmapper.

timohirt avatar timohirt commented on July 22, 2024

Hmm, how could that be?

image

I am using JDK 1.7.11, Modelmapper 0.5.4 and JUnit 4.8.1.

Could you send me your running version of the test back? If you run it in eclipse or whatever IDE, please send me the whole code project.

from modelmapper.

jhalterman avatar jhalterman commented on July 22, 2024

Not sure - Mailed you my test project though.

from modelmapper.

timohirt avatar timohirt commented on July 22, 2024

It turned out I imported the User class from another package. Thus mapping did not apply. Thank you four your support.

However, this brings us to the problem I analysed before I ran into the failing test. It appears that the order in which type maps are created affects mapping.

Lets assume I create the following type map:

createTypeMap(ProjetType, Project)
createTypeMap(UserType, Person)

And now lets assume I change ordering as follows:

createTypeMap(UserType, Person)
createTypeMap(ProjetType, Project)

Mapping results shall be the same (in my opinion) but actually they are not. I modified the test and sent it back to you. Would be nice if you could take a look at it. And give some feedback.

from modelmapper.

jhalterman avatar jhalterman commented on July 22, 2024

Thanks for the followup. This is a known issue that indeed has to do with the order in which TypeMaps are created. See issue #25. This is a high priority for me to fix next, but for now I'll close this issue.

from modelmapper.

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.