Program: 20970
Project: 20970
Buggy source:
@Override public void run(){
  while (running) {
    try {
      if (jdAntiStandby.isStatus()) {
switch (jdAntiStandby.getPluginConfig().getIntegerProperty("String_Node_Str")) {
case 0:
          if (run) {
            run=false;
            logger.fine("String_Node_Str");
            kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS);
          }
        break;
case 1:
      if (DownloadWatchDog.getInstance().getDownloadStatus() == DownloadWatchDog.STATE.RUNNING) {
        if (!run) {
          run=true;
          logger.fine("String_Node_Str");
        }
        kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS | Kernel32.ES_SYSTEM_REQUIRED | Kernel32.ES_DISPLAY_REQUIRED);
      }
    if ((DownloadWatchDog.getInstance().getDownloadStatus() == DownloadWatchDog.STATE.NOT_RUNNING) || (DownloadWatchDog.getInstance().getDownloadStatus() == DownloadWatchDog.STATE.STOPPING)) {
      if (run) {
        run=false;
        logger.fine("String_Node_Str");
        kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS);
      }
    }
  break;
case 2:
if (!run) {
  run=true;
  logger.fine("String_Node_Str");
}
kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS | Kernel32.ES_SYSTEM_REQUIRED | Kernel32.ES_DISPLAY_REQUIRED);
break;
default :
logger.finest("String_Node_Str");
}
}
 else {
if (run) {
run=false;
logger.fine("String_Node_Str");
kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS);
}
}
Thread.sleep(sleep);
}
 catch (InterruptedException e) {
}
}
kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS);
logger.fine("String_Node_Str");
}

Fixed version (ground truth):
public void run(){
  while (running) {
    try {
      if (jdAntiStandby.isStatus()) {
switch (jdAntiStandby.getPluginConfig().getIntegerProperty("String_Node_Str")) {
case 0:
          if (run) {
            run=false;
            logger.fine("String_Node_Str");
            kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS);
          }
        break;
case 1:
      if (DownloadWatchDog.getInstance().getDownloadStatus() == DownloadWatchDog.STATE.RUNNING) {
        if (!run) {
          run=true;
          logger.fine("String_Node_Str");
        }
        kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS | Kernel32.ES_SYSTEM_REQUIRED | Kernel32.ES_DISPLAY_REQUIRED);
      }
    if ((DownloadWatchDog.getInstance().getDownloadStatus() == DownloadWatchDog.STATE.NOT_RUNNING) || (DownloadWatchDog.getInstance().getDownloadStatus() == DownloadWatchDog.STATE.STOPPING)) {
      if (run) {
        run=false;
        logger.fine("String_Node_Str");
        kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS);
      }
    }
  break;
case 2:
if (!run) {
  run=true;
  logger.fine("String_Node_Str");
}
kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS | Kernel32.ES_SYSTEM_REQUIRED | Kernel32.ES_DISPLAY_REQUIRED);
break;
default :
logger.finest("String_Node_Str");
}
}
 else {
if (run) {
run=false;
logger.fine("String_Node_Str");
kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS);
}
}
Thread.sleep(sleep);
}
 catch (InterruptedException e) {
}
}
kernel32.SetThreadExecutionState(Kernel32.ES_CONTINUOUS);
logger.fine("String_Node_Str");
}