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

remove unnecessary throws clauses

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