summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
ee1e076)
This method is deprecated in JDK9+, migrate to its replacement.
This also means that any exceptions thrown are wrapped in
InvocationTargetException, hence we can (and are forced by FindBugs)
replace catching of Exception with catching of ClassCastException
and ReflectiveOperationException.
Change-Id: Iefd48ecef653fc73f74b2a77ac1ab7891b2575d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
try {
String className = DefaultConfigParamsImpl.this.customRaftPolicyImplementationClass;
LOG.info("Trying to use custom RaftPolicy {}", className);
try {
String className = DefaultConfigParamsImpl.this.customRaftPolicyImplementationClass;
LOG.info("Trying to use custom RaftPolicy {}", className);
- return (RaftPolicy)Class.forName(className).newInstance();
- } catch (Exception e) {
+ return (RaftPolicy)Class.forName(className).getDeclaredConstructor().newInstance();
+ } catch (ClassCastException | ReflectiveOperationException e) {
if (LOG.isDebugEnabled()) {
LOG.error("Could not create custom raft policy, will stick with default", e);
} else {
if (LOG.isDebugEnabled()) {
LOG.error("Could not create custom raft policy, will stick with default", e);
} else {