Program: 44241
Project: 44241
Buggy source:
public void run(){
  if (getConsumerState() == StreamConsumer.STATE_RESTARTING) {
    onRestarted();
  }
  int reconnect_delay=0;
  String reason="String_Node_Str";
  do {
    if ((getConsumerState() == StreamConsumer.STATE_RUNNING || getConsumerState() == StreamConsumer.STATE_RESTARTING) && reconnect_delay > 0) {
      try {
        Thread.sleep(reconnect_delay * 1000);
      }
 catch (      Exception e) {
      }
    }
    if (getConsumerState() == StreamConsumer.STATE_RUNNING) {
      try {
        _ws.setEventHandler(new WebSocketEventHandler(){
          public void onOpen(){
          }
          public void onMessage(          WebSocketMessage message){
            String line=message.getText();
            if (line.length() > 100) {
              processLine(line);
            }
          }
          public void onClose(){
            if (getConsumerState() == StreamConsumer.STATE_RUNNING) {
              if (_auto_reconnect) {
                restartConsumer();
              }
 else {
                stopConsumer();
              }
            }
          }
        }
);
        _ws.connect();
        while (getConsumerState() == StreamConsumer.STATE_RUNNING) {
          Thread.sleep(5000);
        }
        reason="String_Node_Str";
      }
 catch (      WebSocketException e) {
        _auto_reconnect=false;
        reason=e.getMessage();
      }
catch (      InterruptedException e) {
        reason="String_Node_Str";
      }
    }
    if (reason.length() == 0 && (getConsumerState() == StreamConsumer.STATE_RUNNING || getConsumerState() == StreamConsumer.STATE_RESTARTING) && _auto_reconnect) {
      if (reconnect_delay == 0) {
        reconnect_delay=1;
      }
 else       if (reconnect_delay < 16) {
        reconnect_delay++;
      }
 else {
        reason="String_Node_Str";
        stopConsumer();
      }
    }
  }
 while ((getConsumerState() == StreamConsumer.STATE_RUNNING || getConsumerState() == StreamConsumer.STATE_RESTARTING) && _auto_reconnect);
  if (reason.length() == 0) {
    if (getConsumerState() == StreamConsumer.STATE_STOPPING) {
      reason="String_Node_Str";
    }
 else {
      reason="String_Node_Str";
    }
  }
  onStopped(reason);
}

Fixed version (ground truth):
public void run(){
  if (getConsumerState() == StreamConsumer.STATE_RESTARTING) {
    onRestarted();
  }
  int reconnect_delay=0;
  String reason="String_Node_Str";
  do {
    if ((getConsumerState() == StreamConsumer.STATE_RUNNING || getConsumerState() == StreamConsumer.STATE_RESTARTING) && reconnect_delay > 0) {
      try {
        Thread.sleep(reconnect_delay * 1000);
      }
 catch (      Exception e) {
      }
    }
    if (getConsumerState() == StreamConsumer.STATE_RUNNING) {
      try {
        _ws.setEventHandler(new WebSocketEventHandler(){
          public void onOpen(){
          }
          public void onMessage(          WebSocketMessage message){
            String line=message.getText();
            if (line.length() > 100) {
              processLine(line);
            }
          }
          public void onClose(){
            if (getConsumerState() == StreamConsumer.STATE_RUNNING) {
              if (_auto_reconnect) {
                restartConsumer();
              }
 else {
                stopConsumer();
              }
            }
          }
        }
);
        _ws.connect();
        while (getConsumerState() == StreamConsumer.STATE_RUNNING) {
          Thread.sleep(5000);
        }
        reason="String_Node_Str";
      }
 catch (      WebSocketException e) {
        _auto_reconnect=false;
        reason=e.getMessage();
      }
catch (      InterruptedException e) {
        reason="String_Node_Str";
      }
 finally {
        try {
          _ws.close();
        }
 catch (        WebSocketException e) {
        }
      }
    }
    if (reason.length() == 0 && (getConsumerState() == StreamConsumer.STATE_RUNNING || getConsumerState() == StreamConsumer.STATE_RESTARTING) && _auto_reconnect) {
      if (reconnect_delay == 0) {
        reconnect_delay=1;
      }
 else       if (reconnect_delay < 16) {
        reconnect_delay++;
      }
 else {
        reason="String_Node_Str";
        stopConsumer();
      }
    }
  }
 while ((getConsumerState() == StreamConsumer.STATE_RUNNING || getConsumerState() == StreamConsumer.STATE_RESTARTING) && _auto_reconnect);
  if (reason.length() == 0) {
    if (getConsumerState() == StreamConsumer.STATE_STOPPING) {
      reason="String_Node_Str";
    }
 else {
      reason="String_Node_Str";
    }
  }
  onStopped(reason);
}