thiagoretondar
05/07/2019, 6:47 PMMap<String, String>?
. This method is in a Custom Implementation for Spring Data Repositories (exactly as described here: https://docs.spring.io/spring-data/jpa/docs/2.1.6.RELEASE/reference/html/#repositories.custom-implementations).
My problem: when I return urlRequestResult?.value as Map<String, String>?
(using restTemplate to do the request here) it returns an empty LinkedHashMap
, but if I evaluate it in debug mode it returns null
(as I was expecting when urlRequestResult
is null)
Is it a bug or am I doing something wrong here?Stephan Schroeder
05/08/2019, 9:11 AMprintln(urlRequestResult)
just before the return statement. I expect urlRequestResult to be non-null with an empty map in value (while not in debug). nullvalues normally don’t generate emty maps (or anything really)thiagoretondar
05/13/2019, 5:29 PMnull
, but spring transforms it to LinkedHashMap
when receives it. I couldn’t debug more to find where it’s happening, I’ll try later this week.
Another test I’ve made is to put this method in the same class of the invoker (Service Layer) and the method returned null
as expected (the same body method)