boolean findOwnersInVotes()

in src/main/java/com/googlesource/gerrit/plugins/findowners/Checker.java [94:113]


  boolean findOwnersInVotes(Set<String> owners, Map<String, Integer> votes) {
    boolean foundVeto = false;
    boolean foundApproval = false;
    boolean foundNull = false;
    for (String owner : owners) {
      if (owner == null) {
        foundNull = true; // Something is wrong in OwnersDb!
      } else if (votes.containsKey(owner)) {
        int v = votes.get(owner);
        foundApproval |= (v >= minVoteLevel);
        foundVeto |= (v < 0); // an owner's -1 vote is a veto
      } else if (owner.equals("*")) {
        foundApproval = true; // no specific owner
      }
    }
    if (foundNull) {
      logger.atSevere().log("Unexpected null owner email for %s", Config.getChangeId(changeData));
    }
    return foundApproval && !foundVeto;
  }