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/08 19:58:21 UTC
[logging-log4j2] 02/03: Only check if log4j-core is available once.
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
commit cead0fdc28acdcb54baf7f37b6deb92661b202ad
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jan 8 14:57:48 2022 -0500
Only check if log4j-core is available once.
---
log4j-1.2-api/src/main/java/org/apache/log4j/spi/Filter.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/spi/Filter.java b/log4j-1.2-api/src/main/java/org/apache/log4j/spi/Filter.java
index 5cd7189..17a15d6 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/spi/Filter.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/spi/Filter.java
@@ -27,16 +27,17 @@ public abstract class Filter {
boolean temp;
try {
temp = Class.forName("org.apache.logging.log4j.core.Filter") != null;
- } catch (Exception e) {
+ } catch (Exception | LinkageError e) {
temp = false;
}
isCorePresent = temp;
}
+ // TODO Unused?
private final FilterAdapter adapter;
/**
- * C
+ * Constructs a new instance.
*/
public Filter() {
this.adapter = isCorePresent ? new FilterAdapter(this) : null;
@@ -75,6 +76,7 @@ public abstract class Filter {
* default do-nothing implementation for convenience.
*/
public void activateOptions() {
+ // noop
}