Program: 37666
Project: 37666
Buggy source:
/** 
 * Open is called once the SidelineSpout instance has been deployed to the Storm cluster and is ready to get to work.
 * @param topologyConfig - The Storm Topology configuration.
 * @param topologyContext - The Storm Topology context.
 * @param spoutOutputCollector - The output collector to emit tuples via.
 */
@Override public void open(Map topologyConfig,TopologyContext topologyContext,SpoutOutputCollector spoutOutputCollector){
  this.topologyConfig=Tools.immutableCopy(SidelineSpoutConfig.setDefaults(topologyConfig));
  this.topologyContext=topologyContext;
  this.outputCollector=spoutOutputCollector;
  if (Strings.isNullOrEmpty((String)getTopologyConfigItem(SidelineSpoutConfig.CONSUMER_ID_PREFIX))) {
    throw new IllegalStateException("String_Node_Str" + SidelineSpoutConfig.CONSUMER_ID_PREFIX);
  }
  metricsRecorder=getFactoryManager().createNewMetricsRecorder();
  getMetricsRecorder().open(getTopologyConfig(),getTopologyContext());
  if (startingTrigger != null) {
    startingTrigger.setSidelineSpout(new SpoutTriggerProxy(this));
  }
  if (stoppingTrigger != null) {
    stoppingTrigger.setSidelineSpout(new SpoutTriggerProxy(this));
  }
  persistenceAdapter=getFactoryManager().createNewPersistenceAdapterInstance();
  getPersistenceAdapter().open(getTopologyConfig());
  fireHoseSpout=new VirtualSpout(getTopologyConfig(),getTopologyContext(),getFactoryManager());
  fireHoseSpout.setVirtualSpoutId(generateVirtualSpoutId("String_Node_Str"));
  final TupleBuffer tupleBuffer=getFactoryManager().createNewTupleBufferInstance();
  tupleBuffer.open(getTopologyConfig());
  coordinator=new SpoutCoordinator(fireHoseSpout,getMetricsRecorder(),tupleBuffer);
  getCoordinator().open(getTopologyConfig());
  final ConsumerState currentState=fireHoseSpout.getCurrentState();
  final List<SidelineRequestIdentifier> existingRequestIds=getPersistenceAdapter().listSidelineRequests();
  logger.info("String_Node_Str",existingRequestIds.size());
  for (  SidelineRequestIdentifier id : existingRequestIds) {
    final ConsumerState.ConsumerStateBuilder startingStateBuilder=ConsumerState.builder();
    final ConsumerState.ConsumerStateBuilder endingStateStateBuilder=ConsumerState.builder();
    SidelinePayload payload=null;
    for (    final TopicPartition topicPartition : currentState.getTopicPartitions()) {
      payload=getPersistenceAdapter().retrieveSidelineRequest(id,topicPartition.partition());
      if (payload == null) {
        continue;
      }
      startingStateBuilder.withPartition(topicPartition,payload.startingOffset);
      if (payload.endingOffset != null) {
        endingStateStateBuilder.withPartition(topicPartition,payload.endingOffset);
      }
    }
    if (payload == null) {
      logger.warn("String_Node_Str",id);
      continue;
    }
    if (payload.type.equals(SidelineType.START)) {
      logger.info("String_Node_Str",payload.id,payload.request.step);
      fireHoseSpout.getFilterChain().addStep(payload.id,payload.request.step);
    }
    if (payload.type.equals(SidelineType.STOP)) {
      openVirtualSpout(payload.id,payload.request.step,startingStateBuilder.build(),endingStateStateBuilder.build());
    }
  }
  if (startingTrigger != null) {
    startingTrigger.open(getTopologyConfig());
  }
 else {
    logger.warn("String_Node_Str");
  }
  if (stoppingTrigger != null) {
    stoppingTrigger.open(getTopologyConfig());
  }
 else {
    logger.warn("String_Node_Str");
  }
  emitCountMetrics=Maps.newHashMap();
}

