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

fix(deps): update mapstruct monorepo to v1.6.3 (minor) #164

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

LNDS-Sysadmins
Copy link
Contributor

@LNDS-Sysadmins LNDS-Sysadmins commented Nov 29, 2024

This PR contains the following updates:

Package Type Update Change
org.mapstruct:mapstruct-processor (source) provided minor 1.5.5.Final -> 1.6.3
org.mapstruct:mapstruct (source) compile minor 1.5.5.Final -> 1.6.3

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

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

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

Rebasing: Whenever PR is behind base branch, 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 has been generated by Renovate Bot.

Summary by Sourcery

Update MapStruct dependencies to version 1.6.3, addressing several bugs and enhancing performance with new Java factory methods. Update documentation to include a comparison of MapStruct with Java Records.

Bug Fixes:

  • Fix redundant if condition in Java record mapping with RETURN_DEFAULT strategy.
  • Resolve StackOverflowError with Immutables custom builder.
  • Remove unused import of java.time.LocalDate when mapping source LocalDateTime to target LocalDate.
  • Fix ClassCastException when using records.

Enhancements:

  • Use Java LinkedHashSet and LinkedHashMap new factory method with known capacity when on Java 19 or later.

Documentation:

  • Add section to README.md comparing mapstruct with Java Records.

Copy link

sourcery-ai bot commented Nov 29, 2024

Reviewer's Guide by Sourcery

This PR updates the MapStruct dependency from version 1.5.5.Final to 1.6.3. The update includes several bug fixes, particularly around Java record mappings, builder patterns, and mapping inheritance. The change is implemented through a simple version update in the project's pom.xml file.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Update MapStruct version in project properties
  • Update mapstruct.version property from 1.5.5.Final to 1.6.3
  • Update both mapstruct and mapstruct-processor dependencies through version property
pom.xml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have skipped reviewing this pull request. We don't review packaging changes - Let us know if you'd like us to change this.

@brunopacheco1 brunopacheco1 merged commit 27eb4d1 into main Nov 29, 2024
3 checks passed
@brunopacheco1 brunopacheco1 deleted the renovate/mapstruct-monorepo branch November 29, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants