private static Class LoadClass(string name, ClassLoader classLoader, JNIEnv env) { Class res = null; if (classLoader == null) { classLoader = systemClassLoader; string rn = name.Replace('.', '/'); res = env.FindClassNoThrow(rn); } if (classLoader != null && res==null) { try { res = classLoader.loadClass(name); } catch (Throwable th) { throw new JNIException("Can't load java class for " + name + " from classLoader " + classLoader, th); } } return res; }
private static Class LoadClass(string name, JNIEnv env, bool throwNoFound) { Class res; string rn = name.Replace('.', '/'); res = env.FindClassNoThrow(rn); if (res == null && systemClassLoader != null) { try { res = systemClassLoader.loadClass(name); } catch(Throwable th) { } } if (res == null && throwNoFound) { throw new JNIException("Can't find java class for " + name); } return res; }