nus-yam/ex-repair huggingface dataset:
Program: 37965
Project: 37965
Buggy source:
public FlowAdapter(Record dbRecord){
  String pathJson=dbRecord.get("String_Node_Str").asString();
  PathInfoData path;
  try {
    path=Utils.MAPPER.readValue(pathJson,PathInfoData.class);
  }
 catch (  IOException e) {
    throw new IllegalArgumentException(String.format("String_Node_Str",pathJson),e);
  }
  flow=new Flow(dbRecord.get(Utils.FLOW_ID).asString(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asBoolean(),dbRecord.get("String_Node_Str").asLong(),dbRecord.get("String_Node_Str").asString(),dbRecord.get("String_Node_Str").asString(),dbRecord.get("String_Node_Str").asString(),dbRecord.get("String_Node_Str").asString(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asInt(),path,FlowState.CACHED);
}

Fixed version (ground truth):
public FlowAdapter(Record dbRecord){
  String pathJson=dbRecord.get("String_Node_Str").asString();
  if (pathJson.equals("String_Node_Str")) {
    pathJson="String_Node_Str";
  }
  String remaining=pathJson.substring(2);
  PathInfoData path;
  pathJson="String_Node_Str" + remaining;
  try {
    path=Utils.MAPPER.readValue(pathJson,PathInfoData.class);
  }
 catch (  IOException e) {
    throw new IllegalArgumentException(String.format("String_Node_Str",pathJson),e);
  }
  flow=new Flow(dbRecord.get(Utils.FLOW_ID).asString(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asBoolean(),dbRecord.get("String_Node_Str").asLong(),dbRecord.get("String_Node_Str").asString(),dbRecord.get("String_Node_Str").asString(),dbRecord.get("String_Node_Str").asString(),dbRecord.get("String_Node_Str").asString(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asInt(),dbRecord.get("String_Node_Str").asInt(),path,FlowState.CACHED);
}
Program: 37966
Project: 37966
Buggy source:
@Test public void getAllFlows(){
  try (Transaction tx=graphDb.beginTx()){
    Node node1, node2;
    node1=graphDb.createNode(Label.label("String_Node_Str"));
    node1.setProperty("String_Node_Str","String_Node_Str");
    node2=graphDb.createNode(Label.label("String_Node_Str"));
    node2.setProperty("String_Node_Str","String_Node_Str");
    Relationship rel1=node1.createRelationshipTo(node2,RelationshipType.withName("String_Node_Str"));
    rel1.setProperty("String_Node_Str","String_Node_Str");
    rel1.setProperty("String_Node_Str",3);
    rel1.setProperty("String_Node_Str",2);
    rel1.setProperty("String_Node_Str",1);
    rel1.setProperty("String_Node_Str","String_Node_Str");
    rel1.setProperty("String_Node_Str","String_Node_Str");
    rel1.setProperty("String_Node_Str",1);
    rel1.setProperty("String_Node_Str",2);
    rel1.setProperty("String_Node_Str",5);
    rel1.setProperty("String_Node_Str",5);
    rel1.setProperty("String_Node_Str",200);
    rel1.setProperty("String_Node_Str",true);
    rel1.setProperty("String_Node_Str","String_Node_Str");
    rel1.setProperty("String_Node_Str","String_Node_Str");
    tx.success();
  }
   List<Flow> flows=target.getAllFlows();
  Flow flow=flows.get(0);
  Assert.assertEquals(3,flow.getCookie());
  Assert.assertEquals("String_Node_Str",flow.getFlowId());
  Assert.assertEquals(true,flow.isIgnoreBandwidth());
}

Fixed version (ground truth):
@Test public void getAllFlows(){
  try (Transaction tx=graphDb.beginTx()){
    Node node1, node2;
    node1=graphDb.createNode(Label.label("String_Node_Str"));
    node1.setProperty("String_Node_Str","String_Node_Str");
    node2=graphDb.createNode(Label.label("String_Node_Str"));
    node2.setProperty("String_Node_Str","String_Node_Str");
    Relationship rel1=node1.createRelationshipTo(node2,RelationshipType.withName("String_Node_Str"));
    rel1.setProperty("String_Node_Str","String_Node_Str");
    rel1.setProperty("String_Node_Str",3);
    rel1.setProperty("String_Node_Str",2);
    rel1.setProperty("String_Node_Str",1);
    rel1.setProperty("String_Node_Str","String_Node_Str");
    rel1.setProperty("String_Node_Str","String_Node_Str");
    rel1.setProperty("String_Node_Str",1);
    rel1.setProperty("String_Node_Str",2);
    rel1.setProperty("String_Node_Str",5);
    rel1.setProperty("String_Node_Str",5);
    rel1.setProperty("String_Node_Str","String_Node_Str");
    rel1.setProperty("String_Node_Str",200);
    rel1.setProperty("String_Node_Str",true);
    rel1.setProperty("String_Node_Str","String_Node_Str");
    rel1.setProperty("String_Node_Str","String_Node_Str");
    tx.success();
  }
   List<Flow> flows=target.getAllFlows();
  Flow flow=flows.get(0);
  Assert.assertEquals(3,flow.getCookie());
  Assert.assertEquals("String_Node_Str",flow.getFlowId());
  Assert.assertEquals(true,flow.isIgnoreBandwidth());
}
Program: 37967
Project: 37967
Buggy source:
private void handleFlowEvent(FlowInfoData flowData,Tuple tuple) throws IOException {
switch (flowData.getOperation()) {
case PUSH:
    logger.debug("String_Node_Str",flowData);
  flowCache.putFlow(flowData.getPayload());
logger.info("String_Node_Str",flowData);
break;
case UNPUSH:
logger.debug("String_Node_Str",flowData);
String flowsId=flowData.getPayload().getLeft().getFlowId();
flowCache.removeFlow(flowsId);
reroutedFlows.remove(flowsId);
logger.info("String_Node_Str",flowData);
break;
case CREATE:
flowCache.putFlow(flowData.getPayload());
emitFlowMessage(flowData,tuple,flowData.getCorrelationId());
logger.info("String_Node_Str",flowData);
break;
case DELETE:
String flowsId=flowData.getPayload().getLeft().getFlowId();
flowCache.removeFlow(flowsId);
reroutedFlows.remove(flowsId);
emitFlowMessage(flowData,tuple,flowData.getCorrelationId());
logger.info("String_Node_Str",flowData);
break;
case UPDATE:
processFlowUpdate(flowData.getPayload().getLeft());
flowCache.putFlow(flowData.getPayload());
emitFlowMessage(flowData,tuple,flowData.getCorrelationId());
logger.info("String_Node_Str",flowData);
break;
case STATE:
flowCache.putFlow(flowData.getPayload());
logger.info("String_Node_Str",flowData);
break;
case CACHE:
break;
default :
logger.warn("String_Node_Str",flowData);
break;
}
}

Fixed version (ground truth):
private void handleFlowEvent(FlowInfoData flowData,Tuple tuple) throws IOException {
switch (flowData.getOperation()) {
case PUSH:
    logger.debug("String_Node_Str",flowData);
  flowCache.putFlow(flowData.getPayload());
logger.info("String_Node_Str",flowData);
break;
case UNPUSH:
logger.debug("String_Node_Str",flowData);
String flowsId2=flowData.getPayload().getLeft().getFlowId();
flowCache.removeFlow(flowsId2);
reroutedFlows.remove(flowsId2);
logger.info("String_Node_Str",flowData);
break;
case CREATE:
flowCache.putFlow(flowData.getPayload());
emitFlowMessage(flowData,tuple,flowData.getCorrelationId());
logger.info("String_Node_Str",flowData);
break;
case DELETE:
String flowsId=flowData.getPayload().getLeft().getFlowId();
flowCache.removeFlow(flowsId);
reroutedFlows.remove(flowsId);
emitFlowMessage(flowData,tuple,flowData.getCorrelationId());
logger.info("String_Node_Str",flowData);
break;
case UPDATE:
processFlowUpdate(flowData.getPayload().getLeft());
flowCache.putFlow(flowData.getPayload());
emitFlowMessage(flowData,tuple,flowData.getCorrelationId());
logger.info("String_Node_Str",flowData);
break;
case STATE:
flowCache.putFlow(flowData.getPayload());
logger.info("String_Node_Str",flowData);
break;
case CACHE:
break;
default :
logger.warn("String_Node_Str",flowData);
break;
}
}
Program: 37968
Project: 37968
Buggy source:
/** 
 * Installs egress flow on the switch.
 * @param message command message for flow installation
 */
private void doInstallEgressFlow(final CommandMessage message,String replyToTopic,Destination replyDestination) throws FlowCommandException {
  InstallEgressFlow command=(InstallEgressFlow)message.getData();
  logger.debug("String_Node_Str",command);
  try {
    context.getSwitchManager().installEgressFlow(DatapathId.of(command.getSwitchId()),command.getId(),command.getCookie(),command.getInputPort(),command.getOutputPort(),command.getTransitVlanId(),command.getOutputVlanId(),command.getOutputVlanType());
    message.setDestination(replyDestination);
    context.getKafkaProducer().postMessage(replyToTopic,message);
  }
 catch (  SwitchOperationException e) {
    throw new FlowCommandException(command.getId(),ErrorType.CREATION_FAILURE,e);
  }
}

Fixed version (ground truth):
/** 
 * Installs egress flow on the switch.
 * @param message command message for flow installation
 */
private void doInstallEgressFlow(final CommandMessage message,String replyToTopic,Destination replyDestination) throws FlowCommandException {
  InstallEgressFlow command=(InstallEgressFlow)message.getData();
  logger.debug("String_Node_Str",command);
  try {
    context.getSwitchManager().installEgressFlow(DatapathId.of(command.getSwitchId()),command.getId(),command.getCookie(),command.getInputPort(),command.getOutputPort(),command.getTransitVlanId(),command.getOutputVlanId(),command.getOutputVlanType());
    if (!StringUtils.isBlank(replyToTopic)) {
      message.setDestination(replyDestination);
      context.getKafkaProducer().postMessage(replyToTopic,message);
    }
  }
 catch (  SwitchOperationException e) {
    throw new FlowCommandException(command.getId(),ErrorType.CREATION_FAILURE,e);
  }
}
Program: 37969
Project: 37969
Buggy source:
private void doSyncRulesRequest(final CommandMessage message){
  InstallMissedFlowsRequest request=(InstallMissedFlowsRequest)message.getData();
  final String switchId=request.getSwitchId();
  logger.debug("String_Node_Str",switchId);
}

Fixed version (ground truth):
private void doSyncRulesRequest(final CommandMessage message) throws FlowCommandException {
  InstallMissedFlowsRequest request=(InstallMissedFlowsRequest)message.getData();
  final String switchId=request.getSwitchId();
  logger.debug("String_Node_Str",switchId);
  for (  BaseFlow installCommand : request.getFlowCommands()) {
    logger.debug("String_Node_Str",switchId,installCommand);
    handleCommand(message,installCommand,StringUtils.EMPTY,Destination.TOPOLOGY_ENGINE);
  }
}
Program: 37970
Project: 37970
Buggy source:
/** 
 * Installs flow through one switch.
 * @param message command message for flow installation
 */
private void doInstallOneSwitchFlow(final CommandMessage message,String replyToTopic,Destination replyDestination) throws FlowCommandException {
  InstallOneSwitchFlow command=(InstallOneSwitchFlow)message.getData();
  logger.debug("String_Node_Str",command);
  Long meterId=command.getMeterId();
  if (meterId == null) {
    logger.error("String_Node_Str",command.getCookie());
    meterId=(long)meterPool.allocate(command.getSwitchId(),command.getId());
    logger.error("String_Node_Str",meterId,command.getCookie());
  }
  try {
    context.getSwitchManager().installMeter(DatapathId.of(command.getSwitchId()),command.getBandwidth(),1024,meterId);
    OutputVlanType directOutputVlanType=command.getOutputVlanType();
    context.getSwitchManager().installOneSwitchFlow(DatapathId.of(command.getSwitchId()),command.getId(),command.getCookie(),command.getInputPort(),command.getOutputPort(),command.getInputVlanId(),command.getOutputVlanId(),directOutputVlanType,meterId);
    message.setDestination(replyDestination);
    context.getKafkaProducer().postMessage(replyToTopic,message);
  }
 catch (  SwitchOperationException e) {
    throw new FlowCommandException(command.getId(),ErrorType.CREATION_FAILURE,e);
  }
}

Fixed version (ground truth):
/** 
 * Installs flow through one switch.
 * @param message command message for flow installation
 */
private void doInstallOneSwitchFlow(final CommandMessage message,String replyToTopic,Destination replyDestination) throws FlowCommandException {
  InstallOneSwitchFlow command=(InstallOneSwitchFlow)message.getData();
  logger.debug("String_Node_Str",command);
  Long meterId=command.getMeterId();
  if (meterId == null) {
    logger.error("String_Node_Str",command.getCookie());
    meterId=(long)meterPool.allocate(command.getSwitchId(),command.getId());
    logger.error("String_Node_Str",meterId,command.getCookie());
  }
  try {
    context.getSwitchManager().installMeter(DatapathId.of(command.getSwitchId()),command.getBandwidth(),1024,meterId);
    OutputVlanType directOutputVlanType=command.getOutputVlanType();
    context.getSwitchManager().installOneSwitchFlow(DatapathId.of(command.getSwitchId()),command.getId(),command.getCookie(),command.getInputPort(),command.getOutputPort(),command.getInputVlanId(),command.getOutputVlanId(),directOutputVlanType,meterId);
    if (!StringUtils.isBlank(replyToTopic)) {
      message.setDestination(replyDestination);
      context.getKafkaProducer().postMessage(replyToTopic,message);
    }
  }
 catch (  SwitchOperationException e) {
    throw new FlowCommandException(command.getId(),ErrorType.CREATION_FAILURE,e);
  }
}
Program: 37971
Project: 37971
Buggy source:
protected void doControllerMsg(CommandMessage message){
  final String replyToTopic;
  if (message instanceof CommandWithReplyToMessage) {
    replyToTopic=((CommandWithReplyToMessage)message).getReplyTo();
  }
 else {
    replyToTopic=OUTPUT_FLOW_TOPIC;
  }
  final Destination replyDestination=getDestinationForTopic(replyToTopic);
  try {
    CommandData data=message.getData();
    if (data instanceof DiscoverIslCommandData) {
      doDiscoverIslCommand(data);
    }
 else     if (data instanceof DiscoverPathCommandData) {
      doDiscoverPathCommand(data);
    }
 else     if (data instanceof InstallIngressFlow) {
      doInstallIngressFlow(message,replyToTopic,replyDestination);
    }
 else     if (data instanceof InstallEgressFlow) {
      doInstallEgressFlow(message,replyToTopic,replyDestination);
    }
 else     if (data instanceof InstallTransitFlow) {
      doInstallTransitFlow(message,replyToTopic,replyDestination);
    }
 else     if (data instanceof InstallOneSwitchFlow) {
      doInstallOneSwitchFlow(message,replyToTopic,replyDestination);
    }
 else     if (data instanceof RemoveFlow) {
      doDeleteFlow(message,replyToTopic,replyDestination);
    }
 else     if (data instanceof NetworkCommandData) {
      doNetworkDump(message);
    }
 else     if (data instanceof SwitchRulesDeleteRequest) {
      doDeleteSwitchRules(message,replyToTopic,replyDestination);
    }
 else     if (data instanceof SwitchRulesInstallRequest) {
      doInstallSwitchRules(message,replyToTopic,replyDestination);
    }
 else     if (data instanceof ConnectModeRequest) {
      doConnectMode(message,replyToTopic,replyDestination);
    }
 else     if (data instanceof DumpRulesRequest) {
      doDumpRulesRequest(message);
    }
 else     if (data instanceof InstallMissedFlowsRequest) {
      doSyncRulesRequest(message);
    }
 else {
      logger.error("String_Node_Str",data.toString());
    }
  }
 catch (  FlowCommandException e) {
    ErrorMessage error=new ErrorMessage(e.makeErrorResponse(),System.currentTimeMillis(),message.getCorrelationId(),replyDestination);
    context.getKafkaProducer().postMessage(replyToTopic,error);
  }
catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
protected void doControllerMsg(CommandMessage message){
  final String replyToTopic;
  if (message instanceof CommandWithReplyToMessage) {
    replyToTopic=((CommandWithReplyToMessage)message).getReplyTo();
  }
 else {
    replyToTopic=OUTPUT_FLOW_TOPIC;
  }
  final Destination replyDestination=getDestinationForTopic(replyToTopic);
  try {
    CommandData data=message.getData();
    handleCommand(message,data,replyToTopic,replyDestination);
  }
 catch (  FlowCommandException e) {
    ErrorMessage error=new ErrorMessage(e.makeErrorResponse(),System.currentTimeMillis(),message.getCorrelationId(),replyDestination);
    context.getKafkaProducer().postMessage(replyToTopic,error);
  }
catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}
Program: 37972
Project: 37972
Buggy source:
/** 
 * Installs ingress flow on the switch.
 * @param message command message for flow installation
 */
private void doInstallIngressFlow(final CommandMessage message,String replyToTopic,Destination replyDestination) throws FlowCommandException {
  InstallIngressFlow command=(InstallIngressFlow)message.getData();
  logger.debug("String_Node_Str",command);
  Long meterId=command.getMeterId();
  if (meterId == null) {
    logger.error("String_Node_Str",command.getCookie());
    meterId=(long)meterPool.allocate(command.getSwitchId(),command.getId());
    logger.error("String_Node_Str",meterId,command.getCookie());
  }
  try {
    context.getSwitchManager().installMeter(DatapathId.of(command.getSwitchId()),command.getBandwidth(),1024,meterId);
    context.getSwitchManager().installIngressFlow(DatapathId.of(command.getSwitchId()),command.getId(),command.getCookie(),command.getInputPort(),command.getOutputPort(),command.getInputVlanId(),command.getTransitVlanId(),command.getOutputVlanType(),meterId);
    message.setDestination(replyDestination);
    context.getKafkaProducer().postMessage(replyToTopic,message);
  }
 catch (  SwitchOperationException e) {
    throw new FlowCommandException(command.getId(),ErrorType.CREATION_FAILURE,e);
  }
}

Fixed version (ground truth):
/** 
 * Installs ingress flow on the switch.
 * @param message command message for flow installation
 */
private void doInstallIngressFlow(final CommandMessage message,String replyToTopic,Destination replyDestination) throws FlowCommandException {
  InstallIngressFlow command=(InstallIngressFlow)message.getData();
  logger.debug("String_Node_Str",command);
  Long meterId=command.getMeterId();
  if (meterId == null) {
    logger.error("String_Node_Str",command.getCookie());
    meterId=(long)meterPool.allocate(command.getSwitchId(),command.getId());
    logger.error("String_Node_Str",meterId,command.getCookie());
  }
  try {
    context.getSwitchManager().installMeter(DatapathId.of(command.getSwitchId()),command.getBandwidth(),1024,meterId);
    context.getSwitchManager().installIngressFlow(DatapathId.of(command.getSwitchId()),command.getId(),command.getCookie(),command.getInputPort(),command.getOutputPort(),command.getInputVlanId(),command.getTransitVlanId(),command.getOutputVlanType(),meterId);
    if (!StringUtils.isBlank(replyToTopic)) {
      message.setDestination(replyDestination);
      context.getKafkaProducer().postMessage(replyToTopic,message);
    }
  }
 catch (  SwitchOperationException e) {
    throw new FlowCommandException(command.getId(),ErrorType.CREATION_FAILURE,e);
  }
}
Program: 37973
Project: 37973
Buggy source:
private void doDumpRulesRequest(final CommandMessage message){
  DumpRulesRequest request=(DumpRulesRequest)message.getData();
  final String switchId=request.getSwitchId();
  logger.debug("String_Node_Str",switchId);
  OFFlowStatsReply reply=context.getSwitchManager().dumpFlowTable(DatapathId.of(switchId));
  List<FlowEntry> flows=reply.getEntries().stream().map(OFFlowStatsConverter::toFlowEntry).collect(Collectors.toList());
  SwitchFlowEntries response=SwitchFlowEntries.builder().switchId(switchId).flowEntries(flows).build();
  InfoMessage infoMessage=new InfoMessage(response,message.getTimestamp(),message.getCorrelationId());
  context.getKafkaProducer().postMessage(OUTPUT_FLOW_TOPIC,infoMessage);
}

Fixed version (ground truth):
private void doDumpRulesRequest(final CommandMessage message){
  DumpRulesRequest request=(DumpRulesRequest)message.getData();
  final String switchId=request.getSwitchId();
  logger.debug("String_Node_Str",switchId);
  OFFlowStatsReply reply=context.getSwitchManager().dumpFlowTable(DatapathId.of(switchId));
  List<FlowEntry> flows=reply.getEntries().stream().map(OFFlowStatsConverter::toFlowEntry).collect(Collectors.toList());
  SwitchFlowEntries response=SwitchFlowEntries.builder().switchId(switchId).flowEntries(flows).build();
  InfoMessage infoMessage=new InfoMessage(response,message.getTimestamp(),message.getCorrelationId());
  context.getKafkaProducer().postMessage(TOPO_ENG_TOPIC,infoMessage);
}
Program: 37974
Project: 37974
Buggy source:
/** 
 * Installs transit flow on the switch.
 * @param message command message for flow installation
 */
private void doInstallTransitFlow(final CommandMessage message,String replyToTopic,Destination replyDestination) throws FlowCommandException {
  InstallTransitFlow command=(InstallTransitFlow)message.getData();
  logger.debug("String_Node_Str",command);
  try {
    context.getSwitchManager().installTransitFlow(DatapathId.of(command.getSwitchId()),command.getId(),command.getCookie(),command.getInputPort(),command.getOutputPort(),command.getTransitVlanId());
    message.setDestination(replyDestination);
    context.getKafkaProducer().postMessage(replyToTopic,message);
  }
 catch (  SwitchOperationException e) {
    throw new FlowCommandException(command.getId(),ErrorType.CREATION_FAILURE,e);
  }
}

Fixed version (ground truth):
/** 
 * Installs transit flow on the switch.
 * @param message command message for flow installation
 */
private void doInstallTransitFlow(final CommandMessage message,String replyToTopic,Destination replyDestination) throws FlowCommandException {
  InstallTransitFlow command=(InstallTransitFlow)message.getData();
  logger.debug("String_Node_Str",command);
  try {
    context.getSwitchManager().installTransitFlow(DatapathId.of(command.getSwitchId()),command.getId(),command.getCookie(),command.getInputPort(),command.getOutputPort(),command.getTransitVlanId());
    if (!StringUtils.isBlank(replyToTopic)) {
      message.setDestination(replyDestination);
      context.getKafkaProducer().postMessage(replyToTopic,message);
    }
  }
 catch (  SwitchOperationException e) {
    throw new FlowCommandException(command.getId(),ErrorType.CREATION_FAILURE,e);
  }
}
Program: 37975
Project: 37975
Buggy source:
@After public void verifyMocks(){
  verify(topologyEngineService).getActiveSwitches();
  verify(topologyEngineService).getActiveLinks();
  verify(topologyDefinition,times(3)).getActiveSwitches();
  verify(topologyDefinition).getIslsForActiveSwitches();
}

Fixed version (ground truth):
@After public void verifyMocks(){
  verify(topologyEngineService).getActiveSwitches();
  verify(topologyEngineService).getActiveLinks();
  verify(topologyDefinition,times(2)).getActiveSwitches();
  verify(topologyDefinition).getIslsForActiveSwitches();
}
Program: 37977
Project: 37977
Buggy source:
@Override public StormTopology createTopology() throws NameCollisionException {
}

Fixed version (ground truth):
@Override public StormTopology createTopology() throws NameCollisionException {
  final String clazzName=this.getClass().getSimpleName();
  logger.debug("String_Node_Str",clazzName);
  TopologyBuilder builder=new TopologyBuilder();
  String topoDiscoTopic=config.getKafkaTopoDiscoTopic();
  checkAndCreateTopic(topoDiscoTopic);
  logger.debug("String_Node_Str",topoDiscoTopic);
  builder.setSpout(TOPO_DISCO_SPOUT,createKafkaSpout(topoDiscoTopic,clazzName + topoDiscoTopic));
  TopoDiscoParseBolt topoDiscoParseBolt=new TopoDiscoParseBolt();
  builder.setBolt(TOPO_DISCO_PARSE_BOLT_NAME,topoDiscoParseBolt,config.getParallelism()).shuffleGrouping(TopoDiscoParseBolt.TOPO_TO_PORT_INFO_STREAM,PARSE_PORT_INFO_BOLT_NAME);
  ParsePortInfoBolt parsePortInfoBolt=new ParsePortInfoBolt();
  builder.setBolt(PARSE_PORT_INFO_BOLT_NAME,parsePortInfoBolt,config.getParallelism()).shuffleGrouping(TopoDiscoParseBolt.TOPO_TO_PORT_INFO_STREAM,TOPO_DISCO_PARSE_BOLT_NAME).shuffleGrouping(WfmStatsParseBolt.WFM_TO_PARSE_PORT_INFO_STREAM,WFM_STATS_PARSE_BOLT_NAME);
  final String openTsdbTopic=config.getKafkaOtsdbTopic();
  checkAndCreateTopic(openTsdbTopic);
  KafkaBolt openTsdbBolt=createKafkaBolt(openTsdbTopic);
  builder.setBolt(OtsdbKafkaBoltName,openTsdbBolt,config.getParallelism()).shuffleGrouping(PARSE_PORT_INFO_BOLT_NAME);
  String wfmStatsTopic=config.getKafkaStatsTopic();
  checkAndCreateTopic(wfmStatsTopic);
  logger.debug("String_Node_Str",wfmStatsTopic);
  builder.setSpout(WFM_STATS_SPOUT,createKafkaSpout(wfmStatsTopic,clazzName + wfmStatsTopic));
  WfmStatsParseBolt wfmStatsParseBolt=new WfmStatsParseBolt();
  builder.setBolt(WFM_STATS_PARSE_BOLT_NAME,wfmStatsParseBolt,config.getParallelism()).shuffleGrouping(WFM_STATS_SPOUT);
  SwitchPortsSpout switchPortsSpout=new SwitchPortsSpout(JANITOR_REFRESH);
  builder.setSpout(SWITCH_PORTS_SPOUT_NAME,switchPortsSpout);
  final String speakerTopic=config.getKafkaSpeakerTopic();
  checkAndCreateTopic(speakerTopic);
  KafkaBolt speakerBolt=createKafkaBolt(speakerTopic);
  builder.setBolt(SpeakerBoltName,speakerBolt,config.getParallelism()).shuffleGrouping(SWITCH_PORTS_SPOUT_NAME);
  return builder.createTopology();
}
Program: 37978
Project: 37978
Buggy source:
@Override public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer){
  outputFieldsDeclarer.declareStream(PARSE_PORT_INFO_STREAM,new Fields(FIELD_NAME));
}

Fixed version (ground truth):
@Override public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer){
  outputFieldsDeclarer.declareStream(TOPO_TO_PORT_INFO_STREAM,new Fields(FIELD_NAME));
}
Program: 37979
Project: 37979
Buggy source:
private void doParseMessage(Tuple tuple){
  try {
    InfoData infoData=getInfoData(tuple);
    if (infoData instanceof PortInfoData) {
      collector.emit(PARSE_PORT_INFO_STREAM,new Values((PortInfoData)infoData));
    }
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",tuple.toString(),e);
  }
catch (  MessageException e) {
  }
 finally {
    collector.ack(tuple);
  }
}

Fixed version (ground truth):
private void doParseMessage(Tuple tuple){
  try {
    InfoData infoData=getInfoData(tuple);
    if (infoData instanceof PortInfoData) {
      collector.emit(TOPO_TO_PORT_INFO_STREAM,new Values((PortInfoData)infoData));
    }
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",tuple.toString(),e);
  }
catch (  MessageException e) {
  }
 finally {
    collector.ack(tuple);
  }
}
Program: 37980
Project: 37980
Buggy source:
/** 
 * Chk string is not empty.
 * @param value the value
 * @return true, if successful
 */
public static boolean chkStringIsNotEmpty(Object value){
  boolean flag=false;
  if (value != null) {
    String string=String.valueOf(value);
    if (string != null && !"String_Node_Str".equalsIgnoreCase(string.trim()) && string.length() > 0 && !"String_Node_Str".equalsIgnoreCase(string)) {
      flag=true;
    }
  }
  return flag;
}

Fixed version (ground truth):
/** 
 * Chk string is not empty.
 * @param value the value
 * @return true, if successful
 */
public static boolean chkStringIsNotEmpty(String value){
  if (value != null) {
    Predicate<String> predicates=s -> {
      return value.trim().length() > 0;
    }
;
    return predicates.test(value);
  }
  return false;
}
Program: 37981
Project: 37981
Buggy source:
@Override public void execute(Tuple input){
  StatsComponentType componentId=StatsComponentType.valueOf(input.getSourceComponent());
  InfoMessage message=(InfoMessage)input.getValueByField(MESSAGE_FIELD);
  if (!Destination.WFM_STATS.equals(message.getDestination())) {
    collector.ack(input);
    return;
  }
  LOGGER.debug("String_Node_Str",CORRELATION_ID,message.getCorrelationId(),componentId,StatsStreamType.valueOf(input.getSourceStreamId()));
  PortStatsData data=(PortStatsData)message.getData();
  long timestamp=message.getTimestamp();
  try {
    String switchId=data.getSwitchId().replaceAll("String_Node_Str","String_Node_Str");
    for (    PortStatsReply reply : data.getStats()) {
      for (      PortStatsEntry entry : reply.getEntries()) {
        emit(entry,timestamp,switchId);
      }
    }
  }
  finally {
    collector.ack(input);
  }
}

Fixed version (ground truth):
@Override public void execute(Tuple input){
  StatsComponentType componentId=StatsComponentType.valueOf(input.getSourceComponent());
  InfoMessage message=(InfoMessage)input.getValueByField(MESSAGE_FIELD);
  if (!Destination.WFM_STATS.equals(message.getDestination())) {
    collector.ack(input);
    return;
  }
  LOGGER.debug("String_Node_Str",CORRELATION_ID,message.getCorrelationId(),componentId,StatsStreamType.valueOf(input.getSourceStreamId()));
  PortStatsData data=(PortStatsData)message.getData();
  long timestamp=message.getTimestamp();
  try {
    String switchId=switchNameCache.get(data.getSwitchId());
    if (switchId == null) {
      switchId="String_Node_Str" + data.getSwitchId().replaceAll("String_Node_Str","String_Node_Str").toUpperCase();
      switchNameCache.put(data.getSwitchId(),switchId);
    }
    for (    PortStatsReply reply : data.getStats()) {
      for (      PortStatsEntry entry : reply.getEntries()) {
        emit(entry,timestamp,switchId);
      }
    }
  }
  finally {
    collector.ack(input);
  }
}
Program: 37982
Project: 37982
Buggy source:
public void handleFailed(String switchId,String portId){
  Node node=new Node(switchId,portId);
  List<DiscoveryNode> subjectList=filterQueue(node);
  if (subjectList.size() == 0) {
    logger.warn("String_Node_Str",node);
  }
 else {
    DiscoveryNode subject=subjectList.get(0);
    subject.countFailure();
    logger.info("String_Node_Str",subject);
  }
}

Fixed version (ground truth):
/** 
 * ISL Failure Event
 * @return true if this is new .. ie this isn't a consecutive failure.
 */
public boolean handleFailed(String switchId,String portId){
  boolean stateChanged=false;
  Node node=new Node(switchId,portId);
  List<DiscoveryNode> subjectList=filterQueue(node);
  if (subjectList.size() == 0) {
    logger.warn("String_Node_Str",node);
  }
 else {
    DiscoveryNode subject=subjectList.get(0);
    if (subject.isFoundIsl() && subject.getConsecutiveFailure() == 0) {
      stateChanged=true;
      logger.info("String_Node_Str",subject);
    }
    subject.renew();
    subject.incConsecutiveFailure();
    subject.clearConsecutiveSuccess();
  }
  return stateChanged;
}
Program: 37983
Project: 37983
Buggy source:
public Plan makeDiscoveryPlan(){
  Plan result=new Plan();
  for (  DiscoveryNode subject : pollQueue) {
    Node node=new Node(subject.getSwitchId(),subject.getPortId());
    if (subject.forlorn()) {
      continue;
    }
 else     if (subject.isStale(consecutiveLostTillFail) && subject.timeToCheck()) {
      result.discoveryFailure.add(node);
      subject.resetTickCounter();
      continue;
    }
 else     if (subject.isStale(consecutiveLostTillFail) && !subject.timeToCheck()) {
      subject.logTick();
      continue;
    }
    if (filter.isMatch(subject)) {
      logger.debug("String_Node_Str",subject);
      subject.renew();
      subject.resetTickCounter();
      continue;
    }
    subject.incAge();
    subject.resetTickCounter();
    result.needDiscovery.add(node);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * The discovery plan takes into consideration multiple metrics to determine what should be discovered. At present, we want to send Discovery health checks on every ISL every x period. And, if the Discovery fails (either isn't an ISL or ISL is down) then we may want to give up checking. General algorithm: 1) if the node is an ISL (isFoundIsl) .. and is UP .. keep checking 2) if the node is not an ISL (ie !isFoundIsl), then check less frequently 3) if the node is an ISL .. and is DOWN .. keep checking
 */
public Plan makeDiscoveryPlan(){
  Plan result=new Plan();
  for (  DiscoveryNode subject : pollQueue) {
    if (filter.isMatch(subject)) {
      logger.debug("String_Node_Str",subject);
      subject.renew();
      subject.resetTickCounter();
      continue;
    }
    if (subject.forlorn()) {
      continue;
    }
    Node node=new Node(subject.getSwitchId(),subject.getPortId());
    if (subject.maxAttempts(consecutiveLostTillFail)) {
      if (subject.isFoundIsl() && subject.getConsecutiveFailure() == 0) {
        result.discoveryFailure.add(node);
        logger.info("String_Node_Str",subject);
      }
      subject.incConsecutiveFailure();
    }
    if (subject.timeToCheck()) {
      subject.incAttempts();
      subject.resetTickCounter();
      result.needDiscovery.add(node);
    }
 else {
      subject.logTick();
    }
  }
  return result;
}
Program: 37984
Project: 37984
Buggy source:
public void handleDiscovered(String switchId,String portId){
  Node node=new Node(switchId,portId);
  List<DiscoveryNode> subjectList=filterQueue(node);
  if (subjectList.size() == 0) {
    logger.warn("String_Node_Str",node);
  }
 else {
    DiscoveryNode subject=subjectList.get(0);
    subject.renew();
    logger.info("String_Node_Str",subject);
  }
}

Fixed version (ground truth):
/** 
 * ISL Discovery Event
 * @return true if this is a new event (ie first time discovered or prior failure)
 */
public boolean handleDiscovered(String switchId,String portId){
  boolean stateChanged=false;
  Node node=new Node(switchId,portId);
  List<DiscoveryNode> subjectList=filterQueue(node);
  if (subjectList.size() == 0) {
    logger.warn("String_Node_Str",node);
  }
 else {
    DiscoveryNode subject=subjectList.get(0);
    if (!subject.isFoundIsl()) {
      subject.setFoundIsl(true);
      stateChanged=true;
      logger.info("String_Node_Str",subject);
    }
    if (subject.getConsecutiveFailure() > 0) {
      stateChanged=true;
      logger.info("String_Node_Str",subject);
    }
    subject.renew();
    subject.incConsecutiveSuccess();
    subject.clearConsecutiveFailure();
  }
  return stateChanged;
}
Program: 37985
Project: 37985
Buggy source:
public boolean forlorn(){
  if (forlornThreshold == NEVER) {
    return false;
  }
  return consecutiveFailures >= forlornThreshold;
}

Fixed version (ground truth):
public boolean forlorn(){
  if (forlornThreshold == NEVER) {
    return false;
  }
  return consecutiveFailure >= forlornThreshold;
}
Program: 37986
Project: 37986
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + switchId + '\''+ "String_Node_Str"+ portId+ '\''+ "String_Node_Str"+ age+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + switchId + '\''+ "String_Node_Str"+ portId+ '\''+ "String_Node_Str"+ attempts+ "String_Node_Str"+ consecutiveFailure+ "String_Node_Str"+ consecutiveSuccess+ '}';
}
Program: 37987
Project: 37987
Buggy source:
public void renew(){
  age=0;
  timeCounter=0;
}

Fixed version (ground truth):
/** 
 * Whereas renew is called when a successful Discovery is received, it isn't the place to put "foundIsl". This is out of fear that renew() could be called from somewhere else. The semantics of "renew" doesn't say "found ISL"
 */
public void renew(){
  attempts=0;
  timeCounter=0;
}
Program: 37988
Project: 37988
Buggy source:
private void handleIslEvent(Tuple tuple,IslInfoData discoveredIsl){
  PathNode node=discoveredIsl.getPath().get(0);
  String switchID=node.getSwitchId();
  String portID="String_Node_Str" + node.getPortNo();
  IslChangeType state=discoveredIsl.getState();
  logger.info("String_Node_Str",switchID,portID,state);
  if (IslChangeType.DISCOVERED.equals(state)) {
    discovery.handleDiscovered(switchID,portID);
  }
 else   if (IslChangeType.FAILED.equals(state)) {
    discovery.handleFailed(switchID,portID);
  }
 else {
    logger.warn("String_Node_Str",state);
  }
  String json=tuple.getString(0);
  collector.emit(topoEngTopic,tuple,new Values(PAYLOAD,json));
}

Fixed version (ground truth):
private void handleIslEvent(Tuple tuple,IslInfoData discoveredIsl){
  PathNode node=discoveredIsl.getPath().get(0);
  String switchID=node.getSwitchId();
  String portID="String_Node_Str" + node.getPortNo();
  IslChangeType state=discoveredIsl.getState();
  boolean stateChanged=false;
  if (IslChangeType.DISCOVERED.equals(state)) {
    stateChanged=discovery.handleDiscovered(switchID,portID);
  }
 else   if (IslChangeType.FAILED.equals(state)) {
    stateChanged=discovery.handleFailed(switchID,portID);
  }
 else {
    logger.warn("String_Node_Str",state);
  }
  if (stateChanged) {
    logger.info("String_Node_Str",switchID,portID,state);
    String json=tuple.getString(0);
    collector.emit(topoEngTopic,tuple,new Values(PAYLOAD,json));
  }
}
Program: 37989
Project: 37989
Buggy source:
@Override public void run(){
  while (true) {
    KafkaConsumer<String,String> consumer=null;
    try {
      consumer=new KafkaConsumer<>(kafkaProps);
      consumer.subscribe(topics);
      while (true) {
        ConsumerRecords<String,String> records=consumer.poll(100);
        logger.debug("String_Node_Str",records.count());
        for (        ConsumerRecord<String,String> record : records) {
          logger.trace("String_Node_Str",record.offset(),record.value());
          parseRecordExecutor.execute(new ParseRecord(record));
        }
      }
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",e);
      if (consumer != null) {
        consumer.close();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (true) {
    KafkaConsumer<String,String> consumer=null;
    try {
      consumer=new KafkaConsumer<>(kafkaProps);
      consumer.subscribe(topics);
      while (true) {
        ConsumerRecords<String,String> records=consumer.poll(100);
        if (records.count() > 0)         logger.debug("String_Node_Str",records.count());
        for (        ConsumerRecord<String,String> record : records) {
          logger.trace("String_Node_Str",record.offset(),record.value());
          parseRecordExecutor.execute(new ParseRecord(record));
        }
      }
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",e);
      if (consumer != null) {
        consumer.close();
      }
    }
  }
}
Program: 37990
Project: 37990
Buggy source:
@Override public boolean sendDiscoveryMessage(DatapathId srcSwId,OFPort port,DatapathId dstSwId){
  IOFSwitch srcSwitch=switchService.getSwitch(srcSwId);
  if (srcSwitch == null) {
    return false;
  }
  if (dstSwId == null) {
    return srcSwitch.write(generateVerificationPacket(srcSwitch,port));
  }
  IOFSwitch dstSwitch=switchService.getSwitch(dstSwId);
  OFPacketOut ofPacketOut=generateVerificationPacket(srcSwitch,port,dstSwitch);
  logger.debug("String_Node_Str",srcSwitch.getId().toString(),port.getPortNumber(),Hex.encodeHexString(ofPacketOut.getData()));
  return srcSwitch.write(ofPacketOut);
}

Fixed version (ground truth):
@Override public boolean sendDiscoveryMessage(DatapathId srcSwId,OFPort port,DatapathId dstSwId){
  IOFSwitch srcSwitch=switchService.getSwitch(srcSwId);
  if (srcSwitch == null || srcSwitch.getPort(port) == null) {
    return false;
  }
  if (dstSwId == null) {
    return srcSwitch.write(generateVerificationPacket(srcSwitch,port));
  }
  IOFSwitch dstSwitch=switchService.getSwitch(dstSwId);
  OFPacketOut ofPacketOut=generateVerificationPacket(srcSwitch,port,dstSwitch);
  logger.debug("String_Node_Str",srcSwitch.getId().toString(),port.getPortNumber(),Hex.encodeHexString(ofPacketOut.getData()));
  return srcSwitch.write(ofPacketOut);
}
Program: 37992
Project: 37992
Buggy source:
@Override public int hashCode(){
  int result=metric != null ? metric.hashCode() : 0;
  result=31 * result + (tags != null ? tags.hashCode() : 0);
  result=31 * result + (value != null ? value.hashCode() : 0);
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=metric != null ? metric.hashCode() : 0;
  result=31 * result + (tags != null ? tags.hashCode() : 0);
  return result;
}
Program: 37994
Project: 37994
Buggy source:
@Override public StormTopology createTopology(){
  LOGGER.info("String_Node_Str");
  TopologyBuilder tb=new TopologyBuilder();
  final String topic=config.getKafkaOtsdbTopic();
  final String spoutId=topic + "String_Node_Str";
  final String boltId=topic + "String_Node_Str";
  checkAndCreateTopic(topic);
  KafkaSpout kafkaSpout=createKafkaSpout(topic,spoutId);
  tb.setSpout(spoutId,kafkaSpout,config.getOpenTsdbNumSpouts());
  tb.setBolt(boltId,new OpenTSDBFilterBolt(),config.getOpenTsdbNumOpentasbFilterBolt()).shuffleGrouping(spoutId);
  OpenTsdbClient.Builder tsdbBuilder=OpenTsdbClient.newBuilder(config.getOpenTsDBHosts()).sync(config.getOpenTsdbTimeout()).returnDetails();
  OpenTsdbBolt openTsdbBolt=new OpenTsdbBolt(tsdbBuilder,TupleOpenTsdbDatapointMapper.DEFAULT_MAPPER).withBatchSize(10).withFlushInterval(2).failTupleForFailedMetrics();
  tb.setBolt("String_Node_Str",openTsdbBolt,config.getOpenTsdbNumOpentsdbBolt()).shuffleGrouping(boltId);
  return tb.createTopology();
}

Fixed version (ground truth):
@Override public StormTopology createTopology(){
  LOGGER.info("String_Node_Str");
  TopologyBuilder tb=new TopologyBuilder();
  final String topic=config.getKafkaOtsdbTopic();
  final String spoutId=topic + "String_Node_Str";
  final String boltId=topic + "String_Node_Str";
  checkAndCreateTopic(topic);
  KafkaSpout kafkaSpout=createKafkaSpout(topic,spoutId);
  tb.setSpout(spoutId,kafkaSpout,config.getOpenTsdbNumSpouts());
  tb.setBolt(boltId,new OpenTSDBFilterBolt(),config.getOpenTsdbFilterBoltExecutors()).fieldsGrouping(spoutId,new Fields("String_Node_Str"));
  OpenTsdbClient.Builder tsdbBuilder=OpenTsdbClient.newBuilder(config.getOpenTsDBHosts()).sync(config.getOpenTsdbTimeout()).returnDetails();
  OpenTsdbBolt openTsdbBolt=new OpenTsdbBolt(tsdbBuilder,TupleOpenTsdbDatapointMapper.DEFAULT_MAPPER).withBatchSize(config.getOpenTsdbBatchSize()).withFlushInterval(config.getOpenTsdbFlushInterval()).failTupleForFailedMetrics();
  tb.setBolt("String_Node_Str",openTsdbBolt,config.getOpenTsdbBoltExecutors()).setNumTasks(config.getOpenTsdbBoltWorkers()).shuffleGrouping(boltId);
  return tb.createTopology();
}
Program: 37995
Project: 37995
Buggy source:
private boolean isUpdateRequired(Datapoint datapoint){
  return !storage.contains(datapoint) || isDatapointOutdated(datapoint);
}

Fixed version (ground truth):
private boolean isUpdateRequired(Datapoint datapoint){
  boolean update=true;
  if (storage.containsKey(datapoint.hashCode())) {
    Datapoint prevDatapoint=storage.get(datapoint.hashCode());
    update=!prevDatapoint.getValue().equals(datapoint.getValue()) || datapoint.getTime() - prevDatapoint.getTime() >= TEN_MINUTES;
  }
  return update;
}
Program: 37996
Project: 37996
Buggy source:
private void addDatapoint(Datapoint datapoint){
  if (!storage.add(datapoint)) {
    storage.remove(datapoint);
    storage.add(datapoint);
  }
}

Fixed version (ground truth):
private void addDatapoint(Datapoint datapoint){
  LOGGER.debug("String_Node_Str" + datapoint.hashCode());
  storage.put(datapoint.hashCode(),datapoint);
}
Program: 37998
Project: 37998
Buggy source:
/** 
 * Checks if is valid response.
 * @param response the response
 * @return true, if is valid response
 */
public static boolean isValidResponse(final HttpResponse response){
  _log.debug("String_Node_Str" + response.getStatusLine().getStatusCode());
  return response.getStatusLine().getStatusCode() >= HttpStatus.OK.value() && response.getStatusLine().getStatusCode() < HttpStatus.MULTIPLE_CHOICES.value() && response.getEntity() != null;
}

Fixed version (ground truth):
/** 
 * Checks if is valid response.
 * @param response the response
 * @return true, if is valid response
 */
public static boolean isValidResponse(final HttpResponse response){
  LOGGER.debug("String_Node_Str" + response.getStatusLine().getStatusCode());
  return response.getStatusLine().getStatusCode() >= HttpStatus.OK.value() && response.getStatusLine().getStatusCode() < HttpStatus.MULTIPLE_CHOICES.value() && response.getEntity() != null;
}
Program: 38000
Project: 38000
Buggy source:
private void sendDiscoveryFailed(String switchId,String portId,Tuple tuple) throws IOException {
  String discoFail=OFEMessageUtils.createIslFail(switchId,portId);
  Values dataVal=new Values(PAYLOAD,discoFail,switchId,portId,OFEMessageUtils.LINK_DOWN);
  collector.emit(topoEngTopic,tuple,dataVal);
  discovery.handleFailed(switchId,portId);
  logger.warn("String_Node_Str",discoFail);
}

Fixed version (ground truth):
private void sendDiscoveryFailed(String switchId,String portId,Tuple tuple) throws IOException {
  String discoFail=OFEMessageUtils.createIslFail(switchId,portId);
  collector.emit(topoEngTopic,tuple,new Values(PAYLOAD,discoFail));
  discovery.handleFailed(switchId,portId);
  logger.warn("String_Node_Str",discoFail);
}
Program: 38001
Project: 38001
Buggy source:
private void parseRecord(ConsumerRecord record){
  try {
    if (record.value() instanceof String) {
      String value=(String)record.value();
      BaseMessage message=MAPPER.readValue(value,BaseMessage.class);
      if (message instanceof CommandMessage) {
        logger.debug("String_Node_Str",value);
        doControllerMsg((CommandMessage)message);
      }
 else {
        logger.trace("String_Node_Str",message);
      }
    }
 else {
      logger.error("String_Node_Str",record.value());
    }
  }
 catch (  Exception exception) {
    logger.error("String_Node_Str",record.value(),exception);
  }
}

Fixed version (ground truth):
private void parseRecord(ConsumerRecord record){
  try {
    if (record.value() instanceof String) {
      String value=(String)record.value();
      CommandMessage message=MAPPER.readValue(value,CommandMessage.class);
      doControllerMsg((CommandMessage)message);
    }
 else {
      logger.error("String_Node_Str",record.value());
    }
  }
 catch (  Exception exception) {
    logger.error("String_Node_Str",record.value(),exception);
  }
}
Program: 38002
Project: 38002
Buggy source:
/** 
 * Returns CommandData entity constructed by data string from json resource file.
 * @param value data string from json resource file
 * @return CommandData entity
 * @throws IOException if mapping fails
 */
private static CommandData prepareData(String value) throws IOException {
  Message message=MAPPER.readValue(value,Message.class);
  CommandMessage commandMessage=(CommandMessage)message;
  return commandMessage.getData();
}

Fixed version (ground truth):
/** 
 * Returns CommandData entity constructed by data string from json resource file.
 * @param value data string from json resource file
 * @return CommandData entity
 * @throws IOException if mapping fails
 */
private static CommandData prepareData(String value) throws IOException {
  CommandMessage message=MAPPER.readValue(value,CommandMessage.class);
  return message.getData();
}