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

some Eclipse warnings cleanup

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