You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Revisit handling of missing fields (without default values) for immutable data classes [SPR-15877] #20432
Following up on #20426 and #20101, there is still a case to be revisited: namely missing fields (without default values provided by Kotlin) which we currently inject as a null value. While this can be acceptable for object types, it leads to an IllegalArgumentException on construction for primitive types which is definitely worth improving. We could also reject such missing fields upfront if there are no default values or optional declarations for them.
Also, the WebFlux ModelAttributeMethodArgumentResolver needs to catch up around all of those RC4 refinements eventually.
We're sending null values through type conversion now for proper detection of primitive mismatches and also for java.util.Optional support now... but only for regular parameters, not for Kotlin's optional parameters which we're explicitly detecting there.
We also have a KotlinDetector delegate in org.springframework.core now, for the common detection of Kotlin's presence and for identifying Kotlin types and Kotlin's optional parameters.
Activity
spring-projects-issues commentedon Sep 27, 2017
Juergen Hoeller commented
We're sending
nullvalues through type conversion now for proper detection of primitive mismatches and also forjava.util.Optionalsupport now... but only for regular parameters, not for Kotlin's optional parameters which we're explicitly detecting there.We also have a
KotlinDetectordelegate inorg.springframework.corenow, for the common detection of Kotlin's presence and for identifying Kotlin types and Kotlin's optional parameters.