1
0

Simplify weird code

This commit is contained in:
Gary Gregory
2023-11-25 12:16:31 -05:00
parent a5b6ec6522
commit 09e85b177c

View File

@@ -206,9 +206,7 @@ public class LogSource {
*/ */
static public void setLogImplementation(final Class<?> logClass) static public void setLogImplementation(final Class<?> logClass)
throws LinkageError, ExceptionInInitializerError, NoSuchMethodException, SecurityException { throws LinkageError, ExceptionInInitializerError, NoSuchMethodException, SecurityException {
final Class<?>[] argTypes = new Class[1]; logImplctor = logClass.getConstructor(new Class<?>[] { String.class });
argTypes[0] = "".getClass();
logImplctor = logClass.getConstructor(argTypes);
} }
/** /**
@@ -224,9 +222,7 @@ public class LogSource {
static public void setLogImplementation(final String className) throws LinkageError, SecurityException { static public void setLogImplementation(final String className) throws LinkageError, SecurityException {
try { try {
final Class<?> logClass = Class.forName(className); final Class<?> logClass = Class.forName(className);
final Class<?>[] argTypes = new Class[1]; logImplctor = logClass.getConstructor(new Class<?>[] { String.class });
argTypes[0] = "".getClass();
logImplctor = logClass.getConstructor(argTypes);
} catch (final Throwable t) { } catch (final Throwable t) {
logImplctor = null; logImplctor = null;
} }