mirror of https://github.com/apache/lucene.git
LUCENE-5207: Throw correct exception in JavascriptFunction ctor
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene5207@1523204 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ada121d6b0
commit
98e055a539
|
@ -83,10 +83,10 @@ class JavascriptFunction {
|
||||||
private JavascriptFunction(String call, Method method) {
|
private JavascriptFunction(String call, Method method) {
|
||||||
// do some checks if the signature is "compatible":
|
// do some checks if the signature is "compatible":
|
||||||
if (!Modifier.isStatic(method.getModifiers())) {
|
if (!Modifier.isStatic(method.getModifiers())) {
|
||||||
throw new Error(method + " is not static.");
|
throw new IllegalArgumentException(method + " is not static.");
|
||||||
}
|
}
|
||||||
if (method.getReturnType() != double.class) {
|
if (method.getReturnType() != double.class) {
|
||||||
throw new Error(method + " does not return a double.");
|
throw new IllegalArgumentException(method + " does not return a double.");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.call = call;
|
this.call = call;
|
||||||
|
|
Loading…
Reference in New Issue