private BuildPromotionEx occupyingPromo()

in server/src/jetbrains/buildServer/sharedResources/server/runtime/TakenLocksImpl.java [338:352]


  private BuildPromotionEx occupyingPromo(@NotNull final TakenLock takenLock,
                                          @NotNull final String value) {
    for (Map.Entry<BuildPromotionEx, String> entry : takenLock.getReadLocks().entrySet()) {
      if (value.equals(entry.getValue())) {
        return entry.getKey();
      }
    }

    for (Map.Entry<BuildPromotionEx, String> entry : takenLock.getWriteLocks().entrySet()) {
      if (entry.getValue().contains(value)) {
        return entry.getKey();
      }
    }
    return null;
  }