Use StringBuilder instead of StringBuffer

上级 a318cf11
...@@ -1201,7 +1201,7 @@ public class Parser { ...@@ -1201,7 +1201,7 @@ public class Parser {
// build and prepare the targetMatchQuery ready to test each rows // build and prepare the targetMatchQuery ready to test each rows
// existence in the target table (using source row to match) // existence in the target table (using source row to match)
StringBuffer targetMatchQuerySQL = new StringBuffer( 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(
......
...@@ -788,7 +788,7 @@ public class TableFilter implements ColumnResolver { ...@@ -788,7 +788,7 @@ public class TableFilter implements ColumnResolver {
} }
} }
if (nestedJoin != null) { if (nestedJoin != null) {
StringBuffer buffNested = new StringBuffer(); StringBuilder buffNested = new StringBuilder();
TableFilter n = nestedJoin; TableFilter n = nestedJoin;
do { do {
buffNested.append(n.getPlanSQL(n != nestedJoin)); buffNested.append(n.getPlanSQL(n != nestedJoin));
......
...@@ -197,7 +197,7 @@ public class OsgiDataSourceFactory implements DataSourceFactory { ...@@ -197,7 +197,7 @@ public class OsgiDataSourceFactory implements DataSourceFactory {
} }
// Setting URL // Setting URL
StringBuffer connectionUrl = new StringBuffer(); StringBuilder connectionUrl = new StringBuilder();
if (p.containsKey(DataSourceFactory.JDBC_URL)) { if (p.containsKey(DataSourceFactory.JDBC_URL)) {
// Use URL if specified // Use URL if specified
connectionUrl.append(p.remove(DataSourceFactory.JDBC_URL)); connectionUrl.append(p.remove(DataSourceFactory.JDBC_URL));
......
...@@ -548,7 +548,7 @@ public class TestGeneralCommonTableQueries extends TestBase { ...@@ -548,7 +548,7 @@ public class TestGeneralCommonTableQueries extends TestBase {
int rowNdx=0; int rowNdx=0;
while (rs.next()) { while (rs.next()) {
StringBuffer buf = new StringBuffer(); StringBuilder buf = new StringBuilder();
for(int columnIndex = 1; columnIndex <= rs.getMetaData().getColumnCount(); columnIndex++){ for(int columnIndex = 1; columnIndex <= rs.getMetaData().getColumnCount(); columnIndex++){
buf.append("|"+rs.getString(columnIndex)); buf.append("|"+rs.getString(columnIndex));
} }
......
...@@ -305,7 +305,7 @@ public class TestMergeUsing extends TestBase implements Trigger { ...@@ -305,7 +305,7 @@ public class TestMergeUsing extends TestBase implements Trigger {
+ expectedResultsSQL + " )"); + expectedResultsSQL + " )");
int rowCount = 0; int rowCount = 0;
StringBuffer diffBuffer = new StringBuffer(""); StringBuilder diffBuffer = new StringBuilder("");
while (rs.next()) { while (rs.next()) {
rowCount++; rowCount++;
diffBuffer.append("|"); diffBuffer.append("|");
...@@ -401,7 +401,7 @@ public class TestMergeUsing extends TestBase implements Trigger { ...@@ -401,7 +401,7 @@ public class TestMergeUsing extends TestBase implements Trigger {
} }
private String getCreateTriggerSQL() { private String getCreateTriggerSQL() {
StringBuffer buf = new StringBuffer(); StringBuilder buf = new StringBuilder();
buf.append("CREATE TRIGGER INS_BEFORE " + "BEFORE INSERT ON PARENT " buf.append("CREATE TRIGGER INS_BEFORE " + "BEFORE INSERT ON PARENT "
+ "FOR EACH ROW NOWAIT CALL \"" + getClass().getName() + "\";"); + "FOR EACH ROW NOWAIT CALL \"" + getClass().getName() + "\";");
buf.append("CREATE TRIGGER UPD_BEFORE " + "BEFORE UPDATE ON PARENT " buf.append("CREATE TRIGGER UPD_BEFORE " + "BEFORE UPDATE ON PARENT "
......
...@@ -344,7 +344,7 @@ class ForStatement extends StatementBase { ...@@ -344,7 +344,7 @@ class ForStatement extends StatementBase {
@Override @Override
public String asString() { public String asString() {
StringBuffer buff = new StringBuffer(); StringBuilder buff = new StringBuilder();
buff.append("for ("); buff.append("for (");
if (iterableType != null) { if (iterableType != null) {
Type it = iterable.getType(); Type it = iterable.getType();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论