Skip to content

Revisit handling of missing fields (without default values) for immutable data classes [SPR-15877] #20432

Closed

Description

@spring-projects-issues

Juergen Hoeller opened SPR-15877 and commented

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.


Affects: 5.0 RC3

Issue Links:

Referenced from: commits ec345bf

1 votes, 4 watchers

Activity

  1. spring-projects-issues commented on Sep 27, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    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.

  2. added
    type: enhancement
    in: web
    on Jan 11, 2019
  3. added this to the 5.0 GA milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webtype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions