@Override
  protected int doWork() throws Exception {
    if (tablePatterns.isEmpty() && classes.isEmpty() && !config) {
      LOG.error("Please give at least one -table, -class or -config parameter.");
      printUsage();
      return EXIT_FAILURE;
    }

    List<URL> urlList = buildClasspath(jars);
    URL[] urls = urlList.toArray(new URL[urlList.size()]);

    LOG.debug("Classpath: {}", urlList);

    List<CoprocessorViolation> violations = new ArrayList<>();

    try (ResolverUrlClassLoader classLoader = createClassLoader(urls)) {
      for (Pattern tablePattern : tablePatterns) {
        validateTables(classLoader, tablePattern, violations);
      }

      validateClasses(classLoader, classes, violations);

      if (config) {
        String[] masterCoprocessors =
          getConf().getStrings(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY);
        if (masterCoprocessors != null) {
          validateClasses(classLoader, masterCoprocessors, violations);
        }

        String[] regionCoprocessors =
          getConf().getStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY);
        if (regionCoprocessors != null) {
          validateClasses(classLoader, regionCoprocessors, violations);
        }
      }
    }

    boolean error = false;

    for (CoprocessorViolation violation : violations) {
      String className = violation.getClassName();
      String message = violation.getMessage();
      Throwable throwable = violation.getThrowable();

      switch (violation.getSeverity()) {
        case WARNING:
          if (throwable == null) {
            LOG.warn("Warning in class '{}': {}.", className, message);
          } else {
            LOG.warn("Warning in class '{}': {}.", className, message, throwable);
          }

          if (dieOnWarnings) {
            error = true;
          }

          break;
        case ERROR:
          if (throwable == null) {
            LOG.error("Error in class '{}': {}.", className, message);
          } else {
            LOG.error("Error in class '{}': {}.", className, message, throwable);
          }

          error = true;

          break;
      }
    }

    return (error) ? EXIT_FAILURE : EXIT_SUCCESS;
  }
This classloader implementation calls {@link #resolveClass(Class)} method for every loaded
class. It means that some extra validation will take place
<a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.3"> according to
JLS</a>.
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/coprocessor/CoprocessorValidator.java