MapStruct v1.3.1.Final Release Notes

Release Date: 2019-09-29 // 16 days ago
  • ✨ Enhancements

    • @AfterMapping methods with non unique parameters (#1457) - Stricter matching for lifecycle methods / non-unique parameters
      In case a lifecycle method has multiple matching parameters (e. g. same type)
      all parameter names must match exactly with the ones from the mapping method,
      ⚠ otherwise the lifecycle method will not be used and a warning will be shown.
    • 🏗 Ability to disable builders on method level via Builder#disableBuilder (#1661)
    • Vague message when handling nested property mapping (#1756)

    🐛 Bug fixes

    • MapStruct producing uncompilable code when using bounded wildcard (#1738)
    • 🐛 Bug with Nested Properties and ReportingPolicy.ERROR on Unmapped Source Properties (#1772)
    • 👉 Make MapStruct generate compilable mapping code for attributes of type EnumSet (#1797)
    • 0️⃣ StackOverflowError in DefaultBuilderProvider` when a type has a public static generic method that returns the type (#1751)
    • 👻 Null pointer exception in nested property mapping method with presence check (#1826)
    • 1.3.0.Final Regression in nullValuePropertyMappingStrategy when inherited (#1790)
    • Some Mappers using @Context not yielding Impl classes in Java11 (#1904)
    • Fluent setters on fields with names starting with set are not working #1799
    • MapStruct 1.3.0.Final produces uncompilable code when using Java 11 + Lombok 1.18.6 (#1742)
    • 🏗 Using constructor as builderCreationMethod in custom builder provider causes NullPointerException (#1801)
    • MapStruct 1.3.0.Final generates invalid implementation when nested property of target is populated with multiple nested properties of source (#1828)
    • Nullptr in 1.3.0.Final due to result type definition (#1821)

    📚 Documentation

    • ⚡️ Clarify use of clearing collections in case of update methods (#1142)
    • 🛠 Fix typo in documentation (PR #1760)
    • 🛠 Fix typo and code error in documentation (PR #1779)
    • 📚 Wrong documentation in relation to NullValueMappingStrategy.RETURN_DEFAULT (#1784)
    • 📚 Documentation clarification on obtaining Mapper (#1819)
    • 👌 Improve terms in qualifier docs (PR #1814)
    • 📚 Update @MappingTarget documentation to take builders (#1862)

Previous changes from v1.3.0.Final

  • 🚀 This contains only changes between 1.3.0.Beta2 and 1.3.0.Final. To read the changes from the betas go to 1.3.0.Beta1 and 1.3.0.Beta2

    ✨ Enhancements

    • 👌 Improvement: builder for Mapper/Decorator/GeneratedType (PR #1649)
    • Builtin mapping of String <-> Duration/Period/Instant (#1656)
    • ➕ Add Mappers.getMapperClass for getting the class of a Mapper (#1657)
    • Defaults for `NullValuePropertyMapping#SET_TO_DEFAULT (boxed types, Strings and primitives) (#1699)
    • Optimising code (local variables) for CollectionMappingStrategy#ADDER_PREFERRED
    • NullValuePropertyMapping strategy not implemented fully (#1685)
    • Consider sensible defaults for NullValuePropertyMappingStrategy.SET_TO_DEFAULT (#1699)
    • Optimise AdderWrapper / StreamAdderWrapper to use local variable (#1700)

    🐛 Bug fixes

    • unmappedSourcePolicy may lead to false positives (#1648)
    • Static factory method incorrectly recognised as a fluent setter (#1660) - With the fix for this a method is only considered a candidate if it is public not static
    • ➕ Adder with primitive type not being used (#1665)
    • Nested mapping & MappingTarget - "cannot find symbol" (#1650)
    • NullValuePropertyMappingStrategy was not implemented completely (#1685)
    • ⚡️ Non-void update methods try calling build() on the @MappingTarget when a Builder is available (#1681)
    • Uncompilable code is generated when mapping Stream to List and using @AfterMapping on result (#1707)

    📚 Documentation

    • 📚 Use Repeatable Mapping annotation in the reference documentation (#1645)
    • ⚡️ Update gradle installation guide (#1695)

    🏗 Build