On Thu, 28 Jul 2022 14:33:39 GMT, Сергей Цыпанов <d...@openjdk.org> wrote:

>> If we go with the proposal above to make `appendTo(Appendable)` package 
>> visible so that `Throwable.printStackTrace()` can benefit from this as well, 
>> we would need to keep this as Appendable, otherwise I agree we should just 
>> inline this all into toString
>
> `Throwable.printStackTrace()` will use `StringBuilder` as well, won't it?

I don't think so, it appends directly do something like System.err (default) or 
another PrintStream/PrintWriter without fully holding the string value on heap. 
If it supported overloads for Appendable/StringBuilder, that would be 
fantastic, but that would expand the scope of this PR. Is that something you 
would support?

-------------

PR: https://git.openjdk.org/jdk/pull/9665

Reply via email to