Fixed version (ground truth):
/** 
 * Open is called once the SidelineSpout instance has been deployed to the Storm cluster and is ready to get to work.
 * @param topologyConfig - The Storm Topology configuration.
 * @param topologyContext - The Storm Topology context.
 * @param spoutOutputCollector - The output collector to emit tuples via.
 */
@Override public void open(Map topologyConfig,TopologyContext topologyContext,SpoutOutputCollector spoutOutputCollector){
  this.topologyConfig=topologyConfig;
  this.topologyContext=topologyContext;
  this.outputCollector=spoutOutputCollector;
  if (Strings.isNullOrEmpty((String)getSpoutConfigItem(SidelineSpoutConfig.CONSUMER_ID_PREFIX))) {
    throw new IllegalStateException("String_Node_Str" + SidelineSpoutConfig.CONSUMER_ID_PREFIX);
  }
  metricsRecorder=getFactoryManager().createNewMetricsRecorder();
  getMetricsRecorder().open(getSpoutConfig(),getTopologyContext());
  if (startingTrigger != null) {
    startingTrigger.setSidelineSpout(new SpoutTriggerProxy(this));
  }
  if (stoppingTrigger != null) {
    stoppingTrigger.setSidelineSpout(new SpoutTriggerProxy(this));
  }
  persistenceAdapter=getFactoryManager().createNewPersistenceAdapterInstance();
  getPersistenceAdapter().open(getSpoutConfig());
  fireHoseSpout=new VirtualSpout(getSpoutConfig(),getTopologyContext(),getFactoryManager());
  fireHoseSpout.setVirtualSpoutId(generateVirtualSpoutId("String_Node_Str"));
  final TupleBuffer tupleBuffer=getFactoryManager().createNewTupleBufferInstance();
  tupleBuffer.open(getSpoutConfig());
  coordinator=new SpoutCoordinator(fireHoseSpout,getMetricsRecorder(),tupleBuffer);
  getCoordinator().open(getSpoutConfig());
  final ConsumerState currentState=fireHoseSpout.getCurrentState();
  final List<SidelineRequestIdentifier> existingRequestIds=getPersistenceAdapter().listSidelineRequests();
  logger.info("String_Node_Str",existingRequestIds.size());
  for (  SidelineRequestIdentifier id : existingRequestIds) {
    final ConsumerState.ConsumerStateBuilder startingStateBuilder=ConsumerState.builder();
    final ConsumerState.ConsumerStateBuilder endingStateStateBuilder=ConsumerState.builder();
    SidelinePayload payload=null;
    for (    final TopicPartition topicPartition : currentState.getTopicPartitions()) {
      payload=getPersistenceAdapter().retrieveSidelineRequest(id,topicPartition.partition());
      if (payload == null) {
        continue;
      }
      startingStateBuilder.withPartition(topicPartition,payload.startingOffset);
      if (payload.endingOffset != null) {
        endingStateStateBuilder.withPartition(topicPartition,payload.endingOffset);
      }
    }
    if (payload == null) {
      logger.warn("String_Node_Str",id);
      continue;
    }
    if (payload.type.equals(SidelineType.START)) {
      logger.info("String_Node_Str",payload.id,payload.request.step);
      fireHoseSpout.getFilterChain().addStep(payload.id,payload.request.step);
    }
    if (payload.type.equals(SidelineType.STOP)) {
      openVirtualSpout(payload.id,payload.request.step,startingStateBuilder.build(),endingStateStateBuilder.build());
    }
  }
  if (startingTrigger != null) {
    startingTrigger.open(getSpoutConfig());
  }
 else {
    logger.warn("String_Node_Str");
  }
  if (stoppingTrigger != null) {
    stoppingTrigger.open(getSpoutConfig());
  }
 else {
    logger.warn("String_Node_Str");
  }
  emitCountMetrics=Maps.newHashMap();
}