提交 c751c9e6 authored 作者: noelgrandin's avatar noelgrandin

these fields can be replaced by local variables

上级 f430a1e4
......@@ -35,7 +35,6 @@ public class CommandRemote implements CommandInterface {
private int id;
private boolean isQuery;
private boolean readonly;
private int paramCount;
private int created;
public CommandRemote(SessionRemote session, ArrayList<Transfer> transferList, String sql, int fetchSize) {
......@@ -53,7 +52,6 @@ public class CommandRemote implements CommandInterface {
private void prepare(SessionRemote s, boolean createParams) {
id = s.getNextId();
paramCount = 0;
for (int i = 0, count = 0; i < transferList.size(); i++) {
try {
Transfer transfer = transferList.get(i);
......@@ -67,7 +65,7 @@ public class CommandRemote implements CommandInterface {
s.done(transfer);
isQuery = transfer.readBoolean();
readonly = transfer.readBoolean();
paramCount = transfer.readInt();
int paramCount = transfer.readInt();
if (createParams) {
parameters.clear();
for (int j = 0; j < paramCount; j++) {
......
......@@ -29,7 +29,6 @@ import org.h2.value.ValueNull;
public class UpdatableRow {
private final JdbcConnection conn;
private final DatabaseMetaData meta;
private final ResultInterface result;
private final int columnCount;
private String schemaName;
......@@ -46,7 +45,6 @@ public class UpdatableRow {
*/
public UpdatableRow(JdbcConnection conn, ResultInterface result) throws SQLException {
this.conn = conn;
this.meta = conn.getMetaData();
this.result = result;
columnCount = result.getVisibleColumnCount();
for (int i = 0; i < columnCount; i++) {
......@@ -66,6 +64,7 @@ public class UpdatableRow {
return;
}
}
final DatabaseMetaData meta = conn.getMetaData();
ResultSet rs = meta.getTables(null,
JdbcUtils.escapeMetaDataPattern(schemaName),
JdbcUtils.escapeMetaDataPattern(tableName),
......
......@@ -117,7 +117,6 @@ public class PageLog {
private Trace trace;
private Data writeBuffer;
private PageInputStream pageIn;
private PageOutputStream pageOut;
private int firstTrunkPage;
private int firstDataPage;
......@@ -261,7 +260,7 @@ public class PageLog {
in.close();
return true;
}
pageIn = new PageInputStream(store, logKey, firstTrunkPage, firstDataPage);
PageInputStream pageIn = new PageInputStream(store, logKey, firstTrunkPage, firstDataPage);
DataReader in = new DataReader(pageIn);
int logId = 0;
Data data = store.createData();
......
......@@ -27,12 +27,11 @@ public class OutputCatcher {
public static final String START_ERROR = "<span style=\"color:red;\">";
private ByteArrayOutputStream buff = new ByteArrayOutputStream();
private HtmlOutputStream html;
private DualOutputStream out, err;
private String output;
private OutputCatcher() {
html = new HtmlOutputStream(buff);
HtmlOutputStream html = new HtmlOutputStream(buff);
out = new DualOutputStream(html, System.out, false);
err = new DualOutputStream(html, System.err, true);
System.setOut(new PrintStream(out, true));
......
......@@ -34,7 +34,6 @@ public class FtpClient {
private PrintWriter writer;
private int code;
private String message;
private Socket socketData;
private InputStream inData;
private OutputStream outData;
......@@ -237,7 +236,7 @@ public class FtpClient {
String ip = buff.toString();
InetAddress addr = InetAddress.getByName(ip);
int port = (Integer.parseInt(address[4]) << 8) | Integer.parseInt(address[5]);
socketData = NetUtils.createSocket(addr, port, false);
Socket socketData = NetUtils.createSocket(addr, port, false);
inData = socketData.getInputStream();
outData = socketData.getOutputStream();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论