提交 39ff37a6 authored 作者: Jacek Ławrynowicz's avatar Jacek Ławrynowicz

performance - fix passing concatenation to StringBuilder append

上级 82fa24a0
...@@ -1206,8 +1206,7 @@ public class Parser { ...@@ -1206,8 +1206,7 @@ public class Parser {
StringBuilder targetMatchQuerySQL = new StringBuilder( StringBuilder targetMatchQuerySQL = new StringBuilder(
"SELECT _ROWID_ FROM " + command.getTargetTable().getName()); "SELECT _ROWID_ FROM " + command.getTargetTable().getName());
if (command.getTargetTableFilter().getTableAlias() != null) { if (command.getTargetTableFilter().getTableAlias() != null) {
targetMatchQuerySQL.append( targetMatchQuerySQL.append(" AS ").append(command.getTargetTableFilter().getTableAlias());
" AS " + command.getTargetTableFilter().getTableAlias());
} }
targetMatchQuerySQL targetMatchQuerySQL
.append(" WHERE ").append(command.getOnCondition().getSQL()); .append(" WHERE ").append(command.getOnCondition().getSQL());
......
...@@ -1268,9 +1268,8 @@ public class WebApp { ...@@ -1268,9 +1268,8 @@ public class WebApp {
sqlUpper.contains("ALTER") || sqlUpper.contains("ALTER") ||
sqlUpper.contains("RUNSCRIPT")) { sqlUpper.contains("RUNSCRIPT")) {
String sessionId = attributes.getProperty("jsessionid"); String sessionId = attributes.getProperty("jsessionid");
buff.append("<script type=\"text/javascript\">" + buff.append("<script type=\"text/javascript\">parent['h2menu'].location='tables.do?jsessionid=")
"parent['h2menu'].location='tables.do?jsessionid=" .append(sessionId).append("';</script>");
+ sessionId + "';</script>");
} }
Statement stat; Statement stat;
DbContents contents = session.getContents(); DbContents contents = session.getContents();
......
...@@ -219,7 +219,7 @@ public class AbbaLockingDetector implements Runnable { ...@@ -219,7 +219,7 @@ public class AbbaLockingDetector implements Runnable {
dumpStackTraceElement(info, sb, i, e); dumpStackTraceElement(info, sb, i, e);
startDumping = true; startDumping = true;
} }
sb.append("\t- locked " + mi); sb.append("\t- locked ").append(mi);
sb.append('\n'); sb.append('\n');
} }
} }
......
...@@ -153,7 +153,7 @@ public class ThreadDeadlockDetector { ...@@ -153,7 +153,7 @@ public class ThreadDeadlockDetector {
print.print("\"" + ti.getThreadName() + "\"" + " Id=" print.print("\"" + ti.getThreadName() + "\"" + " Id="
+ ti.getThreadId() + " in " + ti.getThreadState()); + ti.getThreadId() + " in " + ti.getThreadState());
if (ti.getLockName() != null) { if (ti.getLockName() != null) {
print.append(" on lock=" + ti.getLockName()); print.append(" on lock=").append(ti.getLockName());
} }
if (ti.isSuspended()) { if (ti.isSuspended()) {
print.append(" (suspended)"); print.append(" (suspended)");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论