提交 eb49972e authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Rename throwUnsupportedExceptionForType() and make implementation and usage consistent

上级 f80b78b6
......@@ -514,11 +514,11 @@ public abstract class Value {
* @return the result
*/
public Value add(@SuppressWarnings("unused") Value v) {
throw throwUnsupportedExceptionForType("+");
throw getUnsupportedExceptionForOperation("+");
}
public int getSignum() {
throw throwUnsupportedExceptionForType("SIGNUM");
throw getUnsupportedExceptionForOperation("SIGNUM");
}
/**
......@@ -527,7 +527,7 @@ public abstract class Value {
* @return the negative
*/
public Value negate() {
throw throwUnsupportedExceptionForType("NEG");
throw getUnsupportedExceptionForOperation("NEG");
}
/**
......@@ -537,7 +537,7 @@ public abstract class Value {
* @return the result
*/
public Value subtract(@SuppressWarnings("unused") Value v) {
throw throwUnsupportedExceptionForType("-");
throw getUnsupportedExceptionForOperation("-");
}
/**
......@@ -547,7 +547,7 @@ public abstract class Value {
* @return the result
*/
public Value divide(@SuppressWarnings("unused") Value v) {
throw throwUnsupportedExceptionForType("/");
throw getUnsupportedExceptionForOperation("/");
}
/**
......@@ -557,7 +557,7 @@ public abstract class Value {
* @return the result
*/
public Value multiply(@SuppressWarnings("unused") Value v) {
throw throwUnsupportedExceptionForType("*");
throw getUnsupportedExceptionForOperation("*");
}
/**
......@@ -567,7 +567,7 @@ public abstract class Value {
* @return the result
*/
public Value modulus(@SuppressWarnings("unused") Value v) {
throw throwUnsupportedExceptionForType("%");
throw getUnsupportedExceptionForOperation("%");
}
/**
......@@ -1320,15 +1320,14 @@ public abstract class Value {
}
/**
* Throw the exception that the feature is not support for the given data
* type.
* Create an exception meaning the specified operation is not supported for
* this data type.
*
* @param op the operation
* @return never returns normally
* @throws DbException the exception
* @return the exception
*/
protected DbException throwUnsupportedExceptionForType(String op) {
throw DbException.getUnsupportedException(
protected final DbException getUnsupportedExceptionForOperation(String op) {
return DbException.getUnsupportedException(
DataType.getDataType(getType()).name + " " + op);
}
......
......@@ -142,7 +142,7 @@ public class ValueResultSet extends Value {
@Override
public void set(PreparedStatement prep, int parameterIndex) {
throw throwUnsupportedExceptionForType("PreparedStatement.set");
throw getUnsupportedExceptionForOperation("PreparedStatement.set");
}
@Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论