protected static boolean isAncestorClassLoader(ClassLoader loader) { for ( ClassLoader ancestor = JRAbstractLRUVirtualizer.class.getClassLoader(); ancestor != null; ancestor = ancestor.getParent()) { if (ancestor.equals(loader)) { return true; } } return false; }