@Test public void testGetClassLoader2() throws Exception { assertThat(getClassLoader(), sameInstance(ClassHelper.class.getClassLoader())); }
public static ClassLoader getClassLoader(Class<?> cls) { ClassLoader cl = null; try { cl = Thread.currentThread().getContextClassLoader(); } catch (Throwable ex) { } if (cl == null) { cl = cls.getClassLoader(); } return cl; }
ClassHelper { public static ClassLoader getClassLoader(Class<?> cls) { ClassLoader cl = null; try { cl = Thread.currentThread().getContextClassLoader(); } catch (Throwable ex) { } if (cl == null) { cl = cls.getClassLoader(); } return cl; } }
ClassHelper { public static ClassLoader getClassLoader(Class<?> cls) { ClassLoader cl = null; try { cl = Thread.currentThread().getContextClassLoader(); } catch (Throwable ex) { } if (cl == null) { cl = cls.getClassLoader(); } return cl; }  }
ClassHelper { public static ClassLoader getClassLoader(Class<?> cls) { ClassLoader cl = null; try { cl = Thread.currentThread().getContextClassLoader(); } catch (Throwable ex) { } if (cl == null) { cl = cls.getClassLoader(); } return cl; }  static Class<?> forNameWithThreadContextClassLoader(String name); static Class<?> forNameWithCallerClassLoader(String name, Class<?> caller); static ClassLoader getCallerClassLoader(Class<?> caller); static ClassLoader getClassLoader(Class<?> cls); static ClassLoader getClassLoader(); static Class<?> forName(String name); static Class<?> forName(String name, ClassLoader classLoader); static Class<?> resolvePrimitiveClassName(String name); static String toShortString(Object obj); }
ClassHelper { public static ClassLoader getClassLoader(Class<?> cls) { ClassLoader cl = null; try { cl = Thread.currentThread().getContextClassLoader(); } catch (Throwable ex) { } if (cl == null) { cl = cls.getClassLoader(); } return cl; }  static Class<?> forNameWithThreadContextClassLoader(String name); static Class<?> forNameWithCallerClassLoader(String name, Class<?> caller); static ClassLoader getCallerClassLoader(Class<?> caller); static ClassLoader getClassLoader(Class<?> cls); static ClassLoader getClassLoader(); static Class<?> forName(String name); static Class<?> forName(String name, ClassLoader classLoader); static Class<?> resolvePrimitiveClassName(String name); static String toShortString(Object obj); static final String ARRAY_SUFFIX; }