boolean (final Class clazz) { if ("taskdef".equals(getXmlTag().getName())) { // in taskdef, the adapter is always set to Task return true; } final String adaptto = getAdaptto().getStringValue(); if (adaptto != null && isAssignableFrom(adaptto, clazz)) { return isAssignableFrom(Task.class.getName(), clazz); } final String adapter = getAdapter().getStringValue(); if (adapter != null) { try { final Class adapterClass = clazz.getClassLoader().loadClass(adapter); return isAssignableFrom(Task.class.getName(), adapterClass); } catch (ClassNotFoundException | UnsupportedClassVersionError | NoClassDefFoundError ignored) { } } return isAssignableFrom(Task.class.getName(), clazz); }