fix: default value handling for optional#3854
fix: default value handling for optional#3854filiphr merged 12 commits intomapstruct:mainfrom MelleD:fix-null-handling-for-optional
Conversation
filiphr
left a comment
There was a problem hiding this comment.
The solution looks OK. However, there are way too many whitespace changes in the Type.java, can you please revert all those changes and only commit changes that are related to the issue. Makes it easier to review and merge.
But looks more that the file is broken and not formatted with you own code style. I used this one and saved the file: Thats the relevant change: But yes I could revert, but the next one get same issue with the code style, because the change with the spaces looks right, or? |
Remove empty line
fix if condition
I need to update the formatter, I've noticed that there are some changes in newer IntelliJ versions, also it is good practice to only format new code, at least that's what I try to do. Thanks for removing the whitespaces |
Mhm ok. For me it’s good practice in IntelliJ to use proper plugins like save actions and then have a clean format for the whole file and not only partly |
|
@filiphr done |
processor/src/main/java/org/mapstruct/ap/internal/model/common/Type.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/org/mapstruct/ap/internal/model/common/Type.java
Outdated
Show resolved
Hide resolved
processor/src/test/java/org/mapstruct/ap/test/bugs/_3852/Issue3852Mapper.java
Outdated
Show resolved
Hide resolved
No it's fine. I catched up and should fixed all (hopefully :) ). Please have a look again |
|
I polished it a bit and merged it. Thanks @MelleD |
This pull request introduces support for handling not nullable
Optionaltypes in the MapStruct framework and includes related test cases. The most significant changes involve adding a new method to check forOptionaltypes, modifying the handling of null values, and introducing test classes to validate the new functionality. Now the default isOptional.empty()instead ofnullFix #3852