private static boolean matches(String name, String parentRelativePath, @NotNull File srcRoot, CompiledPattern pattern) {
    if (!matches(name, pattern.fileName)) {
      return false;
    }
    if (parentRelativePath != null) {
      if (pattern.dir != null && !matches(parentRelativePath, pattern.dir)) {
        return false;
      }
      if (pattern.srcRoot != null && !matches(srcRoot.getName(), pattern.srcRoot)) {
        return false;
      }
    }
    return true;
  }
private static boolean matches(String name, String parentRelativePath, @NotNull File srcRoot, CompiledPattern pattern)