Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
langjava
public static Class<?> findClass(String name) throws ClassNotFoundException {
  try {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    if (loader == null) {
      loader = ClassLoader.getSystemClassLoader();
    }
    if (loader != null) {
      return Class.forName(name, false, loader);
    }
  } catch (ClassNotFoundException exception) {
    // useUse current class loader instead
  } catch (SecurityException exception) {
    // useUse current class loader instead
  }
  return Class.forName(name);
}

...

Code Block
bgColor#ccccff
langjava
public static Class<?> findClass(String name) throws ClassNotFoundException {
  checkPackageAccess(name);
  try {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    if (loader == null) {
      // canCan be null in IE (see 6204697)
      loader = ClassLoader.getSystemClassLoader();
    }
    if (loader != null) {
      return Class.forName(name, false, loader);
    }

  } catch (ClassNotFoundException exception) {
    // useUse current class loader instead
  } catch (SecurityException exception) {
    // useUse current class loader instead
  }
  return Class.forName(name);
}

...