public void updateExpectedAverageTime() {
    myFreezeDetector.stop();
    if (LOG.isDebugEnabled()) {
      LOG.debug("update expected build time for " + myTotalBuildTimeForFullyRebuiltTargets.size() + " target types");
    }

    ObjectIterator<Object2LongMap.Entry<BuildTargetType<?>>> iterator =
      myTotalBuildTimeForFullyRebuiltTargets.object2LongEntrySet().fastIterator();
    while (iterator.hasNext()) {
      Object2LongMap.Entry<BuildTargetType<?>> entry = iterator.next();
      BuildTargetType<?> type = entry.getKey();
      long totalTime = entry.getLongValue();
      BuildTargetsState targetsState = myDataManager.getTargetsState();
      long oldAverageTime = targetsState.getAverageBuildTime(type);
      long newAverageTime;
      if (oldAverageTime == -1) {
        newAverageTime = totalTime / myNumberOfFullyRebuiltTargets.getInt(type);
      }
      else {
        //if not all targets of this type were fully rebuilt, we assume that old average value is still actual for them; this way we won't get incorrect value if only one small target was fully rebuilt
        newAverageTime = (totalTime + (myTotalTargets.getInt(type) - myNumberOfFullyRebuiltTargets.getInt(type)) * oldAverageTime) / myTotalTargets.getInt(type);
      }
      if (LOG.isDebugEnabled()) {
        LOG.debug(" " + type.getTypeId() + ": old=" + oldAverageTime + ", new=" + newAverageTime + " (based on " + myNumberOfFullyRebuiltTargets.getInt(type)
                  + " of " + myTotalTargets.getInt(type) + " targets)");
      }
      targetsState.setAverageBuildTime(type, newAverageTime);
    }
  }
public void updateExpectedAverageTime()