Skip to content

Commit

Permalink
Replace StringBuffer with StringBuilder in RR code
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Oct 2, 2023
1 parent a45cefb commit 6cf023f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public CacheControl fromString(String value) throws IllegalArgumentException {
return result;
}

private static StringBuffer addDirective(String directive, StringBuffer buffer) {
private static StringBuilder addDirective(String directive, StringBuilder buffer) {
if (buffer.length() > 0)
buffer.append(", ");
buffer.append(directive);
Expand All @@ -82,7 +82,7 @@ private static StringBuffer addDirective(String directive, StringBuffer buffer)
public String toString(CacheControl value) {
if (value == null)
throw new IllegalArgumentException("param was null");
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
if (value.isNoCache()) {
List<String> fields = value.getNoCacheFields();
if (fields.size() < 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public Cookie fromString(String value) throws IllegalArgumentException {
}

public String toString(Cookie value) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
ServerCookie.appendCookieValue(buf, 0, value.getName(), value.getValue(), value.getPath(), value.getDomain(), null, -1,
false);
return buf.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void parseAttribute(MultivaluedMap<String, String> attributes) {
val = value.substring(curr, end);
curr = end + 1;
} else {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
while (curr < value.length()) {
char c = value.charAt(curr);
if (c == ',' || c == ';')
Expand Down Expand Up @@ -136,7 +136,7 @@ public Link fromString(String value) throws IllegalArgumentException {
public String toString(Link value) throws IllegalArgumentException {
if (value == null)
throw new IllegalArgumentException("value was null");
StringBuffer buf = new StringBuffer("<");
StringBuilder buf = new StringBuilder("<");
buf.append(value.getUri().toString()).append(">");

for (Map.Entry<String, String> entry : value.getParams().entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static void formatOldCookie(Date d, StringBuffer sb,
private static final String ancientDate = formatOldCookie(new Date(10000));

// TODO RFC2965 fields also need to be passed
public static void appendCookieValue(StringBuffer headerBuf,
public static void appendCookieValue(StringBuilder headerBuf,
int version,
String name,
String value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public String setAttribute(

int start = offset;

StringBuffer newChars = new StringBuffer();
StringBuilder newChars = new StringBuilder();

while (hasChar()) {
paramName = parseToken(new char[] { '=', separator });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public MultivaluedMap<String, String> getMatrixParameters() {
}

public String toString() {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
if (path != null)
buf.append(path);
if (matrixParameters != null) {
Expand Down

0 comments on commit 6cf023f

Please sign in to comment.