public static boolean isJREType(Class<?> type) { return isJREClass(type.getName()); }
public static Class<?> unproxy(Class<?> cls) { if (Proxy.class.isAssignableFrom(cls)) { for (Class<?> interf : cls.getInterfaces()) { if (!isJREClass(interf.getCanonicalName())) { return interf; } } throw U.rte("Cannot unproxy the class: %s!", cls); } else { return cls; } }
private static boolean couldBeCaller(String cls) { return !Cls.isRapidoidClass(cls) && !Cls.isJREClass(cls) && !Cls.isIdeOrToolClass(cls); }
private boolean shouldReload(String classname) { boolean couldReload = names.contains(classname) || (!Cls.isRapidoidClass(classname) && !Cls.isJREClass(classname) && !isReloadForbidden(classname) && findOnClasspath(classname) != null); return couldReload && !originalMarkedNotToReload(classname); }
return new DataParamRetriever(type, name, required != null); } else if (Cls.isDataStructure(type) || Cls.isJREClass(type.getCanonicalName())) { throw U.rte("Unsupported parameter type: %s", type);
@Override public Class<?> loadClass(String name) throws ClassNotFoundException { U.secure(Lmbd.eval(allowed, name), "Class not allowed: %s", name); if (forceReload && !Cls.isJREClass(name)) { try { // try to force class reloading return findClass(name); } catch (ClassNotFoundException e) { // if the reloading fails, continue to the normal loading flow - below... } } try { // if the class has already been loaded, it's done return super.findClass(name); } catch (ClassNotFoundException e) { // otherwise, the super.loadClass(...) will call this.findClass(...) return super.loadClass(name); } }
return new DataParamRetriever(type, name, required != null); } else if (Cls.isDataStructure(type) || Cls.isJREClass(type.getCanonicalName())) { throw U.rte("Unsupported parameter type: %s", type);