You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2022/01/13 14:04:02 UTC
[logging-log4j2] branch release-2.x updated: Simplify exception handling.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/release-2.x by this push:
new ae79439 Simplify exception handling.
ae79439 is described below
commit ae79439f47b8cd0189e627471f91bf535e44f359
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Jan 13 09:03:58 2022 -0500
Simplify exception handling.
---
.../main/java/org/apache/log4j/config/PropertiesConfiguration.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/config/PropertiesConfiguration.java b/log4j-1.2-api/src/main/java/org/apache/log4j/config/PropertiesConfiguration.java
index df15def..8be58d4 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/config/PropertiesConfiguration.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/config/PropertiesConfiguration.java
@@ -18,7 +18,6 @@ package org.apache.log4j.config;
import java.io.IOException;
import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
@@ -582,8 +581,7 @@ public class PropertiesConfiguration extends Log4j1Configuration {
private static <T> T newInstanceOf(final String className, final String type) {
try {
return LoaderUtil.newInstanceOf(className);
- } catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException |
- InstantiationException | InvocationTargetException ex) {
+ } catch (ReflectiveOperationException ex) {
LOGGER.error("Unable to create {} {} due to {}:{}", type, className,
ex.getClass().getSimpleName(), ex.getMessage());
return null;