Use Class.getDeclaredConstructor().newInstance()

See gh-21913
This commit is contained in:
dreis2211
2020-06-14 08:50:37 +02:00
committed by Andy Wilkinson
parent fbfb7df3e1
commit 507eb9498b
7 changed files with 12 additions and 10 deletions

View File

@@ -132,7 +132,7 @@ public class Handler extends URLStreamHandler {
for (String handlerClassName : FALLBACK_HANDLERS) {
try {
Class<?> handlerClass = Class.forName(handlerClassName);
this.fallbackHandler = (URLStreamHandler) handlerClass.newInstance();
this.fallbackHandler = (URLStreamHandler) handlerClass.getDeclaredConstructor().newInstance();
return this.fallbackHandler;
}
catch (Exception ex) {