format patches

This commit is contained in:
luoyaoming 2024-05-07 14:05:46 +08:00
parent bb9b6520d0
commit 0fc18ddd8a
4 changed files with 97 additions and 54 deletions

View File

@ -1,12 +1,21 @@
Description: This patch has been added to disable the SecurityAllowedTestCase From: Kumar Appaiah <akumar@ee.iitm.ac.in>
Date: Tue, 7 May 2024 14:05:46 +0800
Subject: This patch has been added to disable the SecurityAllowedTestCase
Forwarded: not-needed
altogether, as it fails to complete successfully on GCJ. The issue altogether, as it fails to complete successfully on GCJ. The issue
seems to be with GCJ, so till the time that GCJ is fixed, we don't run seems to be with GCJ, so till the time that GCJ is fixed, we don't run
this test. this test.
Author: Kumar Appaiah <akumar@ee.iitm.ac.in> ---
Forwarded: not-needed .../org/apache/commons/logging/security/SecurityAllowedTestCase.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java b/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java
index a71a42a..b0664bd 100644
--- a/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java --- a/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java
+++ b/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java +++ b/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java
@@ -98,6 +98,7 @@ @@ -98,6 +98,7 @@ public class SecurityAllowedTestCase extends TestCase {
mySecurityManager.addPermission(new AllPermission()); mySecurityManager.addPermission(new AllPermission());
System.setSecurityManager(mySecurityManager); System.setSecurityManager(mySecurityManager);
@ -14,7 +23,7 @@ Forwarded: not-needed
try { try {
// Use reflection so that we can control exactly when the static // Use reflection so that we can control exactly when the static
// initializer for the LogFactory class is executed. // initializer for the LogFactory class is executed.
@@ -142,5 +143,6 @@ @@ -142,5 +143,6 @@ public class SecurityAllowedTestCase extends TestCase {
t.printStackTrace(pw); t.printStackTrace(pw);
fail("Unexpected exception:" + t.getMessage() + ":" + sw.toString()); fail("Unexpected exception:" + t.getMessage() + ":" + sw.toString());
} }

View File

@ -1,9 +1,17 @@
Description: Skips the compilation of the log4j2 tests From: Emmanuel Bourg <ebourg@apache.org>
Author: Emmanuel Bourg <ebourg@apache.org> Date: Tue, 7 May 2024 14:05:46 +0800
Subject: Skips the compilation of the log4j2 tests
Forwarded: not-needed Forwarded: not-needed
---
pom.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/pom.xml b/pom.xml
index 31c0d5f..8251d71 100644
--- a/pom.xml --- a/pom.xml
+++ b/pom.xml +++ b/pom.xml
@@ -198,6 +198,15 @@ @@ -198,6 +198,15 @@ under the License.
<!-- TODO spotbugs:check --> <!-- TODO spotbugs:check -->
<defaultGoal>clean verify apache-rat:check japicmp:cmp javadoc:javadoc checkstyle:check pmd:check</defaultGoal> <defaultGoal>clean verify apache-rat:check japicmp:cmp javadoc:javadoc checkstyle:check pmd:check</defaultGoal>
<plugins> <plugins>

View File

@ -1,9 +1,17 @@
Description: Fixes the compatibility with the version of Logback in Debian From: Emmanuel Bourg <ebourg@apache.org>
Author: Emmanuel Bourg <ebourg@apache.org> Date: Tue, 7 May 2024 14:05:46 +0800
Subject: Fixes the compatibility with the version of Logback in Debian
Forwarded: not-needed Forwarded: not-needed
---
.../java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java b/src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java
index f4537ce..cb61211 100644
--- a/src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java --- a/src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java
+++ b/src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java +++ b/src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java
@@ -94,7 +94,6 @@ @@ -94,7 +94,6 @@ public class CallerInformationTestCase extends TestCase {
for (int hasThrowable = 0; hasThrowable <= 1; hasThrowable++) { for (int hasThrowable = 0; hasThrowable <= 1; hasThrowable++) {
final ILoggingEvent event = events.get(2 * lev + hasThrowable); final ILoggingEvent event = events.get(2 * lev + hasThrowable);
assertEquals("Correct message.", STRING, event.getMessage()); assertEquals("Correct message.", STRING, event.getMessage());

View File

@ -1,14 +1,65 @@
Description: disable slf4j logging backend From: Vladimir Petko <vladimir.petko@canonical.com>
commons-logging added support for slf4j backend that is incompatible Date: Tue, 7 May 2024 14:05:46 +0800
with slf4j 1.7.x. Both logging subsystems try to get logger from Subject: disable slf4j logging backend
each other, causing "IllegalState: Recursive Update" exception.
Author: Vladimir Petko <vladimir.petko@canonical.com>
Bug: https://lists.apache.org/thread/vgj87y00m5svz9ydv5grt3zp2z9hx2zx Bug: https://lists.apache.org/thread/vgj87y00m5svz9ydv5grt3zp2z9hx2zx
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libcommons-logging-java/+bug/2055845 Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libcommons-logging-java/+bug/2055845
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1061025 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1061025
Forwarded: not-needed Forwarded: not-needed
Last-Update: 2024-03-06 Last-Update: 2024-03-06
commons-logging added support for slf4j backend that is incompatible
with slf4j 1.7.x. Both logging subsystems try to get logger from
each other, causing "IllegalState: Recursive Update" exception.
---
.../org/apache/commons/logging/LogFactory.java | 17 +-
.../commons/logging/impl/Slf4jLogFactory.java | 322 ---------------------
.../logging/slf4j/CallerInformationTestCase.java | 112 -------
3 files changed, 2 insertions(+), 449 deletions(-)
delete mode 100644 src/main/java/org/apache/commons/logging/impl/Slf4jLogFactory.java
delete mode 100644 src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java
diff --git a/src/main/java/org/apache/commons/logging/LogFactory.java b/src/main/java/org/apache/commons/logging/LogFactory.java
index d3f5e6e..8889aae 100644
--- a/src/main/java/org/apache/commons/logging/LogFactory.java
+++ b/src/main/java/org/apache/commons/logging/LogFactory.java
@@ -94,9 +94,7 @@ public abstract class LogFactory {
private static final String FACTORY_LOG4J_API = "org.apache.commons.logging.impl.Log4jApiLogFactory";
private static final String LOG4J_API_LOGGER = "org.apache.logging.log4j.Logger";
- private static final String LOG4J_TO_SLF4J_BRIDGE = "org.apache.logging.slf4j.SLF4JProvider";
- private static final String FACTORY_SLF4J = "org.apache.commons.logging.impl.Slf4jLogFactory";
private static final String SLF4J_API_LOGGER = "org.slf4j.Logger";
/**
@@ -918,21 +916,10 @@ public abstract class LogFactory {
try {
// We prefer Log4j API, since it does not stringify objects.
if (factory == null && isClassAvailable(LOG4J_API_LOGGER, baseClassLoader)) {
- // If the Log4j API is redirected to SLF4J, we use SLF4J directly.
- if (isClassAvailable(LOG4J_TO_SLF4J_BRIDGE, baseClassLoader)) {
- logDiagnostic(
- "[LOOKUP] Log4j API to SLF4J redirection detected. Loading the SLF4J LogFactory implementation '" + FACTORY_SLF4J + "'.");
- factory = newFactory(FACTORY_SLF4J, baseClassLoader, contextClassLoader);
- } else {
- logDiagnostic("[LOOKUP] Log4j API detected. Loading the Log4j API LogFactory implementation '" + FACTORY_LOG4J_API + "'.");
- factory = newFactory(FACTORY_LOG4J_API, baseClassLoader, contextClassLoader);
- }
+ logDiagnostic("[LOOKUP] Log4j API detected. Loading the Log4j API LogFactory implementation '" + FACTORY_LOG4J_API + "'.");
+ factory = newFactory(FACTORY_LOG4J_API, baseClassLoader, contextClassLoader);
}
- if (factory == null && isClassAvailable(SLF4J_API_LOGGER, baseClassLoader)) {
- logDiagnostic("[LOOKUP] SLF4J detected. Loading the SLF4J LogFactory implementation '" + FACTORY_SLF4J + "'.");
- factory = newFactory(FACTORY_SLF4J, baseClassLoader, contextClassLoader);
- }
} catch (final Exception e) {
logDiagnostic("[LOOKUP] An exception occurred while creating LogFactory: " + e.getMessage());
}
diff --git a/src/main/java/org/apache/commons/logging/impl/Slf4jLogFactory.java b/src/main/java/org/apache/commons/logging/impl/Slf4jLogFactory.java
deleted file mode 100644
index adb8f81..0000000
--- a/src/main/java/org/apache/commons/logging/impl/Slf4jLogFactory.java --- a/src/main/java/org/apache/commons/logging/impl/Slf4jLogFactory.java
+++ /dev/null +++ /dev/null
@@ -1,322 +0,0 @@ @@ -1,322 +0,0 @@
@ -334,42 +385,9 @@ Last-Update: 2024-03-06
- } - }
- } - }
-} -}
--- a/src/main/java/org/apache/commons/logging/LogFactory.java diff --git a/src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java b/src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java
+++ b/src/main/java/org/apache/commons/logging/LogFactory.java deleted file mode 100644
@@ -94,9 +94,7 @@ index cb61211..0000000
private static final String FACTORY_LOG4J_API = "org.apache.commons.logging.impl.Log4jApiLogFactory";
private static final String LOG4J_API_LOGGER = "org.apache.logging.log4j.Logger";
- private static final String LOG4J_TO_SLF4J_BRIDGE = "org.apache.logging.slf4j.SLF4JProvider";
- private static final String FACTORY_SLF4J = "org.apache.commons.logging.impl.Slf4jLogFactory";
private static final String SLF4J_API_LOGGER = "org.slf4j.Logger";
/**
@@ -918,21 +916,10 @@
try {
// We prefer Log4j API, since it does not stringify objects.
if (factory == null && isClassAvailable(LOG4J_API_LOGGER, baseClassLoader)) {
- // If the Log4j API is redirected to SLF4J, we use SLF4J directly.
- if (isClassAvailable(LOG4J_TO_SLF4J_BRIDGE, baseClassLoader)) {
- logDiagnostic(
- "[LOOKUP] Log4j API to SLF4J redirection detected. Loading the SLF4J LogFactory implementation '" + FACTORY_SLF4J + "'.");
- factory = newFactory(FACTORY_SLF4J, baseClassLoader, contextClassLoader);
- } else {
- logDiagnostic("[LOOKUP] Log4j API detected. Loading the Log4j API LogFactory implementation '" + FACTORY_LOG4J_API + "'.");
- factory = newFactory(FACTORY_LOG4J_API, baseClassLoader, contextClassLoader);
- }
+ logDiagnostic("[LOOKUP] Log4j API detected. Loading the Log4j API LogFactory implementation '" + FACTORY_LOG4J_API + "'.");
+ factory = newFactory(FACTORY_LOG4J_API, baseClassLoader, contextClassLoader);
}
- if (factory == null && isClassAvailable(SLF4J_API_LOGGER, baseClassLoader)) {
- logDiagnostic("[LOOKUP] SLF4J detected. Loading the SLF4J LogFactory implementation '" + FACTORY_SLF4J + "'.");
- factory = newFactory(FACTORY_SLF4J, baseClassLoader, contextClassLoader);
- }
} catch (final Exception e) {
logDiagnostic("[LOOKUP] An exception occurred while creating LogFactory: " + e.getMessage());
}
--- a/src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java --- a/src/test/java/org/apache/commons/logging/slf4j/CallerInformationTestCase.java
+++ /dev/null +++ /dev/null
@@ -1,112 +0,0 @@ @@ -1,112 +0,0 @@