nus-yam/ex-repair huggingface dataset:
Program: 37855
Project: 37855
Buggy source:
@Test public void getFlowName() throws Exception {
  assertEquals(flowName,flow.getCookie());
}

Fixed version (ground truth):
@Test public void getFlowName() throws Exception {
  assertEquals(flowName,flow.getFlowName());
}
Program: 37856
Project: 37856
Buggy source:
/** 
 * Instance constructor.
 * @param flowName        name of the flow
 * @param switchId        switch ID for flow installation
 * @param inputPort       input port of the flow
 * @param outputPort      output port of the flow
 * @param inputVlanId     input vlan id value
 * @param outputVlanId    output vlan id value
 * @param outputVlanType  output vlan tag action
 * @param bandwidth       flow bandwidth
 * @param inputMeterId    allocated meter id
 * @param outputMeterId   allocated meter id
 * @throws IllegalArgumentException if any of arguments is null
 */
@JsonCreator public InstallOneSwitchFlowCommandData(@JsonProperty("String_Node_Str") String cookie,@JsonProperty("String_Node_Str") String switchId,@JsonProperty("String_Node_Str") Number inputPort,@JsonProperty("String_Node_Str") Number outputPort,@JsonProperty("String_Node_Str") Number inputVlanId,@JsonProperty("String_Node_Str") Number outputVlanId,@JsonProperty("String_Node_Str") OutputVlanType outputVlanType,@JsonProperty("String_Node_Str") Number bandwidth,@JsonProperty("String_Node_Str") Number inputMeterId,@JsonProperty("String_Node_Str") Number outputMeterId){
  super(cookie,switchId,inputPort,outputPort);
  setInputVlanId(inputVlanId);
  setOutputVlanId(outputVlanId);
  setOutputVlanType(outputVlanType);
  setBandwidth(bandwidth);
  setInputMeterId(inputMeterId);
  setOutputMeterId(outputMeterId);
}

Fixed version (ground truth):
/** 
 * Instance constructor.
 * @param flowName        name of the flow
 * @param switchId        switch ID for flow installation
 * @param inputPort       input port of the flow
 * @param outputPort      output port of the flow
 * @param inputVlanId     input vlan id value
 * @param outputVlanId    output vlan id value
 * @param outputVlanType  output vlan tag action
 * @param bandwidth       flow bandwidth
 * @param inputMeterId    allocated meter id
 * @param outputMeterId   allocated meter id
 * @throws IllegalArgumentException if any of arguments is null
 */
@JsonCreator public InstallOneSwitchFlowCommandData(@JsonProperty("String_Node_Str") String flowName,@JsonProperty("String_Node_Str") String switchId,@JsonProperty("String_Node_Str") Number inputPort,@JsonProperty("String_Node_Str") Number outputPort,@JsonProperty("String_Node_Str") Number inputVlanId,@JsonProperty("String_Node_Str") Number outputVlanId,@JsonProperty("String_Node_Str") OutputVlanType outputVlanType,@JsonProperty("String_Node_Str") Number bandwidth,@JsonProperty("String_Node_Str") Number inputMeterId,@JsonProperty("String_Node_Str") Number outputMeterId){
  super(flowName,switchId,inputPort,outputPort);
  setInputVlanId(inputVlanId);
  setOutputVlanId(outputVlanId);
  setOutputVlanType(outputVlanType);
  setBandwidth(bandwidth);
  setInputMeterId(inputMeterId);
  setOutputMeterId(outputMeterId);
}
Program: 37857
Project: 37857
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  return toStringHelper(this).addValue(cookie).addValue(switchId).addValue(inputPort).addValue(outputPort).addValue(inputVlanId).addValue(outputVlanId).addValue(outputVlanType).addValue(bandwidth).addValue(inputMeterId).addValue(outputMeterId).toString();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  return toStringHelper(this).addValue(flowName).addValue(switchId).addValue(inputPort).addValue(outputPort).addValue(inputVlanId).addValue(outputVlanId).addValue(outputVlanType).addValue(bandwidth).addValue(inputMeterId).addValue(outputMeterId).toString();
}
Program: 37858
Project: 37858
Buggy source:
/** 
 * The data field holds the "message_type" and "state" fields.
 * @param root the "data" field of an "INFO" message
 */
private void splitInfoMessage(Map<String,?> root,Tuple tuple) throws JsonProcessingException {
  Values dataVal=new Values("String_Node_Str",new ObjectMapper().writeValueAsString(root));
  String key=((String)root.get("String_Node_Str")).toLowerCase();
  String state=(String)root.get("String_Node_Str");
switch (key) {
case "String_Node_Str":
    _collector.emit(I_SWITCH,tuple,dataVal);
  logger.debug("String_Node_Str",I_SWITCH,dataVal);
if (state.equals("String_Node_Str") || state.equals("String_Node_Str")) {
  _collector.emit(I_SWITCH_UPDOWN,tuple,dataVal);
  logger.debug("String_Node_Str",I_SWITCH_UPDOWN,dataVal);
}
 else {
  _collector.emit(I_SWITCH_OTHER,tuple,dataVal);
  logger.debug("String_Node_Str",I_SWITCH_OTHER,dataVal);
}
break;
case "String_Node_Str":
_collector.emit(I_PORT,tuple,dataVal);
if (state.equals("String_Node_Str") || state.equals("String_Node_Str")) {
_collector.emit(I_PORT_UPDOWN,tuple,dataVal);
}
 else {
_collector.emit(I_PORT_OTHER,tuple,dataVal);
}
break;
case "String_Node_Str":
_collector.emit(I_ISL,tuple,dataVal);
if (state.equals("String_Node_Str") || state.equals("String_Node_Str")) {
_collector.emit(I_ISL_UPDOWN,tuple,dataVal);
}
 else {
_collector.emit(I_ISL_OTHER,tuple,dataVal);
}
break;
default :
_collector.emit(I_OTHER,tuple,dataVal);
logger.warn("String_Node_Str",key,root);
}
}

Fixed version (ground truth):
/** 
 * The data field holds the "message_type" and "state" fields.
 * @param root the "data" field of an "INFO" message
 */
private void splitInfoMessage(Map<String,?> root,Tuple tuple) throws JsonProcessingException {
  Values dataVal=new Values("String_Node_Str",new ObjectMapper().writeValueAsString(root));
  String key=((String)root.get("String_Node_Str")).toLowerCase();
  String state=(String)root.get("String_Node_Str");
switch (key) {
case "String_Node_Str":
    _collector.emit(I_SWITCH,tuple,dataVal);
  logger.debug("String_Node_Str",I_SWITCH,dataVal);
if (state.equals("String_Node_Str") || state.equals("String_Node_Str")) {
  _collector.emit(I_SWITCH_UPDOWN,tuple,dataVal);
  logger.debug("String_Node_Str",I_SWITCH_UPDOWN,dataVal);
}
 else {
  _collector.emit(I_SWITCH_OTHER,tuple,dataVal);
  logger.debug("String_Node_Str",I_SWITCH_OTHER,dataVal);
}
break;
case "String_Node_Str":
_collector.emit(I_PORT,tuple,dataVal);
logger.debug("String_Node_Str",I_PORT,dataVal);
if (state.equals("String_Node_Str") || state.equals("String_Node_Str")) {
_collector.emit(I_PORT_UPDOWN,tuple,dataVal);
}
 else {
_collector.emit(I_PORT_OTHER,tuple,dataVal);
}
break;
case "String_Node_Str":
_collector.emit(I_ISL,tuple,dataVal);
logger.debug("String_Node_Str",I_ISL,dataVal);
if (state != null && (state.equals("String_Node_Str") || state.equals("String_Node_Str"))) {
_collector.emit(I_ISL_UPDOWN,tuple,dataVal);
}
 else {
_collector.emit(I_ISL_OTHER,tuple,dataVal);
}
break;
default :
_collector.emit(I_OTHER,tuple,dataVal);
logger.warn("String_Node_Str",key,root);
}
}
Program: 37859
Project: 37859
Buggy source:
/** 
 * This will create all of the topics passed in. - Currently doesn't check to see if they already exist.
 */
public void createTopics(String[] topics,int partitions,int replication){
  int sessionTimeoutMs=5 * 1000;
  int connectionTimeoutMs=5 * 1000;
  ZkClient zkClient=new ZkClient(zookeeperHost,sessionTimeoutMs,connectionTimeoutMs,ZKStringSerializer$.MODULE$);
  boolean isSecureKafkaCluster=false;
  ZkUtils zkUtils=new ZkUtils(zkClient,new ZkConnection(zookeeperHost),isSecureKafkaCluster);
  Properties topicConfig=new Properties();
  for (  String topic : topics) {
    AdminUtils.createTopic(zkUtils,topic,partitions,replication,topicConfig,RackAwareMode.Disabled$.MODULE$);
  }
  zkClient.close();
}

Fixed version (ground truth):
/** 
 * Create the topic, using the default setting for Partitions and Replication
 */
public void createTopics(String[] topics){
  createTopics(topics,1,1);
}
Program: 37860
Project: 37860
Buggy source:
public void primeKafkaTopic(String topic){
  kProducer.send(new ProducerRecord<>(topic,"String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void primeKafkaTopic(String topic){
  if (!kutils.topicExists(topic)) {
    kutils.createTopics(new String[]{topic});
  }
}
Program: 37861
Project: 37861
Buggy source:
public StormTopology createTopology(){
  logger.debug("String_Node_Str" + this.getClass().getSimpleName());
  TopologyBuilder builder=new TopologyBuilder();
  BoltDeclarer kbolt=builder.setBolt(kafkaOutputTopic + "String_Node_Str",kutils.createKafkaBolt(kafkaOutputTopic),parallelism);
  BoltDeclarer[] tbolt=new BoltDeclarer[bolts.length];
  for (int i=0; i < topics.length; i++) {
    String topic=topics[i];
    String spoutName=topic + "String_Node_Str";
    String boltName=topic + "String_Node_Str";
    builder.setSpout(spoutName,kutils.createKafkaSpout(topic));
    tbolt[i]=builder.setBolt(boltName,bolts[i],parallelism).shuffleGrouping(spoutName);
    kbolt=kbolt.shuffleGrouping(boltName,kafkaOutputTopic);
  }
  tbolt[2].shuffleGrouping(topics[0] + "String_Node_Str",kafkaOutputTopic).shuffleGrouping(topics[1] + "String_Node_Str",kafkaOutputTopic);
  String discoTopic=((OFELinkBolt)bolts[2]).islDiscoTopic;
  builder.setBolt("String_Node_Str",kutils.createKafkaBolt(discoTopic),parallelism).shuffleGrouping(topics[2] + "String_Node_Str",discoTopic);
  return builder.createTopology();
}

Fixed version (ground truth):
public StormTopology createTopology(){
  logger.debug("String_Node_Str" + this.getClass().getSimpleName());
  TopologyBuilder builder=new TopologyBuilder();
  primeTopic(kafkaOutputTopic);
  BoltDeclarer kbolt=builder.setBolt(kafkaOutputTopic + "String_Node_Str",kutils.createKafkaBolt(kafkaOutputTopic),parallelism);
  BoltDeclarer[] tbolt=new BoltDeclarer[bolts.length];
  for (int i=0; i < topics.length; i++) {
    String topic=topics[i];
    String spoutName=topic + "String_Node_Str";
    String boltName=topic + "String_Node_Str";
    primeTopic(topic);
    builder.setSpout(spoutName,kutils.createKafkaSpout(topic));
    tbolt[i]=builder.setBolt(boltName,bolts[i],parallelism).shuffleGrouping(spoutName);
    kbolt=kbolt.shuffleGrouping(boltName,kafkaOutputTopic);
  }
  tbolt[2].shuffleGrouping(topics[0] + "String_Node_Str",kafkaOutputTopic).shuffleGrouping(topics[1] + "String_Node_Str",kafkaOutputTopic);
  String discoTopic=((OFELinkBolt)bolts[2]).islDiscoTopic;
  builder.setBolt("String_Node_Str",kutils.createKafkaBolt(discoTopic),parallelism).shuffleGrouping(topics[2] + "String_Node_Str",discoTopic);
  return builder.createTopology();
}
Program: 37862
Project: 37862
Buggy source:
private List<Flow> loadFlows(String whereClause){
  String q="String_Node_Str" + whereClause + "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"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  logger.debug("String_Node_Str",q);
  try (Session session=driver.session(AccessMode.READ)){
    StatementResult queryResults=session.run(q);
    List<Flow> results=new ArrayList<>();
    for (    Record record : queryResults.list()) {
      FlowAdapter adapter=new FlowAdapter(record);
      results.add(adapter.getFlow());
    }
    return results;
  }
 }

Fixed version (ground truth):
private List<Flow> loadFlows(String whereClause,Value parameters){
  String q="String_Node_Str" + whereClause + "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"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  logger.debug("String_Node_Str",q);
  try (Session session=driver.session(AccessMode.READ)){
    StatementResult queryResults=session.run(q,parameters);
    List<Flow> results=new ArrayList<>();
    for (    Record record : queryResults.list()) {
      FlowAdapter adapter=new FlowAdapter(record);
      results.add(adapter.getFlow());
    }
    return results;
  }
 }
Program: 37863
Project: 37863
Buggy source:
@Override public List<Flow> getFlows(String flowId){
  String where="String_Node_Str" + flowId + "String_Node_Str";
  return loadFlows(where);
}

Fixed version (ground truth):
@Override public List<Flow> getFlows(String flowId){
  String where="String_Node_Str";
  Value parameters=Values.parameters("String_Node_Str",flowId);
  return loadFlows(where,parameters);
}
Program: 37864
Project: 37864
Buggy source:
@Override public List<Flow> getAllFlows(){
  String noWhere="String_Node_Str";
  return loadFlows(noWhere);
}

Fixed version (ground truth):
@Override public List<Flow> getAllFlows(){
  String noWhere="String_Node_Str";
  return loadFlows(noWhere,null);
}
Program: 37865
Project: 37865
Buggy source:
@Given("String_Node_Str") public void selectARandomSwitch(String switchAlias){
  List<Switch> switches=getUnaliasedSwitches();
  Random r=new Random();
  Switch theSwitch=switches.get(r.nextInt(switches.size()));
  log.info("String_Node_Str",theSwitch.getDpId());
  topologyUnderTest.addAlias(switchAlias,theSwitch);
}

Fixed version (ground truth):
@Given("String_Node_Str") public void selectARandomSwitch(String switchAlias){
  List<Switch> switches=getUnaliasedSwitches();
  Assume.assumeFalse("String_Node_Str",CollectionUtils.isEmpty(switches));
  Switch theSwitch=switches.get(0);
  log.info("String_Node_Str",theSwitch.getDpId());
  topologyUnderTest.addAlias(switchAlias,theSwitch);
}
Program: 37866
Project: 37866
Buggy source:
/** 
 * Checks if discovery should be suspended for that link.
 * @return true if link should be excluded from discovery plan and discovery packets should not be sent.
 */
public boolean isNewAttemptAllowed(){
  if (consecutiveFailureLimit == ENDLESS_ATTEMPTS) {
    return true;
  }
  return consecutiveFailure < consecutiveFailureLimit;
}

Fixed version (ground truth):
/** 
 * Checks if discovery should be suspended for that link or we can try to discover it.
 * @return true if link should be excluded from discovery plan and discovery packets should not be sent.
 */
public boolean isNewAttemptAllowed(){
  if (consecutiveFailureLimit == ENDLESS_ATTEMPTS) {
    return true;
  }
  return consecutiveFailure < consecutiveFailureLimit;
}
Program: 37867
Project: 37867
Buggy source:
/** 
 * This helper function is used with getPath(hint) to confirm the hint path exists 
 */
private SearchNode confirmIsls(List<SimpleIsl> srcIsls){
  int totalCost=0;
  LinkedList<SimpleIsl> confirmedIsls=new LinkedList<>();
  boolean validPath=true;
  for (  SimpleIsl i : srcIsls) {
    boolean foundThisOne=false;
    SimpleSwitch srcSwitch=network.getSimpleSwitch(i.src_dpid);
    if (srcSwitch != null) {
      Set<SimpleIsl> pathsToDst=safeSet(srcSwitch.outbound.get(i.dst_dpid));
      if (pathsToDst.equals(Collections.EMPTY_SET))       logger.debug("String_Node_Str",i.src_dpid,i.dst_dpid);
      for (      SimpleIsl orig : pathsToDst) {
        if (i.equals(orig)) {
          foundThisOne=true;
          confirmedIsls.add(orig);
          totalCost+=orig.cost;
          break;
        }
      }
    }
 else {
      logger.warn("String_Node_Str",i.src_dpid);
    }
    if (!foundThisOne) {
      validPath=false;
      break;
    }
  }
  if (validPath) {
    return new SearchNode(this.allowedDepth - confirmedIsls.size(),totalCost,network.getSimpleSwitch(confirmedIsls.peekLast().dst_dpid),confirmedIsls);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * This helper function is used with getPath(hint) to confirm the hint path exists. 
 */
private SearchNode confirmIsls(List<SimpleIsl> srcIsls){
  int totalCost=0;
  LinkedList<SimpleIsl> confirmedIsls=new LinkedList<>();
  boolean validPath=true;
  for (  SimpleIsl i : srcIsls) {
    boolean foundThisOne=false;
    SimpleSwitch srcSwitch=network.getSimpleSwitch(i.getSrcDpid());
    if (srcSwitch != null) {
      Set<SimpleIsl> pathsToDst=srcSwitch.outbound.get(i.getDstDpid());
      for (      SimpleIsl orig : pathsToDst) {
        if (i.equals(orig)) {
          foundThisOne=true;
          confirmedIsls.add(orig);
          totalCost+=orig.getCost();
          break;
        }
      }
    }
 else {
      logger.warn("String_Node_Str",i.getSrcDpid());
    }
    if (!foundThisOne) {
      validPath=false;
      break;
    }
  }
  if (validPath) {
    return new SearchNode(this.allowedDepth - confirmedIsls.size(),totalCost,network.getSimpleSwitch(confirmedIsls.peekLast().getDstDpid()),confirmedIsls);
  }
  return null;
}
Program: 37868
Project: 37868
Buggy source:
/** 
 * This helper function is used with getPath(hint) and will swap the src and dst of each isl in the list 
 */
private List<SimpleIsl> swapSrcDst(List<SimpleIsl> originalIsls){
  List<SimpleIsl> mirrorIsls=new ArrayList<>();
  for (  SimpleIsl original : originalIsls) {
    mirrorIsls.add(new SimpleIsl(original.dst_dpid,original.src_dpid,original.dst_port,original.src_port,original.cost,original.latency));
  }
  return mirrorIsls;
}

Fixed version (ground truth):
/** 
 * This helper function is used with getPath(hint) and will swap the src and dst of each isl in the list. 
 */
private List<SimpleIsl> swapSrcDst(List<SimpleIsl> originalIsls){
  List<SimpleIsl> mirrorIsls=new ArrayList<>();
  for (  SimpleIsl original : originalIsls) {
    mirrorIsls.add(new SimpleIsl(original.getDstDpid(),original.getSrcDpid(),original.getDstPort(),original.getSrcPort(),original.getCost(),original.getLatency()));
  }
  return mirrorIsls;
}
Program: 37869
Project: 37869
Buggy source:
public SearchNode addNode(SimpleIsl nextIsl){
  SearchNode newNode=this.clone();
  newNode.parentPath.add(nextIsl);
  newNode.dst_sw=network.getSimpleSwitch(nextIsl.dst_dpid);
  newNode.allowedDepth--;
  newNode.parentCost+=nextIsl.cost;
  return newNode;
}

Fixed version (ground truth):
SearchNode addNode(SimpleIsl nextIsl){
  SearchNode newNode=this.clone();
  newNode.parentPath.add(nextIsl);
  newNode.dstSw=network.getSimpleSwitch(nextIsl.getDstDpid());
  newNode.allowedDepth--;
  newNode.parentCost+=nextIsl.getCost();
  return newNode;
}
Program: 37871
Project: 37871
Buggy source:
@Override @SuppressWarnings("String_Node_Str") protected SearchNode clone(){
  return new SearchNode(allowedDepth,parentCost,dst_sw,(LinkedList<SimpleIsl>)parentPath.clone());
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") protected SearchNode clone(){
  return new SearchNode(allowedDepth,parentCost,dstSw,(LinkedList<SimpleIsl>)parentPath.clone());
}
Program: 37872
Project: 37872
Buggy source:
public SearchNode(int allowedDepth,int parentCost,SimpleSwitch dst_sw,LinkedList<SimpleIsl> parentPath){
  this.dst_sw=dst_sw;
  this.allowedDepth=allowedDepth;
  this.parentCost=parentCost;
  this.parentPath=parentPath;
}

Fixed version (ground truth):
SearchNode(int allowedDepth,int parentCost,SimpleSwitch dstSw,LinkedList<SimpleIsl> parentPath){
  this.dstSw=dstSw;
  this.allowedDepth=allowedDepth;
  this.parentCost=parentCost;
  this.parentPath=parentPath;
}
Program: 37873
Project: 37873
Buggy source:
public SimpleGetShortestPath(AvailableNetwork network,String src_dpid,String dst_dpid,int allowedDepth){
  this.network=network;
  this.start=network.getSwitches().get(src_dpid);
  this.end=network.getSwitches().get(dst_dpid);
  this.allowedDepth=allowedDepth;
  if (this.start == null)   logger.warn("String_Node_Str",src_dpid);
  if (this.end == null)   logger.warn("String_Node_Str",dst_dpid);
}

Fixed version (ground truth):
public SimpleGetShortestPath(AvailableNetwork network,String srcDpid,String dstDpid,int allowedDepth){
  this.network=network;
  this.start=network.getSwitches().get(srcDpid);
  this.end=network.getSwitches().get(dstDpid);
  this.allowedDepth=allowedDepth;
  if (this.start == null) {
    logger.warn("String_Node_Str",srcDpid);
  }
  if (this.end == null) {
    logger.warn("String_Node_Str",dstDpid);
  }
}
Program: 37874
Project: 37874
Buggy source:
/** 
 * Use this comparison if very strong equality is needed (most likely rare; probably only testing)
 * @return true if every field is the same.
 */
public boolean identical(Object o){
  if (this.equals(o)) {
    SimpleIsl simpleIsl=(SimpleIsl)o;
    return cost == simpleIsl.cost && latency == simpleIsl.latency;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Use this comparison if very strong equality is needed (most likely rare; probably only testing).
 * @return true if every field is the same.
 */
public boolean identical(Object o){
  if (this.equals(o)) {
    SimpleIsl simpleIsl=(SimpleIsl)o;
    return cost == simpleIsl.cost && latency == simpleIsl.latency;
  }
  return false;
}
Program: 37875
Project: 37875
Buggy source:
public SimpleIsl(String src_dpid,String dst_dpid,int src_port,int dst_port,int cost,int latency){
  this.src_dpid=src_dpid;
  this.dst_dpid=dst_dpid;
  this.src_port=src_port;
  this.dst_port=dst_port;
  this.cost=(cost == 0) ? DEFAULT_COST : cost;
  this.latency=latency;
}

Fixed version (ground truth):
public SimpleIsl(String srcDpid,String dstDpid,int srcPort,int dstPort,int cost,int latency){
  this.srcDpid=srcDpid;
  this.dstDpid=dstDpid;
  this.srcPort=srcPort;
  this.dstPort=dstPort;
  this.cost=(cost == 0) ? DEFAULT_COST : cost;
  this.latency=latency;
}
Program: 37876
Project: 37876
Buggy source:
public SimpleSwitch addOutbound(SimpleIsl isl){
  outbound.computeIfAbsent(isl.dst_dpid,newSet -> new HashSet<>()).add(isl);
  return this;
}

Fixed version (ground truth):
public SimpleSwitch addOutbound(SimpleIsl isl){
  outbound.computeIfAbsent(isl.getDstDpid(),newSet -> new HashSet<>()).add(isl);
  return this;
}
Program: 37877
Project: 37877
Buggy source:
@Builder @JsonCreator public LinkProps(@JsonProperty("String_Node_Str") NetworkEndpoint source,@JsonProperty("String_Node_Str") NetworkEndpoint dest,@JsonProperty("String_Node_Str") Map<String,String> props){
  this.source=source;
  this.dest=dest;
  this.props=props;
}

Fixed version (ground truth):
public LinkProps(NetworkEndpoint source,NetworkEndpoint dest,Map<String,String> props){
  this.source=source;
  this.dest=dest;
  this.props=props;
  this.created=null;
  this.modified=null;
}
Program: 37878
Project: 37878
Buggy source:
public boolean isReadRequest(){
  return this.getClass().isAnnotationPresent(ReadRequest.class);
}

Fixed version (ground truth):
@JsonIgnore public boolean isReadRequest(){
  return this.getClass().isAnnotationPresent(ReadRequest.class);
}
Program: 37879
Project: 37879
Buggy source:
public LinkPropsData(@JsonProperty("String_Node_Str") NetworkEndpoint source,@JsonProperty("String_Node_Str") NetworkEndpoint destination,@JsonProperty("String_Node_Str") Map<String,String> props){
  this.source=source;
  this.destination=destination;
  this.props=props;
}

Fixed version (ground truth):
public LinkPropsData(@JsonProperty("String_Node_Str") LinkProps linkProps){
  this.linkProps=linkProps;
}
Program: 37880
Project: 37880
Buggy source:
/** 
 * Produce   {@link LinkProps} object with predefined data.
 */
public static LinkProps makeSubject(){
  NetworkEndpoint source=new NetworkEndpoint("String_Node_Str",8);
  NetworkEndpoint dest=new NetworkEndpoint("String_Node_Str",9);
  HashMap<String,String> props=new HashMap<>();
  props.put("String_Node_Str","String_Node_Str");
  return new LinkProps(source,dest,props);
}

Fixed version (ground truth):
/** 
 * Produce   {@link LinkProps} object with predefined data.
 */
public static LinkProps makeSubject(){
  NetworkEndpoint source=new NetworkEndpoint("String_Node_Str",8);
  NetworkEndpoint dest=new NetworkEndpoint("String_Node_Str",9);
  HashMap<String,String> props=new HashMap<>();
  props.put("String_Node_Str","String_Node_Str");
  long created=System.currentTimeMillis();
  return new LinkProps(source,dest,props,created,created);
}
Program: 37881
Project: 37881
Buggy source:
/** 
 * Converts link properties to   {@link LinkPropsDto}.
 */
default LinkPropsDto toDto(LinkPropsData data){
  NetworkEndpoint source=data.getSource();
  NetworkEndpoint destination=data.getDestination();
  return new LinkPropsDto(source.getDatapath(),source.getPortNumber(),destination.getDatapath(),destination.getPortNumber(),data.getProps());
}

Fixed version (ground truth):
/** 
 * Converts link properties to   {@link LinkPropsDto}.
 */
default LinkPropsDto toDto(LinkPropsData data){
  requireNonNull(data.getLinkProps(),"String_Node_Str");
  NetworkEndpoint source=data.getLinkProps().getSource();
  NetworkEndpoint destination=data.getLinkProps().getDest();
  return new LinkPropsDto(source.getDatapath(),source.getPortNumber(),destination.getDatapath(),destination.getPortNumber(),data.getLinkProps().getProps());
}
Program: 37882
Project: 37882
Buggy source:
@Test public void shouldGetPropsList(){
  final String correlationId="String_Node_Str";
  LinkPropsData linkProps=new LinkPropsData(new NetworkEndpoint("String_Node_Str",1),new NetworkEndpoint("String_Node_Str",2),Collections.singletonMap("String_Node_Str","String_Node_Str"));
  Message message=new ChunkedInfoMessage(linkProps,0,correlationId,null);
  messageExchanger.mockResponse(message);
  RequestCorrelationId.create(correlationId);
  List<LinkPropsDto> result=linkService.getLinkProps(null,0,null,0);
  assertFalse("String_Node_Str",result.isEmpty());
  LinkPropsDto dto=result.get(0);
  assertThat(dto.getSrcSwitch(),is(linkProps.getSource().getDatapath()));
  assertThat(dto.getSrcPort(),is(linkProps.getSource().getPortNumber()));
  assertThat(dto.getDstSwitch(),is(linkProps.getDestination().getDatapath()));
  assertThat(dto.getDstPort(),is(linkProps.getDestination().getPortNumber()));
}

Fixed version (ground truth):
@Test public void shouldGetPropsList(){
  final String correlationId="String_Node_Str";
  LinkProps linkProps=new LinkProps(new NetworkEndpoint("String_Node_Str",1),new NetworkEndpoint("String_Node_Str",2),Collections.singletonMap("String_Node_Str","String_Node_Str"));
  LinkPropsData linkPropsData=new LinkPropsData(linkProps);
  Message message=new ChunkedInfoMessage(linkPropsData,0,correlationId,null);
  messageExchanger.mockResponse(message);
  RequestCorrelationId.create(correlationId);
  List<LinkPropsDto> result=linkService.getLinkProps(null,0,null,0);
  assertFalse("String_Node_Str",result.isEmpty());
  LinkPropsDto dto=result.get(0);
  assertThat(dto.getSrcSwitch(),is(linkPropsData.getLinkProps().getSource().getDatapath()));
  assertThat(dto.getSrcPort(),is(linkPropsData.getLinkProps().getSource().getPortNumber()));
  assertThat(dto.getDstSwitch(),is(linkPropsData.getLinkProps().getDest().getDatapath()));
  assertThat(dto.getDstPort(),is(linkPropsData.getLinkProps().getDest().getPortNumber()));
}
Program: 37883
Project: 37883
Buggy source:
private Set<String> availablePermissions(final UserInfo userInfo){
  Set<String> availablePermissions=new HashSet<>();
  Set<String> roles=userInfo.getRoles();
  if (roles != null && roles.size() > 0) {
    List<Role> roleList=roleService.getRoleByName(roles);
    for (    Role role : roleList) {
      if (role.getPermissions() != null) {
        for (        Permission permission : role.getPermissions()) {
          if (Status.ACTIVE.getStatusEntity().getStatus().equalsIgnoreCase(permission.getStatus())) {
            availablePermissions.add(permission.getName());
          }
        }
      }
    }
  }
  return availablePermissions;
}

Fixed version (ground truth):
private Set<String> availablePermissions(final UserInfo userInfo){
  Set<String> availablePermissions=new HashSet<>();
  if (userInfo.getUserId() != 1) {
    Set<String> roles=userInfo.getRoles();
    if (roles != null && roles.size() > 0) {
      List<Role> roleList=roleService.getRoleByName(roles);
      for (      Role role : roleList) {
        if (role.getPermissions() != null) {
          for (          Permission permission : role.getPermissions()) {
            if (Status.ACTIVE.getStatusEntity().getStatus().equalsIgnoreCase(permission.getStatus())) {
              availablePermissions.add(permission.getName());
            }
          }
        }
      }
    }
  }
 else {
    List<Permission> permissions=permissionService.getAllPermission(userInfo.getUserId());
    for (    Permission permission : permissions) {
      availablePermissions.add(permission.getName());
    }
  }
  userInfo.setPermissions(availablePermissions);
  return availablePermissions;
}
Program: 37884
Project: 37884
Buggy source:
private void validateAndPopulatePermisssion(final UserInfo userInfo,final Permissions permissions) throws Exception {
  if (!permissions.checkObjectAccessPermissions()) {
    if (!hasPermissions(userInfo,permissions.values())) {
      throw new AccessDeniedException(messageUtils.getUnauthorizedMessage());
    }
  }
}

Fixed version (ground truth):
private void validateAndPopulatePermisssion(final UserInfo userInfo,final Permissions permissions) throws Exception {
  if (!permissions.checkObjectAccessPermissions()) {
    if (!hasPermissions(userInfo,permissions.values())) {
      LOGGER.error("String_Node_Str" + userInfo.getUserId() + "String_Node_Str"+ permissions.values());
      throw new AccessDeniedException(messageUtils.getUnauthorizedMessage());
    }
  }
}
Program: 37885
Project: 37885
Buggy source:
@Override public boolean preHandle(final HttpServletRequest request,final HttpServletResponse response,final Object handler) throws Exception {
  String correlationId=request.getParameter(CORRELATION_ID);
  correlationId=correlationId == null ? UUID.randomUUID().toString() : correlationId;
  try {
    MDC.put(CORRELATION_ID,correlationId);
    HttpSession session=request.getSession();
    UserInfo userInfo=null;
    userInfo=(UserInfo)session.getAttribute(IConstants.SESSION_OBJECT);
    if (userInfo != null) {
      if (handler instanceof HandlerMethod) {
        HandlerMethod handlerMethod=(HandlerMethod)handler;
        Permissions permissions=handlerMethod.getMethod().getAnnotation(Permissions.class);
        LOGGER.info("String_Node_Str");
        if (permissions != null) {
          LOGGER.info("String_Node_Str" + permissions.values());
          validateAndPopulatePermisssion(userInfo,permissions);
        }
      }
      updateRequestContext(correlationId,request,userInfo);
    }
  }
 catch (  IllegalStateException ex) {
    LOGGER.info("String_Node_Str" + ex.getLocalizedMessage(),ex);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean preHandle(final HttpServletRequest request,final HttpServletResponse response,final Object handler) throws Exception {
  String correlationId=request.getParameter(CORRELATION_ID);
  correlationId=correlationId == null ? UUID.randomUUID().toString() : correlationId;
  try {
    MDC.put(CORRELATION_ID,correlationId);
    HttpSession session=request.getSession();
    UserInfo userInfo=null;
    userInfo=(UserInfo)session.getAttribute(IConstants.SESSION_OBJECT);
    if (userInfo != null) {
      if (handler instanceof HandlerMethod) {
        HandlerMethod handlerMethod=(HandlerMethod)handler;
        Permissions permissions=handlerMethod.getMethod().getAnnotation(Permissions.class);
        if (permissions != null) {
          validateAndPopulatePermisssion(userInfo,permissions);
        }
      }
      updateRequestContext(correlationId,request,userInfo);
    }
  }
 catch (  IllegalStateException ex) {
    LOGGER.info("String_Node_Str" + ex.getLocalizedMessage(),ex);
  }
  return true;
}
Program: 37886
Project: 37886
Buggy source:
/** 
 * Sets request payload.
 * @param payload request payload
 */
public void setPayload(final FlowIdStatusPayload payload){
  if (payload == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.payload=payload;
}

Fixed version (ground truth):
/** 
 * Sets request payload.
 * @param payload request payload
 */
public void setPayload(final FlowIdStatusPayload payload){
  this.payload=payload;
}
Program: 37887
Project: 37887
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<FlowPayload> getFlows(){
  final String correlationId=RequestCorrelationId.getId();
  LOGGER.debug("String_Node_Str",CORRELATION_ID,correlationId);
  FlowsGetRequest data=new FlowsGetRequest(new FlowIdStatusPayload());
  CommandMessage request=new CommandMessage(data,System.currentTimeMillis(),correlationId,Destination.WFM);
  messageConsumer.clear();
  messageProducer.send(topic,request);
  Message message=(Message)messageConsumer.poll(correlationId);
  FlowsResponse response=(FlowsResponse)validateInfoMessage(request,message,correlationId);
  List<FlowPayload> result=collectFlows(response.getFlowIds(),correlationId);
  logger.debug("String_Node_Str",CORRELATION_ID,correlationId,result.size());
  return result;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public List<FlowPayload> getFlows(){
  final String correlationId=RequestCorrelationId.getId();
  LOGGER.debug("String_Node_Str");
  FlowGetRequest data=new FlowGetRequest();
  CommandMessage request=new CommandMessage(data,System.currentTimeMillis(),correlationId,Destination.WFM);
  messageProducer.send(topic,request);
  List<FlowResponse> result=flowsCollector.getResult(correlationId);
  logger.debug("String_Node_Str",result.size());
  return result.stream().map(FlowResponse::getPayload).map(FlowPayloadToFlowConverter::buildFlowPayloadByFlow).collect(Collectors.toList());
}
Program: 37888
Project: 37888
Buggy source:
/** 
 * Chooses response by request.
 * @param data received from kafka CommandData message payload
 * @return InfoMassage to be send as response payload
 */
private Message formatResponse(final String correlationId,final CommandData data){
  if (data instanceof FlowCreateRequest) {
    return new InfoMessage(flowResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof FlowDeleteRequest) {
    return new InfoMessage(flowResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof FlowUpdateRequest) {
    return new InfoMessage(flowResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof FlowGetRequest) {
    if (ERROR_FLOW_ID.equals(((FlowGetRequest)data).getPayload().getId())) {
      return new ErrorMessage(new ErrorData(ErrorType.NOT_FOUND,"String_Node_Str",ERROR_FLOW_ID),0,correlationId,Destination.NORTHBOUND);
    }
 else {
      return new InfoMessage(flowResponse,0,correlationId,Destination.NORTHBOUND);
    }
  }
 else   if (data instanceof FlowsGetRequest) {
    return new InfoMessage(flowsResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof FlowStatusRequest) {
    return new InfoMessage(flowStatusResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof FlowPathRequest) {
    return new InfoMessage(flowPathResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof SwitchRulesDeleteRequest) {
    return new InfoMessage(switchRulesResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Chooses response by request.
 * @param data received from kafka CommandData message payload
 * @return InfoMassage to be send as response payload
 */
private Message formatResponse(final String correlationId,final CommandData data){
  if (data instanceof FlowCreateRequest) {
    return new InfoMessage(flowResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof FlowDeleteRequest) {
    return new InfoMessage(flowResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof FlowUpdateRequest) {
    return new InfoMessage(flowResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof FlowGetRequest) {
    FlowIdStatusPayload request=((FlowGetRequest)data).getPayload();
    return getFlowResponse(request,correlationId);
  }
 else   if (data instanceof FlowStatusRequest) {
    return new InfoMessage(flowStatusResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof FlowPathRequest) {
    return new InfoMessage(flowPathResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else   if (data instanceof SwitchRulesDeleteRequest) {
    return new InfoMessage(switchRulesResponse,0,correlationId,Destination.NORTHBOUND);
  }
 else {
    return null;
  }
}
Program: 37889
Project: 37889
Buggy source:
private boolean hasPermissions(final UserInfo userInfo,final String... permissions){
  LOGGER.info("String_Node_Str");
  boolean hasPermission=true;
  Set<String> availablePermissions=availablePermissions(userInfo);
  if (!availablePermissions.isEmpty()) {
    for (    String permission : permissions) {
      if (!availablePermissions.contains(permission)) {
        hasPermission=false;
        break;
      }
    }
  }
 else {
    hasPermission=false;
  }
  LOGGER.info("String_Node_Str");
  return hasPermission;
}

Fixed version (ground truth):
private boolean hasPermissions(final UserInfo userInfo,final String... permissions){
  boolean hasPermission=true;
  Set<String> availablePermissions=availablePermissions(userInfo);
  if (!availablePermissions.isEmpty()) {
    for (    String permission : permissions) {
      if (!availablePermissions.contains(permission)) {
        hasPermission=false;
        break;
      }
    }
  }
 else {
    hasPermission=false;
  }
  return hasPermission;
}
Program: 37890
Project: 37890
Buggy source:
private void validateAndPopulatePermisssion(final UserInfo userInfo,final Permissions permissions) throws Exception {
  if (!permissions.checkObjectAccessPermissions()) {
    if (!hasPermissions(userInfo,permissions.values())) {
      throw new AccessDeniedException(messageUtils.getUnauthorizedMessage());
    }
  }
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
private void validateAndPopulatePermisssion(final UserInfo userInfo,final Permissions permissions) throws Exception {
  if (!permissions.checkObjectAccessPermissions()) {
    if (!hasPermissions(userInfo,permissions.values())) {
      throw new AccessDeniedException(messageUtils.getUnauthorizedMessage());
    }
  }
}
Program: 37891
Project: 37891
Buggy source:
@Override public boolean preHandle(final HttpServletRequest request,final HttpServletResponse response,final Object handler) throws Exception {
  String correlationId=request.getParameter(CORRELATION_ID);
  correlationId=correlationId == null ? UUID.randomUUID().toString() : correlationId;
  try {
    MDC.put(CORRELATION_ID,correlationId);
    HttpSession session=request.getSession();
    UserInfo userInfo=null;
    userInfo=(UserInfo)session.getAttribute(IConstants.SESSION_OBJECT);
    if (userInfo != null) {
      if (handler instanceof HandlerMethod) {
        HandlerMethod handlerMethod=(HandlerMethod)handler;
        Permissions permissions=handlerMethod.getMethod().getAnnotation(Permissions.class);
        LOGGER.info("String_Node_Str");
        if (permissions != null) {
          LOGGER.info("String_Node_Str" + permissions.values());
          validateAndPopulatePermisssion(userInfo,permissions);
        }
      }
      updateRequestContext(correlationId,request,userInfo);
      LOGGER.info("String_Node_Str");
    }
  }
 catch (  IllegalStateException ex) {
    LOGGER.info("String_Node_Str" + ex.getLocalizedMessage(),ex);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean preHandle(final HttpServletRequest request,final HttpServletResponse response,final Object handler) throws Exception {
  String correlationId=request.getParameter(CORRELATION_ID);
  correlationId=correlationId == null ? UUID.randomUUID().toString() : correlationId;
  try {
    MDC.put(CORRELATION_ID,correlationId);
    HttpSession session=request.getSession();
    UserInfo userInfo=null;
    userInfo=(UserInfo)session.getAttribute(IConstants.SESSION_OBJECT);
    if (userInfo != null) {
      if (handler instanceof HandlerMethod) {
        HandlerMethod handlerMethod=(HandlerMethod)handler;
        Permissions permissions=handlerMethod.getMethod().getAnnotation(Permissions.class);
        LOGGER.info("String_Node_Str");
        if (permissions != null) {
          LOGGER.info("String_Node_Str" + permissions.values());
          validateAndPopulatePermisssion(userInfo,permissions);
        }
      }
      updateRequestContext(correlationId,request,userInfo);
    }
  }
 catch (  IllegalStateException ex) {
    LOGGER.info("String_Node_Str" + ex.getLocalizedMessage(),ex);
  }
  return true;
}
Program: 37892
Project: 37892
Buggy source:
/** 
 * Return logged in user information.
 * @param request HttpServletRequest to retrieve logged in user information.
 * @return logged in user information.
 */
protected UserInfo getLoggedInUser(final HttpServletRequest request){
  LOGGER.info("String_Node_Str");
  HttpSession session=request.getSession();
  UserInfo userInfo=null;
  try {
    userInfo=(UserInfo)session.getAttribute(IConstants.SESSION_OBJECT);
  }
 catch (  IllegalStateException ex) {
    LOGGER.info("String_Node_Str" + ex.getLocalizedMessage(),ex);
  }
 finally {
    if (userInfo == null) {
      session=request.getSession(false);
      userInfo=new UserInfo();
      session.setAttribute(IConstants.SESSION_OBJECT,userInfo);
    }
  }
  return userInfo;
}

Fixed version (ground truth):
/** 
 * Return logged in user information.
 * @param request HttpServletRequest to retrieve logged in user information.
 * @return logged in user information.
 */
protected UserInfo getLoggedInUser(final HttpServletRequest request){
  HttpSession session=request.getSession();
  UserInfo userInfo=null;
  try {
    userInfo=(UserInfo)session.getAttribute(IConstants.SESSION_OBJECT);
  }
 catch (  IllegalStateException ex) {
    LOGGER.info("String_Node_Str" + ex.getLocalizedMessage(),ex);
  }
 finally {
    if (userInfo == null) {
      session=request.getSession(false);
      userInfo=new UserInfo();
      session.setAttribute(IConstants.SESSION_OBJECT,userInfo);
    }
  }
  return userInfo;
}
Program: 37893
Project: 37893
Buggy source:
/** 
 * Sending message.
 * @param receivers the list of receivers.
 * @param subject mail subject.
 * @param template template.
 * @param context Map with context values for velocity template.
 */
public void send(final String receiver,final String subject,final TemplateService.Template template,final Map<String,Object> context){
  MimeMessage mimeMessage=javaMailSender.createMimeMessage();
  MimeMessageHelper msg=new MimeMessageHelper(mimeMessage);
  if (!StringUtil.isNullOrEmpty(receiver)) {
    try {
      msg.setSubject(subject);
      msg.setTo(receiver);
      msg.setText(templateService.mergeTemplateToString(template,context),true);
    }
 catch (    MessagingException e) {
      e.printStackTrace();
    }
    javaMailSender.send(mimeMessage);
  }
}

Fixed version (ground truth):
/** 
 * Sending message.
 * @param receivers the list of receivers.
 * @param subject mail subject.
 * @param template template.
 * @param context Map with context values for velocity template.
 */
public void send(final String receiver,final String subject,final TemplateService.Template template,final Map<String,Object> context){
  MimeMessage mimeMessage=javaMailSender.createMimeMessage();
  MimeMessageHelper msg=new MimeMessageHelper(mimeMessage);
  if (!StringUtil.isNullOrEmpty(receiver)) {
    try {
      msg.setSubject(subject);
      msg.setTo(receiver);
      msg.setText(templateService.mergeTemplateToString(template,context),true);
      javaMailSender.send(mimeMessage);
      LOGGER.info("String_Node_Str" + subject);
    }
 catch (    MessagingException e) {
      LOGGER.error("String_Node_Str" + e.getMessage(),e);
    }
  }
}
Program: 37894
Project: 37894
Buggy source:
@Override public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException {
  LOGGER.info("String_Node_Str");
  UserEntity user=userRepository.findByUsername(username);
  Set<GrantedAuthority> authorities=new HashSet<GrantedAuthority>(0);
  if (user == null) {
    throw new UsernameNotFoundException(username);
  }
  return new org.springframework.security.core.userdetails.User(username,user.getPassword(),authorities);
}

Fixed version (ground truth):
@Override public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException {
  UserEntity user=userRepository.findByUsername(username);
  Set<GrantedAuthority> authorities=new HashSet<GrantedAuthority>(0);
  if (user == null) {
    throw new UsernameNotFoundException(username);
  }
  return new org.springframework.security.core.userdetails.User(username,user.getPassword(),authorities);
}
Program: 37896
Project: 37896
Buggy source:
/** 
 * Gets the switch ports.
 * @return the switch ports
 * @throws IntegrationException
 */
public List<PortInfo> getSwitchPorts(final String switchId) throws IntegrationException {
  HttpResponse response=null;
  try {
    if (RestClientManager.isValidResponse(response)) {
      String responseEntity=IoUtil.toString(response.getEntity().getContent());
      JSONObject jsonObject=JsonUtil.toObject(responseEntity,JSONObject.class);
      return PortConverter.toPortsInfo(jsonObject,switchId);
    }
  }
 catch (  IOException exception) {
    LOGGER.error("String_Node_Str" + exception.getMessage(),exception);
    throw new IntegrationException(exception);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the switch ports.
 * @return the switch ports
 * @throws IntegrationException
 */
public List<PortInfo> getSwitchPorts(final String switchId) throws IntegrationException {
  HttpResponse response=null;
  try {
    if (response != null && RestClientManager.isValidResponse(response)) {
      String responseEntity=IoUtil.toString(response.getEntity().getContent());
      JSONObject jsonObject=JsonUtil.toObject(responseEntity,JSONObject.class);
      return PortConverter.toPortsInfo(jsonObject,switchId);
    }
  }
 catch (  IOException exception) {
    LOGGER.error("String_Node_Str" + exception.getMessage(),exception);
    throw new IntegrationException(exception);
  }
  return null;
}
Program: 37897
Project: 37897
Buggy source:
/** 
 * Gets the isl link cost.
 * @return the isl link cost
 */
public List<LinkProps> getIslLinkProps(LinkProps keys){
  UriComponentsBuilder builder=UriComponentsBuilder.fromHttpUrl(applicationProperties.getLinkProps());
  builder=setLinkProps(keys,builder);
  String fullUri=builder.build().toUriString();
  HttpResponse response=restClientManager.invoke(fullUri,HttpMethod.GET,"String_Node_Str","String_Node_Str",applicationService.getAuthHeader());
  if (RestClientManager.isValidResponse(response)) {
    List<LinkProps> linkPropsResponses=restClientManager.getResponseList(response,LinkProps.class);
    if (CollectionUtil.isEmpty(linkPropsResponses)) {
      throw new ContentNotFoundException();
    }
 else {
      return linkPropsResponses;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the isl link cost.
 * @return the isl link cost
 */
public List<LinkProps> getIslLinkProps(LinkProps keys){
  UriComponentsBuilder builder=UriComponentsBuilder.fromHttpUrl(applicationProperties.getLinkProps());
  builder=setLinkProps(keys,builder);
  String fullUri=builder.build().toUriString();
  HttpResponse response=restClientManager.invoke(fullUri,HttpMethod.GET,"String_Node_Str","String_Node_Str",applicationService.getAuthHeader());
  if (RestClientManager.isValidResponse(response)) {
    List<LinkProps> linkPropsResponses=restClientManager.getResponseList(response,LinkProps.class);
    if (!CollectionUtil.isEmpty(linkPropsResponses)) {
      return linkPropsResponses;
    }
  }
  return null;
}
Program: 37898
Project: 37898
Buggy source:
private Map<String,String> islCostMap(){
  List<LinkProps> linkProps=getIslLinkProps(null);
  Map<String,String> islCostMap=new HashMap<>();
  linkProps.forEach(linkProp -> {
    String key=linkProp.getSrc_switch() + "String_Node_Str" + linkProp.getSrc_port()+ "String_Node_Str"+ linkProp.getDst_switch()+ "String_Node_Str"+ linkProp.getDst_port();
    String value=linkProp.getProperty("String_Node_Str");
    islCostMap.put(key,value);
  }
);
  return islCostMap;
}

Fixed version (ground truth):
private Map<String,String> islCostMap(){
  List<LinkProps> linkProps=getIslLinkProps(null);
  Map<String,String> islCostMap=new HashMap<>();
  if (linkProps != null) {
    linkProps.forEach(linkProp -> {
      String key=linkProp.getSrc_switch() + "String_Node_Str" + linkProp.getSrc_port()+ "String_Node_Str"+ linkProp.getDst_switch()+ "String_Node_Str"+ linkProp.getDst_port();
      String value=linkProp.getProperty("String_Node_Str");
      islCostMap.put(key,value);
    }
);
  }
  return islCostMap;
}