public boolean isTask(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("org.apache.tools.ant.Task", clazz);
    }

    final String adapter = getAdapter().getStringValue();
    if (adapter != null) {
      try {
        final Class adapterClass = clazz.getClassLoader().loadClass(adapter);
        return isAssignableFrom("org.apache.tools.ant.Task", adapterClass);
      }
      catch (ClassNotFoundException | UnsupportedClassVersionError | NoClassDefFoundError ignored) {
      }
    }

    return isAssignableFrom("org.apache.tools.ant.Task", clazz);
  }
public boolean isTask(final Class clazz)