提交 9cd01f57 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Replace String.valueOf(int) with Integer.toString(int) or other alternatives

上级 bce947f0
...@@ -1866,10 +1866,9 @@ public class JdbcConnection extends TraceObject ...@@ -1866,10 +1866,9 @@ public class JdbcConnection extends TraceObject
} }
} }
p.setProperty(NUM_SERVERS, String.valueOf(serverList.size())); p.setProperty(NUM_SERVERS, Integer.toString(serverList.size()));
for (int i = 0; i < serverList.size(); i++) { for (int i = 0; i < serverList.size(); i++) {
p.setProperty(PREFIX_SERVER + String.valueOf(i), p.setProperty(PREFIX_SERVER + i, serverList.get(i));
serverList.get(i));
} }
return p; return p;
......
...@@ -335,7 +335,7 @@ public class JdbcDataSource extends TraceObject implements XADataSource, ...@@ -335,7 +335,7 @@ public class JdbcDataSource extends TraceObject implements XADataSource,
ref.add(new StringRefAddr("url", url)); ref.add(new StringRefAddr("url", url));
ref.add(new StringRefAddr("user", userName)); ref.add(new StringRefAddr("user", userName));
ref.add(new StringRefAddr("password", convertToString(passwordChars))); ref.add(new StringRefAddr("password", convertToString(passwordChars)));
ref.add(new StringRefAddr("loginTimeout", String.valueOf(loginTimeout))); ref.add(new StringRefAddr("loginTimeout", Integer.toString(loginTimeout)));
ref.add(new StringRefAddr("description", description)); ref.add(new StringRefAddr("description", description));
return ref; return ref;
} }
......
...@@ -349,7 +349,7 @@ public class WebApp { ...@@ -349,7 +349,7 @@ public class WebApp {
try { try {
Properties prop = new SortedProperties(); Properties prop = new SortedProperties();
int port = Integer.decode((String) attributes.get("port")); int port = Integer.decode((String) attributes.get("port"));
prop.setProperty("webPort", String.valueOf(port)); prop.setProperty("webPort", Integer.toString(port));
server.setPort(port); server.setPort(port);
boolean allowOthers = Utils.parseBoolean((String) attributes.get("allowOthers"), false, false); boolean allowOthers = Utils.parseBoolean((String) attributes.get("allowOthers"), false, false);
prop.setProperty("webAllowOthers", String.valueOf(allowOthers)); prop.setProperty("webAllowOthers", String.valueOf(allowOthers));
......
...@@ -645,7 +645,7 @@ public class WebServer implements Service { ...@@ -645,7 +645,7 @@ public class WebServer implements Service {
} }
} else { } else {
for (int i = 0;; i++) { for (int i = 0;; i++) {
String data = prop.getProperty(String.valueOf(i)); String data = prop.getProperty(Integer.toString(i));
if (data == null) { if (data == null) {
break; break;
} }
...@@ -689,7 +689,7 @@ public class WebServer implements Service { ...@@ -689,7 +689,7 @@ public class WebServer implements Service {
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
ConnectionInfo info = settings.get(i); ConnectionInfo info = settings.get(i);
if (info != null) { if (info != null) {
prop.setProperty(String.valueOf(len - i - 1), info.getString()); prop.setProperty(Integer.toString(len - i - 1), info.getString());
} }
} }
if (!"null".equals(serverPropertiesDir)) { if (!"null".equals(serverPropertiesDir)) {
......
...@@ -401,7 +401,7 @@ public class FileLock implements Runnable { ...@@ -401,7 +401,7 @@ public class FileLock implements Runnable {
serverSocket = NetUtils.createServerSocket(0, false); serverSocket = NetUtils.createServerSocket(0, false);
int port = serverSocket.getLocalPort(); int port = serverSocket.getLocalPort();
properties.setProperty("ipAddress", ipAddress); properties.setProperty("ipAddress", ipAddress);
properties.setProperty("port", String.valueOf(port)); properties.setProperty("port", Integer.toString(port));
} catch (Exception e) { } catch (Exception e) {
trace.debug(e, "lock"); trace.debug(e, "lock");
serverSocket = null; serverSocket = null;
......
...@@ -843,7 +843,7 @@ public class MetaTable extends Table { ...@@ -843,7 +843,7 @@ public class MetaTable extends Table {
// COLUMN_NAME // COLUMN_NAME
identifier(c.getName()), identifier(c.getName()),
// ORDINAL_POSITION // ORDINAL_POSITION
String.valueOf(j + 1), Integer.toString(j + 1),
// COLUMN_DEFAULT // COLUMN_DEFAULT
c.getDefaultSQL(), c.getDefaultSQL(),
// IS_NULLABLE // IS_NULLABLE
...@@ -1104,9 +1104,9 @@ public class MetaTable extends Table { ...@@ -1104,9 +1104,9 @@ public class MetaTable extends Table {
// TYPE_NAME // TYPE_NAME
t.name, t.name,
// DATA_TYPE // DATA_TYPE
String.valueOf(t.sqlType), Integer.toString(t.sqlType),
// PRECISION // PRECISION
String.valueOf(MathUtils.convertLongToInt(t.maxPrecision)), Integer.toString(MathUtils.convertLongToInt(t.maxPrecision)),
// PREFIX // PREFIX
t.prefix, t.prefix,
// SUFFIX // SUFFIX
...@@ -1116,13 +1116,13 @@ public class MetaTable extends Table { ...@@ -1116,13 +1116,13 @@ public class MetaTable extends Table {
// AUTO_INCREMENT // AUTO_INCREMENT
String.valueOf(t.autoIncrement), String.valueOf(t.autoIncrement),
// MINIMUM_SCALE // MINIMUM_SCALE
String.valueOf(t.minScale), Integer.toString(t.minScale),
// MAXIMUM_SCALE // MAXIMUM_SCALE
String.valueOf(t.maxScale), Integer.toString(t.maxScale),
// RADIX // RADIX
t.decimal ? "10" : null, t.decimal ? "10" : null,
// POS // POS
String.valueOf(t.sqlTypePos), Integer.toString(t.sqlTypePos),
// CASE_SENSITIVE // CASE_SENSITIVE
String.valueOf(t.caseSensitive), String.valueOf(t.caseSensitive),
// NULLABLE // NULLABLE
...@@ -1145,7 +1145,7 @@ public class MetaTable extends Table { ...@@ -1145,7 +1145,7 @@ public class MetaTable extends Table {
for (int i = 0; rs.next(); i++) { for (int i = 0; rs.next(); i++) {
add(rows, add(rows,
// ID // ID
String.valueOf(i), Integer.toString(i),
// SECTION // SECTION
rs.getString(1).trim(), rs.getString(1).trim(),
// TOPIC // TOPIC
...@@ -1627,11 +1627,11 @@ public class MetaTable extends Table { ...@@ -1627,11 +1627,11 @@ public class MetaTable extends Table {
// FKCOLUMN_NAME // FKCOLUMN_NAME
identifier(cols[j].column.getName()), identifier(cols[j].column.getName()),
// ORDINAL_POSITION // ORDINAL_POSITION
String.valueOf(j + 1), Integer.toString(j + 1),
// UPDATE_RULE SMALLINT // UPDATE_RULE SMALLINT
String.valueOf(update), Integer.toString(update),
// DELETE_RULE SMALLINT // DELETE_RULE SMALLINT
String.valueOf(delete), Integer.toString(delete),
// FK_NAME // FK_NAME
identifier(ref.getName()), identifier(ref.getName()),
// PK_NAME // PK_NAME
......
...@@ -1070,7 +1070,7 @@ public class Recover extends Tool implements DataHandler { ...@@ -1070,7 +1070,7 @@ public class Recover extends Tool implements DataHandler {
private String setStorage(int storageId) { private String setStorage(int storageId) {
this.storageId = storageId; this.storageId = storageId;
this.storageName = "O_" + String.valueOf(storageId).replace('-', 'M'); this.storageName = "O_" + Integer.toString(storageId).replace('-', 'M');
return storageName; return storageName;
} }
......
...@@ -333,7 +333,7 @@ public class Shell extends Tool implements Runnable { ...@@ -333,7 +333,7 @@ public class Shell extends Tool implements Runnable {
String data = null; String data = null;
boolean found = false; boolean found = false;
for (int i = 0;; i++) { for (int i = 0;; i++) {
String d = prop.getProperty(String.valueOf(i)); String d = prop.getProperty(Integer.toString(i));
if (d == null) { if (d == null) {
break; break;
} }
......
...@@ -115,7 +115,7 @@ public class ValueByte extends Value { ...@@ -115,7 +115,7 @@ public class ValueByte extends Value {
@Override @Override
public String getString() { public String getString() {
return String.valueOf(value); return Integer.toString(value);
} }
@Override @Override
......
...@@ -148,7 +148,7 @@ public class ValueInt extends Value { ...@@ -148,7 +148,7 @@ public class ValueInt extends Value {
@Override @Override
public String getString() { public String getString() {
return String.valueOf(value); return Integer.toString(value);
} }
@Override @Override
......
...@@ -115,7 +115,7 @@ public class ValueShort extends Value { ...@@ -115,7 +115,7 @@ public class ValueShort extends Value {
@Override @Override
public String getString() { public String getString() {
return String.valueOf(value); return Integer.toString(value);
} }
@Override @Override
......
...@@ -102,7 +102,7 @@ public class Function { ...@@ -102,7 +102,7 @@ public class Function {
* @return true if it is a prime number * @return true if it is a prime number
*/ */
public static boolean isPrime(int value) { public static boolean isPrime(int value) {
return new BigInteger(String.valueOf(value)).isProbablePrime(100); return BigInteger.valueOf(value).isProbablePrime(100);
} }
/** /**
......
...@@ -157,7 +157,7 @@ public class BenchCRandom { ...@@ -157,7 +157,7 @@ public class BenchCRandom {
* @return the big decimal object * @return the big decimal object
*/ */
BigDecimal getBigDecimal(int value, int scale) { BigDecimal getBigDecimal(int value, int scale) {
return new BigDecimal(new BigInteger(String.valueOf(value)), scale); return new BigDecimal(BigInteger.valueOf(value), scale);
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论