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

these fields can be replaced by local variables

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