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 f85a691 Use forEach()
f85a691 is described below
commit f85a691196087b65d8954005145670d86043cb97
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Dec 29 13:27:24 2023 -0500
Use forEach()
---
src/main/java/org/apache/commons/logging/LogFactory.java | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/logging/LogFactory.java
b/src/main/java/org/apache/commons/logging/LogFactory.java
index b5ffacf..c94f1db 100644
--- a/src/main/java/org/apache/commons/logging/LogFactory.java
+++ b/src/main/java/org/apache/commons/logging/LogFactory.java
@@ -1510,11 +1510,7 @@ public abstract class LogFactory {
// factories is not final and could be replaced in this block.
final Hashtable<ClassLoader, LogFactory> factories =
LogFactory.factories;
synchronized (factories) {
- final Enumeration<LogFactory> elements = factories.elements();
- while (elements.hasMoreElements()) {
- final LogFactory element = elements.nextElement();
- element.release();
- }
+ factories.values().forEach(LogFactory::release);
factories.clear();
if (nullClassLoaderFactory != null) {