提交 be0f8ddc authored 作者: Noel Grandin's avatar Noel Grandin

some Eclipse warnings cleanup

上级 a632178c
......@@ -198,7 +198,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
return 0;
}
private void checkDefaultReferencesTable(Table table, Expression defaultExpression) {
private static void checkDefaultReferencesTable(Table table, Expression defaultExpression) {
if (defaultExpression == null) {
return;
}
......
......@@ -67,6 +67,7 @@ public interface ResultInterface extends AutoCloseable {
/**
* Close the result and delete any temporary files
*/
@Override
void close();
/**
......
......@@ -153,7 +153,7 @@ public abstract class TestBase {
if (config.stopOnError) {
throw new AssertionError("ERROR");
}
conf.atLeastOneTestFailed = true;
TestAll.atLeastOneTestFailed = true;
if (e instanceof OutOfMemoryError) {
throw (OutOfMemoryError) e;
}
......
......@@ -12,13 +12,11 @@ import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import org.h2.mvstore.MVMap;
import org.h2.mvstore.MVStore;
import org.h2.store.FileLister;
import org.h2.store.fs.FileUtils;
import org.h2.test.TestBase;
import org.h2.util.Profiler;
import org.h2.util.Task;
/**
......@@ -216,7 +214,7 @@ public class TestBenchmark extends TestBase {
conn.close();
}
private void randomize(byte[] data, int i) {
private static void randomize(byte[] data, int i) {
Random r = new Random(i);
r.nextBytes(data);
}
......
......@@ -19,7 +19,6 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import org.h2.mvstore.DataUtils;
import org.h2.mvstore.MVMap;
import org.h2.mvstore.MVStore;
......@@ -314,7 +313,7 @@ public class TestConcurrent extends TestMVStore {
}
}
private void testConcurrentChangeAndGetVersion() throws InterruptedException {
private static void testConcurrentChangeAndGetVersion() throws InterruptedException {
for (int test = 0; test < 10; test++) {
final MVStore s = new MVStore.Builder().
autoCommitDisabled().open();
......@@ -522,7 +521,7 @@ public class TestConcurrent extends TestMVStore {
/**
* Test the concurrent map implementation.
*/
private void testConcurrentMap() throws InterruptedException {
private static void testConcurrentMap() throws InterruptedException {
final MVStore s = openStore(null);
final MVMap<Integer, Integer> m = s.openMap("data");
try {
......@@ -644,7 +643,7 @@ public class TestConcurrent extends TestMVStore {
in.close();
}
private void testConcurrentIterate() {
private static void testConcurrentIterate() {
MVStore s = new MVStore.Builder().pageSplitSize(3).open();
s.setVersionsToKeep(100);
final MVMap<Integer, Integer> map = s.openMap("test");
......@@ -697,7 +696,7 @@ public class TestConcurrent extends TestMVStore {
assertTrue(notDetected.get() * 10 <= detected.get());
}
private void testConcurrentWrite(final AtomicInteger detected,
private static void testConcurrentWrite(final AtomicInteger detected,
final AtomicInteger notDetected) throws InterruptedException {
final MVStore s = openStore(null);
final MVMap<Integer, Integer> m = s.openMap("data");
......@@ -761,7 +760,7 @@ public class TestConcurrent extends TestMVStore {
s.close();
}
private void testConcurrentRead() throws InterruptedException {
private static void testConcurrentRead() throws InterruptedException {
final MVStore s = openStore(null);
final MVMap<Integer, Integer> m = s.openMap("data");
final int size = 3;
......
......@@ -9,7 +9,6 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import org.h2.mvstore.ConcurrentArrayList;
import org.h2.test.TestBase;
import org.h2.util.Task;
......@@ -45,7 +44,7 @@ public class TestConcurrentLinkedList extends TestBase {
testPerformance(false);
}
private void testPerformance(final boolean stock) {
private static void testPerformance(final boolean stock) {
System.out.print(stock ? "stock " : "custom ");
long start = System.currentTimeMillis();
// final ConcurrentLinkedList<Integer> test =
......
......@@ -15,7 +15,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import org.h2.mvstore.DataUtils;
import org.h2.mvstore.MVMap;
import org.h2.mvstore.MVStore;
......@@ -63,7 +62,7 @@ public class TestTransactionStore extends TestBase {
testStoreMultiThreadedReads();
}
private void testConcurrentAddRemove() throws InterruptedException {
private static void testConcurrentAddRemove() throws InterruptedException {
MVStore s = MVStore.open(null);
int threadCount = 3;
final int keyCount = 2;
......@@ -988,7 +987,7 @@ public class TestTransactionStore extends TestBase {
s.close();
}
private void testStoreMultiThreadedReads() throws Exception {
private static void testStoreMultiThreadedReads() throws Exception {
MVStore s = MVStore.open(null);
final TransactionStore ts = new TransactionStore(s);
......
......@@ -177,7 +177,7 @@ public class TestNetUtils extends TestBase {
}
}
private void testFrequentConnections(boolean ssl, int count) throws Exception {
private static void testFrequentConnections(boolean ssl, int count) throws Exception {
final ServerSocket serverSocket = NetUtils.createServerSocket(PORT, ssl);
final AtomicInteger counter = new AtomicInteger(count);
Task serverThread = new Task() {
......
......@@ -17,7 +17,6 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import javax.servlet.Filter;
import javax.servlet.FilterRegistration;
import javax.servlet.FilterRegistration.Dynamic;
......@@ -30,7 +29,6 @@ import javax.servlet.ServletRegistration;
import javax.servlet.SessionCookieConfig;
import javax.servlet.SessionTrackingMode;
import javax.servlet.descriptor.JspConfigDescriptor;
import org.h2.api.ErrorCode;
import org.h2.server.web.DbStarter;
import org.h2.test.TestBase;
......@@ -150,6 +148,7 @@ public class TestServlet extends TestBase {
* @deprecated as of servlet API 2.1
*/
@Override
@Deprecated
public Servlet getServlet(String string) {
throw new UnsupportedOperationException();
}
......@@ -162,6 +161,7 @@ public class TestServlet extends TestBase {
/**
* @deprecated as of servlet API 2.1
*/
@Deprecated
@Override
public Enumeration<String> getServletNames() {
throw new UnsupportedOperationException();
......@@ -170,6 +170,7 @@ public class TestServlet extends TestBase {
/**
* @deprecated as of servlet API 2.0
*/
@Deprecated
@Override
public Enumeration<Servlet> getServlets() {
throw new UnsupportedOperationException();
......@@ -183,6 +184,7 @@ public class TestServlet extends TestBase {
/**
* @deprecated as of servlet API 2.1
*/
@Deprecated
@Override
public void log(Exception exception, String string) {
throw new UnsupportedOperationException();
......
......@@ -18,6 +18,7 @@ import android.os.Bundle;
/**
* A cursor implementation.
*/
@SuppressWarnings("unused")
public class H2Cursor extends AbstractWindowedCursor {
private H2Database database;
......@@ -33,22 +34,27 @@ public class H2Cursor extends AbstractWindowedCursor {
this.result = result;
}
@Override
public void close() {
result.close();
}
@Override
public void deactivate() {
// TODO
}
@Override
public int getColumnIndex(String columnName) {
return 0;
}
@Override
public String[] getColumnNames() {
return null;
}
@Override
public int getCount() {
return result.getRowCount();
}
......@@ -73,10 +79,12 @@ public class H2Cursor extends AbstractWindowedCursor {
return false;
}
@Override
public void registerDataSetObserver(DataSetObserver observer) {
// TODO
}
@Override
public boolean requery() {
return false;
}
......@@ -99,6 +107,7 @@ public class H2Cursor extends AbstractWindowedCursor {
// TODO
}
@Override
public boolean move(int offset) {
if (offset == 1) {
return result.next();
......@@ -106,148 +115,178 @@ public class H2Cursor extends AbstractWindowedCursor {
throw H2Database.unsupported();
}
@Override
public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
// TODO
}
@Override
public byte[] getBlob(int columnIndex) {
// TODO
return null;
}
@Override
public int getColumnCount() {
// TODO
return 0;
}
@Override
public int getColumnIndexOrThrow(String columnName) {
// TODO
return 0;
}
@Override
public String getColumnName(int columnIndex) {
// TODO
return null;
}
@Override
public double getDouble(int columnIndex) {
// TODO
return 0;
}
@Override
public Bundle getExtras() {
// TODO
return null;
}
@Override
public float getFloat(int columnIndex) {
// TODO
return 0;
}
@Override
public int getInt(int columnIndex) {
return result.currentRow()[columnIndex].getInt();
}
@Override
public long getLong(int columnIndex) {
return result.currentRow()[columnIndex].getLong();
}
@Override
public int getPosition() {
// TODO
return 0;
}
@Override
public short getShort(int columnIndex) {
// TODO
return 0;
}
@Override
public String getString(int columnIndex) {
return result.currentRow()[columnIndex].getString();
}
@Override
public boolean getWantsAllOnMoveCalls() {
// TODO
return false;
}
@Override
public boolean isAfterLast() {
// TODO
return false;
}
@Override
public boolean isBeforeFirst() {
// TODO
return false;
}
@Override
public boolean isClosed() {
// TODO
return false;
}
@Override
public boolean isFirst() {
// TODO
return false;
}
@Override
public boolean isLast() {
// TODO
return false;
}
@Override
public boolean isNull(int columnIndex) {
// TODO
return false;
}
@Override
public boolean moveToFirst() {
// TODO
return false;
}
@Override
public boolean moveToLast() {
// TODO
return false;
}
@Override
public boolean moveToNext() {
// TODO
return false;
}
@Override
public boolean moveToPosition(int position) {
// TODO
return false;
}
@Override
public boolean moveToPrevious() {
// TODO
return false;
}
@Override
public void registerContentObserver(ContentObserver observer) {
// TODO
}
@Override
public Bundle respond(Bundle extras) {
// TODO
return null;
}
@Override
public void setNotificationUri(ContentResolver cr, Uri uri) {
// TODO
}
@Override
public void unregisterContentObserver(ContentObserver observer) {
// TODO
}
@Override
public void unregisterDataSetObserver(DataSetObserver observer) {
// TODO
......
......@@ -26,6 +26,7 @@ import android.database.Cursor;
/**
* This class represents a database connection.
*/
@SuppressWarnings("unused")
public class H2Database {
/**
......@@ -680,7 +681,7 @@ public class H2Database {
return prep;
}
private Value getValue(Object o) {
private static Value getValue(Object o) {
if (o == null) {
return ValueNull.INSTANCE;
} else if (o instanceof String) {
......
......@@ -11,6 +11,7 @@ import android.content.Context;
* This helper class helps creating and managing databases. A subclass typically
* implements the "on" methods.
*/
@SuppressWarnings("unused")
public abstract class H2OpenHelper {
/**
......
......@@ -12,6 +12,7 @@ import org.h2.value.ValueBytes;
/**
* This class represents a prepared statement.
*/
@SuppressWarnings("unused")
public class H2Program extends H2Closable {
/**
......@@ -99,6 +100,7 @@ public class H2Program extends H2Closable {
/**
* TODO
*/
@Override
protected void onAllReferencesReleased() {
// TODO
}
......@@ -106,6 +108,7 @@ public class H2Program extends H2Closable {
/**
* TODO
*/
@Override
protected void onAllReferencesReleasedFromContainer() {
// TODO
}
......
......@@ -22,6 +22,7 @@ public class H2Query extends H2Program {
* @param index the parameter index (0, 1,...)
* @param value the new value
*/
@Override
public void bindDouble(int index, double value) {
// TODO
}
......@@ -32,6 +33,7 @@ public class H2Query extends H2Program {
* @param index the parameter index (0, 1,...)
* @param value the new value
*/
@Override
public void bindLong(int index, long value) {
// TODO
}
......@@ -41,6 +43,7 @@ public class H2Query extends H2Program {
*
* @param index the parameter index (0, 1,...)
*/
@Override
public void bindNull(int index) {
// TODO
}
......@@ -51,6 +54,7 @@ public class H2Query extends H2Program {
* @param index the parameter index (0, 1,...)
* @param value the new value
*/
@Override
public void bindString(int index, String value) {
// TODO
}
......@@ -58,6 +62,7 @@ public class H2Query extends H2Program {
/**
* Close the statement.
*/
@Override
public void close() {
// TODO
}
......
......@@ -13,6 +13,7 @@ import android.database.Cursor;
/**
* This helper class is used to build SQL statements.
*/
@SuppressWarnings("unused")
public class H2QueryBuilder {
private H2Database.CursorFactory factory;
......
......@@ -474,7 +474,7 @@ public class BuildBase {
}
}
private PrintStream filter(PrintStream out, final String[] exclude) {
private static PrintStream filter(PrintStream out, final String[] exclude) {
return new PrintStream(new FilterOutputStream(out) {
private ByteArrayOutputStream buff = new ByteArrayOutputStream();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论