From 2946e3b0b34c2a22fd20b97058944aeb67d4361f Mon Sep 17 00:00:00 2001 From: Ceki Gulcu Date: Mon, 6 Nov 2023 19:12:59 +0100 Subject: [PATCH] minor refactoring Signed-off-by: Ceki Gulcu --- .../src/main/java/ch/qos/logback/core/util/Loader.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/logback-core/src/main/java/ch/qos/logback/core/util/Loader.java b/logback-core/src/main/java/ch/qos/logback/core/util/Loader.java index 4959e6de6c..32c793f5f7 100644 --- a/logback-core/src/main/java/ch/qos/logback/core/util/Loader.java +++ b/logback-core/src/main/java/ch/qos/logback/core/util/Loader.java @@ -165,18 +165,14 @@ public ClassLoader run() { /** * Return the class loader which loaded the class passed as argument. Return the - * system class loader if appropriate. + * system class loader if the class loader of 'clazz' argument is null. * * @param clazz * @return */ public static ClassLoader getClassLoaderOfClass(final Class clazz) { ClassLoader cl = clazz.getClassLoader(); - if (cl == null) { - return ClassLoader.getSystemClassLoader(); - } else { - return cl; - } + return systemClassloaderIfNull(cl); } /**