mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Merge pull request #3174 from FOCONIS/more-char-append
Use char-append instead of String-append
This commit is contained in:
@@ -77,9 +77,9 @@ public final class StdOperators {
|
||||
StringBuilder expression = new StringBuilder(50);
|
||||
expression.append("concat(").append(property.toString());
|
||||
for (Object value : values) {
|
||||
expression.append(",").append(sqlConcatString(value));
|
||||
expression.append(',').append(sqlConcatString(value));
|
||||
}
|
||||
expression.append(")");
|
||||
expression.append(')');
|
||||
return Property.of(expression.toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class TenantAwareKey {
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder(key.toString());
|
||||
if (tenantId != null) {
|
||||
sb.append(":").append(tenantId);
|
||||
sb.append(':').append(tenantId);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ public abstract class AbstractNamingConvention implements NamingConvention {
|
||||
public TableName getM2MJoinTableName(TableName lhsTable, TableName rhsTable) {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
buffer.append(unQuote(lhsTable.getName()));
|
||||
buffer.append("_");
|
||||
buffer.append('_');
|
||||
|
||||
String rhsTableName = unQuote(rhsTable.getName());
|
||||
if (rhsTableName.indexOf('_') < rhsPrefixLength) {
|
||||
@@ -271,10 +271,10 @@ public abstract class AbstractNamingConvention implements NamingConvention {
|
||||
public String getTableName(String catalog, String schema, String name) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (!isNull(catalog)) {
|
||||
sb.append(quoteIdentifiers(catalog)).append(".");
|
||||
sb.append(quoteIdentifiers(catalog)).append('.');
|
||||
}
|
||||
if (!isNull(schema)) {
|
||||
sb.append(quoteIdentifiers(schema)).append(".");
|
||||
sb.append(quoteIdentifiers(schema)).append('.');
|
||||
}
|
||||
return sb.append(quoteIdentifiers(name)).toString();
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class DbConstraintNaming {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < columns.length; i++) {
|
||||
if (i > 0) {
|
||||
sb.append("_");
|
||||
sb.append('_');
|
||||
}
|
||||
sb.append(normaliseColumn(columns[i]));
|
||||
}
|
||||
|
||||
@@ -117,12 +117,12 @@ public final class TableName {
|
||||
// Add schema
|
||||
if (schema != null) {
|
||||
if (buffer.length() > 0) {
|
||||
buffer.append(".");
|
||||
buffer.append('.');
|
||||
}
|
||||
buffer.append(schema);
|
||||
}
|
||||
if (buffer.length() > 0) {
|
||||
buffer.append(".");
|
||||
buffer.append('.');
|
||||
}
|
||||
return buffer.append(name).toString();
|
||||
}
|
||||
|
||||
@@ -118,28 +118,28 @@ final class MetricsAsJson implements ServerMetricsAsJson {
|
||||
|
||||
private void objStart() throws IOException {
|
||||
objKeyCounter = 0;
|
||||
writer.append("{");
|
||||
writer.append('{');
|
||||
}
|
||||
|
||||
private void objEnd() throws IOException {
|
||||
writer.append("}");
|
||||
writer.append('}');
|
||||
}
|
||||
|
||||
private void listStart() throws IOException {
|
||||
listCounter = 0;
|
||||
writer.append("[");
|
||||
writer.append('[');
|
||||
writer.append(newLine);
|
||||
}
|
||||
|
||||
private void listEnd() throws IOException {
|
||||
writer.append("]");
|
||||
writer.append(']');
|
||||
}
|
||||
|
||||
private void key(String key) throws IOException {
|
||||
if (objKeyCounter++ > 0) {
|
||||
writer.append(", ");
|
||||
}
|
||||
writer.append("\"").append(key).append("\":");
|
||||
writer.append('"').append(key).append("\":");
|
||||
}
|
||||
|
||||
private void val(long count) throws IOException {
|
||||
@@ -147,12 +147,12 @@ final class MetricsAsJson implements ServerMetricsAsJson {
|
||||
}
|
||||
|
||||
private void val(String val) throws IOException {
|
||||
writer.append("\"").append(val).append("\"");
|
||||
writer.append('"').append(val).append('"');
|
||||
}
|
||||
|
||||
private void metricStart(MetaMetric metric) throws IOException {
|
||||
if (listCounter++ > 0) {
|
||||
writer.append(",").append(newLine);
|
||||
writer.append(',').append(newLine);
|
||||
}
|
||||
objStart();
|
||||
key("name");
|
||||
|
||||
@@ -205,7 +205,7 @@ public class PathProperties implements FetchPath {
|
||||
sb.append(it.next());
|
||||
hasNext = it.hasNext();
|
||||
if (hasNext) {
|
||||
sb.append(",");
|
||||
sb.append(',');
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
@@ -25,14 +25,14 @@ public final class CamelCaseHelper {
|
||||
lastUpper = i;
|
||||
} else if (Character.isDigit(c)) {
|
||||
if (i > lastUpper + 1 && !digitsCompressed) {
|
||||
sb.append("_");
|
||||
sb.append('_');
|
||||
lastUpper = i;
|
||||
}
|
||||
sb.append(c);
|
||||
|
||||
} else if (Character.isUpperCase(c)) {
|
||||
if (i > lastUpper + 1) {
|
||||
sb.append("_");
|
||||
sb.append('_');
|
||||
}
|
||||
sb.append(Character.toLowerCase(c));
|
||||
lastUpper = i;
|
||||
|
||||
@@ -73,13 +73,13 @@ public final class BindParams implements Serializable {
|
||||
for (Param param : positionedParameters) {
|
||||
tempBindCount = param.queryBindCount();
|
||||
bc += tempBindCount;
|
||||
builder.append("p").append(bc).append(" ?:").append(tempBindCount).append(",");
|
||||
builder.append('p').append(bc).append(" ?:").append(tempBindCount).append(',');
|
||||
}
|
||||
|
||||
for (Map.Entry<String, Param> entry : namedParameters.entrySet()) {
|
||||
tempBindCount = entry.getValue().queryBindCount();
|
||||
bc += tempBindCount;
|
||||
builder.append("n").append(bc).append(" k:").append(entry.getKey()).append(" ?:").append(tempBindCount).append(",");
|
||||
builder.append('n').append(bc).append(" k:").append(entry.getKey()).append(" ?:").append(tempBindCount).append(',');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -281,9 +281,9 @@ public final class DefaultSqlUpdate implements Serializable, SpiSqlUpdate {
|
||||
int offset = 0;
|
||||
for (Object val : values) {
|
||||
if (offset > 0) {
|
||||
sqlExpand.append(",");
|
||||
sqlExpand.append(',');
|
||||
}
|
||||
sqlExpand.append("?");
|
||||
sqlExpand.append('?');
|
||||
bindParams.setParameter(position + offset++, val);
|
||||
}
|
||||
bindExpansion += (offset - 1);
|
||||
|
||||
+1
-1
@@ -552,7 +552,7 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
if (val == null) {
|
||||
return null;
|
||||
}
|
||||
sb.append(val).append(";");
|
||||
sb.append(val).append(';');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public final class BeanNaturalKey {
|
||||
public String calculateKey(Map<String, Object> map) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (BeanProperty prop : props) {
|
||||
sb.append(prop.naturalKeyVal(map)).append(";");
|
||||
sb.append(prop.naturalKeyVal(map)).append(';');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
+3
-3
@@ -86,7 +86,7 @@ class BeanPropertyAssocManySqlHelp<T> {
|
||||
|
||||
@Override
|
||||
public void visitScalar(BeanProperty p, boolean allowNonNull) {
|
||||
sb.append(",").append(p.dbColumn());
|
||||
sb.append(',').append(p.dbColumn());
|
||||
colCount++;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ class BeanPropertyAssocManySqlHelp<T> {
|
||||
private void appendBind(StringBuilder sb, int count, boolean skipComma) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (!skipComma || i > 0) {
|
||||
sb.append(",");
|
||||
sb.append(',');
|
||||
}
|
||||
sb.append('?');
|
||||
}
|
||||
@@ -261,7 +261,7 @@ class BeanPropertyAssocManySqlHelp<T> {
|
||||
return "?";
|
||||
}
|
||||
final var sb = new StringBuilder(exportedProperties.length * 2 + 2);
|
||||
sb.append("(");
|
||||
sb.append('(');
|
||||
for (int i = 0; i < exportedProperties.length; i++) {
|
||||
if (i > 0) {
|
||||
sb.append(',');
|
||||
|
||||
@@ -72,7 +72,7 @@ final class DetermineAggPath {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < pos; i++) {
|
||||
if (i > 0) {
|
||||
sb.append(".");
|
||||
sb.append('.');
|
||||
}
|
||||
sb.append(paths[i]);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ final class ExportedProperty {
|
||||
public void appendWhere(StringBuilder sb, String alias, String path) {
|
||||
sb.append(alias).append(foreignDbColumn).append(" = ");
|
||||
if (path != null) {
|
||||
sb.append(path).append(".");
|
||||
sb.append(path).append('.');
|
||||
}
|
||||
sb.append(property.name());
|
||||
}
|
||||
|
||||
@@ -51,9 +51,9 @@ public final class IntersectionBuilder {
|
||||
if (i > 0) {
|
||||
sb.append(", ");
|
||||
}
|
||||
sb.append("?");
|
||||
sb.append('?');
|
||||
}
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ public final class IntersectionRow {
|
||||
if (i > 0) {
|
||||
sb.append(", ");
|
||||
}
|
||||
sb.append("?");
|
||||
sb.append('?');
|
||||
}
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
return new DefaultSqlUpdate(server, sb.toString(), bindParams);
|
||||
}
|
||||
|
||||
|
||||
@@ -160,9 +160,9 @@ public final class TableJoin {
|
||||
if (i > 0) {
|
||||
sb.append(" and ");
|
||||
}
|
||||
sb.append(a1).append(".").append(pair.getLocalDbColumn());
|
||||
sb.append(a1).append('.').append(pair.getLocalDbColumn());
|
||||
sb.append(" = ");
|
||||
sb.append(a2).append(".").append(pair.getForeignDbColumn());
|
||||
sb.append(a2).append('.').append(pair.getForeignDbColumn());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,26 +57,26 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
|
||||
private String idInExpanded() {
|
||||
final StringBuilder sb = new StringBuilder(30);
|
||||
sb.append("(");
|
||||
sb.append('(');
|
||||
for (int i = 0; i < props.length; i++) {
|
||||
if (i > 0) {
|
||||
sb.append(" and ");
|
||||
}
|
||||
sb.append(idDesc.baseTableAlias()).append(".").append(props[i].dbColumn()).append("=?");
|
||||
sb.append(idDesc.baseTableAlias()).append('.').append(props[i].dbColumn()).append("=?");
|
||||
}
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private String idInCompressed() {
|
||||
final StringBuilder sb = new StringBuilder(props.length * 2 + 2).append("(");
|
||||
final StringBuilder sb = new StringBuilder(props.length * 2 + 2).append('(');
|
||||
for (int i = 0; i < props.length; i++) {
|
||||
if (i > 0) {
|
||||
sb.append(",");
|
||||
sb.append(',');
|
||||
}
|
||||
sb.append("?");
|
||||
sb.append('?');
|
||||
}
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -127,10 +127,10 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
sb.append(", ");
|
||||
}
|
||||
if (pathPrefix != null) {
|
||||
sb.append(pathPrefix).append(".");
|
||||
sb.append(pathPrefix).append('.');
|
||||
}
|
||||
if (!idClass) {
|
||||
sb.append(embIdProperty.name()).append(".");
|
||||
sb.append(embIdProperty.name()).append('.');
|
||||
}
|
||||
sb.append(props[i].name());
|
||||
if (!ascending) {
|
||||
@@ -153,19 +153,19 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
return idInValueExpr(false, size);
|
||||
}
|
||||
final StringBuilder sb = new StringBuilder(80);
|
||||
sb.append("(");
|
||||
sb.append('(');
|
||||
for (int j = 0; j < size; j++) {
|
||||
if (j > 0) {
|
||||
sb.append(" or ");
|
||||
}
|
||||
sb.append("(");
|
||||
sb.append('(');
|
||||
for (int i = 0; i < props.length; i++) {
|
||||
if (i > 0) {
|
||||
sb.append(" and ");
|
||||
}
|
||||
sb.append(props[i].dbColumn()).append("=?");
|
||||
}
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
}
|
||||
sb.append(") ");
|
||||
return sb.toString();
|
||||
@@ -337,17 +337,17 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
@Override
|
||||
public String assocInExpr(String prefix) {
|
||||
final StringBuilder sb = new StringBuilder(80);
|
||||
sb.append("(");
|
||||
sb.append('(');
|
||||
for (int i = 0; i < props.length; i++) {
|
||||
if (i > 0) {
|
||||
sb.append(", ");
|
||||
}
|
||||
if (prefix != null) {
|
||||
sb.append(prefix).append(".");
|
||||
sb.append(prefix).append('.');
|
||||
}
|
||||
sb.append(props[i].name());
|
||||
}
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -359,10 +359,10 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
sb.append(" and ");
|
||||
}
|
||||
if (prefix != null) {
|
||||
sb.append(prefix).append(".");
|
||||
sb.append(prefix).append('.');
|
||||
}
|
||||
if (!idClass) {
|
||||
sb.append(embIdProperty.name()).append(".");
|
||||
sb.append(embIdProperty.name()).append('.');
|
||||
}
|
||||
sb.append(props[i].name()).append(operator);
|
||||
}
|
||||
@@ -377,7 +377,7 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
sb.append(" and ");
|
||||
}
|
||||
if (baseTableAlias != null) {
|
||||
sb.append(baseTableAlias).append(".");
|
||||
sb.append(baseTableAlias).append('.');
|
||||
}
|
||||
sb.append(props[i].dbColumn()).append("=?");
|
||||
}
|
||||
@@ -390,17 +390,17 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
return "";
|
||||
}
|
||||
final StringBuilder sb = new StringBuilder(80);
|
||||
sb.append("(");
|
||||
sb.append('(');
|
||||
for (int i = 0; i < props.length; i++) {
|
||||
if (i > 0) {
|
||||
sb.append(",");
|
||||
sb.append(',');
|
||||
}
|
||||
if (baseTableAlias != null) {
|
||||
sb.append(baseTableAlias).append(".");
|
||||
sb.append(baseTableAlias).append('.');
|
||||
}
|
||||
sb.append(props[i].dbColumn());
|
||||
}
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -436,7 +436,7 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
if (val != null) {
|
||||
sb.append(prop.format(val));
|
||||
}
|
||||
sb.append("|");
|
||||
sb.append('|');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public final class IdBinderSimple implements IdBinder {
|
||||
public String orderBy(String pathPrefix, boolean ascending) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (pathPrefix != null) {
|
||||
sb.append(pathPrefix).append(".");
|
||||
sb.append(pathPrefix).append('.');
|
||||
}
|
||||
sb.append(idProperty.name());
|
||||
if (!ascending) {
|
||||
@@ -224,7 +224,7 @@ public final class IdBinderSimple implements IdBinder {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (prefix != null) {
|
||||
sb.append(prefix);
|
||||
sb.append(".");
|
||||
sb.append('.');
|
||||
}
|
||||
sb.append(idProperty.name());
|
||||
return sb.toString();
|
||||
|
||||
+1
-1
@@ -809,7 +809,7 @@ public class DeployBeanDescriptor<T> {
|
||||
for (DeployBeanProperty prop : propMap.values()) {
|
||||
if (!prop.isTransient() && !(prop instanceof DeployBeanPropertyAssocMany<?>)) {
|
||||
if (prop.isFetchEager()) {
|
||||
sb.append(prop.getName()).append(",");
|
||||
sb.append(prop.getName()).append(',');
|
||||
} else {
|
||||
hasLazyFetch = true;
|
||||
}
|
||||
|
||||
+3
-3
@@ -235,17 +235,17 @@ public final class DeployInheritInfo implements Comparable<DeployInheritInfo> {
|
||||
appendSqlLiteralValue(i, discList.get(i), sb);
|
||||
}
|
||||
if (size > 1) {
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private void appendSqlLiteralValue(int count, Object value, StringBuilder sb) {
|
||||
if (count > 0) {
|
||||
sb.append(",");
|
||||
sb.append(',');
|
||||
}
|
||||
if (value instanceof String) {
|
||||
sb.append("'").append(value).append("'");
|
||||
sb.append('\'').append(value).append('\'');
|
||||
} else {
|
||||
sb.append(value);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ final class InTuplesExpression extends AbstractExpression {
|
||||
}
|
||||
builder.append("InTuple[");
|
||||
for (String property : properties) {
|
||||
builder.append(property).append("-");
|
||||
builder.append(property).append('-');
|
||||
}
|
||||
builder.append(entries.size()).append(']');
|
||||
}
|
||||
|
||||
@@ -807,7 +807,7 @@ public final class DefaultPersister implements Persister {
|
||||
Query<?> q = server.createQuery(desc.type());
|
||||
StringBuilder sb = new StringBuilder(30);
|
||||
for (BeanPropertyAssocOne<?> aPropImportDelete : propImportDelete) {
|
||||
sb.append(aPropImportDelete.name()).append(",");
|
||||
sb.append(aPropImportDelete.name()).append(',');
|
||||
}
|
||||
q.setAutoTune(false);
|
||||
q.select(sb.toString());
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ final class DeleteUnloadedForeignKeys {
|
||||
|
||||
StringBuilder sb = new StringBuilder(30);
|
||||
for (BeanPropertyAssocOne<?> aPropList : propList) {
|
||||
sb.append(aPropList.name()).append(",");
|
||||
sb.append(aPropList.name()).append(',');
|
||||
}
|
||||
|
||||
// run query in a separate persistence context
|
||||
|
||||
@@ -166,7 +166,7 @@ public abstract class DmlHandler implements PersistHandler, BindableRequest {
|
||||
public void bind(Object value, int sqlType) throws SQLException {
|
||||
if (logLevelSql) {
|
||||
if (bindLog.length() > 0) {
|
||||
bindLog.append(",");
|
||||
bindLog.append(',');
|
||||
}
|
||||
if (value == null) {
|
||||
bindLog.append("null");
|
||||
@@ -186,7 +186,7 @@ public abstract class DmlHandler implements PersistHandler, BindableRequest {
|
||||
public void bindNoLog(Object value, int sqlType, String logPlaceHolder) throws SQLException {
|
||||
if (logLevelSql) {
|
||||
if (bindLog.length() > 0) {
|
||||
bindLog.append(",");
|
||||
bindLog.append(',');
|
||||
}
|
||||
bindLog.append(logPlaceHolder);
|
||||
}
|
||||
@@ -212,7 +212,7 @@ public abstract class DmlHandler implements PersistHandler, BindableRequest {
|
||||
private void bindInternal(boolean log, Object value, BeanProperty prop) throws SQLException {
|
||||
if (log) {
|
||||
if (bindLog.length() > 0) {
|
||||
bindLog.append(",");
|
||||
bindLog.append(',');
|
||||
}
|
||||
if (prop.isLob()) {
|
||||
bindLog.append("[LOB]");
|
||||
|
||||
+2
-2
@@ -29,11 +29,11 @@ public final class GenerateDmlRequest {
|
||||
//sb.append(expr);
|
||||
if (insertMode > 0) {
|
||||
if (insertMode++ > 1) {
|
||||
insertBindBuffer.append(",");
|
||||
insertBindBuffer.append(',');
|
||||
}
|
||||
insertBindBuffer.append(bind);
|
||||
} else {
|
||||
sb.append("=");
|
||||
sb.append('=');
|
||||
sb.append(bind);
|
||||
}
|
||||
if (prefix2 != null) {
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ public class MultiValueBind {
|
||||
}
|
||||
sb.append(" in (?");
|
||||
sb.append(",?".repeat(Math.max(0, size - 1)));
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ final class CQueryBuilder {
|
||||
sb.append(", ");
|
||||
}
|
||||
sb.append(name);
|
||||
sb.append(".");
|
||||
sb.append('.');
|
||||
sb.append(token.trim());
|
||||
}
|
||||
return sb.toString();
|
||||
@@ -580,7 +580,7 @@ final class CQueryBuilder {
|
||||
sb.append(select.selectSql());
|
||||
}
|
||||
if (request.isInlineCountDistinct()) {
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
}
|
||||
if (distinct && dbOrderBy != null) {
|
||||
// add the orderBy columns to the select clause (due to distinct)
|
||||
|
||||
@@ -444,7 +444,7 @@ public final class CQueryEngine {
|
||||
}
|
||||
msg.append("exeMicros[").append(q.queryExecutionTimeMicros());
|
||||
msg.append("] rows[").append(q.loadedRowDetail());
|
||||
msg.append("] bind[").append(q.bindLog()).append("]");
|
||||
msg.append("] bind[").append(q.bindLog()).append(']');
|
||||
q.transaction().logSummary(msg.toString());
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ public final class CQueryEngine {
|
||||
msg.append("exeMicros[").append(q.queryExecutionTimeMicros());
|
||||
msg.append("] rows[").append(q.loadedRowDetail());
|
||||
msg.append("] predicates[").append(q.logWhereSql());
|
||||
msg.append("] bind[").append(q.bindLog()).append("]");
|
||||
msg.append("] bind[").append(q.bindLog()).append(']');
|
||||
q.transaction().logSummary(msg.toString());
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ final class CQueryFetchSingleAttribute implements SpiProfileTransactionEvent, Ca
|
||||
.append("] rows[").append(rowCount)
|
||||
.append("] type[").append(desc.name())
|
||||
.append("] predicates[").append(predicates.logWhereSql())
|
||||
.append("] bind[").append(bindLog).append("]");
|
||||
.append("] bind[").append(bindLog).append(']');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ final class CQueryRowCount implements SpiProfileTransactionEvent, CancelableQuer
|
||||
.append("] rows[").append(rowCount)
|
||||
.append("] type[").append(desc.fullName())
|
||||
.append("] predicates[").append(predicates.logWhereSql())
|
||||
.append("] bind[").append(bindLog).append("]");
|
||||
.append("] bind[").append(bindLog).append(']');
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -151,13 +151,13 @@ final class DefaultDbSqlContext implements DbSqlContext {
|
||||
if (pair.getForeignSqlFormula() != null) {
|
||||
sb.append(pair.getForeignSqlFormula().replace(tableAliasPlaceHolder, a2));
|
||||
} else {
|
||||
sb.append(a2).append(".").append(pair.getForeignDbColumn());
|
||||
sb.append(a2).append('.').append(pair.getForeignDbColumn());
|
||||
}
|
||||
sb.append(" = ");
|
||||
if (pair.getLocalSqlFormula() != null) {
|
||||
sb.append(pair.getLocalSqlFormula().replace(tableAliasPlaceHolder, a1));
|
||||
} else {
|
||||
sb.append(a1).append(".").append(pair.getLocalDbColumn());
|
||||
sb.append(a1).append('.').append(pair.getLocalDbColumn());
|
||||
}
|
||||
}
|
||||
if (addAsOfOnClause) {
|
||||
|
||||
@@ -15,7 +15,7 @@ public abstract class QueryPlanLogger {
|
||||
final SpiDbQueryPlan readQueryPlan(SpiQueryPlan plan, BindCapture bind, ResultSet rset) throws SQLException {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 1; i <= rset.getMetaData().getColumnCount(); i++) {
|
||||
sb.append(rset.getMetaData().getColumnLabel(i)).append("\t");
|
||||
sb.append(rset.getMetaData().getColumnLabel(i)).append('\t');
|
||||
}
|
||||
sb.setLength(sb.length() - 1);
|
||||
readPlanData(sb, rset);
|
||||
@@ -37,7 +37,7 @@ public abstract class QueryPlanLogger {
|
||||
while (rset.next()) {
|
||||
sb.append('\n');
|
||||
for (int i = 1; i <= rset.getMetaData().getColumnCount(); i++) {
|
||||
sb.append(rset.getString(i)).append("\t");
|
||||
sb.append(rset.getString(i)).append('\t');
|
||||
}
|
||||
sb.setLength(sb.length() - 1);
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ public final class OrmQueryProperties implements Serializable {
|
||||
if (allProperties) {
|
||||
sb.append("(*)");
|
||||
} else if (included != null) {
|
||||
sb.append("(").append(String.join(",", included)).append(")");
|
||||
sb.append('(').append(String.join(",", included)).append(')');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ public final class OrmQueryProperties implements Serializable {
|
||||
* Calculate the query plan hash.
|
||||
*/
|
||||
public void queryPlanHash(StringBuilder builder) {
|
||||
builder.append("{");
|
||||
builder.append('{');
|
||||
if (path != null) {
|
||||
builder.append(path);
|
||||
}
|
||||
@@ -428,7 +428,7 @@ public final class OrmQueryProperties implements Serializable {
|
||||
if (fetchConfig != null) {
|
||||
builder.append("/c").append(fetchConfig.hashCode());
|
||||
}
|
||||
builder.append("}");
|
||||
builder.append('}');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public final class OrmUpdateProperties {
|
||||
} else {
|
||||
binder.bindObject(dataBind, value);
|
||||
}
|
||||
dataBind.append(value).append(",");
|
||||
dataBind.append(value).append(',');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public final class OrmUpdateProperties {
|
||||
public void bind(Binder binder, DataBind dataBind) throws SQLException {
|
||||
for (Object val : bindValues) {
|
||||
binder.bindObject(dataBind, val);
|
||||
dataBind.append(val).append(",");
|
||||
dataBind.append(val).append(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,10 +77,10 @@ public final class DRawSqlService implements SpiRawSqlService {
|
||||
String combine(String schemaName, String tableName, String name) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (schemaName != null) {
|
||||
sb.append(schemaName).append(".");
|
||||
sb.append(schemaName).append('.');
|
||||
}
|
||||
if (tableName != null) {
|
||||
sb.append(tableName).append(".");
|
||||
sb.append(tableName).append('.');
|
||||
}
|
||||
return sb.append(name).toString();
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public final class BeanPersistIds implements BinaryWritable {
|
||||
if (ids != null) {
|
||||
sb.append(" ids:").append(ids);
|
||||
}
|
||||
sb.append("]");
|
||||
sb.append(']');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ public final class DefaultProfileStream implements ProfileStream {
|
||||
buffer.append(micros).append(',');
|
||||
buffer.append(beanName).append(',');
|
||||
buffer.append(beanCount).append(',');
|
||||
buffer.append(queryId).append(";");
|
||||
buffer.append(queryId).append(';');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ public final class RemoteTransactionEvent implements Runnable, BinaryWritable {
|
||||
if (deleteByIdMap != null) {
|
||||
sb.append(deleteByIdMap);
|
||||
}
|
||||
sb.append("]");
|
||||
sb.append(']');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ final class ConvertInetAddresses {
|
||||
int count = numberOfColons(ipString);
|
||||
StringBuilder buffer = new StringBuilder(DOUBLE_COLON);
|
||||
for (int i = 0; i + count < 7; i++) {
|
||||
buffer.append(":");
|
||||
buffer.append(':');
|
||||
}
|
||||
|
||||
ipString = IPSTRING_REPLACE.matcher(ipString).replaceAll(Matcher.quoteReplacement(buffer.toString()));
|
||||
|
||||
+3
-3
@@ -52,12 +52,12 @@ public class BeanDescriptor_documentMappingTest extends BaseTest {
|
||||
@Override
|
||||
public void visitBegin() {
|
||||
|
||||
sb.append("{");
|
||||
sb.append('{');
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitEnd() {
|
||||
sb.append("}");
|
||||
sb.append('}');
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,7 +67,7 @@ public class BeanDescriptor_documentMappingTest extends BaseTest {
|
||||
|
||||
@Override
|
||||
public void visitEndObject(DocPropertyMapping property) {
|
||||
sb.append("}");
|
||||
sb.append('}');
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -309,7 +309,7 @@ public class DdlGenerator implements SpiDdlGenerator {
|
||||
try (LineNumberReader lineReader = new LineNumberReader(reader)) {
|
||||
String s;
|
||||
while ((s = lineReader.readLine()) != null) {
|
||||
buf.append(s).append("\n");
|
||||
buf.append(s).append('\n');
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ public class DB2Ddl extends PlatformDdl {
|
||||
|
||||
for (int i = 0; i < columns.length; i++) {
|
||||
if (i > 0) {
|
||||
sb.append(",");
|
||||
sb.append(',');
|
||||
}
|
||||
sb.append(columns[i]);
|
||||
}
|
||||
|
||||
+3
-3
@@ -64,13 +64,13 @@ public class DdlIdentity {
|
||||
if (brackets) {
|
||||
sb.append(" (");
|
||||
} else {
|
||||
sb.append(" ");
|
||||
sb.append(' ');
|
||||
}
|
||||
optionFor(sb, startWith, identityMode.getStart());
|
||||
optionFor(sb, incrementBy, identityMode.getIncrement());
|
||||
optionFor(sb, cache, identityMode.getCache());
|
||||
if (brackets) {
|
||||
sb.append(")");
|
||||
sb.append(')');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class DdlIdentity {
|
||||
private void optionFor(StringBuilder sb, String prefix, int val) {
|
||||
if (val > 0 && prefix != null) {
|
||||
if (sb.length() > 2) {
|
||||
sb.append(" ");
|
||||
sb.append(' ');
|
||||
}
|
||||
sb.append(prefix).append(" ").append(val);
|
||||
}
|
||||
|
||||
+2
-2
@@ -19,13 +19,13 @@ public class NuoDbDdl extends PlatformDdl {
|
||||
sb.append(quote(sequenceName));
|
||||
int start = identity.getStart();
|
||||
if (start > 0) {
|
||||
sb.append(" ").append(sequenceStartWith).append(" ").append(start);
|
||||
sb.append(' ').append(sequenceStartWith).append(' ').append(start);
|
||||
}
|
||||
int cache = identity.getCache();
|
||||
if (cache > 0) {
|
||||
sb.append(" quantum size ").append(cache);
|
||||
}
|
||||
sb.append(";");
|
||||
sb.append(';');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -364,7 +364,7 @@ public class PlatformDdl {
|
||||
StringBuilder sb = new StringBuilder("create sequence ");
|
||||
sb.append(quote(sequenceName));
|
||||
sb.append(identity.sequenceOptions(sequenceStartWith, sequenceIncrementBy, sequenceCache));
|
||||
sb.append(";");
|
||||
sb.append(';');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@ public class SqlServerDdl extends PlatformDdl {
|
||||
if (cache > 1) {
|
||||
sb.append(" cache ").append(increment);
|
||||
}
|
||||
sb.append(";");
|
||||
sb.append(';');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ public class MCompoundForeignKey {
|
||||
StringBuilder sb = new StringBuilder(40);
|
||||
for (int i = 0; i < columns.size(); i++) {
|
||||
if (i > 0) {
|
||||
sb.append(",");
|
||||
sb.append(',');
|
||||
}
|
||||
sb.append(columns.get(i));
|
||||
}
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ public class MCompoundUniqueConstraint {
|
||||
StringBuilder sb = new StringBuilder(50);
|
||||
for (int i = 0; i < arr.length; i++) {
|
||||
if (i > 0) {
|
||||
sb.append(",");
|
||||
sb.append(',');
|
||||
}
|
||||
sb.append(arr[i]);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ public class MIndex {
|
||||
StringBuilder sb = new StringBuilder(50);
|
||||
for (int i = 0; i < columns.size(); i++) {
|
||||
if (i > 0) {
|
||||
sb.append(",");
|
||||
sb.append(',');
|
||||
}
|
||||
sb.append(columns.get(i));
|
||||
}
|
||||
|
||||
+1
-1
@@ -303,7 +303,7 @@ public class ModelBuildPropertyVisitor extends BaseTablePropertyVisitor {
|
||||
int count = 0;
|
||||
for (String value : checkConstraintValues) {
|
||||
if (count++ > 0) {
|
||||
sb.append(",");
|
||||
sb.append(',');
|
||||
}
|
||||
sb.append(value);
|
||||
}
|
||||
|
||||
+2
-2
@@ -47,9 +47,9 @@ public class ExtraDdlXmlReader {
|
||||
sb.append(value);
|
||||
if (value.lastIndexOf(';') == -1) {
|
||||
// add statement terminator as we didn't find one
|
||||
sb.append(";");
|
||||
sb.append(';');
|
||||
}
|
||||
sb.append("\n");
|
||||
sb.append('\n');
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ public class Helper {
|
||||
StringBuilder builder = new StringBuilder(400);
|
||||
String line;
|
||||
while ((line = lineNumberReader.readLine()) != null) {
|
||||
builder.append(line).append("\n");
|
||||
builder.append(line).append('\n');
|
||||
}
|
||||
return builder.toString();
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ final class RedisCacheFactory implements ServerCacheFactory {
|
||||
if (dependentTables != null && !dependentTables.isEmpty()) {
|
||||
StringBuilder msg = new StringBuilder(50);
|
||||
for (String table : dependentTables) {
|
||||
msg.append(table).append(",");
|
||||
msg.append(table).append(',');
|
||||
}
|
||||
String formattedMsg = msg.toString();
|
||||
if (tableModLogger.isLoggable(DEBUG)) {
|
||||
|
||||
+2
-2
@@ -60,10 +60,10 @@ public class TransactionNotTerminatedAfterRollback {
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder s = new StringBuilder();
|
||||
s.append("{");
|
||||
s.append('{');
|
||||
s.append("id: ").append(id).append(", ");
|
||||
s.append("name: ").append(name);
|
||||
s.append("}");
|
||||
s.append('}');
|
||||
return s.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,12 +48,12 @@ public class H2HistoryTrigger implements Trigger {
|
||||
|
||||
// build the insert into history table SQL
|
||||
StringBuilder insertSql = new StringBuilder(150);
|
||||
insertSql.append("insert into ").append(schemaName).append(".").append(tableName).append(HISTORY_SUFFIX).append(" (");
|
||||
insertSql.append("insert into ").append(schemaName).append('.').append(tableName).append(HISTORY_SUFFIX).append(" (");
|
||||
|
||||
int count = 0;
|
||||
while (rs.next()) {
|
||||
if (++count > 1) {
|
||||
insertSql.append(",");
|
||||
insertSql.append(',');
|
||||
}
|
||||
String columnName = rs.getString("COLUMN_NAME");
|
||||
if (columnName.equalsIgnoreCase(SYS_PERIOD_START)) {
|
||||
@@ -66,9 +66,9 @@ public class H2HistoryTrigger implements Trigger {
|
||||
insertSql.append(") values (");
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (i > 0) {
|
||||
insertSql.append(",");
|
||||
insertSql.append(',');
|
||||
}
|
||||
insertSql.append("?");
|
||||
insertSql.append('?');
|
||||
}
|
||||
insertSql.append(");");
|
||||
|
||||
|
||||
+2
-2
@@ -79,9 +79,9 @@ class SimpleModuleInfoWriter {
|
||||
StringBuilder builder = new StringBuilder("entity-packages: ");
|
||||
for (String pkg : allEntityPackages) {
|
||||
// one package per line
|
||||
builder.append(pkg).append("\n").append(" ");
|
||||
builder.append(pkg).append('\n').append(" ");
|
||||
}
|
||||
return builder.delete(builder.lastIndexOf("\n"), builder.length()).append("\n").toString();
|
||||
return builder.delete(builder.lastIndexOf("\n"), builder.length()).append('\n').toString();
|
||||
}
|
||||
|
||||
private void writePackage() {
|
||||
|
||||
Reference in New Issue
Block a user