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:
Uwe Schindler 2013-09-14 10:20:47 +00:00
parent ada121d6b0
commit 98e055a539
1 changed files with 2 additions and 2 deletions

View File

@ -83,10 +83,10 @@ class JavascriptFunction {
private JavascriptFunction(String call, Method method) {
// do some checks if the signature is "compatible":
if (!Modifier.isStatic(method.getModifiers())) {
throw new Error(method + " is not static.");
throw new IllegalArgumentException(method + " is not static.");
}
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;