提交 f02315ce authored 作者: Thomas Mueller's avatar Thomas Mueller

Improved error message

上级 d9d9eca7
......@@ -265,7 +265,7 @@ public class FunctionAlias extends SchemaObjectBase {
}
}
throw DbException.get(ErrorCode.METHOD_NOT_FOUND_1,
methodName + " (" + className + ", parameter count: " + parameterCount + ")");
getName() + " (" + className + ", parameter count: " + parameterCount + ")");
}
public String getJavaClassName() {
......@@ -286,6 +286,50 @@ public class FunctionAlias extends SchemaObjectBase {
return javaMethods;
}
public void setDeterministic(boolean deterministic) {
this.deterministic = deterministic;
}
public boolean isDeterministic() {
return deterministic;
}
public String getSource() {
return source;
}
/**
* Checks if the given method takes a variable number of arguments. For Java
* 1.4 and older, false is returned. Example:
* <pre>
* public static double mean(double... values)
* </pre>
*
* @param m the method to test
* @return true if the method takes a variable number of arguments.
*/
static boolean isVarArgs(Method m) {
if ("1.5".compareTo(SysProperties.JAVA_SPECIFICATION_VERSION) > 0) {
return false;
}
try {
Method isVarArgs = m.getClass().getMethod("isVarArgs");
Boolean result = (Boolean) isVarArgs.invoke(m);
return result.booleanValue();
} catch (Exception e) {
return false;
}
}
/**
* Should the return value ResultSet be buffered in a local temporary file?
*
* @return true if yes
*/
public boolean isBufferResultSetToLocalTemp() {
return bufferResultSetToLocalTemp;
}
/**
* There may be multiple Java methods that match a function name.
* Each method must have a different number of parameters however.
......@@ -482,47 +526,4 @@ public class FunctionAlias extends SchemaObjectBase {
}
public void setDeterministic(boolean deterministic) {
this.deterministic = deterministic;
}
public boolean isDeterministic() {
return deterministic;
}
public String getSource() {
return source;
}
/**
* Checks if the given method takes a variable number of arguments. For Java
* 1.4 and older, false is returned. Example:
* <pre>
* public static double mean(double... values)
* </pre>
*
* @param m the method to test
* @return true if the method takes a variable number of arguments.
*/
static boolean isVarArgs(Method m) {
if ("1.5".compareTo(SysProperties.JAVA_SPECIFICATION_VERSION) > 0) {
return false;
}
try {
Method isVarArgs = m.getClass().getMethod("isVarArgs");
Boolean result = (Boolean) isVarArgs.invoke(m);
return result.booleanValue();
} catch (Exception e) {
return false;
}
}
/**
* Should the return value ResultSet be buffered in a local temporary file?
*
* @return true if yes
*/
public boolean isBufferResultSetToLocalTemp() {
return bufferResultSetToLocalTemp;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论