提交 8558795d authored 作者: Thomas Mueller's avatar Thomas Mueller

remove unnecessary throws clauses

上级 0ccda3fb
...@@ -176,6 +176,8 @@ public abstract class Prepared { ...@@ -176,6 +176,8 @@ public abstract class Prepared {
/** /**
* Prepare this statement. * Prepare this statement.
*
* @throws SQLException
*/ */
public void prepare() throws SQLException { public void prepare() throws SQLException {
// nothing to do // nothing to do
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
*/ */
package org.h2.command.dml; package org.h2.command.dml;
import java.sql.SQLException;
import org.h2.expression.Expression; import org.h2.expression.Expression;
import org.h2.expression.ExpressionColumn; import org.h2.expression.ExpressionColumn;
import org.h2.table.Column; import org.h2.table.Column;
...@@ -71,7 +69,7 @@ public class SelectListColumnResolver implements ColumnResolver { ...@@ -71,7 +69,7 @@ public class SelectListColumnResolver implements ColumnResolver {
return null; return null;
} }
public Value getValue(Column column) throws SQLException { public Value getValue(Column column) {
return null; return null;
} }
......
...@@ -143,7 +143,7 @@ public class ConstraintCheck extends Constraint { ...@@ -143,7 +143,7 @@ public class ConstraintCheck extends Constraint {
return null; return null;
} }
public void rebuild() throws SQLException { public void rebuild() {
// nothing to do // nothing to do
} }
......
...@@ -533,7 +533,7 @@ public class ConstraintReferential extends Constraint { ...@@ -533,7 +533,7 @@ public class ConstraintReferential extends Constraint {
updateSQL = buff.toString(); updateSQL = buff.toString();
} }
public void rebuild() throws SQLException { public void rebuild() {
buildUpdateSQL(); buildUpdateSQL();
buildDeleteSQL(); buildDeleteSQL();
} }
......
...@@ -148,7 +148,7 @@ public class ConstraintUnique extends Constraint { ...@@ -148,7 +148,7 @@ public class ConstraintUnique extends Constraint {
return index; return index;
} }
public void rebuild() throws SQLException { public void rebuild() {
// nothing to do // nothing to do
} }
......
...@@ -486,7 +486,7 @@ public class Database implements DataHandler { ...@@ -486,7 +486,7 @@ public class Database implements DataHandler {
* @param testHash the hash code * @param testHash the hash code
* @return true if the cipher algorithm and the password match * @return true if the cipher algorithm and the password match
*/ */
public boolean validateFilePasswordHash(String testCipher, byte[] testHash) throws SQLException { public boolean validateFilePasswordHash(String testCipher, byte[] testHash) {
if (!StringUtils.equals(testCipher, this.cipher)) { if (!StringUtils.equals(testCipher, this.cipher)) {
return false; return false;
} }
......
...@@ -322,7 +322,7 @@ public class FunctionAlias extends DbObjectBase { ...@@ -322,7 +322,7 @@ public class FunctionAlias extends DbObjectBase {
} }
} }
public Class[] getColumnClasses() throws SQLException { public Class[] getColumnClasses() {
return method.getParameterTypes(); return method.getParameterTypes();
} }
...@@ -330,7 +330,7 @@ public class FunctionAlias extends DbObjectBase { ...@@ -330,7 +330,7 @@ public class FunctionAlias extends DbObjectBase {
return dataType; return dataType;
} }
public int getParameterCount() throws SQLException { public int getParameterCount() {
return paramCount; return paramCount;
} }
......
...@@ -629,7 +629,7 @@ public class Session extends SessionWithState { ...@@ -629,7 +629,7 @@ public class Session extends SessionWithState {
} }
} }
private void unlockAll() throws SQLException { private void unlockAll() {
if (SysProperties.CHECK) { if (SysProperties.CHECK) {
if (undoLog.size() > 0) { if (undoLog.size() > 0) {
Message.throwInternalError(); Message.throwInternalError();
......
...@@ -87,7 +87,7 @@ public class SessionRemote extends SessionWithState implements SessionFactory, D ...@@ -87,7 +87,7 @@ public class SessionRemote extends SessionWithState implements SessionFactory, D
// nothing to do // nothing to do
} }
private SessionRemote(ConnectionInfo ci) throws SQLException { private SessionRemote(ConnectionInfo ci) {
this.connectionInfo = ci; this.connectionInfo = ci;
} }
......
...@@ -193,6 +193,7 @@ public abstract class Expression { ...@@ -193,6 +193,7 @@ public abstract class Expression {
* *
* @param session the session * @param session the session
* @param filter the table filter * @param filter the table filter
* @throws SQLException
*/ */
public void createIndexConditions(Session session, TableFilter filter) throws SQLException { public void createIndexConditions(Session session, TableFilter filter) throws SQLException {
// default is do nothing // default is do nothing
...@@ -300,6 +301,7 @@ public abstract class Expression { ...@@ -300,6 +301,7 @@ public abstract class Expression {
* @param session the session * @param session the session
* @param select the query * @param select the query
* @return the optimized expression * @return the optimized expression
* @throws SQLException
*/ */
public Expression optimizeInJoin(Session session, Select select) throws SQLException { public Expression optimizeInJoin(Session session, Select select) throws SQLException {
return this; return this;
......
...@@ -109,7 +109,7 @@ public class JavaFunction extends Expression implements FunctionCall { ...@@ -109,7 +109,7 @@ public class JavaFunction extends Expression implements FunctionCall {
return functionAlias.getName(); return functionAlias.getName();
} }
public int getParameterCount() throws SQLException { public int getParameterCount() {
return javaMethod.getParameterCount(); return javaMethod.getParameterCount();
} }
......
...@@ -26,7 +26,7 @@ import org.h2.value.ValueResultSet; ...@@ -26,7 +26,7 @@ import org.h2.value.ValueResultSet;
/** /**
* Implementation of the functions TABLE(..) and TABLE_DISTINCT(..). * Implementation of the functions TABLE(..) and TABLE_DISTINCT(..).
*/ */
public class TableFunction extends Function implements FunctionCall { public class TableFunction extends Function {
private final boolean distinct; private final boolean distinct;
private final long rowCount; private final long rowCount;
private Column[] columnList; private Column[] columnList;
......
...@@ -793,14 +793,14 @@ public class FullText { ...@@ -793,14 +793,14 @@ public class FullText {
/** /**
* INTERNAL * INTERNAL
*/ */
public void close() throws SQLException { public void close() {
setting.removeIndexInfo(index); setting.removeIndexInfo(index);
} }
/** /**
* INTERNAL * INTERNAL
*/ */
public void remove() throws SQLException { public void remove() {
setting.removeIndexInfo(index); setting.removeIndexInfo(index);
} }
......
...@@ -174,6 +174,16 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index { ...@@ -174,6 +174,16 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
return false; return false;
} }
/**
* Find a row or a list of rows that is larger and create a cursor to
* iterate over the result. The base implementation doesn't support this feature.
*
* @param session the session
* @param higherThan the lower limit (excluding)
* @param last the last row, or null for no limit
* @return the cursor
* @throws SQLException
*/
public Cursor findNext(Session session, SearchRow first, SearchRow last) throws SQLException { public Cursor findNext(Session session, SearchRow first, SearchRow last) throws SQLException {
throw Message.throwInternalError(); throw Message.throwInternalError();
} }
......
...@@ -138,6 +138,7 @@ public abstract class BtreePage extends Record { ...@@ -138,6 +138,7 @@ public abstract class BtreePage extends Record {
* *
* @param i the index * @param i the index
* @return the row * @return the row
* @throws SQLException
*/ */
SearchRow getData(int i) throws SQLException { SearchRow getData(int i) throws SQLException {
return (SearchRow) pageData.get(i); return (SearchRow) pageData.get(i);
......
...@@ -122,7 +122,6 @@ public interface Index extends SchemaObject { ...@@ -122,7 +122,6 @@ public interface Index extends SchemaObject {
* @param last the last row, or null for no limit * @param last the last row, or null for no limit
* @return the cursor * @return the cursor
*/ */
Cursor findNext(Session session, SearchRow higherThan, SearchRow last) throws SQLException; Cursor findNext(Session session, SearchRow higherThan, SearchRow last) throws SQLException;
/** /**
......
...@@ -98,7 +98,7 @@ abstract class PageBtree extends Record { ...@@ -98,7 +98,7 @@ abstract class PageBtree extends Record {
int comp = 1; int comp = 1;
while (l < r) { while (l < r) {
int i = (l + r) >>> 1; int i = (l + r) >>> 1;
SearchRow row = (SearchRow) getRow(i); SearchRow row = getRow(i);
comp = index.compareRows(row, compare); comp = index.compareRows(row, compare);
if (comp == 0 && add) { if (comp == 0 && add) {
if (index.indexType.getUnique()) { if (index.indexType.getUnique()) {
......
...@@ -477,7 +477,7 @@ implements XAConnection, XAResource ...@@ -477,7 +477,7 @@ implements XAConnection, XAResource
private boolean isClosed; private boolean isClosed;
public PooledJdbcConnection(JdbcConnection conn) throws SQLException { public PooledJdbcConnection(JdbcConnection conn) {
super(conn); super(conn);
} }
......
...@@ -15,7 +15,6 @@ import java.util.Enumeration; ...@@ -15,7 +15,6 @@ import java.util.Enumeration;
import java.util.Properties; import java.util.Properties;
import javax.servlet.ServletConfig; import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -32,7 +31,7 @@ public class WebServlet extends HttpServlet { ...@@ -32,7 +31,7 @@ public class WebServlet extends HttpServlet {
private static final long serialVersionUID = 9171446624885086692L; private static final long serialVersionUID = 9171446624885086692L;
private transient WebServer server; private transient WebServer server;
public void init() throws ServletException { public void init() {
ServletConfig config = getServletConfig(); ServletConfig config = getServletConfig();
Enumeration en = config.getInitParameterNames(); Enumeration en = config.getInitParameterNames();
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
......
...@@ -171,7 +171,7 @@ public class FileLock { ...@@ -171,7 +171,7 @@ public class FileLock {
* @param key the key * @param key the key
* @param value the value * @param value the value
*/ */
public void setProperty(String key, String value) throws SQLException { public void setProperty(String key, String value) {
if (value == null) { if (value == null) {
properties.remove(key); properties.remove(key);
} else { } else {
......
...@@ -114,7 +114,7 @@ public class PageFreeList extends Record { ...@@ -114,7 +114,7 @@ public class PageFreeList extends Record {
return -1; return -1;
} }
return next.allocate(pos); return next.allocate(pos);
} else { }
int idx = pos - firstAddressed; int idx = pos - firstAddressed;
if (idx >= 0 && !used.get(idx)) { if (idx >= 0 && !used.get(idx)) {
used.set(pos - firstAddressed); used.set(pos - firstAddressed);
...@@ -122,7 +122,6 @@ public class PageFreeList extends Record { ...@@ -122,7 +122,6 @@ public class PageFreeList extends Record {
} }
return pos; return pos;
} }
}
/** /**
* Add a page to the free list. * Add a page to the free list.
...@@ -155,7 +154,7 @@ public class PageFreeList extends Record { ...@@ -155,7 +154,7 @@ public class PageFreeList extends Record {
} }
} }
public int getByteCount(DataPage dummy) throws SQLException { public int getByteCount(DataPage dummy) {
return store.getPageSize(); return store.getPageSize();
} }
......
...@@ -44,6 +44,8 @@ public abstract class Record extends CacheObject { ...@@ -44,6 +44,8 @@ public abstract class Record extends CacheObject {
* If a read operation is required before writing, this needs to be done here. * If a read operation is required before writing, this needs to be done here.
* Because the data page buffer is shared for read and write operations. * Because the data page buffer is shared for read and write operations.
* The method may read data and change the file pointer. * The method may read data and change the file pointer.
*
* @throws SQLException
*/ */
public void prepareWrite() throws SQLException { public void prepareWrite() throws SQLException {
// nothing to do // nothing to do
......
...@@ -106,7 +106,7 @@ public class FileObjectDiskMapped implements FileObject { ...@@ -106,7 +106,7 @@ public class FileObjectDiskMapped implements FileObject {
file = null; file = null;
} }
public long getFilePointer() throws IOException { public long getFilePointer() {
return mapped.position(); return mapped.position();
} }
...@@ -118,11 +118,11 @@ public class FileObjectDiskMapped implements FileObject { ...@@ -118,11 +118,11 @@ public class FileObjectDiskMapped implements FileObject {
return file.length(); return file.length();
} }
public void readFully(byte[] b, int off, int len) throws IOException { public void readFully(byte[] b, int off, int len) {
mapped.get(b, off, len); mapped.get(b, off, len);
} }
public void seek(long pos) throws IOException { public void seek(long pos) {
mapped.position((int) pos); mapped.position((int) pos);
} }
......
...@@ -38,11 +38,11 @@ public class FileObjectSplit implements FileObject { ...@@ -38,11 +38,11 @@ public class FileObjectSplit implements FileObject {
} }
} }
public long getFilePointer() throws IOException { public long getFilePointer() {
return filePointer; return filePointer;
} }
public long length() throws IOException { public long length() {
return length; return length;
} }
...@@ -67,7 +67,7 @@ public class FileObjectSplit implements FileObject { ...@@ -67,7 +67,7 @@ public class FileObjectSplit implements FileObject {
} }
} }
public void seek(long pos) throws IOException { public void seek(long pos) {
filePointer = pos; filePointer = pos;
} }
......
...@@ -110,7 +110,7 @@ public class FileSystemMemory extends FileSystem { ...@@ -110,7 +110,7 @@ public class FileSystemMemory extends FileSystem {
} }
} }
public void deleteRecursive(String fileName) throws SQLException { public void deleteRecursive(String fileName) {
fileName = normalize(fileName); fileName = normalize(fileName);
synchronized (MEMORY_FILES) { synchronized (MEMORY_FILES) {
Iterator it = MEMORY_FILES.keySet().iterator(); Iterator it = MEMORY_FILES.keySet().iterator();
......
...@@ -18,7 +18,7 @@ import java.util.Set; ...@@ -18,7 +18,7 @@ import java.util.Set;
* and removed. It is not a general purpose cache, as it doesn't implement some * and removed. It is not a general purpose cache, as it doesn't implement some
* methods, and others not according to the map definition, to improve speed. * methods, and others not according to the map definition, to improve speed.
*/ */
public class SoftHashMap extends AbstractMap implements Map { public class SoftHashMap extends AbstractMap {
private Map map; private Map map;
private ReferenceQueue queue = new ReferenceQueue(); private ReferenceQueue queue = new ReferenceQueue();
......
...@@ -858,6 +858,7 @@ public abstract class Value { ...@@ -858,6 +858,7 @@ public abstract class Value {
* @param onlyToSmallerScale if the scale should not reduced * @param onlyToSmallerScale if the scale should not reduced
* @param targetScale the requested scale * @param targetScale the requested scale
* @return the value * @return the value
* @throws SQLException
*/ */
public Value convertScale(boolean onlyToSmallerScale, int targetScale) throws SQLException { public Value convertScale(boolean onlyToSmallerScale, int targetScale) throws SQLException {
return this; return this;
...@@ -868,6 +869,7 @@ public abstract class Value { ...@@ -868,6 +869,7 @@ public abstract class Value {
* *
* @param precision the new precision * @param precision the new precision
* @return the new value * @return the new value
* @throws SQLException
*/ */
public Value convertPrecision(long precision) throws SQLException { public Value convertPrecision(long precision) throws SQLException {
return this; return this;
...@@ -922,6 +924,7 @@ public abstract class Value { ...@@ -922,6 +924,7 @@ public abstract class Value {
* @param handler the data handler * @param handler the data handler
* @param tableId the table to link to * @param tableId the table to link to
* @return the new value or itself * @return the new value or itself
* @throws SQLException
*/ */
public Value link(DataHandler handler, int tableId) throws SQLException { public Value link(DataHandler handler, int tableId) throws SQLException {
return this; return this;
...@@ -940,6 +943,8 @@ public abstract class Value { ...@@ -940,6 +943,8 @@ public abstract class Value {
/** /**
* Mark any underlying resource as 'not linked to any table'. For values * Mark any underlying resource as 'not linked to any table'. For values
* that are kept fully in memory this method has no effect. * that are kept fully in memory this method has no effect.
*
* @throws SQLException
*/ */
public void unlink() throws SQLException { public void unlink() throws SQLException {
// nothing to do // nothing to do
...@@ -958,6 +963,8 @@ public abstract class Value { ...@@ -958,6 +963,8 @@ public abstract class Value {
/** /**
* Close the underlying resource, if any. For values that are kept fully in * Close the underlying resource, if any. For values that are kept fully in
* memory this method has no effect. * memory this method has no effect.
*
* @throws SQLException
*/ */
public void close() throws SQLException { public void close() throws SQLException {
// nothing to do // nothing to do
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论