Skip to content

Getters can be computed twice when nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS #4030

Description

@altaiezior

Expected behavior

We may have getters with complex logic within, so we would want that getter to be computed only once but it can be computed twice, one for checking the nullability and other time for assigning the value. We may want to store the getter value in a variable, check for nullability and then assign the value.

Actual behavior

We should store the values from the getter methods in a variable and use the same variable for checking null and assiging the value

Steps to reproduce the problem

https://github.com/altaiezior/mapstruct-issues/tree/master/issue-4030

MapStruct Version

1.6.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions