mirror of https://github.com/apache/lucene.git
LUCENE-6193: Use ReflectiveOperationException to simplify catch clauses around reflection errors
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1653909 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f5f2b28541
commit
77982fb4e3
|
@ -139,7 +139,7 @@ public class LockStressTest {
|
||||||
// try to create a new instance
|
// try to create a new instance
|
||||||
try {
|
try {
|
||||||
return Class.forName(lockFactoryClassName).asSubclass(FSLockFactory.class).newInstance();
|
return Class.forName(lockFactoryClassName).asSubclass(FSLockFactory.class).newInstance();
|
||||||
} catch (IllegalAccessException | InstantiationException | ClassCastException | ClassNotFoundException e) {
|
} catch (ReflectiveOperationException | ClassCastException e) {
|
||||||
// fall-through
|
// fall-through
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -565,7 +565,7 @@ public class JavascriptCompiler {
|
||||||
checkFunction(method, JavascriptCompiler.class.getClassLoader());
|
checkFunction(method, JavascriptCompiler.class.getClassLoader());
|
||||||
map.put(call, method);
|
map.put(call, method);
|
||||||
}
|
}
|
||||||
} catch (NoSuchMethodException | ClassNotFoundException | IOException e) {
|
} catch (ReflectiveOperationException | IOException e) {
|
||||||
throw new Error("Cannot resolve function", e);
|
throw new Error("Cannot resolve function", e);
|
||||||
}
|
}
|
||||||
DEFAULT_FUNCTIONS = Collections.unmodifiableMap(map);
|
DEFAULT_FUNCTIONS = Collections.unmodifiableMap(map);
|
||||||
|
|
Loading…
Reference in New Issue