Commit b9f1ed7b authored by Piotr Gawron's avatar Piotr Gawron
Browse files

deprecated method replaced

parent cce092cd
......@@ -278,8 +278,9 @@ public class ConvertController extends BaseController {
for (Converter converter : modelConverters) {
if (removeWhiteSpaces(converter.getCommonName()).equals(name)) {
try {
return converter.getClass().newInstance();
} catch (InstantiationException | IllegalAccessException e) {
return converter.getClass().getConstructor().newInstance();
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
| SecurityException e) {
throw new InvalidStateException(e);
}
}
......@@ -295,8 +296,9 @@ public class ConvertController extends BaseController {
for (Converter converter : modelConverters) {
if (converter.getClass().getCanonicalName().equals(handlerClass)) {
try {
return (Converter) Class.forName(handlerClass).newInstance();
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
return (Converter) Class.forName(handlerClass).getConstructor().newInstance();
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | IllegalArgumentException | InvocationTargetException
| NoSuchMethodException | SecurityException e) {
throw new QueryException("Problem with handler:" + handlerClass);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment