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

Remove converting to string using concatenation with empty string

上级 064dc058
......@@ -924,7 +924,7 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
if (!locks.contains(log.getTable())
&& TableType.TABLE_LINK != tableType
&& TableType.EXTERNAL_TABLE_ENGINE != tableType) {
DbException.throwInternalError("" + tableType);
DbException.throwInternalError(String.valueOf(tableType));
}
}
}
......
......@@ -51,7 +51,7 @@ public class PageBtreeIndex extends PageIndex {
// trace.setLevel(TraceSystem.DEBUG);
tableData = table;
if (!database.isPersistent() || id < 0) {
throw DbException.throwInternalError("" + indexName);
throw DbException.throwInternalError(indexName);
}
this.store = database.getPageStore();
store.addIndex(this);
......@@ -154,7 +154,7 @@ public class PageBtreeIndex extends PageIndex {
store.update(empty);
return empty;
} else if (!(p instanceof PageBtree)) {
throw DbException.get(ErrorCode.FILE_CORRUPTED_1, "" + p);
throw DbException.get(ErrorCode.FILE_CORRUPTED_1, String.valueOf(p));
}
return (PageBtree) p;
}
......
......@@ -237,7 +237,7 @@ public class PageDataIndex extends PageIndex {
store.update(empty);
return empty;
} else if (!(pd instanceof PageData)) {
throw DbException.get(ErrorCode.FILE_CORRUPTED_1, "" + pd);
throw DbException.get(ErrorCode.FILE_CORRUPTED_1, String.valueOf(pd));
}
PageData p = (PageData) pd;
if (parent != -1) {
......
......@@ -153,7 +153,7 @@ public class PageDataLeaf extends PageData {
private int findInsertionPoint(long key) {
int x = find(key);
if (x < entryCount && keys[x] == key) {
throw index.getDuplicateKeyException(""+key);
throw index.getDuplicateKeyException(String.valueOf(key));
}
return x;
}
......
......@@ -32,7 +32,7 @@ public class PageDelegateIndex extends PageIndex {
this.initBaseIndex(table, id, name, cols, indexType);
this.mainIndex = mainIndex;
if (!database.isPersistent() || id < 0) {
throw DbException.throwInternalError("" + name);
throw DbException.throwInternalError(name);
}
PageStore store = database.getPageStore();
store.addIndex(this);
......
......@@ -1098,7 +1098,7 @@ public class JdbcConnection extends TraceObject
private static JdbcSavepoint convertSavepoint(Savepoint savepoint) {
if (!(savepoint instanceof JdbcSavepoint)) {
throw DbException.get(ErrorCode.SAVEPOINT_IS_INVALID_1,
"" + savepoint);
String.valueOf(savepoint));
}
return (JdbcSavepoint) savepoint;
}
......
......@@ -35,7 +35,7 @@ public class MVDelegateIndex extends BaseIndex implements MVIndex {
this.initBaseIndex(table, id, name, cols, indexType);
this.mainIndex = mainIndex;
if (id < 0) {
throw DbException.throwInternalError("" + name);
throw DbException.throwInternalError(name);
}
}
......
......@@ -301,7 +301,7 @@ public class WebApp {
for (Map.Entry<String, String> entry : map.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
String type = "" + key.charAt(0);
String type = String.valueOf(key.charAt(0));
if (Integer.parseInt(type) > 2) {
continue;
}
......@@ -1182,14 +1182,14 @@ public class WebApp {
rs.addRow("conn.getCatalog", conn.getCatalog());
rs.addRow("conn.getAutoCommit", Boolean.toString(conn.getAutoCommit()));
rs.addRow("conn.getTransactionIsolation", Integer.toString(conn.getTransactionIsolation()));
rs.addRow("conn.getWarnings", "" + conn.getWarnings());
rs.addRow("conn.getWarnings", String.valueOf(conn.getWarnings()));
String map;
try {
map = "" + conn.getTypeMap();
map = String.valueOf(conn.getTypeMap());
} catch (SQLException e) {
map = e.toString();
}
rs.addRow("conn.getTypeMap", "" + map);
rs.addRow("conn.getTypeMap", map);
rs.addRow("conn.isReadOnly", Boolean.toString(conn.isReadOnly()));
rs.addRow("conn.getHoldability", Integer.toString(conn.getHoldability()));
addDatabaseMetaData(rs, meta);
......@@ -1229,7 +1229,7 @@ public class WebApp {
if (m.getParameterTypes().length == 0) {
try {
Object o = m.invoke(meta);
rs.addRow("meta." + m.getName(), "" + o);
rs.addRow("meta." + m.getName(), String.valueOf(o));
} catch (InvocationTargetException e) {
rs.addRow("meta." + m.getName(), e.getTargetException().toString());
} catch (Exception e) {
......
......@@ -279,8 +279,7 @@ public class LobStorageMap implements LobStorageInterface {
if (lob.getTableId() == LobStorageFrontend.TABLE_RESULT ||
lob.getTableId() == LobStorageFrontend.TABLE_ID_SESSION_VARIABLE) {
throw DbException.get(
ErrorCode.LOB_CLOSED_ON_TIMEOUT_1, "" +
lob.getLobId() + "/" + lob.getTableId());
ErrorCode.LOB_CLOSED_ON_TIMEOUT_1, lob.getLobId() + "/" + lob.getTableId());
}
throw DbException.throwInternalError("Lob not found: " +
lob.getLobId() + "/" + lob.getTableId());
......
......@@ -1764,11 +1764,11 @@ public class MetaTable extends Table {
// SELECTIVITY INT
Integer.toString(col.getSelectivity()),
// CHECK_CONSTRAINT
"" + col.getCheckConstraintSQL(session, "VALUE"),
col.getCheckConstraintSQL(session, "VALUE"),
// REMARKS
replaceNullWithEmpty(dt.getComment()),
// SQL
"" + dt.getCreateSQL(),
dt.getCreateSQL(),
// ID
Integer.toString(dt.getId())
);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论