8274879: Replace uses of StringBuffer with StringBuilder within java.base classes

Reviewed-by: naoto
This commit is contained in:
Andrey Turbanov 2021-10-27 16:18:12 +00:00 committed by Naoto Sato
parent e6fa5fa37e
commit 9a3e954299
11 changed files with 31 additions and 31 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -262,7 +262,7 @@ public class Debug {
private static String marshal(String args) {
if (args != null) {
StringBuilder target = new StringBuilder();
StringBuffer source = new StringBuffer(args);
StringBuilder source = new StringBuilder(args);
// obtain the "permission=<classname>" options
// the syntax of classname: IDENTIFIER.IDENTIFIER
@ -274,7 +274,7 @@ public class Debug {
"[a-zA-Z_$][a-zA-Z0-9_$]*([.][a-zA-Z_$][a-zA-Z0-9_$]*)*";
Pattern pattern = Pattern.compile(reg);
Matcher matcher = pattern.matcher(source);
StringBuffer left = new StringBuffer();
StringBuilder left = new StringBuilder();
while (matcher.find()) {
String matched = matcher.group();
target.append(matched.replaceFirst(keyReg, keyStr));
@ -298,7 +298,7 @@ public class Debug {
reg = keyReg + "[^, ;]*";
pattern = Pattern.compile(reg);
matcher = pattern.matcher(source);
left = new StringBuffer();
left = new StringBuilder();
while (matcher.find()) {
String matched = matcher.group();
target.append(matched.replaceFirst(keyReg, keyStr));

View file

@ -94,7 +94,7 @@ public class JulianCalendar extends BaseCalendar {
public String toString() {
String time = super.toString();
time = time.substring(time.indexOf('T'));
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
Era era = getEra();
if (era != null) {
String n = era.getAbbreviation();

View file

@ -123,7 +123,7 @@ public class LocalGregorianCalendar extends BaseCalendar {
public String toString() {
String time = super.toString();
time = time.substring(time.indexOf('T'));
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
Era era = getEra();
if (era != null) {
String abbr = era.getAbbreviation();