https://kotlinlang.org logo
#coroutines
Title
# coroutines
c

christophsturm

05/05/2020, 2:32 PM
why does idea mark StringBuffer.append(Charsequence) as a blocking call?
o

octylFractal

05/05/2020, 4:31 PM
it's
synchronized
so it is potentially blocking. use StringBuilder if you don't need thread safety
c

christophsturm

05/05/2020, 4:43 PM
oh thanks. I always mix up those two.
i just noticed i was indeed using StringBuilder, which is not synchronized, and idea complained for that. I just mixed it up here in my error report. so why does idea complain for StringBuilder.append ?
o

octylFractal

05/05/2020, 5:19 PM
I think that's a bug on IntelliJ's part, probably already reported, where it thinks that the overriden method
Appendable.append(CharSequence) throws IOException
is still an IO call for the
StringBuilder
5 Views