MapStruct 1.4.2.Final bug fix released
It is my pleasure to announce the 1.4.2.Final bug fix release of MapStruct.
This release includes 2 enhancements, 10 bug fixes, and some documentation fixes.
The most notable enhancement is the relaxing of the strictness for Mapping#qualifiedByName
and Mapping#qualifier
for collection mappings.
Relaxing qualifiers for collections
In 1.4.0 we made the qualifiers stricter, which lead to certain things like delegating the Mapping#qualifiedByName
and Mapping#qualifiedBy
no longer working.
We relaxed this in 1.4.2 and now the following example works again.
@Mapper public interface TopologyMapper { @Mapping( target = "topologyFeatures", qualifiedByName = "Rivers" ) Topology mapTopologyAsRiver(TopologyDto dto); @Named("Rivers") default TopologyFeature mapRiver( TopologyFeatureDto dto ) { if ( dto instanceof RiverDto ) { River river = new River(); river.setLength( ( (RiverDto) dto ).getLength() ); river.setName( dto.getName() ); return river; } throws UnsupportedOperationException( "dto is not an instance of RiverDto" ); } }
Thanks
Thanks to our entire community for reporting these errors and being patient with our release schedule.
Happy coding with MapStruct 1.4.2!!
Download
You can fetch the new release from Maven Central using the following GAV coordinates:
- Annotation JAR: org.mapstruct:mapstruct:1.4.2.Final
- Annotation processor JAR: org.mapstruct:mapstruct-processor:1.4.2.Final
Alternatively, you can get ZIP and TAR.GZ distribution bundles - containing all the JARs, documentation etc. - from GitHub.
If you run into any trouble or would like to report a bug, feature request or similar, use the following channels to get in touch:
- Get help in our Gitter room or at the mapstruct-users group
- Report bugs and feature requests via the issue tracker
- Follow @GetMapStruct on Twitter