From 51a3978280cf938cd4e7857b3b284b72df20bbe4 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 20 Nov 2023 09:54:16 -0500 Subject: [PATCH] Fix compiler warning --- .../apache/commons/logging/impl/ServletContextCleaner.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/logging/impl/ServletContextCleaner.java b/src/main/java/org/apache/commons/logging/impl/ServletContextCleaner.java index fc50642..7c1137d 100644 --- a/src/main/java/org/apache/commons/logging/impl/ServletContextCleaner.java +++ b/src/main/java/org/apache/commons/logging/impl/ServletContextCleaner.java @@ -48,7 +48,7 @@ import org.apache.commons.logging.LogFactory; */ public class ServletContextCleaner implements ServletContextListener { - private static final Class[] RELEASE_SIGNATURE = {ClassLoader.class}; + private static final Class[] RELEASE_SIGNATURE = { ClassLoader.class }; /** * Invoked when a webapp is undeployed, this tells the LogFactory @@ -98,12 +98,13 @@ public class ServletContextCleaner implements ServletContextListener { // via this loader, but is accessible via some ancestor then that class // will be returned. try { - final Class logFactoryClass = loader.loadClass("org.apache.commons.logging.LogFactory"); + @SuppressWarnings("unchecked") + final Class logFactoryClass = (Class) loader.loadClass("org.apache.commons.logging.LogFactory"); final Method releaseMethod = logFactoryClass.getMethod("release", RELEASE_SIGNATURE); releaseMethod.invoke(null, params); loader = logFactoryClass.getClassLoader().getParent(); } catch (final ClassNotFoundException ex) { - // Neither the current classloader nor any of its ancestors could find + // Neither the current class loader nor any of its ancestors could find // the LogFactory class, so we can stop now. loader = null; } catch (final NoSuchMethodException ex) {