1
0

Update call deprecated in Java 9

This commit is contained in:
Gary Gregory
2023-10-02 12:05:29 -04:00
parent 176a1462a8
commit 260d5e2177
3 changed files with 4 additions and 4 deletions

View File

@@ -329,7 +329,7 @@ public abstract class LogFactory {
} }
try { try {
final Class implementationClass = Class.forName(storeImplementationClass); final Class implementationClass = Class.forName(storeImplementationClass);
result = (Hashtable) implementationClass.newInstance(); result = (Hashtable) implementationClass.getConstructor().newInstance();
} catch (final Throwable t) { } catch (final Throwable t) {
handleThrowable(t); // may re-throw t handleThrowable(t); // may re-throw t
@@ -1046,7 +1046,7 @@ public abstract class LogFactory {
} }
} }
return (LogFactory) logFactoryClass.newInstance(); return (LogFactory) logFactoryClass.getConstructor().newInstance();
} catch (final ClassNotFoundException ex) { } catch (final ClassNotFoundException ex) {
if (classLoader == thisClassLoaderRef.get()) { if (classLoader == thisClassLoaderRef.get()) {

View File

@@ -197,7 +197,7 @@ public class LoadTestCase extends TestCase{
private void execute(final Class cls) throws Exception { private void execute(final Class cls) throws Exception {
cls.newInstance(); cls.getConstructor().newInstance();
} }
@Override @Override

View File

@@ -182,7 +182,7 @@ public class SecurityForbiddenTestCase extends TestCase
private Object loadClass(final String name, final ClassLoader classLoader) { private Object loadClass(final String name, final ClassLoader classLoader) {
try { try {
final Class clazz = classLoader.loadClass(name); final Class clazz = classLoader.loadClass(name);
final Object obj = clazz.newInstance(); final Object obj = clazz.getConstructor().newInstance();
return obj; return obj;
} catch ( final Exception e ) { } catch ( final Exception e ) {
final StringWriter sw = new StringWriter(); final StringWriter sw = new StringWriter();