Use StringBuilder.append(char) where possible
To slightly improve performance, this commit switches to StringBuilder.append(char) instead of StringBuilder.append(String) whenever we append a single character to a StringBuilder. Closes gh-27098
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -646,13 +646,13 @@ public class CallMetaDataContext {
|
||||
}
|
||||
|
||||
if (StringUtils.hasLength(catalogNameToUse)) {
|
||||
callString.append(catalogNameToUse).append(".");
|
||||
callString.append(catalogNameToUse).append('.');
|
||||
}
|
||||
if (StringUtils.hasLength(schemaNameToUse)) {
|
||||
callString.append(schemaNameToUse).append(".");
|
||||
callString.append(schemaNameToUse).append('.');
|
||||
}
|
||||
callString.append(this.metaDataProvider.procedureNameToUse(getProcedureName()));
|
||||
callString.append("(");
|
||||
callString.append('(');
|
||||
|
||||
for (SqlParameter parameter : this.callParameters) {
|
||||
if (!parameter.isResultsParameter()) {
|
||||
|
||||
@@ -280,7 +280,7 @@ public class TableMetaDataContext {
|
||||
insertStatement.append("INSERT INTO ");
|
||||
if (getSchemaName() != null) {
|
||||
insertStatement.append(getSchemaName());
|
||||
insertStatement.append(".");
|
||||
insertStatement.append('.');
|
||||
}
|
||||
insertStatement.append(getTableName());
|
||||
insertStatement.append(" (");
|
||||
@@ -313,7 +313,7 @@ public class TableMetaDataContext {
|
||||
}
|
||||
String params = String.join(", ", Collections.nCopies(columnCount, "?"));
|
||||
insertStatement.append(params);
|
||||
insertStatement.append(")");
|
||||
insertStatement.append(')');
|
||||
return insertStatement.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -186,10 +186,10 @@ public class TransactionAwareDataSourceProxy extends DelegatingDataSource {
|
||||
// Allow for differentiating between the proxy and the raw Connection.
|
||||
StringBuilder sb = new StringBuilder("Transaction-aware proxy for target Connection ");
|
||||
if (this.target != null) {
|
||||
sb.append("[").append(this.target.toString()).append("]");
|
||||
sb.append('[').append(this.target.toString()).append(']');
|
||||
}
|
||||
else {
|
||||
sb.append(" from DataSource [").append(this.targetDataSource).append("]");
|
||||
sb.append(" from DataSource [").append(this.targetDataSource).append(']');
|
||||
}
|
||||
return sb.toString();
|
||||
case "close":
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -152,7 +152,7 @@ public abstract class AbstractIdentityColumnMaxValueIncrementer extends Abstract
|
||||
for (int i = 0; i < values.length - 1; i++) {
|
||||
sb.append(", ").append(values[i]);
|
||||
}
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
}
|
||||
else {
|
||||
long maxValue = values[values.length - 1];
|
||||
|
||||
Reference in New Issue
Block a user