Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mapstruct monorepo to v1.6.3 #2886

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Nov 21, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
org.mapstruct:mapstruct-processor (source) 1.2.0.Final -> 1.6.3 age adoption passing confidence
org.mapstruct:mapstruct-jdk8 (source) 1.2.0.Final -> 1.6.3 age adoption passing confidence

Release Notes

mapstruct/mapstruct (org.mapstruct:mapstruct-processor)

v1.6.3

Compare Source

Bugs
  • Redundant if condition in Java record mapping with RETURN_DEFAULT strategy (#​3747)
  • Stackoverflow with Immutables custom builder (#​3370)
  • Unused import of java.time.LocalDate when mapping source LocalDateTime to target LocalDate (#​3732)
Documentation
  • Add section to README.md comparing mapstruct with Java Records (#​3751)

v1.6.2

Compare Source

Bugs
  • Regression from 1.6.1: ClassCastException when using records (#​3717)

v1.6.1

Compare Source

Enhancements
  • Use Java LinkedHashSet and LinkedHashMap new factory method with known capacity when on Java 19 or later (#​3113)
Bugs
  • Inverse Inheritance Strategy not working for ignored mappings only with target (#​3652)
  • Inconsistent ambiguous mapping method error when using SubclassMapping: generic vs raw types (#​3668)
  • Fix regression when using InheritInverseConfiguration with nested target properties and reversing target = "." (#​3670)
  • Deep mapping with multiple mappings broken in 1.6.0 (#​3667)
  • Two different constants are ignored in 1.6.0 (#​3673)
  • Inconsistent ambiguous mapping method error: generic vs raw types in 1.6.0 (#​3668)
  • Fix cross module records with interfaces not recognizing accessors (#​3661)
  • @AfterMapping methods are called twice when using target with builder (#​3678)
  • Compile error when using @AfterMapping method with Builder and TargetObject (#​3703)
Behaviour change
Inverse Inheritance Strategy not working for ignored mappings only with target

Prior to this fix @Mapping(target = "myProperty", ignore = true) was being ignored when using @InheritInverseConfiguration.

e.g.

@​Mapper
public interface ModelMapper {

    @​Mapping(target = "creationDate", ignore = true)
    Entity toEntity(Model model);    

    @​InheritInverseConfiguration
    Model toModel(Entity entity);
}

In the example above prior 1.6.1 the Model toModel(Entity entity) was going to map the id property. In order to keep that behavior you'll need to explicitly do the mapping for it.

@​Mapper
public interface ModelMappe {
    @​Mapping(target = "creationDate", ignore = true) // NOTE: Handled by JPA.
    Entity toEntity(Model model);    

    @​InheritInverseConfiguration
    @​Mapping(target = "creationDate", source = "creationDate") // Allow reading from Entity
    Model toModel(Entity entity);
}

v1.6.0

Compare Source

Previous Release Notes

v1.5.5.Final

Compare Source

Enhancements
  • Add support for Jakarta XML Binding (#​2730)
Bugs
  • BeanMappingOptions#ignoreUnmappedSourceProperties are not inherited via @InheritConfiguration (#​3248) - Regression from 1.5.3
Documentation
  • jakarta-cdi component model not in docs (#​3236)
  • Polish links in docs (#​3214)

v1.5.4.Final

Compare Source

Enhancements
  • Support for Jakarta @ApplicationScoped is missing (#​2950)
Bugs
  • Exceptions declared to be thrown by a mapping method, are not declared in generated mapping methods for nested types (#​3142)
  • DeepClone mapping control not generating third tier functions to clone (#​3135)
  • missing throws clauses when mapping enum with checked exceptions (#​3110)
  • Version 1.5.3 doesn't consider Mapping annotations for nested objects (worked with 1.5.2) (#​3057)
  • Cannot use only BeanMapping#mappingControl (#​3040)
Documentation
  • Document <THROW_EXCEPTION> in the reference guide (#​3112)

v1.5.3.Final

Compare Source

Bugs
  • Generic @AfterMapping does not consider @MappingTarget properly in 1.5 (#​3036)
  • Method annotated with @AfterMapping is not called (#​2955)
  • Ignored unknown source property error, but property exist (#​2743)
  • SubclassMapping doesn't honour mappingControl (#​3018)
  • Upgrade from 1.4.1 to 1.5.2 broke primitive to wrapper classes mapping (#​2921)
  • Conversion of BigDecimal to primitive double wrong with 1.5.2 (#​2913)
  • Ambiguous mapping methods when upgrading to MapStruct 1.5.0.RC1 (#​2840)
  • SubclassMapping stackoverflow exception (#​2825)
  • Optional wrapping pattern broken in 1.5.2.Final (#​2925)
  • Missing import in generated mapper when referencing a nested enum from an unrelated class (#​2945)
  • Unused import warning of nested classes (#​2907)
  • Compilation error in generated code for @Conditional and collection (#​2937)
  • Missing import of nested class (#​2897)
  • Ignoring unmapped source properties in inverse inheritance (#​2949)
  • Compilation error when mapping fields with the same type due to not wrapping in a try-catch block (#​2839)
  • Using @TargetType as a parameter for @Condition causes NPE during compiling (#​2882)
  • Cannot map from a covariant (extends) generic type (#​2677)
Documentation
Build
  • Build fails when running mvn test on an M1 Mac (#​2922)

v1.5.2.Final

Compare Source

Enhancements
  • Add support for Java Text Blocks in expressions (#​2837)
Bugs
  • Generated code does not include enclosing class when referring to nested class (#​2880)
  • SubclassExhaustiveStrategy.RUNTIME_EXCEPTION option does not work if the superclass has a non-empty constructor #​2891
Build
  • Codecov no longer publishes information for commits (#​2870)

v1.5.1.Final

Compare Source

Bugs
  • NullPointerException when reporting errors for non Mappers (#​2867)

v1.5.0.Final

Compare Source

Bugs
  • Compilation error due to missing import with nested classes (#​2797)
  • MapStruct 1.5.0 generates invalid code when using @Condition on a presence check for a generic wrapper (#​2795)
  • No compile error when conditionExpression and expression are used together (#​2794)
  • No import is added to generated class when using @BeforeMapping on a used mapper (#​2807)
Documentation
  • Error in the readme ( what is MapStruct paragraph ) (#​2851)
  • Enhance documentation around SPI usage (#​2739)
Build
  • Update jacoco maven plugin to compile on Java 17 (#​2835)
Previous Release Notes

v1.4.2.Final

Compare Source

Enhancement
  • Relax strictness for Mapping#qualifiedByName and Mapping#qualifier for collection mappings (#​2324, #​2346)
  • Mark mapstruct-processor jar as Spring-Boot-Jar-Type: annotation-processor (#​2244)
Bugs
  • Nested target properties uses same method for different mappings after upgrade from 1.3.1.Final to 1.4.1.Final (#​2236)
  • MapStruct 1.3.0.Final version is generating wrong code for optional collection getter fields (#​2233)
  • Problems with Optional<T> mapping (#​2295)
  • Nested source null check calls method twice instead of using intermediate variable (#​2245)
  • Mapper create invalid implementation - variable is already defined in method (#​2251)
  • Stack Trace instead of Message on Missing Mapping (#​2263)
  • Wrong reporting for unmapped source properties when source source is implicitly mapped (#​2253)
  • Getting either "Unknown property" or "Unmapped target property" (#​2301)
  • @InheritInverseConfiguration and @Mapping(target:"bean.childProperty", ignore=true) do not play together (#​2278)
  • Mappings are ignored when @InheritConfiguration defines a mapping for a sub-field (#​2318)
Documentation
  • Vague documentation and code samples of @Default annotation as of 1.4.X (#​2258)
  • Example uses wrong maven plugin configuration (#​2307)
  • Typo in @MapperConfig annotation in documentation (#​2293)

v1.4.1.Final

Compare Source

Bugs
  • @InheritConfiguration is broken when using multiple source parameters of the same type (#​2221)
  • @Mapping with defaultValue and method argument where is missing source does nothing (#​2220)
  • NPE when running MapStruct from IntelliJ 2020.3 EAP (#​2215) - 1.4.1.Final is the first MapStruct version that supports the new improved IntelliJ experience for annotation processor compiling. In order to avoid the NPE in older MapStruct releases you'll have to build your project with -Djps.track.ap.dependencies=false. More info about this is in IDEA-250718
  • @Mapping needs to define source parameter with defaultValue if you have two arguments in 1.4.0.Final (#​2214)
  • Mapping with qualifying and only target defined should implicitly look for a matching property in one of the parameters (#​2206)
  • Deep cloning creates intermediate methods for primitive arrays (#​2213)

v1.4.0.Final

Compare Source

For full upgrade instructions please read the release notes for the previous 1.4 releases:

Bugs
  • Possible regression: Wrong mapper code generation when using Builder (#​2195)
  • Qualifier is ignored in case of name based mapping when there are multiple source parameters (#​2125)
  • Invalid code generated for enum mapping when field name starts with underscore '_' and continues with digits (#​2197)

v1.3.1.Final

Compare Source

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)
  • 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)

v1.3.0.Final

Compare Source

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

Configuration

📅 Schedule: Branch creation - "before 6am" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Nov 21, 2024
Copy link

CCD diff report

No change

@FeliTam FeliTam closed this Nov 25, 2024
Copy link
Contributor Author

renovate bot commented Nov 25, 2024

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (1.6.3). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate bot deleted the renovate/mapstruct-monorepo branch November 25, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant