nus-yam/ex-repair huggingface dataset:
Program: 37755
Project: 37755
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public ImmutablePair<PathInfoData,PathInfoData> getPath(Flow flow,Strategy strategy) throws UnroutablePathException, RecoverableException {
  long latency=0L;
  List<PathNode> forwardNodes=new LinkedList<>();
  List<PathNode> reverseNodes=new LinkedList<>();
  if (!flow.isOneSwitchFlow()) {
    try {
      Pair<LinkedList<SimpleIsl>,LinkedList<SimpleIsl>> biPath=getPathFromNetwork(flow,strategy);
      if (biPath.getLeft().size() == 0 || biPath.getRight().size() == 0)       throw new UnroutablePathException(flow);
      int seqId=0;
      LinkedList<SimpleIsl> forwardIsl=biPath.getLeft();
      for (      SimpleIsl isl : forwardIsl) {
        latency+=isl.latency;
        forwardNodes.add(new PathNode(isl.src_dpid,isl.src_port,seqId++,(long)isl.latency));
        forwardNodes.add(new PathNode(isl.dst_dpid,isl.dst_port,seqId++,0L));
      }
      seqId=0;
      LinkedList<SimpleIsl> reverseIsl=biPath.getLeft();
      for (      SimpleIsl isl : reverseIsl) {
        reverseNodes.add(new PathNode(isl.src_dpid,isl.src_port,seqId++,(long)isl.latency));
        reverseNodes.add(new PathNode(isl.dst_dpid,isl.dst_port,seqId++,0L));
      }
    }
 catch (    TransientException e) {
      throw new RecoverableException("String_Node_Str",e);
    }
catch (    ClientException e) {
      throw new RecoverableException("String_Node_Str",e);
    }
  }
 else {
    logger.info("String_Node_Str");
  }
  return new ImmutablePair<>(new PathInfoData(latency,forwardNodes),new PathInfoData(latency,reverseNodes));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public ImmutablePair<PathInfoData,PathInfoData> getPath(Flow flow,Strategy strategy) throws UnroutablePathException, RecoverableException {
  long latency=0L;
  List<PathNode> forwardNodes=new LinkedList<>();
  List<PathNode> reverseNodes=new LinkedList<>();
  if (!flow.isOneSwitchFlow()) {
    try {
      Pair<LinkedList<SimpleIsl>,LinkedList<SimpleIsl>> biPath=getPathFromNetwork(flow,strategy);
      if (biPath.getLeft().size() == 0 || biPath.getRight().size() == 0)       throw new UnroutablePathException(flow);
      int seqId=0;
      LinkedList<SimpleIsl> forwardIsl=biPath.getLeft();
      for (      SimpleIsl isl : forwardIsl) {
        latency+=isl.latency;
        forwardNodes.add(new PathNode(isl.src_dpid,isl.src_port,seqId++,(long)isl.latency));
        forwardNodes.add(new PathNode(isl.dst_dpid,isl.dst_port,seqId++,0L));
      }
      seqId=0;
      LinkedList<SimpleIsl> reverseIsl=biPath.getRight();
      for (      SimpleIsl isl : reverseIsl) {
        reverseNodes.add(new PathNode(isl.src_dpid,isl.src_port,seqId++,(long)isl.latency));
        reverseNodes.add(new PathNode(isl.dst_dpid,isl.dst_port,seqId++,0L));
      }
    }
 catch (    TransientException e) {
      throw new RecoverableException("String_Node_Str",e);
    }
catch (    ClientException e) {
      throw new RecoverableException("String_Node_Str",e);
    }
  }
 else {
    logger.info("String_Node_Str");
  }
  return new ImmutablePair<>(new PathInfoData(latency,forwardNodes),new PathInfoData(latency,reverseNodes));
}
Program: 37756
Project: 37756
Buggy source:
/** 
 * Dumps all flows. Dumps all flows with specific status if specified.
 * @return list of flow
 */
@ApiOperation(value="String_Node_Str",response=FlowPayload.class) @ApiResponse(code=200,response=FlowPayload.class,responseContainer="String_Node_Str",message="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<List<FlowPayload>> getFlows(){
  List<FlowPayload> response=flowService.getFlows();
  return new ResponseEntity<>(response,new HttpHeaders(),HttpStatus.OK);
}

Fixed version (ground truth):
/** 
 * Dumps all flows. Dumps all flows with specific status if specified.
 * @return list of flow
 */
@ApiOperation(value="String_Node_Str",response=FlowPayload.class,responseContainer="String_Node_Str") @ApiResponse(code=200,response=FlowPayload.class,responseContainer="String_Node_Str",message="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<List<FlowPayload>> getFlows(){
  List<FlowPayload> response=flowService.getFlows();
  return new ResponseEntity<>(response,new HttpHeaders(),HttpStatus.OK);
}
Program: 37757
Project: 37757
Buggy source:
/** 
 * Delete all flows.
 * @return list of flows that have been deleted
 */
@ApiOperation(value="String_Node_Str",response=FlowPayload.class) @ApiResponse(code=200,response=FlowPayload.class,responseContainer="String_Node_Str",message="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.DELETE,produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ExtraAuthRequired @SuppressWarnings("String_Node_Str") public ResponseEntity<List<FlowPayload>> deleteFlows(@RequestHeader(value=EXTRA_AUTH,defaultValue="String_Node_Str") long extra_auth){
  long current_auth=System.currentTimeMillis();
  if (Math.abs(current_auth - extra_auth) > 120 * 1000) {
    return new ResponseEntity("String_Node_Str" + current_auth,new HttpHeaders(),HttpStatus.UNAUTHORIZED);
  }
  List<FlowPayload> response=flowService.deleteFlows();
  return new ResponseEntity<>(response,new HttpHeaders(),HttpStatus.OK);
}

Fixed version (ground truth):
/** 
 * Delete all flows.
 * @return list of flows that have been deleted
 */
@ApiOperation(value="String_Node_Str",response=FlowPayload.class,responseContainer="String_Node_Str") @ApiResponse(code=200,response=FlowPayload.class,responseContainer="String_Node_Str",message="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.DELETE,produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ExtraAuthRequired @SuppressWarnings("String_Node_Str") public ResponseEntity<List<FlowPayload>> deleteFlows(@RequestHeader(value=EXTRA_AUTH,defaultValue="String_Node_Str") long extra_auth){
  long current_auth=System.currentTimeMillis();
  if (Math.abs(current_auth - extra_auth) > 120 * 1000) {
    return new ResponseEntity("String_Node_Str" + current_auth,new HttpHeaders(),HttpStatus.UNAUTHORIZED);
  }
  List<FlowPayload> response=flowService.deleteFlows();
  return new ResponseEntity<>(response,new HttpHeaders(),HttpStatus.OK);
}
Program: 37758
Project: 37758
Buggy source:
/** 
 * Compares the Flow from the DB to what is on each switch.
 * @param flowId id of flow to be rerouted.
 * @return flow payload with updated path.
 */
@ApiOperation(value="String_Node_Str",response=FlowValidationDto.class,responseContainer="String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,response=FlowValidationDto.class,message="String_Node_Str")}) @RequestMapping(path="String_Node_Str",method=RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public ResponseEntity<List<FlowValidationDto>> validateFlow(@PathVariable("String_Node_Str") String flowId){
  logger.debug("String_Node_Str",flowId);
  ResponseEntity<List<FlowValidationDto>> response;
  try {
    List<FlowValidationDto> result=flowService.validateFlow(flowId);
    if (result == null) {
      logger.info("String_Node_Str",flowId);
      response=ResponseEntity.notFound().build();
    }
 else {
      response=ResponseEntity.ok(result);
    }
  }
 catch (  InvalidPathException e) {
    logger.error("String_Node_Str",flowId);
    logger.error(e.getMessage());
    response=ResponseEntity.notFound().build();
  }
  return response;
}

Fixed version (ground truth):
/** 
 * Compares the Flow from the DB to what is on each switch.
 * @param flowId id of flow to be rerouted.
 * @return flow payload with updated path.
 */
@ApiOperation(value="String_Node_Str",response=FlowValidationDto.class,responseContainer="String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,response=FlowValidationDto.class,responseContainer="String_Node_Str",message="String_Node_Str")}) @RequestMapping(path="String_Node_Str",method=RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public ResponseEntity<List<FlowValidationDto>> validateFlow(@PathVariable("String_Node_Str") String flowId){
  logger.debug("String_Node_Str",flowId);
  ResponseEntity<List<FlowValidationDto>> response;
  try {
    List<FlowValidationDto> result=flowService.validateFlow(flowId);
    if (result == null) {
      logger.info("String_Node_Str",flowId);
      response=ResponseEntity.notFound().build();
    }
 else {
      response=ResponseEntity.ok(result);
    }
  }
 catch (  InvalidPathException e) {
    logger.error("String_Node_Str",flowId);
    logger.error(e.getMessage());
    response=ResponseEntity.notFound().build();
  }
  return response;
}
Program: 37759
Project: 37759
Buggy source:
/** 
 * Get all available links.
 * @return list of links.
 */
@ApiOperation(value="String_Node_Str",response=LinksDto.class) @ApiResponses(value={@ApiResponse(code=200,response=LinksDto.class,message="String_Node_Str"),@ApiResponse(code=400,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=401,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=403,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=404,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=500,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=503,response=MessageError.class,message="String_Node_Str")}) @GetMapping(path="String_Node_Str") @ResponseStatus(HttpStatus.OK) public List<LinksDto> getLinks(){
  return linkService.getLinks();
}

Fixed version (ground truth):
/** 
 * Get all available links.
 * @return list of links.
 */
@ApiOperation(value="String_Node_Str",response=LinksDto.class,responseContainer="String_Node_Str") @ApiResponse(code=200,response=LinksDto.class,responseContainer="String_Node_Str",message="String_Node_Str") @GetMapping(path="String_Node_Str") @ResponseStatus(HttpStatus.OK) public List<LinksDto> getLinks(){
  return linkService.getLinks();
}
Program: 37760
Project: 37760
Buggy source:
/** 
 * Delete link properties from the static link properties table.
 * @param keysAndProps if null, get all link props. Otherwise, the link props that much the primary keys.
 * @return list of link properties.
 */
@ApiOperation(value="String_Node_Str",response=LinkPropsResult.class) @ApiResponses(value={@ApiResponse(code=200,response=LinkPropsResult.class,message="String_Node_Str"),@ApiResponse(code=400,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=401,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=403,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=404,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=500,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=503,response=MessageError.class,message="String_Node_Str")}) @RequestMapping(path="String_Node_Str",method=RequestMethod.DELETE,produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseStatus(HttpStatus.OK) public LinkPropsResult delLinkProps(@RequestBody List<LinkPropsDto> keysAndProps){
  return linkService.delLinkProps(keysAndProps);
}

Fixed version (ground truth):
/** 
 * Delete link properties from the static link properties table.
 * @param keysAndProps if null, get all link props. Otherwise, the link props that much the primary keys.
 * @return list of link properties.
 */
@ApiOperation(value="String_Node_Str",response=LinkPropsResult.class) @ApiResponse(code=200,response=LinkPropsResult.class,message="String_Node_Str") @RequestMapping(path="String_Node_Str",method=RequestMethod.DELETE,produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseStatus(HttpStatus.OK) public LinkPropsResult delLinkProps(@RequestBody List<LinkPropsDto> keysAndProps){
  return linkService.delLinkProps(keysAndProps);
}
Program: 37761
Project: 37761
Buggy source:
/** 
 * Create/Update link properties in the static link properties table.
 * @param keysAndProps if null, get all link props. Otherwise, the link props that much the primary keys.
 * @return list of link properties.
 */
@ApiOperation(value="String_Node_Str",response=LinkPropsResult.class) @ApiResponses(value={@ApiResponse(code=200,response=LinkPropsResult.class,message="String_Node_Str"),@ApiResponse(code=400,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=401,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=403,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=404,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=500,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=503,response=MessageError.class,message="String_Node_Str")}) @RequestMapping(path="String_Node_Str",method=RequestMethod.PUT,produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseStatus(HttpStatus.OK) public LinkPropsResult putLinkProps(@RequestBody List<LinkPropsDto> keysAndProps){
  return linkService.setLinkProps(keysAndProps);
}

Fixed version (ground truth):
/** 
 * Create/Update link properties in the static link properties table.
 * @param keysAndProps if null, get all link props. Otherwise, the link props that much the primary keys.
 * @return list of link properties.
 */
@ApiOperation(value="String_Node_Str",response=LinkPropsResult.class) @ApiResponse(code=200,response=LinkPropsResult.class,message="String_Node_Str") @RequestMapping(path="String_Node_Str",method=RequestMethod.PUT,produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseStatus(HttpStatus.OK) public LinkPropsResult putLinkProps(@RequestBody List<LinkPropsDto> keysAndProps){
  return linkService.setLinkProps(keysAndProps);
}
Program: 37762
Project: 37762
Buggy source:
/** 
 * Get link properties from the static link properties table.
 * @param keys if null, get all link props. Otherwise, the link props that much the primary keys.
 * @return list of link properties.
 */
@ApiOperation(value="String_Node_Str",response=LinkPropsDto.class) @ApiResponses(value={@ApiResponse(code=200,response=LinkPropsDto.class,message="String_Node_Str"),@ApiResponse(code=400,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=401,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=403,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=404,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=500,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=503,response=MessageError.class,message="String_Node_Str")}) @RequestMapping(path="String_Node_Str",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseStatus(HttpStatus.OK) public List<LinkPropsDto> getLinkProps(LinkPropsDto keys){
  return linkService.getLinkProps(keys);
}

Fixed version (ground truth):
/** 
 * Get link properties from the static link properties table.
 * @param keys if null, get all link props. Otherwise, the link props that much the primary keys.
 * @return list of link properties.
 */
@ApiOperation(value="String_Node_Str",response=LinkPropsDto.class,responseContainer="String_Node_Str") @ApiResponse(code=200,response=LinkPropsDto.class,responseContainer="String_Node_Str",message="String_Node_Str") @RequestMapping(path="String_Node_Str",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseStatus(HttpStatus.OK) public List<LinkPropsDto> getLinkProps(LinkPropsDto keys){
  return linkService.getLinkProps(keys);
}
Program: 37763
Project: 37763
Buggy source:
/** 
 * Delete switch rules.
 * @param switchId switch id to delete rules from
 * @param deleteAction defines what to do about the default rules
 * @param oneCookie the cookie to use if deleting one rule (could be any rule)
 * @return list of the cookies of the rules that have been deleted
 */
@ApiOperation(value="String_Node_Str",response=Long.class,responseContainer="String_Node_Str") @DeleteMapping(value="String_Node_Str",produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ExtraAuthRequired public ResponseEntity deleteSwitchRules(@PathVariable("String_Node_Str") String switchId,@ApiParam(value="String_Node_Str" + "String_Node_Str" + "String_Node_Str",required=false) @RequestParam("String_Node_Str") Optional<DeleteRulesAction> deleteAction,@RequestParam("String_Node_Str") Optional<Long> oneCookie){
  List<Long> response=switchService.deleteRules(switchId,deleteAction.orElse(DeleteRulesAction.IGNORE),oneCookie.orElse(0L));
  return ResponseEntity.ok(response);
}

Fixed version (ground truth):
/** 
 * Delete switch rules.
 * @param switchId switch id to delete rules from
 * @param deleteAction defines what to do about the default rules
 * @param oneCookie the cookie to use if deleting one rule (could be any rule)
 * @return list of the cookies of the rules that have been deleted
 */
@ApiOperation(value="String_Node_Str",response=Long.class,responseContainer="String_Node_Str") @ApiResponse(code=200,response=Long.class,responseContainer="String_Node_Str",message="String_Node_Str") @DeleteMapping(value="String_Node_Str",produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ExtraAuthRequired public ResponseEntity<List<Long>> deleteSwitchRules(@PathVariable("String_Node_Str") String switchId,@ApiParam(value="String_Node_Str" + "String_Node_Str" + "String_Node_Str",required=false) @RequestParam("String_Node_Str") Optional<DeleteRulesAction> deleteAction,@RequestParam("String_Node_Str") Optional<Long> oneCookie){
  List<Long> response=switchService.deleteRules(switchId,deleteAction.orElse(DeleteRulesAction.IGNORE),oneCookie.orElse(0L));
  return ResponseEntity.ok(response);
}
Program: 37764
Project: 37764
Buggy source:
/** 
 * Get switch rules.
 * @param switchId the switch
 * @param cookie filter the response based on this cookie
 * @return list of the cookies of the rules that have been deleted
 */
@ApiOperation(value="String_Node_Str",response=Long.class,responseContainer="String_Node_Str") @GetMapping(value="String_Node_Str",produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseStatus(HttpStatus.OK) public SwitchFlowEntries getSwitchRules(@PathVariable("String_Node_Str") String switchId,@ApiParam(value="String_Node_Str",required=false) @RequestParam("String_Node_Str") Optional<Long> cookie){
  SwitchFlowEntries response=switchService.getRules(switchId,cookie.orElse(0L));
  return response;
}

Fixed version (ground truth):
/** 
 * Get switch rules.
 * @param switchId the switch
 * @param cookie filter the response based on this cookie
 * @return list of the cookies of the rules that have been deleted
 */
@ApiOperation(value="String_Node_Str",response=SwitchFlowEntries.class) @ApiResponse(code=200,response=SwitchFlowEntries.class,message="String_Node_Str") @GetMapping(value="String_Node_Str",produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseStatus(HttpStatus.OK) public SwitchFlowEntries getSwitchRules(@PathVariable("String_Node_Str") String switchId,@ApiParam(value="String_Node_Str",required=false) @RequestParam("String_Node_Str") Optional<Long> cookie){
  SwitchFlowEntries response=switchService.getRules(switchId,cookie.orElse(0L));
  return response;
}
Program: 37765
Project: 37765
Buggy source:
/** 
 * Get all available links.
 * @return list of links.
 */
@ApiOperation(value="String_Node_Str",response=SwitchDto.class) @GetMapping(path="String_Node_Str") @ResponseStatus(HttpStatus.OK) public List<SwitchDto> getSwitches(){
  return switchService.getSwitches();
}

Fixed version (ground truth):
/** 
 * Get all available links.
 * @return list of links.
 */
@ApiOperation(value="String_Node_Str",response=SwitchDto.class,responseContainer="String_Node_Str") @GetMapping(path="String_Node_Str") @ResponseStatus(HttpStatus.OK) public List<SwitchDto> getSwitches(){
  return switchService.getSwitches();
}
Program: 37766
Project: 37766
Buggy source:
/** 
 * Install switch rules.
 * @param switchId switch id to delete rules from
 * @param installAction defines what to do about the default rules
 * @return list of the cookies of the rules that have been installed
 */
@ApiOperation(value="String_Node_Str",response=String.class,responseContainer="String_Node_Str") @PutMapping(value="String_Node_Str",produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ExtraAuthRequired public ResponseEntity installSwitchRules(@PathVariable("String_Node_Str") String switchId,@ApiParam(value="String_Node_Str" + "String_Node_Str",required=false) @RequestParam("String_Node_Str") Optional<InstallRulesAction> installAction){
  List<Long> response=switchService.installRules(switchId,installAction.orElse(InstallRulesAction.INSTALL_DEFAULTS));
  return ResponseEntity.ok(response);
}

Fixed version (ground truth):
/** 
 * Install switch rules.
 * @param switchId switch id to delete rules from
 * @param installAction defines what to do about the default rules
 * @return list of the cookies of the rules that have been installed
 */
@ApiOperation(value="String_Node_Str",response=Long.class,responseContainer="String_Node_Str") @ApiResponse(code=200,response=Long.class,responseContainer="String_Node_Str",message="String_Node_Str") @PutMapping(value="String_Node_Str",produces=MediaType.APPLICATION_JSON_UTF8_VALUE) @ExtraAuthRequired public ResponseEntity<List<Long>> installSwitchRules(@PathVariable("String_Node_Str") String switchId,@ApiParam(value="String_Node_Str" + "String_Node_Str",required=false) @RequestParam("String_Node_Str") Optional<InstallRulesAction> installAction){
  List<Long> response=switchService.installRules(switchId,installAction.orElse(InstallRulesAction.INSTALL_DEFAULTS));
  return ResponseEntity.ok(response);
}
Program: 37767
Project: 37767
Buggy source:
/** 
 * Toggle the global behavior of Floodlight when the switch connects: - AUTO - this is the default. Installs all default rules when a switch connects - SAFE - add the default rules slowly .. monitoring traffic on existing rules - MANUAL - don't install any default rules. Call addRule for that. NOTE: no action is taking with existing, connected switches. This operation will only affect future connections
 * @param mode the connectMode to use. A Null value is a No-Op and can be used to return existing value.
 * @return the value of the toggle in Floodlight.
 */
@ApiOperation(value="String_Node_Str",response=ConnectModeRequest.Mode.class) @PutMapping(value="String_Node_Str",produces=MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity toggleSwitchConnectMode(@RequestParam("String_Node_Str") ConnectModeRequest.Mode mode){
  ConnectModeRequest.Mode response=switchService.connectMode(mode);
  return ResponseEntity.ok(response);
}

Fixed version (ground truth):
/** 
 * Toggle the global behavior of Floodlight when the switch connects: - AUTO - this is the default. Installs all default rules when a switch connects - SAFE - add the default rules slowly .. monitoring traffic on existing rules - MANUAL - don't install any default rules. Call addRule for that. NOTE: no action is taking with existing, connected switches. This operation will only affect future connections
 * @param mode the connectMode to use. A Null value is a No-Op and can be used to return existing value.
 * @return the value of the toggle in Floodlight.
 */
@ApiOperation(value="String_Node_Str",response=ConnectModeRequest.Mode.class) @PutMapping(value="String_Node_Str",produces=MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<ConnectModeRequest.Mode> toggleSwitchConnectMode(@RequestParam("String_Node_Str") ConnectModeRequest.Mode mode){
  ConnectModeRequest.Mode response=switchService.connectMode(mode);
  return ResponseEntity.ok(response);
}
Program: 37768
Project: 37768
Buggy source:
/** 
 * @param switchId
 * @return the list of rules on switch, specified what actions were applied.
 */
@ApiOperation(value="String_Node_Str",response=SyncRulesOutput.class) @ApiResponses(value={@ApiResponse(code=200,response=FlowPayload.class,message="String_Node_Str"),@ApiResponse(code=400,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=401,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=403,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=404,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=500,response=MessageError.class,message="String_Node_Str"),@ApiResponse(code=503,response=MessageError.class,message="String_Node_Str")}) @GetMapping(path="String_Node_Str") @ResponseStatus(HttpStatus.OK) public SyncRulesOutput syncRules(@PathVariable(name="String_Node_Str") String switchId){
  return switchService.syncRules(switchId);
}

Fixed version (ground truth):
/** 
 * @param switchId
 * @return the list of rules on switch, specified what actions were applied.
 */
@ApiOperation(value="String_Node_Str",response=SyncRulesOutput.class) @ApiResponse(code=200,response=SyncRulesOutput.class,message="String_Node_Str") @GetMapping(path="String_Node_Str") @ResponseStatus(HttpStatus.OK) public SyncRulesOutput syncRules(@PathVariable(name="String_Node_Str") String switchId){
  return switchService.syncRules(switchId);
}
Program: 37771
Project: 37771
Buggy source:
/** 
 * Gets path between source and destination switch.
 * @param flow {@link Flow} instances
 * @return {@link PathInfoData} instances
 */
ImmutablePair<PathInfoData,PathInfoData> getPath(Flow flow,Strategy strategy) throws UnroutablePathException ;

Fixed version (ground truth):
/** 
 * Gets path between source and destination switch.
 * @param flow {@link Flow} instances
 * @return {@link PathInfoData} instances
 */
ImmutablePair<PathInfoData,PathInfoData> getPath(Flow flow,Strategy strategy) throws UnroutablePathException, RecoverableException ;
Program: 37773
Project: 37773
Buggy source:
private void handleRestoreRequest(CommandMessage message,Tuple tuple) throws IOException {
  ImmutablePair<Flow,Flow> requestedFlow=((FlowRestoreRequest)message.getData()).getPayload();
  try {
    ImmutablePair<PathInfoData,PathInfoData> path=pathComputer.getPath(requestedFlow.getLeft(),Strategy.COST);
    logger.info("String_Node_Str",path);
    ImmutablePair<Flow,Flow> flow;
    if (flowCache.cacheContainsFlow(requestedFlow.getLeft().getFlowId())) {
      flow=flowCache.updateFlow(requestedFlow,path);
    }
 else {
      flow=flowCache.createFlow(requestedFlow,path);
    }
    logger.info("String_Node_Str",flow);
    Values topology=new Values(Utils.MAPPER.writeValueAsString(new FlowInfoData(requestedFlow.getLeft().getFlowId(),flow,UPDATE,message.getCorrelationId())));
    outputCollector.emit(StreamType.UPDATE.toString(),tuple,topology);
  }
 catch (  UnroutablePathException e) {
    throw new MessageException(message.getCorrelationId(),System.currentTimeMillis(),ErrorType.CREATION_FAILURE,"String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
private void handleRestoreRequest(CommandMessage message,Tuple tuple) throws IOException, RecoverableException {
  ImmutablePair<Flow,Flow> requestedFlow=((FlowRestoreRequest)message.getData()).getPayload();
  try {
    ImmutablePair<PathInfoData,PathInfoData> path=pathComputer.getPath(requestedFlow.getLeft(),Strategy.COST);
    logger.info("String_Node_Str",path);
    ImmutablePair<Flow,Flow> flow;
    if (flowCache.cacheContainsFlow(requestedFlow.getLeft().getFlowId())) {
      flow=flowCache.updateFlow(requestedFlow,path);
    }
 else {
      flow=flowCache.createFlow(requestedFlow,path);
    }
    logger.info("String_Node_Str",flow);
    Values topology=new Values(Utils.MAPPER.writeValueAsString(new FlowInfoData(requestedFlow.getLeft().getFlowId(),flow,UPDATE,message.getCorrelationId())));
    outputCollector.emit(StreamType.UPDATE.toString(),tuple,topology);
  }
 catch (  UnroutablePathException e) {
    throw new MessageException(message.getCorrelationId(),System.currentTimeMillis(),ErrorType.CREATION_FAILURE,"String_Node_Str","String_Node_Str");
  }
}
Program: 37775
Project: 37775
Buggy source:
private void handleUpdateRequest(CommandMessage message,Tuple tuple) throws IOException {
  Flow requestedFlow=((FlowUpdateRequest)message.getData()).getPayload();
  ImmutablePair<PathInfoData,PathInfoData> path;
  try {
    new FlowValidator(flowCache).checkFlowForEndpointConflicts(requestedFlow);
    path=pathComputer.getPath(requestedFlow,Strategy.COST);
    logger.info("String_Node_Str",path);
  }
 catch (  FlowValidationException e) {
    throw new MessageException(message.getCorrelationId(),System.currentTimeMillis(),ErrorType.UPDATE_FAILURE,"String_Node_Str",e.getMessage());
  }
catch (  UnroutablePathException e) {
    throw new MessageException(message.getCorrelationId(),System.currentTimeMillis(),ErrorType.UPDATE_FAILURE,"String_Node_Str","String_Node_Str");
  }
  ImmutablePair<Flow,Flow> flow=flowCache.updateFlow(requestedFlow,path);
  logger.info("String_Node_Str",flow);
  FlowInfoData data=new FlowInfoData(requestedFlow.getFlowId(),flow,UPDATE,message.getCorrelationId());
  InfoMessage infoMessage=new InfoMessage(data,System.currentTimeMillis(),message.getCorrelationId());
  Values topology=new Values(MAPPER.writeValueAsString(infoMessage));
  outputCollector.emit(StreamType.UPDATE.toString(),tuple,topology);
  Values northbound=new Values(new InfoMessage(new FlowResponse(buildFlowResponse(flow)),message.getTimestamp(),message.getCorrelationId(),Destination.NORTHBOUND));
  outputCollector.emit(StreamType.RESPONSE.toString(),tuple,northbound);
}

Fixed version (ground truth):
private void handleUpdateRequest(CommandMessage message,Tuple tuple) throws IOException, RecoverableException {
  Flow requestedFlow=((FlowUpdateRequest)message.getData()).getPayload();
  ImmutablePair<PathInfoData,PathInfoData> path;
  try {
    new FlowValidator(flowCache).checkFlowForEndpointConflicts(requestedFlow);
    path=pathComputer.getPath(requestedFlow,Strategy.COST);
    logger.info("String_Node_Str",path);
  }
 catch (  FlowValidationException e) {
    throw new MessageException(message.getCorrelationId(),System.currentTimeMillis(),ErrorType.UPDATE_FAILURE,"String_Node_Str",e.getMessage());
  }
catch (  UnroutablePathException e) {
    throw new MessageException(message.getCorrelationId(),System.currentTimeMillis(),ErrorType.UPDATE_FAILURE,"String_Node_Str","String_Node_Str");
  }
  ImmutablePair<Flow,Flow> flow=flowCache.updateFlow(requestedFlow,path);
  logger.info("String_Node_Str",flow);
  FlowInfoData data=new FlowInfoData(requestedFlow.getFlowId(),flow,UPDATE,message.getCorrelationId());
  InfoMessage infoMessage=new InfoMessage(data,System.currentTimeMillis(),message.getCorrelationId());
  Values topology=new Values(MAPPER.writeValueAsString(infoMessage));
  outputCollector.emit(StreamType.UPDATE.toString(),tuple,topology);
  Values northbound=new Values(new InfoMessage(new FlowResponse(buildFlowResponse(flow)),message.getTimestamp(),message.getCorrelationId(),Destination.NORTHBOUND));
  outputCollector.emit(StreamType.RESPONSE.toString(),tuple,northbound);
}
Program: 37776
Project: 37776
Buggy source:
private void handleCreateRequest(CommandMessage message,Tuple tuple) throws IOException {
  Flow requestedFlow=((FlowCreateRequest)message.getData()).getPayload();
  ImmutablePair<PathInfoData,PathInfoData> path;
  try {
    new FlowValidator(flowCache).checkFlowForEndpointConflicts(requestedFlow);
    path=pathComputer.getPath(requestedFlow,Strategy.COST);
    logger.info("String_Node_Str",path);
  }
 catch (  FlowValidationException e) {
    throw new MessageException(message.getCorrelationId(),System.currentTimeMillis(),ErrorType.CREATION_FAILURE,"String_Node_Str",e.getMessage());
  }
catch (  UnroutablePathException e) {
    throw new MessageException(message.getCorrelationId(),System.currentTimeMillis(),ErrorType.CREATION_FAILURE,"String_Node_Str","String_Node_Str");
  }
  ImmutablePair<Flow,Flow> flow=flowCache.createFlow(requestedFlow,path);
  logger.info("String_Node_Str",flow);
  FlowInfoData data=new FlowInfoData(requestedFlow.getFlowId(),flow,FlowOperation.CREATE,message.getCorrelationId());
  InfoMessage infoMessage=new InfoMessage(data,System.currentTimeMillis(),message.getCorrelationId());
  Values topology=new Values(MAPPER.writeValueAsString(infoMessage));
  outputCollector.emit(StreamType.CREATE.toString(),tuple,topology);
  Values northbound=new Values(new InfoMessage(new FlowResponse(buildFlowResponse(flow)),message.getTimestamp(),message.getCorrelationId(),Destination.NORTHBOUND));
  outputCollector.emit(StreamType.RESPONSE.toString(),tuple,northbound);
}

Fixed version (ground truth):
private void handleCreateRequest(CommandMessage message,Tuple tuple) throws IOException, RecoverableException {
  Flow requestedFlow=((FlowCreateRequest)message.getData()).getPayload();
  ImmutablePair<PathInfoData,PathInfoData> path;
  try {
    new FlowValidator(flowCache).checkFlowForEndpointConflicts(requestedFlow);
    path=pathComputer.getPath(requestedFlow,Strategy.COST);
    logger.info("String_Node_Str",path);
  }
 catch (  FlowValidationException e) {
    throw new MessageException(message.getCorrelationId(),System.currentTimeMillis(),ErrorType.CREATION_FAILURE,"String_Node_Str",e.getMessage());
  }
catch (  UnroutablePathException e) {
    throw new MessageException(message.getCorrelationId(),System.currentTimeMillis(),ErrorType.CREATION_FAILURE,"String_Node_Str","String_Node_Str");
  }
  ImmutablePair<Flow,Flow> flow=flowCache.createFlow(requestedFlow,path);
  logger.info("String_Node_Str",flow);
  FlowInfoData data=new FlowInfoData(requestedFlow.getFlowId(),flow,FlowOperation.CREATE,message.getCorrelationId());
  InfoMessage infoMessage=new InfoMessage(data,System.currentTimeMillis(),message.getCorrelationId());
  Values topology=new Values(MAPPER.writeValueAsString(infoMessage));
  outputCollector.emit(StreamType.CREATE.toString(),tuple,topology);
  Values northbound=new Values(new InfoMessage(new FlowResponse(buildFlowResponse(flow)),message.getTimestamp(),message.getCorrelationId(),Destination.NORTHBOUND));
  outputCollector.emit(StreamType.RESPONSE.toString(),tuple,northbound);
}
Program: 37777
Project: 37777
Buggy source:
@Then("String_Node_Str") public void flowPathCorrect(String flowId,String sourceSwitch,int sourcePort,int sourceVlan,String destinationSwitch,int destinationPort,int destinationVlan,int bandwidth) throws UnroutablePathException, InterruptedException {
  Flow flow=new Flow(FlowUtils.getFlowName(flowId),bandwidth,false,flowId,sourceSwitch,sourcePort,sourceVlan,destinationSwitch,destinationPort,destinationVlan);
  ImmutablePair<PathInfoData,PathInfoData> path=FlowUtils.getFlowPath(flow);
  System.out.println(path);
  assertEquals(expectedShortestPath,path);
}

Fixed version (ground truth):
@Then("String_Node_Str") public void flowPathCorrect(String flowId,String sourceSwitch,int sourcePort,int sourceVlan,String destinationSwitch,int destinationPort,int destinationVlan,int bandwidth) throws UnroutablePathException, InterruptedException, RecoverableException {
  Flow flow=new Flow(FlowUtils.getFlowName(flowId),bandwidth,false,flowId,sourceSwitch,sourcePort,sourceVlan,destinationSwitch,destinationPort,destinationVlan);
  ImmutablePair<PathInfoData,PathInfoData> path=FlowUtils.getFlowPath(flow);
  System.out.println(path);
  assertEquals(expectedShortestPath,path);
}
Program: 37778
Project: 37778
Buggy source:
/** 
 * Gets flow path.
 * @param flow flow
 * @return flow path
 */
public static ImmutablePair<PathInfoData,PathInfoData> getFlowPath(Flow flow) throws InterruptedException, UnroutablePathException {
  Thread.sleep(1000);
  return pathComputer.getPath(flow,PathComputer.Strategy.COST);
}

Fixed version (ground truth):
/** 
 * Gets flow path.
 * @param flow flow
 * @return flow path
 */
public static ImmutablePair<PathInfoData,PathInfoData> getFlowPath(Flow flow) throws InterruptedException, UnroutablePathException, RecoverableException {
  Thread.sleep(1000);
  return pathComputer.getPath(flow,PathComputer.Strategy.COST);
}
Program: 37779
Project: 37779
Buggy source:
@Test public void testGetPathByCostInactiveOnTriangleTopo() throws UnroutablePathException {
  createTriangleTopo("String_Node_Str",10,20);
  Driver driver=GraphDatabase.driver("String_Node_Str",AuthTokens.basic("String_Node_Str","String_Node_Str"));
  NeoDriver nd=new NeoDriver(driver);
  Flow f=new Flow();
  f.setSourceSwitch("String_Node_Str");
  f.setDestinationSwitch("String_Node_Str");
  f.setBandwidth(100);
  ImmutablePair<PathInfoData,PathInfoData> path=nd.getPath(f,PathComputer.Strategy.COST);
  Assert.assertNotNull(path);
  Assert.assertEquals(4,path.left.getPath().size());
  Assert.assertEquals("String_Node_Str",path.left.getPath().get(1).getSwitchId());
}

Fixed version (ground truth):
@Test public void testGetPathByCostInactiveOnTriangleTopo() throws UnroutablePathException, RecoverableException {
  createTriangleTopo("String_Node_Str",10,20);
  Driver driver=GraphDatabase.driver("String_Node_Str",AuthTokens.basic("String_Node_Str","String_Node_Str"));
  NeoDriver nd=new NeoDriver(driver);
  Flow f=new Flow();
  f.setSourceSwitch("String_Node_Str");
  f.setDestinationSwitch("String_Node_Str");
  f.setBandwidth(100);
  ImmutablePair<PathInfoData,PathInfoData> path=nd.getPath(f,PathComputer.Strategy.COST);
  Assert.assertNotNull(path);
  Assert.assertEquals(4,path.left.getPath().size());
  Assert.assertEquals("String_Node_Str",path.left.getPath().get(1).getSwitchId());
}
Program: 37780
Project: 37780
Buggy source:
@Test public void testGetPathByCostNoCost() throws UnroutablePathException {
  createDiamond("String_Node_Str","String_Node_Str",-1,2000);
  Driver driver=GraphDatabase.driver("String_Node_Str",AuthTokens.basic("String_Node_Str","String_Node_Str"));
  NeoDriver nd=new NeoDriver(driver);
  Flow f=new Flow();
  f.setSourceSwitch("String_Node_Str");
  f.setDestinationSwitch("String_Node_Str");
  f.setBandwidth(100);
  ImmutablePair<PathInfoData,PathInfoData> path=nd.getPath(f,PathComputer.Strategy.COST);
  Assert.assertNotNull(path);
  Assert.assertEquals(4,path.left.getPath().size());
  Assert.assertEquals("String_Node_Str",path.left.getPath().get(1).getSwitchId());
}

Fixed version (ground truth):
@Test public void testGetPathByCostNoCost() throws UnroutablePathException, RecoverableException {
  createDiamond("String_Node_Str","String_Node_Str",-1,2000);
  Driver driver=GraphDatabase.driver("String_Node_Str",AuthTokens.basic("String_Node_Str","String_Node_Str"));
  NeoDriver nd=new NeoDriver(driver);
  Flow f=new Flow();
  f.setSourceSwitch("String_Node_Str");
  f.setDestinationSwitch("String_Node_Str");
  f.setBandwidth(100);
  ImmutablePair<PathInfoData,PathInfoData> path=nd.getPath(f,PathComputer.Strategy.COST);
  Assert.assertNotNull(path);
  Assert.assertEquals(4,path.left.getPath().size());
  Assert.assertEquals("String_Node_Str",path.left.getPath().get(1).getSwitchId());
}
Program: 37781
Project: 37781
Buggy source:
@Test public void testGetPathByCostActive() throws UnroutablePathException {
  createDiamond("String_Node_Str","String_Node_Str",10,20);
  Driver driver=GraphDatabase.driver("String_Node_Str",AuthTokens.basic("String_Node_Str","String_Node_Str"));
  NeoDriver nd=new NeoDriver(driver);
  Flow f=new Flow();
  f.setSourceSwitch("String_Node_Str");
  f.setDestinationSwitch("String_Node_Str");
  f.setBandwidth(100);
  ImmutablePair<PathInfoData,PathInfoData> path=nd.getPath(f,PathComputer.Strategy.COST);
  Assert.assertNotNull(path);
  Assert.assertEquals(4,path.left.getPath().size());
  Assert.assertEquals("String_Node_Str",path.left.getPath().get(1).getSwitchId());
}

Fixed version (ground truth):
@Test public void testGetPathByCostActive() throws UnroutablePathException, RecoverableException {
  createDiamond("String_Node_Str","String_Node_Str",10,20);
  Driver driver=GraphDatabase.driver("String_Node_Str",AuthTokens.basic("String_Node_Str","String_Node_Str"));
  NeoDriver nd=new NeoDriver(driver);
  Flow f=new Flow();
  f.setSourceSwitch("String_Node_Str");
  f.setDestinationSwitch("String_Node_Str");
  f.setBandwidth(100);
  ImmutablePair<PathInfoData,PathInfoData> path=nd.getPath(f,PathComputer.Strategy.COST);
  Assert.assertNotNull(path);
  Assert.assertEquals(4,path.left.getPath().size());
  Assert.assertEquals("String_Node_Str",path.left.getPath().get(1).getSwitchId());
}
Program: 37782
Project: 37782
Buggy source:
@Test public void testGetPathByCostInactive() throws UnroutablePathException {
  createDiamond("String_Node_Str","String_Node_Str",10,20);
  Driver driver=GraphDatabase.driver("String_Node_Str",AuthTokens.basic("String_Node_Str","String_Node_Str"));
  NeoDriver nd=new NeoDriver(driver);
  Flow f=new Flow();
  f.setSourceSwitch("String_Node_Str");
  f.setDestinationSwitch("String_Node_Str");
  f.setBandwidth(100);
  ImmutablePair<PathInfoData,PathInfoData> path=nd.getPath(f,PathComputer.Strategy.COST);
  Assert.assertNotNull(path);
  Assert.assertEquals(4,path.left.getPath().size());
  Assert.assertEquals("String_Node_Str",path.left.getPath().get(1).getSwitchId());
}

Fixed version (ground truth):
@Test public void testGetPathByCostInactive() throws UnroutablePathException, RecoverableException {
  createDiamond("String_Node_Str","String_Node_Str",10,20);
  Driver driver=GraphDatabase.driver("String_Node_Str",AuthTokens.basic("String_Node_Str","String_Node_Str"));
  NeoDriver nd=new NeoDriver(driver);
  Flow f=new Flow();
  f.setSourceSwitch("String_Node_Str");
  f.setDestinationSwitch("String_Node_Str");
  f.setBandwidth(100);
  ImmutablePair<PathInfoData,PathInfoData> path=nd.getPath(f,PathComputer.Strategy.COST);
  Assert.assertNotNull(path);
  Assert.assertEquals(4,path.left.getPath().size());
  Assert.assertEquals("String_Node_Str",path.left.getPath().get(1).getSwitchId());
}
Program: 37783
Project: 37783
Buggy source:
@Test(expected=UnroutablePathException.class) public void testGetPathNoPath() throws UnroutablePathException {
  createDiamond("String_Node_Str","String_Node_Str",10,30);
  Driver driver=GraphDatabase.driver("String_Node_Str",AuthTokens.basic("String_Node_Str","String_Node_Str"));
  NeoDriver nd=new NeoDriver(driver);
  Flow f=new Flow();
  f.setSourceSwitch("String_Node_Str");
  f.setDestinationSwitch("String_Node_Str");
  f.setBandwidth(100);
  ImmutablePair<PathInfoData,PathInfoData> path=nd.getPath(f,PathComputer.Strategy.COST);
}

Fixed version (ground truth):
@Test(expected=UnroutablePathException.class) public void testGetPathNoPath() throws UnroutablePathException, RecoverableException {
  createDiamond("String_Node_Str","String_Node_Str",10,30);
  Driver driver=GraphDatabase.driver("String_Node_Str",AuthTokens.basic("String_Node_Str","String_Node_Str"));
  NeoDriver nd=new NeoDriver(driver);
  Flow f=new Flow();
  f.setSourceSwitch("String_Node_Str");
  f.setDestinationSwitch("String_Node_Str");
  f.setBandwidth(100);
  ImmutablePair<PathInfoData,PathInfoData> path=nd.getPath(f,PathComputer.Strategy.COST);
}
Program: 37784
Project: 37784
Buggy source:
/** 
 * Creates or updates   {@link SwitchInfoData} instance.
 * @param newSwitch {@link SwitchInfoData} instance
 * @return created {@link SwitchInfoData} instance
 * @throws CacheException if {@link SwitchInfoData} instance with specified id already exists
 */
public SwitchInfoData createOrUpdateSwitch(SwitchInfoData newSwitch){
  logger.debug("String_Node_Str",newSwitch);
  if (cacheContainsSwitch(newSwitch.getSwitchId())) {
    return updateSwitch(newSwitch);
  }
 else {
    return createSwitch(newSwitch);
  }
}

Fixed version (ground truth):
/** 
 * Creates or updates   {@link SwitchInfoData} instance.
 * @param newSwitch {@link SwitchInfoData} instance
 * @return created {@link SwitchInfoData} instance
 * @throws CacheException if {@link SwitchInfoData} instance with specified id already exists
 */
public SwitchInfoData createOrUpdateSwitch(SwitchInfoData newSwitch){
  logger.debug("String_Node_Str",newSwitch);
  if (newSwitch == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (cacheContainsSwitch(newSwitch.getSwitchId())) {
    return updateSwitch(newSwitch);
  }
 else {
    return createSwitch(newSwitch);
  }
}
Program: 37785
Project: 37785
Buggy source:
/** 
 * Creates   {@link IslInfoData} instance.
 * @param isl {@link IslInfoData} instance
 * @return {@link IslInfoData} instance previously associated with {@link IslInfoData} instance id or null otherwise
 * @throws CacheException if {@link SwitchInfoData} related to {@link IslInfoData} instance do not exist
 */
public IslInfoData createOrUpdateIsl(IslInfoData isl){
  logger.debug("String_Node_Str",isl);
  if (cacheContainsIsl(isl.getId())) {
    return updateIsl(isl);
  }
 else {
    return createIsl(isl);
  }
}

Fixed version (ground truth):
/** 
 * Creates   {@link IslInfoData} instance.
 * @param isl {@link IslInfoData} instance
 * @return {@link IslInfoData} instance previously associated with {@link IslInfoData} instance id or null otherwise
 * @throws CacheException if {@link SwitchInfoData} related to {@link IslInfoData} instance do not exist
 */
public IslInfoData createOrUpdateIsl(IslInfoData isl){
  logger.debug("String_Node_Str",isl);
  if (isl == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (cacheContainsIsl(isl.getId())) {
    return updateIsl(isl);
  }
 else {
    return createIsl(isl);
  }
}
Program: 37786
Project: 37786
Buggy source:
@Override public List<IslInfoData> getIsls(){
  String q="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  logger.debug("String_Node_Str",q);
  Session session=driver.session();
  StatementResult queryResults=session.run(q);
  List<IslInfoData> results=new LinkedList<>();
  for (  Record record : queryResults.list()) {
    IslInfoData isl=new IslInfoData();
    List<PathNode> pathNodes=new ArrayList<>();
    PathNode src=new PathNode();
    src.setSwitchId(record.get("String_Node_Str").asString());
    src.setPortNo(record.get("String_Node_Str").asInt());
    pathNodes.add(src);
    PathNode dst=new PathNode();
    dst.setSwitchId(record.get("String_Node_Str").asString());
    dst.setPortNo(record.get("String_Node_Str").asInt());
    pathNodes.add(dst);
    isl.setPath(pathNodes);
    isl.setSpeed(record.get("String_Node_Str").asInt());
    isl.setLatency(record.get("String_Node_Str").asInt());
    isl.setAvailableBandwidth(record.get("String_Node_Str").asInt());
    String status=record.get("String_Node_Str").asString();
    IslChangeType ct=("String_Node_Str".equals(status)) ? IslChangeType.DISCOVERED : IslChangeType.FAILED;
    isl.setState(ct);
    isl.setTimestamp(System.currentTimeMillis());
    results.add(isl);
  }
  return results;
}

Fixed version (ground truth):
@Override public List<IslInfoData> getIsls(){
  String q="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  logger.debug("String_Node_Str",q);
  Session session=driver.session();
  StatementResult queryResults=session.run(q);
  List<IslInfoData> results=new LinkedList<>();
  for (  Record record : queryResults.list()) {
    IslInfoData isl=new IslInfoData();
    List<PathNode> pathNodes=new ArrayList<>();
    PathNode src=new PathNode();
    src.setSwitchId(record.get("String_Node_Str").asString());
    src.setPortNo(record.get("String_Node_Str").asInt());
    src.setSegLatency(record.get("String_Node_Str").asInt());
    pathNodes.add(src);
    PathNode dst=new PathNode();
    dst.setSwitchId(record.get("String_Node_Str").asString());
    dst.setPortNo(record.get("String_Node_Str").asInt());
    dst.setSegLatency(record.get("String_Node_Str").asInt());
    pathNodes.add(dst);
    isl.setPath(pathNodes);
    isl.setSpeed(record.get("String_Node_Str").asInt());
    isl.setLatency(record.get("String_Node_Str").asInt());
    isl.setAvailableBandwidth(record.get("String_Node_Str").asInt());
    String status=record.get("String_Node_Str").asString();
    IslChangeType ct=("String_Node_Str".equals(status)) ? IslChangeType.DISCOVERED : IslChangeType.FAILED;
    isl.setState(ct);
    isl.setTimestamp(System.currentTimeMillis());
    results.add(isl);
  }
  return results;
}