| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Issue #4086 is only partially fixed by PR #4110. The reused method's result nullability is honoured when it is provable - either an explicit @NonNull return type or a @NullMarked scope - but this reproducer (the verbatim snippet from the issue) leaves the return type unannotated and outside any @NullMarked scope, so it stays UNKNOWN and PROPERTYMAPPING_NULLABLE_SOURCE_TO_NON_NULL_CONSTRUCTOR_PARAM is still raised. @kush2439p plz verify using the verbatim snippet from #4086 |
Sorry, something went wrong.
Add handling for nullable source parameters in assignment.
|
Verified and fixed using the verbatim #4086 shape. The new Issue4086Mapper leaves mapValue's return type unannotated and outside any @NullMarked scope. The generated implementation now invokes it directly: payload = mapValue( source.getValue() );
Target target = new Target( payload );The compatibility rule is intentionally narrow: a helper that accepts @Nullable input is invoked directly when its result is not explicitly @Nullable; an explicit @Nullable return still produces PROPERTYMAPPING_NULLABLE_SOURCE_TO_NON_NULL_CONSTRUCTOR_PARAM. Verification:
The PR is ready for review. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #4106 by carrying the JSpecify input and output contracts of reused mapping methods through generated assignments.
MapStruct previously based null guards primarily on source/target nullability and null-value-check strategy. It did not retain whether a selected helper method required a non-null argument or guaranteed a non-null result, which could generate unsafe calls or reject safe constructor mappings.
Implementation
This also covers the related scenarios described in #4077, #4081, and #4086 without adding public API.
Verification
The full reactor clean install -DskipDistribution=true exceeded the local 15-minute command limit after the processor suite completed; the affected integration path and Checkstyle were rerun successfully afterward.