提交 93c4c62d authored 作者: noelgrandin@gmail.com's avatar noelgrandin@gmail.com

fix some javadoc @throws comments

上级 21d04c85
......@@ -93,7 +93,7 @@ public abstract class Command implements CommandInterface {
* Execute an updating statement, if this is possible.
*
* @return the update count
* @throws SQLException if the command is not an updating statement
* @throws DbException if the command is not an updating statement
*/
public int update() {
throw DbException.get(ErrorCode.METHOD_NOT_ALLOWED_FOR_QUERY);
......@@ -104,7 +104,7 @@ public abstract class Command implements CommandInterface {
*
* @param maxrows the maximum number of rows returned
* @return the local result set
* @throws SQLException if the command is not a query
* @throws DbException if the command is not a query
*/
public ResultInterface query(int maxrows) {
throw DbException.get(ErrorCode.METHOD_ONLY_ALLOWED_FOR_QUERY);
......@@ -126,7 +126,7 @@ public abstract class Command implements CommandInterface {
/**
* Check if this command has been canceled, and throw an exception if yes.
*
* @throws SQLException if the statement has been canceled
* @throws DbException if the statement has been canceled
*/
protected void checkCanceled() {
if (cancel) {
......
......@@ -153,7 +153,7 @@ public abstract class Prepared {
/**
* Check if all parameters have been set.
*
* @throws SQLException if any parameter has not been set
* @throws DbException if any parameter has not been set
*/
protected void checkParameters() {
if (parameters != null) {
......@@ -195,7 +195,7 @@ public abstract class Prepared {
* Execute the statement.
*
* @return the update count
* @throws SQLException if it is a query
* @throws DbException if it is a query
*/
public int update() {
throw DbException.get(ErrorCode.METHOD_NOT_ALLOWED_FOR_QUERY);
......@@ -206,7 +206,7 @@ public abstract class Prepared {
*
* @param maxrows the maximum number of rows to return
* @return the result set
* @throws SQLException if it is not a query
* @throws DbException if it is not a query
*/
public ResultInterface query(int maxrows) {
throw DbException.get(ErrorCode.METHOD_ONLY_ALLOWED_FOR_QUERY);
......@@ -269,7 +269,7 @@ public abstract class Prepared {
/**
* Check if this statement was canceled.
*
* @throws SQLException if it was canceled
* @throws DbException if it was canceled
*/
public void checkCanceled() {
session.checkCanceled();
......
......@@ -894,7 +894,7 @@ public class Database implements DataHandler {
*
* @param name the user name
* @return the user
* @throws SQLException if the user does not exist
* @throws DbException if the user does not exist
*/
public User getUser(String name) {
User user = findUser(name);
......@@ -909,7 +909,7 @@ public class Database implements DataHandler {
*
* @param user the user
* @return the session
* @throws SQLException if the database is in exclusive mode
* @throws DbException if the database is in exclusive mode
*/
synchronized Session createSession(User user) {
if (exclusiveSession != null) {
......@@ -1433,7 +1433,7 @@ public class Database implements DataHandler {
*
* @param schemaName the name of the schema
* @return the schema
* @throws SQLException no schema with that name exists
* @throws DbException no schema with that name exists
*/
public Schema getSchema(String schemaName) {
Schema schema = findSchema(schemaName);
......
......@@ -7,6 +7,7 @@
package org.h2.engine;
import java.util.ArrayList;
import org.h2.message.DbException;
import org.h2.table.Table;
/**
......@@ -167,7 +168,7 @@ public interface DbObject {
/**
* Check if renaming is allowed. Does nothing when allowed.
*
* @throws SQLException if renaming is not allowed
* @throws DbException if renaming is not allowed
*/
void checkRename();
......
......@@ -255,7 +255,7 @@ public class Engine implements SessionFactory {
* stack trace to see if the user name was wrong or the password.
*
* @param correct if the user name or the password was correct
* @throws SQLException the exception 'wrong user or password'
* @throws DbException the exception 'wrong user or password'
*/
private void validateUserAndPassword(boolean correct) {
int min = SysProperties.DELAY_WRONG_PASSWORD_MIN;
......
......@@ -205,7 +205,7 @@ public class Session extends SessionWithState {
* Add a local temporary table to this session.
*
* @param table the table to add
* @throws SQLException if a table with this name already exists
* @throws DbException if a table with this name already exists
*/
public void addLocalTempTable(Table table) {
if (localTempTables == null) {
......@@ -256,7 +256,7 @@ public class Session extends SessionWithState {
* Add a local temporary index to this session.
*
* @param index the index to add
* @throws SQLException if a index with this name already exists
* @throws DbException if a index with this name already exists
*/
public void addLocalTempTableIndex(Index index) {
if (localTempTableIndexes == null) {
......@@ -313,7 +313,7 @@ public class Session extends SessionWithState {
* Add a local temporary constraint to this session.
*
* @param constraint the constraint to add
* @throws SQLException if a constraint with the same name already exists
* @throws DbException if a constraint with the same name already exists
*/
public void addLocalTempTableConstraint(Constraint constraint) {
if (localTempTableConstraints == null) {
......@@ -880,7 +880,7 @@ public class Session extends SessionWithState {
* Check if the current transaction is canceled by calling
* Statement.cancel() or because a session timeout was set and expired.
*
* @throws SQLException if the transaction is canceled
* @throws DbException if the transaction is canceled
*/
public void checkCanceled() {
throttle();
......
......@@ -473,7 +473,7 @@ public class SessionRemote extends SessionWithState implements DataHandler {
/**
* Check if this session is closed and throws an exception if so.
*
* @throws SQLException if the session is closed
* @throws DbException if the session is closed
*/
public void checkClosed() {
if (isClosed()) {
......@@ -522,7 +522,7 @@ public class SessionRemote extends SessionWithState implements DataHandler {
* the server and throws any exception the server sent.
*
* @param transfer the transfer object
* @throws SQLException if the server sent an exception
* @throws DbException if the server sent an exception
* @throws IOException if there is a communication problem between client
* and server
*/
......
......@@ -91,7 +91,7 @@ public class User extends RightOwner {
*
* @param table the database object
* @param rightMask the rights required
* @throws SQLException if this user does not have the required rights
* @throws DbException if this user does not have the required rights
*/
public void checkRight(Table table, int rightMask) {
if (!hasRight(table, rightMask)) {
......@@ -192,7 +192,7 @@ public class User extends RightOwner {
* Check if this user has admin rights. An exception is thrown if he does
* not have them.
*
* @throws SQLException if this user is not an admin
* @throws DbException if this user is not an admin
*/
public void checkAdmin() {
if (!admin) {
......@@ -240,7 +240,7 @@ public class User extends RightOwner {
* Check that this user does not own any schema. An exception is thrown if he
* owns one or more schemas.
*
* @throws SQLException if this user owns a schema
* @throws DbException if this user owns a schema
*/
public void checkOwnsNoSchemas() {
for (Schema s : database.getAllSchemas()) {
......
......@@ -1546,7 +1546,7 @@ public class Function extends Expression implements FunctionCall {
* Check if the parameter count is correct.
*
* @param len the number of parameters set
* @throws SQLException if the parameter count is incorrect
* @throws DbException if the parameter count is incorrect
*/
protected void checkParameterCount(int len) {
int min = 0, max = Integer.MAX_VALUE;
......@@ -1612,7 +1612,7 @@ public class Function extends Expression implements FunctionCall {
* This method is called after all the parameters have been set.
* It checks if the parameter count is correct.
*
* @throws SQLException if the parameter count is incorrect.
* @throws DbException if the parameter count is incorrect.
*/
public void doneWithParameters() {
if (info.parameterCount == VAR_ARGS) {
......
......@@ -107,7 +107,7 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
* @param higherThan the lower limit (excluding)
* @param last the last row, or null for no limit
* @return the cursor
* @throws SQLException
* @throws DbException
*/
public Cursor findNext(Session session, SearchRow higherThan, SearchRow last) {
throw DbException.throwInternalError();
......
......@@ -394,7 +394,7 @@ public class Schema extends DbObjectBase {
* @param session the session
* @param name the table or view name
* @return the table or view
* @throws SQLException if no such object exists
* @throws DbException if no such object exists
*/
public Table getTableOrView(Session session, String name) {
Table table = tablesAndViews.get(name);
......@@ -414,7 +414,7 @@ public class Schema extends DbObjectBase {
*
* @param name the index name
* @return the index
* @throws SQLException if no such object exists
* @throws DbException if no such object exists
*/
public Index getIndex(String name) {
Index index = indexes.get(name);
......@@ -429,7 +429,7 @@ public class Schema extends DbObjectBase {
*
* @param name the constraint name
* @return the constraint
* @throws SQLException if no such object exists
* @throws DbException if no such object exists
*/
public Constraint getConstraint(String name) {
Constraint constraint = constraints.get(name);
......@@ -444,7 +444,7 @@ public class Schema extends DbObjectBase {
*
* @param constantName the constant name
* @return the constant
* @throws SQLException if no such object exists
* @throws DbException if no such object exists
*/
public Constant getConstant(String constantName) {
Constant constant = constants.get(constantName);
......@@ -459,7 +459,7 @@ public class Schema extends DbObjectBase {
*
* @param sequenceName the sequence name
* @return the sequence
* @throws SQLException if no such object exists
* @throws DbException if no such object exists
*/
public Sequence getSequence(String sequenceName) {
Sequence sequence = sequences.get(sequenceName);
......
......@@ -7,6 +7,7 @@
package org.h2.store;
import java.sql.Connection;
import org.h2.message.DbException;
import org.h2.util.SmallLRUCache;
import org.h2.util.TempFileDeleter;
......@@ -37,14 +38,14 @@ public interface DataHandler {
* Check if the simulated power failure occurred.
* This call will decrement the countdown.
*
* @throws SQLException if the simulated power failure occurred
* @throws DbException if the simulated power failure occurred
*/
void checkPowerOff();
/**
* Check if writing is allowed.
*
* @throws SQLException if it is not allowed
* @throws DbException if it is not allowed
*/
void checkWritingAllowed();
......@@ -52,7 +53,7 @@ public interface DataHandler {
* Free up disk space if possible.
* This method is called if more space is needed.
*
* @throws SQLException if no more space could be freed
* @throws DbException if no more space could be freed
*/
void freeUpDiskSpace();
......
......@@ -121,7 +121,7 @@ public class FileLock implements Runnable {
* Lock the file if possible. A file may only be locked once.
*
* @param fileLockMethod the file locking method to use
* @throws SQLException if locking was not successful
* @throws DbException if locking was not successful
*/
public synchronized void lock(int fileLockMethod) {
this.fs = FileSystem.getInstance(fileName);
......@@ -461,7 +461,7 @@ public class FileLock implements Runnable {
*
* @param method the method name
* @return the method type
* @throws SQLException if the method name is unknown
* @throws DbException if the method name is unknown
*/
public static int getFileLockMethod(String method) {
if (method == null || method.equalsIgnoreCase("FILE")) {
......
......@@ -479,7 +479,7 @@ public abstract class Table extends SchemaObjectBase {
*
* @param session the session
* @param col the column
* @throws SQLException if the column is referenced by multi-column
* @throws DbException if the column is referenced by multi-column
* constraints or indexes
*/
public void dropSingleColumnConstraintsAndIndexes(Session session, Column col) {
......@@ -577,7 +577,7 @@ public abstract class Table extends SchemaObjectBase {
*
* @param columnName the column name
* @return the column
* @throws SQLException if the column was not found
* @throws DbException if the column was not found
*/
public Column getColumn(String columnName) {
Column column = columnMap.get(columnName);
......
......@@ -263,7 +263,7 @@ public class Utils {
*
* @param data the byte array
* @return the object
* @throws SQLException
* @throws DbException if serialization fails
*/
public static Object deserialize(byte[] data) {
try {
......
......@@ -1041,7 +1041,7 @@ public abstract class Value {
*
* @param op the operation
* @return never returns normally
* @throws the exception
* @throws DbException the exception
*/
protected DbException throwUnsupportedExceptionForType(String op) {
throw DbException.getUnsupportedException(DataType.getDataType(getType()).name + " " + op);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论