提交 1e9832f5 authored 作者: noelgrandin's avatar noelgrandin

remove some dead fields and variables

上级 de91fc28
......@@ -153,7 +153,6 @@ public class TestDateStorage extends TestBase {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6772689
java.sql.Date date = java.sql.Date.valueOf(s);
long time = date.getTime();
int plus = 0;
while (true) {
date = new java.sql.Date(time);
String x = date.toString();
......@@ -161,7 +160,6 @@ public class TestDateStorage extends TestBase {
break;
}
time += 1000;
plus += 1000;
}
if (!date.toString().equals(s)) {
println(TimeZone.getDefault().getID() + " " + s + " <> " + date.toString());
......
......@@ -128,7 +128,7 @@ public class TestMultiDimension extends TestBase {
long timeMulti = 0, timeRegular = 0;
int timeMax = getSize(500, 2000);
Random rand = new Random(1);
for (int i = 0; timeMulti < timeMax; i++) {
while (timeMulti < timeMax) {
int size = rand.nextInt(max / 10);
int minX = rand.nextInt(max - size);
int minY = rand.nextInt(max - size);
......@@ -199,7 +199,7 @@ public class TestMultiDimension extends TestBase {
long timeMulti = 0, timeRegular = 0;
int timeMax = getSize(500, 2000);
Random rand = new Random(1);
for (int i = 0; timeMulti < timeMax; i++) {
while (timeMulti < timeMax) {
int size = rand.nextInt(max / 10);
int minX = rand.nextInt(max - size);
int minY = rand.nextInt(max - size);
......
......@@ -85,7 +85,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
conn.close();
Thread.sleep(950);
long time = System.currentTimeMillis();
for (int i = 0; System.currentTimeMillis() - time < 100; i++) {
while (System.currentTimeMillis() - time < 100) {
conn = DriverManager.getConnection(url, user, password);
conn.close();
}
......
......@@ -347,23 +347,20 @@ public class TestTableEngines extends TestBase {
}
public Cursor find(TableFilter filter, SearchRow first, SearchRow last) {
return find(filter.getSession(), filter.getFilterCondition(), first, last);
return find(filter.getFilterCondition());
}
public Cursor find(Session session, SearchRow first, SearchRow last) {
return find(session, null, first, last);
return find(null);
}
/**
* Search within the table.
*
* @param session the session
* @param filter the table filter (optional)
* @param first the first row (optional)
* @param last the last row (optional)
* @return the cursor
*/
private Cursor find(Session session, Expression filter, SearchRow first, SearchRow last) {
private Cursor find(Expression filter) {
if (filter != null) {
row.setValue(1, ValueString.get(filter.getSQL()));
}
......
......@@ -55,7 +55,7 @@ public class TestTwoPhaseCommit extends TestBase {
stat.execute("CREATE TABLE TEST2(ID INT)");
String name = "tx12345678";
try {
for (int i = 0;; i++) {
while (true) {
stat.execute("INSERT INTO TEST2 VALUES(1)");
name += "x";
stat.execute("PREPARE COMMIT " + name);
......
......@@ -31,7 +31,6 @@ public class TestPowerOffFs2 extends TestBase {
private String password = "sa";
private ArrayList<Connection> connections = New.arrayList();
private ArrayList<String> tables = New.arrayList();
private int openCount;
/**
* Run just this test.
......@@ -84,7 +83,6 @@ public class TestPowerOffFs2 extends TestBase {
private void testCrash(int x) throws SQLException {
connections.clear();
tables.clear();
openCount = 0;
Random random = new Random(x);
for (int i = 0;; i++) {
if (i > 200 && connections.size() > 1 && tables.size() > 1) {
......@@ -167,7 +165,6 @@ public class TestPowerOffFs2 extends TestBase {
}
private Connection openConnection() throws SQLException {
openCount++;
Connection conn = DriverManager.getConnection(url, user, password);
connections.add(conn);
return conn;
......
......@@ -126,7 +126,7 @@ public class TestThreads extends TestBase implements Runnable {
ResultSet rs;
int max = master.getMaxId();
int rid = random.nextInt(max);
for (int i = 0; !master.stop; i++) {
while (!master.stop) {
switch (type) {
case INSERT:
max = master.incrementMaxId();
......
......@@ -88,12 +88,10 @@ public class TestCache extends TestBase implements CacheWriter {
int rc;
prep = conn.prepareStatement("select * from test where id = ?");
rc = getReadCount(stat);
int p = 0;
for (int x = 0; x < 2; x++) {
for (int i = 0; i < 15000; i++) {
prep.setInt(1, i);
prep.executeQuery();
p++;
}
}
int rcData = getReadCount(stat) - rc;
......
......@@ -159,13 +159,12 @@ public class TestCompress extends TestBase {
long time = System.currentTimeMillis();
for (int i = 0; i < 1000; i++) {
InputStream in = FileUtils.newInputStream("memFS:compress.h2.db");
int total = 0;
while (true) {
int len = in.read(buff);
if (len < 0) {
break;
}
total += compress.compress(buff, pageSize, test, 0);
compress.compress(buff, pageSize, test, 0);
}
in.close();
}
......
......@@ -44,7 +44,6 @@ public class Indexer {
private HashMap<String, Word> words = new HashMap<String, Word>();
private HashSet<String> noIndex = new HashSet<String>();
private ArrayList <Word>wordList;
private int totalAllWeights;
private PrintWriter output;
private Page page;
private boolean title;
......@@ -350,7 +349,6 @@ public class Indexer {
word.name = token.compareTo(word.name) > 0 ? token : word.name;
}
page.totalWeight += weight;
totalAllWeights += weight;
word.addPage(page, weight);
}
}
......
......@@ -298,7 +298,7 @@ public class ModelUtils {
try {
// delegate to static valueOf() method to parse string
Method m = modelClass.getMethod("valueOf", String.class);
Object o = m.invoke(null, unquoted);
m.invoke(null, unquoted);
} catch (NumberFormatException ex) {
return false;
} catch (Throwable t) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论