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

commit 7d6d85a44494694fd81a798de74879c397890283
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Nov 19 11:46:53 2023 -0500

    Fix compiler warning
---
 .../java/org/apache/commons/logging/LogFactory.java   | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/commons/logging/LogFactory.java 
b/src/main/java/org/apache/commons/logging/LogFactory.java
index 12bd2f8..6d02843 100644
--- a/src/main/java/org/apache/commons/logging/LogFactory.java
+++ b/src/main/java/org/apache/commons/logging/LogFactory.java
@@ -601,14 +601,14 @@ public abstract class LogFactory {
         double priority = 0.0;
         URL propsUrl = null;
         try {
-            final Enumeration urls = getResources(classLoader, fileName);
+            final Enumeration<URL> urls = getResources(classLoader, fileName);
 
             if (urls == null) {
                 return null;
             }
 
             while (urls.hasMoreElements()) {
-                final URL url = (URL) urls.nextElement();
+                final URL url = urls.nextElement();
 
                 final Properties newProps = getProperties(url);
                 if (newProps != null) {
@@ -622,8 +622,7 @@ public abstract class LogFactory {
                         }
 
                         if (isDiagnosticsEnabled()) {
-                            logDiagnostic("[LOOKUP] Properties file found at 
'" + url + "'" +
-                                          " with priority " + priority);
+                            logDiagnostic("[LOOKUP] Properties file found at 
'" + url + "'" + " with priority " + priority);
                         }
                     } else {
                         final String newPriorityStr = 
newProps.getProperty(PRIORITY_KEY);
@@ -634,20 +633,16 @@ public abstract class LogFactory {
 
                         if (newPriority > priority) {
                             if (isDiagnosticsEnabled()) {
-                                logDiagnostic("[LOOKUP] Properties file at '" 
+ url + "'" +
-                                              " with priority " + newPriority +
-                                              " overrides file at '" + 
propsUrl + "'" +
-                                              " with priority " + priority);
+                                logDiagnostic("[LOOKUP] Properties file at '" 
+ url + "'" + " with priority " + newPriority + " overrides file at '" + 
propsUrl
+                                        + "'" + " with priority " + priority);
                             }
 
                             propsUrl = url;
                             props = newProps;
                             priority = newPriority;
                         } else if (isDiagnosticsEnabled()) {
-                            logDiagnostic("[LOOKUP] Properties file at '" + 
url + "'" +
-                                          " with priority " + newPriority +
-                                          " does not override file at '" + 
propsUrl + "'" +
-                                          " with priority " + priority);
+                            logDiagnostic("[LOOKUP] Properties file at '" + 
url + "'" + " with priority " + newPriority + " does not override file at '"
+                                    + propsUrl + "'" + " with priority " + 
priority);
                         }
                     }
 

Reply via email to