thanksforallthefish
03/01/2019, 9:34 AM1.3.21
and the base classes are from spring (maybe I can post in spring channel as well, but this seems more generally related to kotlin, spring is relevant only because I have no influence on how enhance
is called, it has to accept `null`s)Andreas Sinz
03/01/2019, 9:44 AM@Nullable
thanksforallthefish
03/01/2019, 9:46 AMHateoasSortHandlerMethodArgumentResolver
comes from a library. @Nullable
would solve the issue thoughRobert Jaros
03/01/2019, 9:51 AMthanksforallthefish
03/01/2019, 9:56 AMsort
query parameter (which is optional). If no sort
parameter is received, the framework (spring-data
) calls the enhance
method with null
. does this answer you?thanksforallthefish
03/01/2019, 9:57 AMBlabla
in java eh ehhho
03/01/2019, 10:01 AMoverride
with nullable types.Robert Jaros
03/01/2019, 10:08 AMhho
03/01/2019, 10:14 AMnull
where the Kotlin parameter is declared non-nullable, a java.lang.IllegalArgumentException: Parameter specified as non-null is null
is thrown.Robert Jaros
03/01/2019, 10:15 AMRobert Jaros
03/01/2019, 10:16 AMhho
03/01/2019, 10:16 AMhho
03/01/2019, 10:16 AM@Nullable
on the parameters.hho
03/01/2019, 10:19 AMUriComponentsContributor
interface explicitly states that the parameters can never be null
. So the annotations seem correct.hho
03/01/2019, 10:20 AMRobert Jaros
03/01/2019, 10:22 AMthanksforallthefish
03/01/2019, 11:59 AMvalue
is nullable (https://github.com/spring-projects/spring-hateoas/blob/master/src/main/java/org/springframework/hateoas/server/mvc/UriComponentsContributor.java#L46), so I guess it is indeed a problem with spring data commons declaring the base class override (HateoasSortHandlerMethodArgumentResolver
) non nullablehho
03/01/2019, 12:36 PMthanksforallthefish
03/01/2019, 12:38 PMhho
03/01/2019, 12:43 PM