|
| 1 | +--- |
| 2 | +title: "MapStruct 1.6.1 bug fix released" |
| 3 | +author: Filip Hrisafov |
| 4 | +date: "2024-09-15" |
| 5 | +tags: [release, news] |
| 6 | +--- |
| 7 | + |
| 8 | +It is my pleasure to announce the 1.6.1 bug fix release of MapStruct. |
| 9 | +This release includes 1 enhancement and 8 bug fixes, including some regressions introduced in 1.6.0. |
| 10 | + |
| 11 | +With this release we support the use of the Java 19 `LinkedHashSet` and `LinkedHashMap` factory methods. |
| 12 | + |
| 13 | +<!--more--> |
| 14 | + |
| 15 | +### LinkedHashSet and LinkedHashMap factory method |
| 16 | + |
| 17 | +With this release if your source code is Java 19 or later MapStruct is going to use the new factory methods when creating a `Set` or `Map` |
| 18 | + |
| 19 | +On Java 18 or earlier it looks like |
| 20 | + |
| 21 | +{{< prettify java >}} |
| 22 | +Map<AuctionDto, AuctionDto> map = new LinkedHashMap<AuctionDto, AuctionDto>( Math.max( (int) ( auctions.size() / .75f ) + 1, 16 ) ); |
| 23 | +Set<TargetFoo> set = new LinkedHashSet<TargetFoo>( Math.max( (int) ( foos.size() / .75f ) + 1, 16 ) ); |
| 24 | +{{< /prettify >}} |
| 25 | + |
| 26 | +Whereas on Java 19 or later it looks like |
| 27 | +{{< prettify java >}} |
| 28 | +Map<AuctionDto, AuctionDto> map = LinkedHashMap.newLinkedHashMap( auctions.size() ); |
| 29 | +Set<TargetFoo> set = LinkedHashSet.newLinkedHashSet( foos.size() ); |
| 30 | +{{< /prettify >}} |
| 31 | + |
| 32 | +### Thanks |
| 33 | + |
| 34 | +Thanks to our entire community for reporting these errors. |
| 35 | + |
| 36 | +In alphabetic order this are all the contributors that contributed to the 1.6.1 release of Mapstruct: |
| 37 | + |
| 38 | +* [@hduelme](https://github.com/hduelme) |
| 39 | +* [@Hypnagokali](https://github.com/Hypnagokali) |
| 40 | +* [@Obolrom](https://github.com/Obolrom) |
| 41 | + |
| 42 | +We are also accepting donations through [Open Collective](https://opencollective.com/mapstruct) or [GitHub](https://github.com/sponsors/mapstruct). |
| 43 | +We'd like to thank all the supporters that supported us with donations in this period: |
| 44 | + |
| 45 | +* [adesso SE](https://github.com/adessoSE) |
| 46 | +* [Bileto](https://opencollective.com/bileto) |
| 47 | +* [Cybozu](https://github.com/cybozu) |
| 48 | +* [Frederik Hahne](https://opencollective.com/atomfrede) |
| 49 | +* [Juyoung Kim](https://github.com/kjuyoung) |
| 50 | +* [Lansana](https://opencollective.com/lansana) |
| 51 | +* [Lee Anne](https://github.com/AnneMayor) |
| 52 | +* [Mariselvam](https://github.com/marisnb) |
| 53 | +* [PRISMA European Capacity Platform GmbH](https://github.com/jan-prisma) |
| 54 | +* [St. Galler Kantonalbank AG](https://opencollective.com/st-galler-kantonalbank-ag) |
| 55 | + |
| 56 | +Happy coding with MapStruct 1.6.1!! |
| 57 | + |
| 58 | +### Download |
| 59 | + |
| 60 | +You can fetch the new release from Maven Central using the following GAV coordinates: |
| 61 | + |
| 62 | +* Annotation JAR: [org.mapstruct:mapstruct:1.6.1](http://search.maven.org/#artifactdetails|org.mapstruct|mapstruct|1.6.1|jar) |
| 63 | +* Annotation processor JAR: [org.mapstruct:mapstruct-processor:1.6.1](http://search.maven.org/#artifactdetails|org.mapstruct|mapstruct-processor|1.6.1|jar) |
| 64 | + |
| 65 | +Alternatively, you can get ZIP and TAR.GZ distribution bundles - containing all the JARs, documentation etc. - [from GitHub](https://github.com/mapstruct/mapstruct/releases/tag/1.6.1). |
| 66 | + |
| 67 | +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: |
| 68 | + |
| 69 | +* Get help in our [GitHub Discussions](https://github.com/mapstruct/mapstruct/discussions) or [StackOverflow](https://stackoverflow.com/questions/tagged/mapstruct) |
| 70 | +* Report bugs and feature requests via the [issue tracker](https://github.com/mapstruct/mapstruct/issues) |
| 71 | +* Follow [@GetMapStruct](https://twitter.com/GetMapStruct) on Twitter |
| 72 | + |
0 commit comments