8269280: (bf) Replace StringBuffer in *Buffer.toString()

Reviewed-by: alanb, chegar, bpb
This commit is contained in:
Aleksey Shipilev 2021-06-25 08:08:10 +00:00
parent c37988d079
commit 3a8f3d6cac
9 changed files with 649 additions and 16 deletions

View file

@ -1666,16 +1666,11 @@ public abstract class $Type$Buffer
* @return A summary string
*/
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(getClass().getName());
sb.append("[pos=");
sb.append(position());
sb.append(" lim=");
sb.append(limit());
sb.append(" cap=");
sb.append(capacity());
sb.append("]");
return sb.toString();
return getClass().getName()
+ "[pos=" + position()
+ " lim=" + limit()
+ " cap=" + capacity()
+ "]";
}
#end[!char]