Program: 34813
Project: 34813
Buggy source:
private void startThriftPublisher() throws InterruptedException, AgentException, MalformedStreamDefinitionException, StreamDefinitionException, DifferentStreamDefinitionAlreadyDefinedException, TransportException, AuthenticationException, MalformedURLException {
  KeyStoreUtil.setTrustStoreParams();
  DataPublisher dataPublisher=new DataPublisher("String_Node_Str","String_Node_Str","String_Node_Str");
  String streamId;
  try {
    streamId=dataPublisher.findStream("String_Node_Str","String_Node_Str");
  }
 catch (  NoStreamDefinitionExistException e) {
    StreamDefinition streamDefinition=new StreamDefinition("String_Node_Str","String_Node_Str");
    streamDefinition.addMetaData("String_Node_Str",AttributeType.STRING);
    streamDefinition.addMetaData("String_Node_Str",AttributeType.LONG);
    streamDefinition.addMetaData("String_Node_Str",AttributeType.LONG);
    streamDefinition.addMetaData("String_Node_Str",AttributeType.LONG);
    streamDefinition.addPayloadData("String_Node_Str",AttributeType.STRING);
    streamDefinition.addPayloadData("String_Node_Str",AttributeType.STRING);
    streamId=dataPublisher.defineStream(streamDefinition);
  }
  Thread.sleep(2000);
  System.out.println("String_Node_Str");
  if (longRunningMode) {
    System.out.println("String_Node_Str");
    long startTime=System.nanoTime();
    boolean burstMode=false;
    for (long i=0; i < Long.MAX_VALUE; i++) {
      Object[] metaDataArray=new Object[]{DataProvider.getMeta(),i,System.currentTimeMillis(),System.nanoTime()};
      dataPublisher.publish(streamId,metaDataArray,null,DataProvider.getPayload());
      if (!burstMode) {
        int sleepTime=(int)Math.round(Math.random() * 100);
        Thread.sleep(sleepTime);
      }
      if ((i + 1) % 100000 == 0) {
        long elapsedTime=System.nanoTime() - startTime;
        double timeInSec=elapsedTime / 1000000000D;
        double throughputPerSec=(i + 1) / timeInSec;
        System.out.println("String_Node_Str" + (i + 1) + "String_Node_Str"+ timeInSec+ "String_Node_Str"+ throughputPerSec+ "String_Node_Str");
        burstMode=!burstMode;
        startTime=System.nanoTime();
      }
    }
  }
 else {
    System.out.println("String_Node_Str");
    long startTime=System.nanoTime();
    for (long i=0; i < totalEvents; i++) {
      Object[] metaDataArray=new Object[]{DataProvider.getMeta(),i,System.currentTimeMillis(),System.nanoTime()};
      dataPublisher.publish(streamId,metaDataArray,null,DataProvider.getPayload());
      if ((i + 1) % 100000 == 0) {
        if ((i + 1) == warmUpThreshold) {
          Thread.sleep(sleepAfterWarmUpMillis);
        }
        long elapsedTime=System.nanoTime() - startTime;
        double timeInSec=elapsedTime / 1000000000D;
        double throughputPerSec=(i + 1) / timeInSec;
        System.out.println("String_Node_Str" + (i + 1) + "String_Node_Str"+ timeInSec+ "String_Node_Str"+ throughputPerSec+ "String_Node_Str");
        startTime=System.nanoTime();
      }
    }
  }
  Thread.sleep(1000);
  dataPublisher.stop();
}

Fixed version (ground truth):
private void startThriftPublisher() throws InterruptedException, AgentException, MalformedStreamDefinitionException, StreamDefinitionException, DifferentStreamDefinitionAlreadyDefinedException, TransportException, AuthenticationException, MalformedURLException {
  KeyStoreUtil.setTrustStoreParams();
  DataPublisher dataPublisher=new DataPublisher("String_Node_Str","String_Node_Str","String_Node_Str");
  String streamId;
  try {
    streamId=dataPublisher.findStream("String_Node_Str","String_Node_Str");
  }
 catch (  NoStreamDefinitionExistException e) {
    StreamDefinition streamDefinition=new StreamDefinition("String_Node_Str","String_Node_Str");
    streamDefinition.addMetaData("String_Node_Str",AttributeType.STRING);
    streamDefinition.addMetaData("String_Node_Str",AttributeType.LONG);
    streamDefinition.addMetaData("String_Node_Str",AttributeType.LONG);
    streamDefinition.addMetaData("String_Node_Str",AttributeType.LONG);
    streamDefinition.addPayloadData("String_Node_Str",AttributeType.STRING);
    streamDefinition.addPayloadData("String_Node_Str",AttributeType.STRING);
    streamId=dataPublisher.defineStream(streamDefinition);
  }
  Thread.sleep(2000);
  System.out.println("String_Node_Str");
  if (longRunningMode) {
    System.out.println("String_Node_Str");
    long startTime=System.nanoTime();
    boolean burstMode=false;
    for (long i=0; i < Long.MAX_VALUE; i++) {
      Object[] metaDataArray=new Object[]{DataProvider.getMeta(),i,System.currentTimeMillis(),System.nanoTime()};
      dataPublisher.publish(streamId,metaDataArray,null,DataProvider.getPayload());
      if (!burstMode) {
        int sleepTime=(int)Math.round(Math.random() * 100);
        Thread.sleep(sleepTime);
      }
      if ((i + 1) % GROUP_SIZE == 0) {
        long elapsedTime=System.nanoTime() - startTime;
        double timeInSec=elapsedTime / 1000000000D;
        double throughputPerSec=GROUP_SIZE / timeInSec;
        System.out.println("String_Node_Str" + (i + 1) + "String_Node_Str"+ GROUP_SIZE+ "String_Node_Str"+ timeInSec+ "String_Node_Str"+ throughputPerSec+ "String_Node_Str");
        burstMode=!burstMode;
        startTime=System.nanoTime();
      }
    }
  }
 else {
    System.out.println("String_Node_Str");
    long startTime=System.nanoTime();
    for (long i=0; i < totalEvents; i++) {
      Object[] metaDataArray=new Object[]{DataProvider.getMeta(),i,System.currentTimeMillis(),System.nanoTime()};
      dataPublisher.publish(streamId,metaDataArray,null,DataProvider.getPayload());
      if (i % GROUP_SIZE == (GROUP_SIZE - 1)) {
        if (i == (warmUpThreshold - 1)) {
          Thread.sleep(sleepAfterWarmUpMillis);
        }
        long elapsedTime=System.nanoTime() - startTime;
        double timeInSec=elapsedTime / 1000000000D;
        double throughputPerSec=GROUP_SIZE / timeInSec;
        System.out.println("String_Node_Str" + (i + 1) + "String_Node_Str"+ GROUP_SIZE+ "String_Node_Str"+ timeInSec+ "String_Node_Str"+ throughputPerSec+ "String_Node_Str");
        startTime=System.nanoTime();
      }
    }
  }
  Thread.sleep(1000);
  dataPublisher.stop();
}