/** * Loads a class by name. This method respects the {@link #IGNORE_TCCL_PROPERTY} Log4j property. If this property is * specified and set to anything besides {@code false}, then the default ClassLoader will be used. * * @param className The class name. * @return the Class for the given name. * @throws ClassNotFoundException if the specified class name could not be found * @since 2.1 */ public static Class<?> loadClass(final String className) throws ClassNotFoundException { if (isIgnoreTccl()) { return Class.forName(className); } try { return getThreadContextClassLoader().loadClass(className); } catch (final Throwable ignored) { return Class.forName(className); } }
/** * Loads a class by name. This method respects the {@link # IGNORE_TCCL_PROPERTY} Log4j property. If this property * is specified and set to anything besides {@code false}, then the default ClassLoader will be used. * * @param className The class name. * @return the Class for the given name. * @throws ClassNotFoundException if the specified class name could not be found * @since 2.1 */ public static Class<?> loadClass(final String className) throws ClassNotFoundException { if (isIgnoreTccl()) { return Class.forName(className); } try { return getThreadContextClassLoader().loadClass(className); } catch (final Throwable ignored) { return Class.forName(className); } }
/** * Loads a class by name. This method respects the {@link #IGNORE_TCCL_PROPERTY} Log4j property. If this property is * specified and set to anything besides {@code false}, then the default ClassLoader will be used. * * @param className The class name. * @return the Class for the given name. * @throws ClassNotFoundException if the specified class name could not be found * @since 2.1 */ public static Class<?> loadClass(final String className) throws ClassNotFoundException { if (isIgnoreTccl()) { return Class.forName(className); } try { return getThreadContextClassLoader().loadClass(className); } catch (final Throwable ignored) { return Class.forName(className); } }