Skip to content

Commit

Permalink
Replace StringBuffer with StringBuilder
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Coustick <jonathan.coustick@payara.fish>
  • Loading branch information
Cousjava committed Apr 8, 2021
1 parent 9a15a4a commit a3437b0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Payara Services Ltd.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -37,7 +38,7 @@ public Class getType(EvaluationContext ctx) throws ELException {

@Override
public Object getValue(EvaluationContext ctx) throws ELException {
StringBuffer sb = new StringBuffer(16);
StringBuilder sb = new StringBuilder(16);
Object obj = null;
if (this.children != null) {
for (int i = 0; i < this.children.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Payara Services Ltd.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -46,7 +47,7 @@ public void setImage(String image) {
return;
}
int size = image.length();
StringBuffer buf = new StringBuffer(size);
StringBuilder buf = new StringBuilder(size);
for (int i = 0; i < size; i++) {
char c = image.charAt(i);
if (c == '\\' && i + 1 < size) {
Expand Down
3 changes: 2 additions & 1 deletion impl/src/main/java/com/sun/el/parser/AstString.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Payara Services Ltd.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -55,7 +56,7 @@ public void setImage(String image) {
return;
}
int size = image.length();
StringBuffer buf = new StringBuffer(size);
StringBuilder buf = new StringBuilder(size);
for (int i = 0; i < size; i++) {
char c = image.charAt(i);
if (c == '\\' && i + 1 < size) {
Expand Down
3 changes: 2 additions & 1 deletion impl/src/main/java/com/sun/el/parser/ParseException.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Payara Services Ltd.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -139,7 +140,7 @@ public String getMessage() {
* string literal.
*/
protected String add_escapes(String str) {
StringBuffer retval = new StringBuffer();
StringBuilder retval = new StringBuilder();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i)) {
Expand Down
3 changes: 2 additions & 1 deletion impl/src/main/java/com/sun/el/parser/TokenMgrError.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Payara Services Ltd.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -50,7 +51,7 @@ public class TokenMgrError extends Error {
* Replaces unprintable characters by their espaced (or unicode escaped) equivalents in the given string
*/
protected static final String addEscapes(String str) {
StringBuffer retval = new StringBuffer();
StringBuilder retval = new StringBuilder();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i)) {
Expand Down

0 comments on commit a3437b0

Please sign in to comment.