private boolean isValid(@NotNull ClassInfo info) {
      if (info.isValid != null) {
        return info.isValid;
      }

      if (info.clazz.getClassLoader() == null || info.clazz.getClassLoader() == ClassLoader.getSystemClassLoader()) {
        info.isValid = true;
        return true;
      }

      List<String> isNotValidReasons = new ArrayList<>();
      if (!useAppCDS && info.source != null) {
        isNotValidReasons.add("the class has non-system source with disabled AppCDS");
      }

      if (info.source != null) {
        if (info.source.contains(" ")) {
          isNotValidReasons.add("the class has whitespace in path, which is not supported by the JVM");
        }

        if (!info.source.endsWith(".jar")) {
          isNotValidReasons.add("only .jar files are supported by CDS");
        }
      }

      info.assertClassVersion = assertClassVersion(info);
      switch (info.assertClassVersion) {
        case ERROR -> isNotValidReasons.add("class version assert failed");
        case NOT_FOUND -> isNotValidReasons.add(".class is not found in the resources");
        case TOO_OLD -> isNotValidReasons.add("class version is too old: " + info.myTooOldClassVersion);
        case OK -> { }
        default -> throw new RuntimeException("Unknown case " + info.myTooOldClassVersion + " for " + info.name);
      }

      if (Boolean.TRUE.equals(info.hasSameNamedClasses)) {
        isNotValidReasons.add("same named class already exists");
      }

      if (!isValid(info.superClass)) {
        isNotValidReasons.add("invalid superclass " + info.superClass.name);
      }

      for (ClassInfo anInterface : info.interfaces) {
        if (!isValid(anInterface)) {
          isNotValidReasons.add("invalid interface " + anInterface.name);
        }
      }

      if (!isNotValidReasons.isEmpty()) {
        info.myIsNotValidReasons = isNotValidReasons;
      }

      info.isValid = isNotValidReasons.isEmpty();
      return info.isValid;
    }
private boolean isValid(@NotNull ClassInfo info)