Hi. IntelliJ gives me a warning that the a call to Jackson’s Object Mapper.writeValueAsString is an “Inappropriate blocking method call”. Is that correct? I cannot see it doing any I/O or inter-thread communication that might block the thread.
d
diesieben07
08/03/2020, 1:29 PM
That warning is based on a heuristic. If a method throws
IOException
it is determined to be blocking
diesieben07
08/03/2020, 1:29 PM
Which is not always correct
n
natpryce
08/03/2020, 1:30 PM
Right. Thanks.
natpryce
08/03/2020, 1:30 PM
It throws JsonProcessingException, which is an IOException.
d
diesieben07
08/03/2020, 1:30 PM
In this case it does not seem correct, that method throws IOException because it uses OutputStream, but that just writes to memory