You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/11/25 17:16:36 UTC
(commons-logging) branch master updated: Simplify weird code
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-logging.git
The following commit(s) were added to refs/heads/master by this push:
new 09e85b1 Simplify weird code
09e85b1 is described below
commit 09e85b177ccc7f5769219f48c3aad2677ed7603e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 25 12:16:31 2023 -0500
Simplify weird code
---
src/main/java/org/apache/commons/logging/LogSource.java | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/apache/commons/logging/LogSource.java b/src/main/java/org/apache/commons/logging/LogSource.java
index e83371e..e194a0d 100644
--- a/src/main/java/org/apache/commons/logging/LogSource.java
+++ b/src/main/java/org/apache/commons/logging/LogSource.java
@@ -205,10 +205,8 @@ public class LogSource {
* s.checkPackageAccess()} denies access to the package of this class.
*/
static public void setLogImplementation(final Class<?> logClass)
- throws LinkageError, ExceptionInInitializerError, NoSuchMethodException, SecurityException {
- final Class<?>[] argTypes = new Class[1];
- argTypes[0] = "".getClass();
- logImplctor = logClass.getConstructor(argTypes);
+ throws LinkageError, ExceptionInInitializerError, NoSuchMethodException, SecurityException {
+ logImplctor = logClass.getConstructor(new Class<?>[] { String.class });
}
/**
@@ -224,9 +222,7 @@ public class LogSource {
static public void setLogImplementation(final String className) throws LinkageError, SecurityException {
try {
final Class<?> logClass = Class.forName(className);
- final Class<?>[] argTypes = new Class[1];
- argTypes[0] = "".getClass();
- logImplctor = logClass.getConstructor(argTypes);
+ logImplctor = logClass.getConstructor(new Class<?>[] { String.class });
} catch (final Throwable t) {
logImplctor = null;
}