Program: 79436
Project: 79436
Buggy source:
protected void logProblem(String type,Object val){
  if (lastWasProblem && currentProblemLoggedAsWarning) {
    if (log.isTraceEnabled())     log.trace("String_Node_Str",new Object[]{type,this,getBriefDescription(),val});
  }
 else {
    long nowTime=System.currentTimeMillis();
    Long currentProblemStartTimeCache=currentProblemStartTime;
    long expiryTime=lastSuccessTime != null ? lastSuccessTime + logWarningGraceTime.toMilliseconds() : currentProblemStartTimeCache != null ? currentProblemStartTimeCache + logWarningGraceTimeOnStartup.toMilliseconds() : nowTime + logWarningGraceTimeOnStartup.toMilliseconds();
    if (!lastWasProblem) {
      if (expiryTime <= nowTime) {
        currentProblemLoggedAsWarning=true;
        log.warn("String_Node_Str" + getBriefDescription() + "String_Node_Str"+ type+ "String_Node_Str"+ val);
        if (log.isDebugEnabled() && val instanceof Throwable)         log.debug("String_Node_Str" + type + "String_Node_Str"+ getBriefDescription()+ "String_Node_Str"+ val,(Throwable)val);
      }
 else {
        if (log.isDebugEnabled())         log.debug("String_Node_Str" + getBriefDescription() + "String_Node_Str"+ type+ "String_Node_Str"+ val);
      }
      lastWasProblem=true;
      currentProblemStartTime=nowTime;
    }
 else {
      if (expiryTime <= nowTime) {
        currentProblemLoggedAsWarning=true;
        log.warn("String_Node_Str" + getBriefDescription() + "String_Node_Str"+ type+ "String_Node_Str"+ Duration.millis(nowTime - currentProblemStartTimeCache)+ (config.hasExceptionHandler() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ val);
        if (log.isDebugEnabled() && val instanceof Throwable)         log.debug("String_Node_Str" + type + "String_Node_Str"+ getBriefDescription()+ "String_Node_Str"+ val,(Throwable)val);
      }
 else {
        if (log.isDebugEnabled())         log.debug("String_Node_Str",new Object[]{type,this,getBriefDescription(),val});
      }
    }
  }
}

Fixed version (ground truth):
protected void logProblem(String type,Object val){
  if (lastWasProblem && currentProblemLoggedAsWarning) {
    if (log.isTraceEnabled())     log.trace("String_Node_Str",new Object[]{type,this,getBriefDescription(),val});
  }
 else {
    long nowTime=System.currentTimeMillis();
    Long currentProblemStartTimeCache=currentProblemStartTime;
    long expiryTime=lastSuccessTime != null ? lastSuccessTime + logWarningGraceTime.toMilliseconds() : currentProblemStartTimeCache != null ? currentProblemStartTimeCache + logWarningGraceTimeOnStartup.toMilliseconds() : nowTime + logWarningGraceTimeOnStartup.toMilliseconds();
    if (!lastWasProblem) {
      if (expiryTime <= nowTime) {
        currentProblemLoggedAsWarning=true;
        if (entity == null || !Entities.isNoLongerManaged(entity)) {
          log.warn("String_Node_Str" + getBriefDescription() + "String_Node_Str"+ type+ "String_Node_Str"+ val);
        }
 else {
          log.debug("String_Node_Str" + getBriefDescription() + "String_Node_Str"+ type+ "String_Node_Str"+ val);
        }
        if (log.isDebugEnabled() && val instanceof Throwable)         log.debug("String_Node_Str" + type + "String_Node_Str"+ getBriefDescription()+ "String_Node_Str"+ val,(Throwable)val);
      }
 else {
        if (log.isDebugEnabled())         log.debug("String_Node_Str" + getBriefDescription() + "String_Node_Str"+ type+ "String_Node_Str"+ val);
      }
      lastWasProblem=true;
      currentProblemStartTime=nowTime;
    }
 else {
      if (expiryTime <= nowTime) {
        currentProblemLoggedAsWarning=true;
        log.warn("String_Node_Str" + getBriefDescription() + "String_Node_Str"+ type+ "String_Node_Str"+ Duration.millis(nowTime - currentProblemStartTimeCache)+ (config.hasExceptionHandler() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ val);
        if (log.isDebugEnabled() && val instanceof Throwable)         log.debug("String_Node_Str" + type + "String_Node_Str"+ getBriefDescription()+ "String_Node_Str"+ val,(Throwable)val);
      }
 else {
        if (log.isDebugEnabled())         log.debug("String_Node_Str",new Object[]{type,this,getBriefDescription(),val});
      }
    }
  }
}