private Responsibility findResponsibleUser()

in src/main/java/jetbrains/buildServer/investigationsAutoAssigner/heuristics/BrokenFileHeuristic.java [99:119]


  private Responsibility findResponsibleUser(List<SVcsModification> vcsChanges,
                                             String problemText,
                                             HeuristicContext heuristicContext) {
    Pair<User, String> foundBrokenFile = null;
    for (SVcsModification vcsChange : vcsChanges) {
      ModificationAnalyzerFactory.ModificationAnalyzer vcsChangeWrapped =
        myModificationAnalyzerFactory.getInstance(vcsChange);
      Pair<User, String> brokenFile =
        vcsChangeWrapped.findProblematicFile(problemText, heuristicContext.getUsersToIgnore());
      if (brokenFile == null) continue;

      ensureSameUsers(foundBrokenFile, brokenFile);
      foundBrokenFile = brokenFile;
    }

    if (foundBrokenFile == null) return null;

    String description =
      String.format("changed the suspicious file \"%s\" which probably broke the build", foundBrokenFile.second);
    return new Responsibility(foundBrokenFile.first, description);
  }