MapStruct v1.4.0.Beta1 Release Notes
Release Date: 2020-06-01 // almost 4 years ago-
๐ Features
- ๐ Make use of constructor arguments when instantiating mapping targets (#73) - Also supports Java 14 records and Kotlin Data classes
- ๐ Support using "." for targeting current target object (#1406)
- ๐ Support value mapping between
String
andEnum
(#1557) - ๐ Support
@Mapping
in meta annotation (#807) - ๐ Support Gradle incremental annotation processing feature (#1420)
- ๐ User control over mapping features (direct, method, conversion, 2step) (#695)
- ๐ Support mapping from/to Java 14 records (preview feature) (#2014)
- โ Add
EnumTransformationStrategy
andEnumNamingStrategy
SPIs (#796, #1220, #1789, #1667 and PRs: #2089, #2100)
See release announcement for more information.
โจ Enhancements
- โ Add "verbose" processor option to print out details if required (#37) - Can be activated by using the compiler argument
mapstruct.verbose=true
- ๐ Qualifiers work dubiously in 2 step mappings (#1714) - See Behaviour changes
- Skip
java.lang.Object
as intermediate result in 2 step mappings (#1698) - โ Add imports to
@MapperConfig
(#1435) - 0๏ธโฃ Annotation processor option for default injection strategy (#1792)
- ๐ Inconsistency in support of containers (enum vs non enum type) (#1788) - Allow mapping between enum and non enum in the same way as mapping between primitive and objects
- โก๏ธ Strange error message when mapping with adder update method (#1719)
- ๐ Support for conversion between
java.time.LocalDateTime
andjavax.xml.datatype.XMLGregorianCalendar
(#1791) - Do not allow using qualifiedBy and qualifiedByName with expression in Mapping (#1851) - This never worked, with this change we are adding a compile error if you try to use it.
๐ Bug fixes
- 0๏ธโฃ
@BeanMapping(ignoreByDefault=true)
in@MapperConfig
not passed to mapping method (#1933) unmappedSourcePolicy
set to ERROR leads to a nested Bean issue (#1881)<ANY_REMAING>
and<ANY_UNMAPPED>
not ignored when inverting Value mapping (#1936)- 0๏ธโฃ
defaultExpression
not being applied when source property not specified explicitly (#1966) - Error mapping processor from Set to Array of Object (#2001)
- Wrong decorator class name used when Decorator class is nested inside mapper interface (#2021)
- MapStruct should work properly on the module path (#2060)
- "uses" entries ignored when used class is generated during annotation processing (#2056)
- Problems with compiling in Eclipse with the Lombok javaagent (#1159)
- NullPointer when accidentally using String source (#2077)
๐ Documentation
- Split reference guide source into an adoc file per chapter (#991)
- ๐ Documentation Update: jsr330/
@DecoratedWith
(#1773) - โ Add code-examples to Javadoc of
org.mapstruct.*
annotations (#166) @InheritInverseConfiguration
doesn't pickup ignore mapping (#1983)- ๐ Various typo fixes
๐ Build
- Replace hickory:prism with the new MapStruct Tools Gem (#2011)
- ๐ NullPointerException when building on OpenJDK 11 (#1675)
- ๐ท Move CI from Travis to GitHub Actions (#2019)
- ๐ Update Checkstyle to 8.29 (#2016)
- โ Switch to JUnit Jupiter and do not use Toolchains for the integration tests (#1308 and PR #2013)
- โก๏ธ Update tycho-compiler-jdt to 1.6.0 version (#1553)
- โ Remove plexus-container-default dependency (#1857)
Codebase Enhancements
- ๐จ Refactor
SourceReference
(#1745) - ๐จ Refactor: make sure that init of Mapping happens inside bean mapping scope (#1845)
- ๐จ Refactor the creation of ForgedMethod into a builder or static method creation (#1088)
model.source
should reflect source only and not (intermediate) creation state (#1867)- ๐จ Refactoring of
BeanMapping
andSource
/TargetReference
s (common base class) (PR #1903) - Simplify usage of inheritance of annotation fields in
@MapperConfig
,@Mapper
,@BeanMapping
,@Mapping
,@IterableMapping
and@MapMapping
(#1998) - Various codebase changes by using more Java 8 features
- โ Various codebase warning fixes (PRs: #1858, #1859, #1860, #1861, #1863, #1865, #1866, #1869, #1870, #1871, #1872)
- โ Remove
JaxbMapper
from integration tests (#724) - Not needed anymore, since MapStruct can work without it. No changes for users - โ Remove not used method "asCollectionOrMap" from
TypeFactory
(#1883) - โ Remove unused methods from class
SourceMethod
(#1897) - ๐จ Refactor class
org.mapstruct.ap.internal.util.Filters
(#1895) - โ Remove unused parameters from classes
TargetTypeSelector
,ValueMapping
,MethodRetrievalProcessor
(#1889) - ๐จ Refactoring class Type (#1914)
- ๐ Change return type
MapperConfiguration.getBuilderPrism
fromOptional<BuilderPrism>
toBuilderPrism
(#1911) - โ Remove unused constants in
JavaStreamConstants
(#1944) - ๐ Fix minor warnings with collection in package model and util (#1948)
- Simplify conditions in some classes (#1946)
- ๐ Use
Map.computeIfAbsent
inNestedTargetPropertyMappingHolder
(#1951) - ๐ Fix TODO items in integration tests (#1953)
- โ Add test case with properties with underscore verifying that it is working as expected (#2018)
- ๐จ
TargetReference
refactorings (#2069)
Behavior
Qualifiers should not qualify when no qualifier is found
Before when doing 2 step mappings MapStruct was forgetting the qualifiers and could select methods with other qualifiers. This is unexpected and has been changed so that qualifiers are always used.
๐ See Issue #1714 and PR #1739 for more information.
โ Removed Deprecated Enum mapping
๐ Before this release it was possible to use
@Mapping
for mapping enums. This is no longer possible and@ValueMapping
should be used before. There was a warning before, so if you don't have that in your build then you don't need to do anything.Contributors
๐ We'd like to thank all the contributors who worked on this release!