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