nus-yam/ex-repair huggingface dataset:
Program: 40942
Project: 40942
Buggy source:
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @ApiOperation(value="String_Node_Str",response=PlanInstanceEventDTO.class,responseContainer="String_Node_Str") @ApiResponses(@ApiResponse(code=404,message="String_Node_Str")) public Response getBuildPlanInstanceLogs(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String instance,@Context final UriInfo uriInfo){
  return this.planService.getPlanInstanceLogs(plan,instance,uriInfo,csarId,serviceTemplate,serviceTemplateInstanceId,PLAN_TYPE);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @ApiOperation(value="String_Node_Str",response=PlanInstanceEventDTO.class,responseContainer="String_Node_Str") @ApiResponses(@ApiResponse(code=404,message="String_Node_Str")) public Response getBuildPlanInstanceLogs(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String instance,@Context final UriInfo uriInfo){
  return this.planService.getPlanInstanceLogs(plan,instance,uriInfo,csarId,serviceTemplate,null,PLAN_TYPE);
}
Program: 40943
Project: 40943
Buggy source:
@POST @Path("String_Node_Str") @Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @Produces({MediaType.APPLICATION_JSON,MediaType.TEXT_PLAIN}) @ApiOperation(value="String_Node_Str") @ApiResponses({@ApiResponse(code=400,message="String_Node_Str"),@ApiResponse(code=200,message="String_Node_Str",response=URI.class)}) public Response invokeBuildPlan(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@Context final UriInfo uriInfo,@ApiParam(required=true,value="String_Node_Str") final List<TParameter> parameters){
  return this.planService.invokePlan(plan,uriInfo,parameters,csarId,serviceTemplate,serviceTemplateInstanceId,PLAN_TYPE);
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @Produces({MediaType.APPLICATION_JSON,MediaType.TEXT_PLAIN}) @ApiOperation(value="String_Node_Str") @ApiResponses({@ApiResponse(code=400,message="String_Node_Str"),@ApiResponse(code=200,message="String_Node_Str",response=URI.class)}) public Response invokeBuildPlan(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@Context final UriInfo uriInfo,@ApiParam(required=true,value="String_Node_Str") final List<TParameter> parameters){
  return this.planService.invokePlan(plan,uriInfo,parameters,csarId,serviceTemplate,-1L,PLAN_TYPE);
}
Program: 40944
Project: 40944
Buggy source:
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @ApiOperation(value="String_Node_Str",response=PlanInstanceDTO.class,responseContainer="String_Node_Str") @ApiResponses(@ApiResponse(code=404,message="String_Node_Str")) public Response getBuildPlanInstance(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String instance,@Context final UriInfo uriInfo){
  return this.planService.getPlanInstance(plan,instance,uriInfo,csarId,serviceTemplate,serviceTemplateInstanceId,PLAN_TYPE);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @ApiOperation(value="String_Node_Str",response=PlanInstanceDTO.class,responseContainer="String_Node_Str") @ApiResponses(@ApiResponse(code=404,message="String_Node_Str")) public Response getBuildPlanInstance(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String instance,@Context final UriInfo uriInfo){
  return this.planService.getPlanInstance(plan,instance,uriInfo,csarId,serviceTemplate,null,PLAN_TYPE);
}
Program: 40945
Project: 40945
Buggy source:
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @ApiOperation(value="String_Node_Str",response=PlanInstanceDTO.class,responseContainer="String_Node_Str") public Response getBuildPlanInstances(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@Context final UriInfo uriInfo){
  return this.planService.getPlanInstances(plan,uriInfo,csarId,serviceTemplate,serviceTemplateInstanceId,PLAN_TYPE);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @ApiOperation(value="String_Node_Str",response=PlanInstanceDTO.class,responseContainer="String_Node_Str") public Response getBuildPlanInstances(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@Context final UriInfo uriInfo){
  return this.planService.getPlanInstances(plan,uriInfo,csarId,serviceTemplate,null,PLAN_TYPE);
}
Program: 40946
Project: 40946
Buggy source:
@PUT @Path("String_Node_Str") @Consumes({MediaType.TEXT_PLAIN}) @ApiOperation(value="String_Node_Str") @ApiResponses({@ApiResponse(code=404,message="String_Node_Str"),@ApiResponse(code=400,message="String_Node_Str"),@ApiResponse(code=200,message="String_Node_Str")}) public Response changeBuildPlanInstanceState(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String instance,@Context final UriInfo uriInfo,@ApiParam(required=true,value="String_Node_Str") String request){
  return this.planService.changePlanInstanceState(request,plan,instance,uriInfo,csarId,serviceTemplate,serviceTemplateInstanceId,PLAN_TYPE);
}

Fixed version (ground truth):
@PUT @Path("String_Node_Str") @Consumes({MediaType.TEXT_PLAIN}) @ApiOperation(value="String_Node_Str") @ApiResponses({@ApiResponse(code=404,message="String_Node_Str"),@ApiResponse(code=400,message="String_Node_Str"),@ApiResponse(code=200,message="String_Node_Str")}) public Response changeBuildPlanInstanceState(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String instance,@Context final UriInfo uriInfo,@ApiParam(required=true,value="String_Node_Str") String request){
  return this.planService.changePlanInstanceState(request,plan,instance,uriInfo,csarId,serviceTemplate,null,PLAN_TYPE);
}
Program: 40947
Project: 40947
Buggy source:
public BuildPlanController(final CSARID csarId,final QName serviceTemplate,final Long serviceTemplateInstanceId,final PlanService planService){
  this.csarId=csarId;
  this.serviceTemplate=serviceTemplate;
  this.serviceTemplateInstanceId=serviceTemplateInstanceId;
  this.planService=planService;
}

Fixed version (ground truth):
public BuildPlanController(final CSARID csarId,final QName serviceTemplate,final PlanService planService){
  this.csarId=csarId;
  this.serviceTemplate=serviceTemplate;
  this.planService=planService;
}
Program: 40948
Project: 40948
Buggy source:
@GET @Path("String_Node_Str") @Produces({MediaType.TEXT_PLAIN}) @ApiOperation(value="String_Node_Str",response=String.class) @ApiResponses(@ApiResponse(code=404,message="String_Node_Str")) public Response getBuildPlanInstanceState(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String instance,@Context final UriInfo uriInfo){
  return this.planService.getPlanInstanceState(plan,instance,uriInfo,csarId,serviceTemplate,serviceTemplateInstanceId,PLAN_TYPE);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces({MediaType.TEXT_PLAIN}) @ApiOperation(value="String_Node_Str",response=String.class) @ApiResponses(@ApiResponse(code=404,message="String_Node_Str")) public Response getBuildPlanInstanceState(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String instance,@Context final UriInfo uriInfo){
  return this.planService.getPlanInstanceState(plan,instance,uriInfo,csarId,serviceTemplate,null,PLAN_TYPE);
}
Program: 40949
Project: 40949
Buggy source:
@POST @Path("String_Node_Str") @Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @ApiOperation(value="String_Node_Str") @ApiResponses({@ApiResponse(code=400,message="String_Node_Str"),@ApiResponse(code=404,message="String_Node_Str"),@ApiResponse(code=200,message="String_Node_Str",response=URI.class)}) public Response addBuildPlanLogEntry(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String instance,@Context final UriInfo uriInfo,@ApiParam(required=true,value="String_Node_Str") final CreatePlanInstanceLogEntryRequest logEntry){
  return this.planService.addLogToPlanInstance(logEntry,plan,instance,uriInfo,csarId,serviceTemplate,serviceTemplateInstanceId,PLAN_TYPE);
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @ApiOperation(value="String_Node_Str") @ApiResponses({@ApiResponse(code=400,message="String_Node_Str"),@ApiResponse(code=404,message="String_Node_Str"),@ApiResponse(code=200,message="String_Node_Str",response=URI.class)}) public Response addBuildPlanLogEntry(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String plan,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String instance,@Context final UriInfo uriInfo,@ApiParam(required=true,value="String_Node_Str") final CreatePlanInstanceLogEntryRequest logEntry){
  return this.planService.addLogToPlanInstance(logEntry,plan,instance,uriInfo,csarId,serviceTemplate,null,PLAN_TYPE);
}
Program: 40950
Project: 40950
Buggy source:
@Path("String_Node_Str") public BuildPlanController getBuildPlans(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String csar,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String serviceTemplateId){
  final CSARID csarId=this.serviceTemplateService.checkServiceTemplateExistence(csar,serviceTemplateId);
  return new BuildPlanController(csarId,QName.valueOf(serviceTemplateId),null,this.planService);
}

Fixed version (ground truth):
@Path("String_Node_Str") public BuildPlanController getBuildPlans(@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String csar,@ApiParam("String_Node_Str") @PathParam("String_Node_Str") final String serviceTemplateId){
  final CSARID csarId=this.serviceTemplateService.checkServiceTemplateExistence(csar,serviceTemplateId);
  return new BuildPlanController(csarId,QName.valueOf(serviceTemplateId),this.planService);
}
Program: 40951
Project: 40951
Buggy source:
public Response invokePlan(final String plan,final UriInfo uriInfo,final List<TParameter> parameters,final CSARID csarId,final QName serviceTemplate,final Long serviceTemplateInstanceId,final PlanTypes... planTypes){
  if (parameters == null) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  if (!hasPlan(csarId,planTypes,plan)) {
    logger.info("String_Node_Str" + plan + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + plan + "String_Node_Str");
  }
  logger.info("String_Node_Str",plan,serviceTemplate,csarId);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",JsonUtil.writeValueAsString(parameters));
  }
  if (serviceTemplateInstanceId != null) {
    String url=Settings.CONTAINER_INSTANCEDATA_API + serviceTemplateInstanceId;
    url=url.replace("String_Node_Str",csarId.getFileName());
    url=url.replace("String_Node_Str",UriComponent.encode(serviceTemplate.toString(),UriComponent.Type.PATH_SEGMENT));
    final URI uri=UriUtil.encode(URI.create(url));
    final TParameter param=new TParameter();
    param.setName("String_Node_Str");
    param.setRequired(TBoolean.fromValue("String_Node_Str"));
    param.setType("String_Node_Str");
    param.setValue(uri.toString());
    parameters.add(param);
  }
  final TPlan p=getPlan(plan,csarId);
  final String correlationId=invokePlan(csarId,serviceTemplate,p,parameters);
  final URI location=UriUtil.encode(uriInfo.getAbsolutePathBuilder().path(correlationId).build());
  return Response.created(location).build();
}

Fixed version (ground truth):
public Response invokePlan(final String plan,final UriInfo uriInfo,final List<TParameter> parameters,final CSARID csarId,final QName serviceTemplate,final Long serviceTemplateInstanceId,final PlanTypes... planTypes){
  if (parameters == null) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  if (!hasPlan(csarId,planTypes,plan)) {
    logger.info("String_Node_Str" + plan + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + plan + "String_Node_Str");
  }
  logger.info("String_Node_Str",plan,serviceTemplate,csarId);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",JsonUtil.writeValueAsString(parameters));
  }
  if (serviceTemplateInstanceId != null) {
    String url=Settings.CONTAINER_INSTANCEDATA_API + serviceTemplateInstanceId;
    url=url.replace("String_Node_Str",csarId.getFileName());
    url=url.replace("String_Node_Str",UriComponent.encode(serviceTemplate.toString(),UriComponent.Type.PATH_SEGMENT));
    final URI uri=UriUtil.encode(URI.create(url));
    final TParameter param=new TParameter();
    param.setName("String_Node_Str");
    param.setRequired(TBoolean.fromValue("String_Node_Str"));
    param.setType("String_Node_Str");
    param.setValue(uri.toString());
    parameters.add(param);
  }
  final TPlan p=getPlan(plan,csarId);
  final String correlationId=invokePlan(csarId,serviceTemplate,serviceTemplateInstanceId,p,parameters);
  final URI location=UriUtil.encode(uriInfo.getAbsolutePathBuilder().path(correlationId).build());
  return Response.created(location).build();
}
Program: 40953
Project: 40953
Buggy source:
/** 
 * Invokes the a process described due the parameter PublicPlan for the given CSAR.
 * @param csarID the ID of the CSAR
 * @param csarInstanceID the instance id, or -1 if the plan is a build plan
 * @param plan which containes the data which with the process is invoked(including the message values).
 * @return
 * @throws UnsupportedEncodingException
 */
public String invokePlanInvocation(CSARID csarID,QName serviceTemplateId,int csarInstanceID,TPlanDTO plan) throws UnsupportedEncodingException ;

Fixed version (ground truth):
/** 
 * Invokes the a process described due the parameter PublicPlan for the given CSAR.
 * @param csarID the ID of the CSAR
 * @param serviceTemplateInstanceID the instance id, or -1 if the plan is a build plan
 * @param plan which containes the data which with the process is invoked(including the message values).
 * @return
 * @throws UnsupportedEncodingException
 */
public String invokePlanInvocation(CSARID csarID,QName serviceTemplateId,long serviceTemplateInstanceID,TPlanDTO plan) throws UnsupportedEncodingException ;
Program: 40954
Project: 40954
Buggy source:
/** 
 * {@inheritDoc}
 * @throws UnsupportedEncodingException
 */
@Override public String invokePlanInvocation(final CSARID csarID,final QName serviceTemplateId,final int csarInstanceID,final TPlanDTO plan) throws UnsupportedEncodingException {
  this.LOG.info("String_Node_Str");
  final String correlationID=OpenToscaControlServiceImpl.planInvocationEngine.invokePlan(csarID,serviceTemplateId,csarInstanceID,plan);
  if (null != correlationID) {
    this.LOG.info("String_Node_Str");
  }
 else {
    this.LOG.error("String_Node_Str");
  }
  return correlationID;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @throws UnsupportedEncodingException
 */
@Override public String invokePlanInvocation(final CSARID csarID,final QName serviceTemplateId,final long csarInstanceID,final TPlanDTO plan) throws UnsupportedEncodingException {
  this.LOG.info("String_Node_Str");
  final String correlationID=OpenToscaControlServiceImpl.planInvocationEngine.invokePlan(csarID,serviceTemplateId,csarInstanceID,plan);
  if (null != correlationID) {
    this.LOG.info("String_Node_Str");
  }
 else {
    this.LOG.error("String_Node_Str");
  }
  return correlationID;
}
Program: 40956
Project: 40956
Buggy source:
/** 
 * Invoke a PublicPlan for a CSAR. If this PublicPlan is of Type OTHERMANAGEMENT or TERMINATION, the information about the CSARInstance is stored inside the PublicPlan.
 * @param csarID
 * @param instance ID of a CSAR instance
 * @param publicPlan
 * @return boolean about success
 * @throws UnsupportedEncodingException
 */
public String invokePlan(CSARID csarID,QName serviceTemplateId,int csarInstanceID,TPlanDTO plan) throws UnsupportedEncodingException ;

Fixed version (ground truth):
/** 
 * Invoke a PublicPlan for a CSAR. If this PublicPlan is of Type OTHERMANAGEMENT or TERMINATION, the information about the CSARInstance is stored inside the PublicPlan.
 * @param csarID
 * @param instance ID of a CSAR instance
 * @param publicPlan
 * @return boolean about success
 * @throws UnsupportedEncodingException
 */
public String invokePlan(CSARID csarID,QName serviceTemplateId,long serviceTemplateInstanceID,TPlanDTO plan) throws UnsupportedEncodingException ;
Program: 40957
Project: 40957
Buggy source:
@Override public void start(BundleContext bundleContext) throws Exception {
  Activator.context=bundleContext;
  this.plugin=new Plugin();
  this.registration=Activator.context.registerService(IPlanBuilderPostPhasePlugin.class.getName(),this.plugin,null);
  this.registration2=Activator.context.registerService(IPlanBuilderPolicyAwarePrePhasePlugin.class.getName(),this.plugin,null);
}

Fixed version (ground truth):
@Override public void start(BundleContext bundleContext) throws Exception {
  Activator.context=bundleContext;
  this.plugin=new BPELInstanceDataPlugin();
  this.registration=Activator.context.registerService(IPlanBuilderPostPhasePlugin.class.getName(),this.plugin,null);
  this.registration2=Activator.context.registerService(IPlanBuilderPolicyAwarePrePhasePlugin.class.getName(),this.plugin,null);
}
Program: 40958
Project: 40958
Buggy source:
@Override public boolean handle(BPELPlanContext context,AbstractRelationshipTemplate relationshipTemplate){
  return this.handler.handle(context,relationshipTemplate);
}

Fixed version (ground truth):
@Override public boolean handle(BPELPlanContext context,AbstractNodeTemplate nodeTemplate,AbstractPolicy policy){
  return this.handler.handlePasswordCheck(context,nodeTemplate);
}
Program: 40959
Project: 40959
Buggy source:
@Override public boolean handle(TemplatePlanContext context,AbstractNodeTemplate nodeTemplate,List<String> selectionStrategies){
  String inputFieldName=nodeTemplate.getId() + "String_Node_Str";
  context.addStringValueToPlanRequest(inputFieldName);
  String nodeInstanceVarName=this.findInstanceVar(context,nodeTemplate.getId(),true);
  try {
    Node assignFromInputToNodeInstanceIdVar=new BPELProcessFragments().generateAssignFromInputMessageToStringVariableAsNode(inputFieldName,nodeInstanceVarName);
    assignFromInputToNodeInstanceIdVar=context.importNode(assignFromInputToNodeInstanceIdVar);
    context.getPrePhaseElement().appendChild(assignFromInputToNodeInstanceIdVar);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean handle(TemplatePlanContext context,AbstractNodeTemplate nodeTemplate,List<String> selectionStrategies){
  String inputFieldName=nodeTemplate.getId() + "String_Node_Str";
  context.addStringValueToPlanRequest(inputFieldName);
  String nodeInstanceVarName=this.findInstanceVar(context,nodeTemplate.getId(),true);
  try {
    Node assignFromInputToNodeInstanceIdVar=new BPELProcessFragments().generateAssignFromInputMessageToStringVariableAsNode(inputFieldName,nodeInstanceVarName);
    assignFromInputToNodeInstanceIdVar=context.importNode(assignFromInputToNodeInstanceIdVar);
    context.getPrePhaseElement().appendChild(assignFromInputToNodeInstanceIdVar);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
  try {
    new NodeInstanceInitializer(new BPELPlanHandler()).addPropertyVariableUpdateBasedOnNodeInstanceID(context,nodeTemplate);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
  return true;
}
Program: 40960
Project: 40960
Buggy source:
private void rewriteServices(Map<QName,QName> servicesToRewrite,WSDLWriter writer,WSDLReader reader,final List<File> referencedFiles) throws WSDLException, FileNotFoundException {
  LOG.debug("String_Node_Str");
  LOG.debug("String_Node_Str" + referencedFiles);
  LOG.debug("String_Node_Str" + servicesToRewrite);
  for (  final QName serviceName : servicesToRewrite.keySet()) {
    for (    final File file : referencedFiles) {
      if (!file.getAbsolutePath().endsWith("String_Node_Str")) {
        continue;
      }
      final Definition def=reader.readWSDL(file.getAbsolutePath());
      final List<QName> servicesToRemove=new ArrayList<>();
      for (      final Object obj : def.getAllServices().values()) {
        final Service service=(Service)obj;
        if (serviceName.equals(service.getQName())) {
          servicesToRemove.add(service.getQName());
          final Service newService=new ServiceImpl();
          for (          final Object o : service.getPorts().values()) {
            final Port port=(Port)o;
            newService.addPort(port);
          }
          newService.setQName(servicesToRewrite.get(serviceName));
          def.addService(newService);
        }
      }
      for (      final QName serviceToRemove : servicesToRemove) {
        def.removeService(serviceToRemove);
      }
      writer.writeWSDL(def,new FileOutputStream(file));
    }
  }
}

Fixed version (ground truth):
private void rewriteServices(Set<Mapping> servicesToRewrite,WSDLWriter writer,WSDLReader reader,final List<File> referencedFiles) throws WSDLException, FileNotFoundException {
  LOG.debug("String_Node_Str");
  LOG.debug("String_Node_Str" + referencedFiles);
  LOG.debug("String_Node_Str" + servicesToRewrite);
  for (  final Mapping service : servicesToRewrite) {
    final QName serviceName=service.key;
    for (    final File file : referencedFiles) {
      if (!file.getAbsolutePath().endsWith("String_Node_Str")) {
        continue;
      }
      final Definition def=reader.readWSDL(file.getAbsolutePath());
      final List<QName> servicesToRemove=new ArrayList<>();
      boolean foundMatch=false;
      for (      final Object obj : def.getAllServices().values()) {
        final Service serviceA=(Service)obj;
        if (serviceName.equals(serviceA.getQName())) {
          servicesToRemove.add(serviceA.getQName());
          final Service newService=new ServiceImpl();
          for (          final Object o : serviceA.getPorts().values()) {
            final Port port=(Port)o;
            newService.addPort(port);
          }
          newService.setQName(service.val);
          def.addService(newService);
          foundMatch=true;
        }
      }
      if (foundMatch) {
        for (        final QName serviceToRemove : servicesToRemove) {
          def.removeService(serviceToRemove);
        }
        writer.writeWSDL(def,new FileOutputStream(file));
        break;
      }
    }
  }
}
Program: 40961
Project: 40961
Buggy source:
/** 
 * Writes the given DOM Document to the location denoted by the given File
 * @param destination a File denoting the location to export to
 * @param doc the Document to export
 * @throws TransformerException is thrown when initializing aTransformerFactory or writing the Document fails
 * @throws FileNotFoundException is thrown when the File denoted by the FileObject doesn't exist
 */
private void writeBPELDocToFile(final File destination,final Document doc) throws TransformerException, FileNotFoundException {
  final TransformerFactory tFactory=TransformerFactory.newInstance();
  final Transformer transformer=tFactory.newTransformer();
  transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"String_Node_Str");
  transformer.setOutputProperty(OutputKeys.METHOD,"String_Node_Str");
  transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
  transformer.setOutputProperty(OutputKeys.ENCODING,"String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  final DOMSource source=new DOMSource(doc);
  final StreamResult result=new StreamResult(new FileOutputStream(destination));
  transformer.transform(source,result);
}

Fixed version (ground truth):
/** 
 * Writes the given DOM Document to the location denoted by the given File
 * @param destination a File denoting the location to export to
 * @param doc the Document to export
 * @throws TransformerException is thrown when initializing a TransformerFactory or writing the Document fails
 * @throws FileNotFoundException is thrown when the File denoted by the File Object doesn't exist
 */
private void writeBPELDocToFile(final File destination,final Document doc) throws TransformerException, FileNotFoundException {
  final TransformerFactory tFactory=TransformerFactory.newInstance();
  final Transformer transformer=tFactory.newTransformer();
  transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"String_Node_Str");
  transformer.setOutputProperty(OutputKeys.METHOD,"String_Node_Str");
  transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
  transformer.setOutputProperty(OutputKeys.ENCODING,"String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  final DOMSource source=new DOMSource(doc);
  final StreamResult result=new StreamResult(new FileOutputStream(destination));
  transformer.transform(source,result);
}
Program: 40964
Project: 40964
Buggy source:
/** 
 * Checks whether the given Node is an infrastructure nodeType that can be handled by the set of plugins used by the PlanBuilder.
 * @param nodeType a QName denoting some nodeType
 * @return a boolean. True if the given nodeType is an infrastructurenodeType
 */
public static boolean isSupportedInfrastructureNodeType(final QName nodeType){
  if (nodeType.equals(Types.ubuntuNodeType)) {
    return true;
  }
  final String nodeTypeNS=nodeType.getNamespaceURI();
  final String nodeTypeLN=nodeType.getLocalPart();
  if (nodeTypeNS.equals("String_Node_Str") && Utils.isProperUbuntuLocalName(nodeTypeLN)) {
    return true;
  }
  if (nodeType.equals(Types.ubuntu1404ServerVmNodeType) || nodeType.equals(Types.ubuntu1404ServerVmNodeType2)) {
    return true;
  }
  if (nodeType.equals(Types.raspbianJessieOSNodeType)) {
    return true;
  }
  if (nodeType.equals(Types.dockerContainerNodeType)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the given Node is an infrastructure nodeType that can be handled by the set of plugins used by the PlanBuilder.
 * @param nodeType a QName denoting some nodeType
 * @return a boolean. True if the given nodeType is an infrastructurenodeType
 */
public static boolean isSupportedInfrastructureNodeType(final QName nodeType){
  if (nodeType.equals(Types.ubuntuNodeType)) {
    return true;
  }
  final String nodeTypeNS=nodeType.getNamespaceURI();
  final String nodeTypeLN=nodeType.getLocalPart();
  if (nodeTypeNS.equals("String_Node_Str") && Utils.isProperUbuntuLocalName(nodeTypeLN)) {
    return true;
  }
  if (nodeType.equals(Types.ubuntu1404ServerVmNodeType) || nodeType.equals(Types.ubuntu1404ServerVmNodeType2)) {
    return true;
  }
  if (nodeType.equals(Types.raspbianJessieOSNodeType)) {
    return true;
  }
  if (nodeType.equals(Types.dockerContainerNodeType)) {
    return true;
  }
  if (nodeType.equals(Types.dockerEngineNodeType)) {
    return true;
  }
  return false;
}
Program: 40965
Project: 40965
Buggy source:
public Map<AbstractActivity,AbstractActivity> getLinks(){
  return links;
}

Fixed version (ground truth):
public Set<Link> getLinks(){
  return links;
}
Program: 40966
Project: 40966
Buggy source:
public AbstractPlan(final String id,final PlanType type,final AbstractDefinitions definitions,final AbstractServiceTemplate serviceTemplate,final Collection<AbstractActivity> activities,final Map<AbstractActivity,AbstractActivity> links){
  this.id=id;
  this.type=type;
  this.definitions=definitions;
  this.serviceTemplate=serviceTemplate;
  this.activites=activities;
  this.links=links;
}

Fixed version (ground truth):
public AbstractPlan(final String id,final PlanType type,final AbstractDefinitions definitions,final AbstractServiceTemplate serviceTemplate,final Collection<AbstractActivity> activities,final Set<Link> links){
  this.id=id;
  this.type=type;
  this.definitions=definitions;
  this.serviceTemplate=serviceTemplate;
  this.activites=activities;
  this.links=links;
}
Program: 40967
Project: 40967
Buggy source:
public BPELPlan(String id,PlanType type,AbstractDefinitions definitions,AbstractServiceTemplate serviceTemplate,Collection<AbstractActivity> activities,Map<AbstractActivity,AbstractActivity> links){
  super(id,type,definitions,serviceTemplate,activities,links);
}

Fixed version (ground truth):
public BPELPlan(String id,PlanType type,AbstractDefinitions definitions,AbstractServiceTemplate serviceTemplate,Collection<AbstractActivity> activities,Set<Link> links){
  super(id,type,definitions,serviceTemplate,activities,links);
}
Program: 40970
Project: 40970
Buggy source:
public static boolean hasTerminationPlan(CSARID csarId) throws UserException, SystemException {
  QName serviceTemplateId=ModelUtils.getEntryServiceTemplate(csarId);
  Map<PlanTypes,LinkedHashMap<QName,TPlan>> plans=ToscaServiceHandler.getToscaEngineService().getToscaReferenceMapper().getCSARIDToPlans(csarId);
  return plans.containsKey(PlanTypes.TERMINATION);
}

Fixed version (ground truth):
public static boolean hasTerminationPlan(CSARID csarId) throws UserException, SystemException {
  Map<PlanTypes,LinkedHashMap<QName,TPlan>> plans=ToscaServiceHandler.getToscaEngineService().getToscaReferenceMapper().getCSARIDToPlans(csarId);
  if (plans == null)   return false;
  return (plans.containsKey(PlanTypes.TERMINATION) & !plans.get(PlanTypes.TERMINATION).isEmpty()) ? true : false;
}
Program: 40971
Project: 40971
Buggy source:
public static boolean hasBuildPlan(CSARID csarId) throws UserException, SystemException {
  QName serviceTemplateId=ModelUtils.getEntryServiceTemplate(csarId);
  Map<PlanTypes,LinkedHashMap<QName,TPlan>> plans=ToscaServiceHandler.getToscaEngineService().getToscaReferenceMapper().getCSARIDToPlans(csarId);
  if (plans == null)   return false;
  return plans.containsKey(PlanTypes.BUILD);
}

Fixed version (ground truth):
public static boolean hasBuildPlan(CSARID csarId) throws UserException, SystemException {
  Map<PlanTypes,LinkedHashMap<QName,TPlan>> plans=ToscaServiceHandler.getToscaEngineService().getToscaReferenceMapper().getCSARIDToPlans(csarId);
  if (plans == null)   return false;
  return (plans.containsKey(PlanTypes.BUILD) & !plans.get(PlanTypes.BUILD).isEmpty()) ? true : false;
}
Program: 40973
Project: 40973
Buggy source:
/** 
 * This function deletes all stored references of a certain CSAR.
 * @param csarID
 * @return true for success, false for an error
 */
public boolean clearCSARContent(final CSARID csarID){
  this.LOG.debug("String_Node_Str" + csarID + "String_Node_Str");
  this.setup();
  this.referenceMap.remove(csarID);
  this.documentMap.remove(csarID);
  this.mapCSARIDToDefinitions.remove(csarID);
  this.mapCSARIDToServiceTemplateIDs.remove(csarID);
  this.csarIDToPlanTypeToIntegerToPlan.remove(csarID);
  this.csarIDToWSDLDocuments.remove(csarID);
  this.csarIDToServiceTemplateIDToPlanID.remove(csarID);
  this.csarIDToPlanIDToSynchronousBoolean.remove(csarID);
  this.csarIDToExportedInterface.remove(csarID);
  this.csarIDToPolicies.remove(csarID);
  this.mapDefinitionsIDToLocationString.remove(csarID);
  this.mapElementIDToDefinitionsID.remove(csarID);
  if (this.containsCSARData(csarID)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * This function deletes all stored references of a certain CSAR.
 * @param csarID
 * @return true for success, false for an error
 */
public boolean clearCSARContent(final CSARID csarID){
  this.LOG.debug("String_Node_Str" + csarID + "String_Node_Str");
  this.setup();
  this.referenceMap.remove(csarID);
  this.documentMap.remove(csarID);
  this.mapCSARIDToDefinitions.remove(csarID);
  this.mapCSARIDToServiceTemplateIDs.remove(csarID);
  this.csarIDToPlanTypeToIntegerToPlan.remove(csarID);
  this.csarIDToWSDLDocuments.remove(csarID);
  this.csarIDToServiceTemplateIDToPlanID.remove(csarID);
  this.csarIDToPlanIDToSynchronousBoolean.remove(csarID);
  this.csarIDToExportedInterface.remove(csarID);
  this.csarIDToPolicies.remove(csarID);
  this.mapDefinitionsIDToLocationString.remove(csarID);
  this.mapElementIDToDefinitionsID.remove(csarID);
  this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.remove(csarID);
  this.mapCSARIDToServiceTemplateQNameToNodeTemplateID.remove(csarID);
  this.mapCSARIDToServiceTemplateQNameToRelationshipTemplateID.remove(csarID);
  this.serviceTemplatePropertiesContent.remove(csarID);
  this.serviceTemplatePropertyMappings.remove(csarID);
  if (this.containsCSARData(csarID)) {
    return false;
  }
  return true;
}
Program: 40975
Project: 40975
Buggy source:
public Response handleCSAR(final String fileName,final InputStream uploadedInputStream) throws IOException, URISyntaxException, UserException, SystemException {
  File uploadFile=this.storeTemporaryFile(fileName,uploadedInputStream);
  CSARID csarID=this.fileHandler.storeCSAR(uploadFile.toPath());
  this.control.invokeTOSCAProcessing(csarID);
  if (ModelUtils.hasOpenRequirements(csarID)) {
    WineryConnector winCon=new WineryConnector();
    if (winCon.isWineryRepositoryAvailable()) {
      QName serviceTemplate=winCon.uploadCSAR(uploadFile);
      this.fileHandler.deleteCSAR(csarID);
      return Response.status(Response.Status.NOT_ACCEPTABLE).entity("String_Node_Str" + winCon.getServiceTemplateURI(serviceTemplate).toString() + "String_Node_Str").build();
    }
 else {
      this.fileHandler.deleteCSAR(csarID);
      return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
    }
  }
  ToscaServiceHandler.getToscaEngineService().clearCSARContent(csarID);
  csarID=this.startPlanBuilder(csarID);
  this.processTOSCA(csarID);
  if (csarID != null) {
    CSARsResource.LOG.info("String_Node_Str",csarID.toString());
    final String path=Utilities.buildURI(this.uriInfo.getAbsolutePath().toString(),csarID.toString());
    final JsonObject retObj=new JsonObject();
    retObj.addProperty("String_Node_Str",path);
    return Response.created(URI.create(path)).entity(retObj.toString()).build();
  }
 else {
    return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
  }
}

Fixed version (ground truth):
public Response handleCSAR(final String fileName,final InputStream uploadedInputStream) throws IOException, URISyntaxException, UserException, SystemException {
  File uploadFile=this.storeTemporaryFile(fileName,uploadedInputStream);
  CSARID csarID=this.fileHandler.storeCSAR(uploadFile.toPath());
  this.control.invokeTOSCAProcessing(csarID);
  if (ModelUtils.hasOpenRequirements(csarID)) {
    WineryConnector winCon=new WineryConnector();
    if (winCon.isWineryRepositoryAvailable()) {
      QName serviceTemplate=winCon.uploadCSAR(uploadFile);
      this.control.deleteCSAR(csarID);
      return Response.status(Response.Status.NOT_ACCEPTABLE).entity("String_Node_Str" + winCon.getServiceTemplateURI(serviceTemplate).toString() + "String_Node_Str").build();
    }
 else {
      this.fileHandler.deleteCSAR(csarID);
      return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
    }
  }
  this.control.deleteCSAR(csarID);
  csarID=this.fileHandler.storeCSAR(uploadFile.toPath());
  csarID=this.startPlanBuilder(csarID);
  this.processTOSCA(csarID);
  if (csarID != null) {
    CSARsResource.LOG.info("String_Node_Str",csarID.toString());
    final String path=Utilities.buildURI(this.uriInfo.getAbsolutePath().toString(),csarID.toString());
    final JsonObject retObj=new JsonObject();
    retObj.addProperty("String_Node_Str",path);
    return Response.created(URI.create(path)).entity(retObj.toString()).build();
  }
 else {
    return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
  }
}
Program: 40977
Project: 40977
Buggy source:
private String fetchPropertyValueFromNodeInstance(NodeInstance nodeInstance,String propertyLocalName){
  NodeList childNodes=nodeInstance.getProperties().getFirstChild().getChildNodes();
  for (int index=0; index < childNodes.getLength(); index++) {
    Node childNode=childNodes.item(index);
    if ((childNode.getNodeType() == Node.ELEMENT_NODE) && childNode.getLocalName().equals(propertyLocalName)) {
      return childNode.getTextContent();
    }
  }
  return null;
}

Fixed version (ground truth):
private String fetchPropertyValueFromNodeInstance(NodeInstance nodeInstance,String propertyLocalName){
  if (nodeInstance.getProperties() == null) {
    return null;
  }
  NodeList childNodes=nodeInstance.getProperties().getFirstChild().getChildNodes();
  for (int index=0; index < childNodes.getLength(); index++) {
    Node childNode=childNodes.item(index);
    if ((childNode.getNodeType() == Node.ELEMENT_NODE) && childNode.getLocalName().equals(propertyLocalName)) {
      return childNode.getTextContent();
    }
  }
  return null;
}
Program: 40978
Project: 40978
Buggy source:
@POST @Consumes(MediaType.APPLICATION_XML) @Produces({MediaType.APPLICATION_XML,MediaType.TEXT_XML}) public Response createServiceInstance(@Context UriInfo uriInfo,String xml){
  log.debug("String_Node_Str",csarId,serviceTemplateID);
  IInstanceDataService service=InstanceDataServiceHandler.getInstanceDataService();
  try {
    ServiceInstance createdServiceInstance=service.createServiceInstance(csarId,serviceTemplateID);
    String corr=xml.substring(xml.indexOf("String_Node_Str") + 1,xml.indexOf("String_Node_Str"));
    int serviceTemplateInstanceId=createdServiceInstance.getDBId();
    String instanceURL=createdServiceInstance.getServiceInstanceID().toString();
    log.debug(corr + "String_Node_Str" + corr+ "String_Node_Str"+ instanceURL);
{
      BuildCorrelationToInstanceMapping.instance.correlateCorrelationIdToServiceTemplateInstanceId(corr,serviceTemplateInstanceId);
      PlanInvocationEngineHandler.planInvocationEngine.correctCorrelationToServiceTemplateInstanceIdMapping(csarId,serviceTemplateID,corr,serviceTemplateInstanceId);
    }
    SimpleXLink response=new SimpleXLink(uriInfo.getAbsolutePath().toString() + "String_Node_Str" + serviceTemplateInstanceId,"String_Node_Str");
    log.debug("String_Node_Str" + response.getHref());
    return Response.ok(response).build();
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new GenericRestException(Status.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}

Fixed version (ground truth):
@POST @Consumes(MediaType.APPLICATION_XML) @Produces({MediaType.APPLICATION_XML,MediaType.TEXT_XML}) public Response createServiceInstance(@Context UriInfo uriInfo,String xml){
  log.debug("String_Node_Str",csarId,serviceTemplateID);
  IInstanceDataService service=InstanceDataServiceHandler.getInstanceDataService();
  try {
    ServiceInstance createdServiceInstance=service.createServiceInstance(csarId,serviceTemplateID);
    String corr=xml.substring(xml.indexOf("String_Node_Str") + 1,xml.indexOf("String_Node_Str"));
    int serviceTemplateInstanceId=createdServiceInstance.getDBId();
    String instanceURL=createdServiceInstance.getServiceInstanceID().toString();
    log.debug(corr + "String_Node_Str" + corr+ "String_Node_Str"+ instanceURL);
{
      BuildCorrelationToInstanceMapping.instance.correlateCorrelationIdToServiceTemplateInstanceId(corr,serviceTemplateInstanceId);
      PlanInvocationEngineHandler.planInvocationEngine.correctCorrelationToServiceTemplateInstanceIdMapping(csarId,serviceTemplateID,corr,serviceTemplateInstanceId);
    }
    SimpleXLink response=new SimpleXLink(uriInfo.getAbsolutePath().toString() + serviceTemplateInstanceId,"String_Node_Str");
    log.debug("String_Node_Str" + response.getHref());
    return Response.ok(response).build();
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new GenericRestException(Status.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}
Program: 40979
Project: 40979
Buggy source:
@POST @Consumes(MediaType.MULTIPART_FORM_DATA) public Response createFromArtefact(@FormDataParam("String_Node_Str") InputStream uploadedInputStream,@FormDataParam("String_Node_Str") FormDataContentDisposition fileDetail,@FormDataParam("String_Node_Str") FormDataBodyPart body,@FormDataParam("String_Node_Str") QName artifactType,@FormDataParam("String_Node_Str") Set<QName> nodeTypes,@FormDataParam("String_Node_Str") QName infrastructureNodeType,@FormDataParam("String_Node_Str") Set<String> tags,@Context UriInfo uriInfo) throws IllegalArgumentException, JAXBException, IOException {
  if (this.connector.isWineryRepositoryAvailable()) {
    return Response.status(Status.SERVICE_UNAVAILABLE).build();
  }
  File tempFile=this.inputStream2File(uploadedInputStream,fileDetail.getFileName());
  try {
    QName xaasServiceTemplate=this.connector.createServiceTemplateFromXaaSPackage(tempFile,artifactType,nodeTypes,infrastructureNodeType,this.createTagMapFromTagSet(tags));
    String redirectUrl=Utilities.buildURI(this.uriInfo.getAbsolutePath().toString(),"String_Node_Str" + Utilities.URLencode(xaasServiceTemplate.toString())).replace("String_Node_Str","String_Node_Str");
    return Response.created(URI.create(redirectUrl)).build();
  }
 catch (  URISyntaxException e) {
    e.printStackTrace();
  }
  return Response.serverError().build();
}

Fixed version (ground truth):
@POST @Consumes(MediaType.MULTIPART_FORM_DATA) public Response createFromArtefact(@FormDataParam("String_Node_Str") InputStream uploadedInputStream,@FormDataParam("String_Node_Str") FormDataContentDisposition fileDetail,@FormDataParam("String_Node_Str") FormDataBodyPart body,@FormDataParam("String_Node_Str") QName artifactType,@FormDataParam("String_Node_Str") Set<QName> nodeTypes,@FormDataParam("String_Node_Str") QName infrastructureNodeType,@FormDataParam("String_Node_Str") Set<String> tags,@Context UriInfo uriInfo) throws IllegalArgumentException, JAXBException, IOException {
  if (!this.connector.isWineryRepositoryAvailable()) {
    return Response.status(Status.SERVICE_UNAVAILABLE).build();
  }
  File tempFile=this.inputStream2File(uploadedInputStream,fileDetail.getFileName());
  try {
    QName xaasServiceTemplate=this.connector.createServiceTemplateFromXaaSPackage(tempFile,artifactType,nodeTypes,infrastructureNodeType,this.createTagMapFromTagSet(tags));
    String redirectUrl=Utilities.buildURI(this.uriInfo.getAbsolutePath().toString(),"String_Node_Str" + Utilities.URLencode(xaasServiceTemplate.toString())).replace("String_Node_Str","String_Node_Str");
    return Response.created(URI.create(redirectUrl)).build();
  }
 catch (  URISyntaxException e) {
    e.printStackTrace();
  }
  return Response.serverError().build();
}
Program: 40980
Project: 40980
Buggy source:
public boolean isWineryRepositoryAvailable(){
  HttpGet get=new HttpGet();
  get.setHeader("String_Node_Str","String_Node_Str");
  try {
    get.setURI(new URI(this.wineryPath + "String_Node_Str"));
    HttpResponse resp=this.client.execute(get);
    if (resp.getStatusLine().getStatusCode() < 400) {
      return true;
    }
  }
 catch (  URISyntaxException e) {
    e.printStackTrace();
  }
catch (  ClientProtocolException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return false;
}

Fixed version (ground truth):
public boolean isWineryRepositoryAvailable(){
  HttpGet get=new HttpGet();
  get.setHeader("String_Node_Str","String_Node_Str");
  try {
    get.setURI(new URI(this.wineryPath + "String_Node_Str"));
    HttpResponse resp=this.client.execute(get);
    EntityUtils.consume(resp.getEntity());
    if (resp.getStatusLine().getStatusCode() < 400) {
      return true;
    }
  }
 catch (  URISyntaxException e) {
    e.printStackTrace();
  }
catch (  ClientProtocolException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return false;
}
Program: 40981
Project: 40981
Buggy source:
@POST @Consumes(MediaType.APPLICATION_XML) @Produces({MediaType.APPLICATION_XML,MediaType.TEXT_XML}) public Response createServiceInstance(@Context UriInfo uriInfo,String xml){
  log.debug("String_Node_Str",csarId,serviceTemplateID);
  IInstanceDataService service=InstanceDataServiceHandler.getInstanceDataService();
  try {
    ServiceInstance createdServiceInstance=service.createServiceInstance(csarId,serviceTemplateID);
    String corr=xml.substring(xml.indexOf("String_Node_Str") + 1,xml.indexOf("String_Node_Str"));
    int serviceTemplateInstanceId=createdServiceInstance.getDBId();
    String instanceURL=createdServiceInstance.getServiceInstanceID().toString();
    log.debug(corr + "String_Node_Str" + corr+ "String_Node_Str"+ instanceURL);
{
      BuildCorrelationToInstanceMapping.instance.correlateCorrelationIdToServiceTemplateInstanceId(corr,serviceTemplateInstanceId);
      PlanInvocationEngineHandler.planInvocationEngine.correctCorrelationToServiceTemplateInstanceIdMapping(csarId,serviceTemplateID,corr,serviceTemplateInstanceId);
    }
    SimpleXLink response=new SimpleXLink(uriInfo.getAbsolutePath().toString() + "String_Node_Str" + serviceTemplateInstanceId,"String_Node_Str");
    log.debug("String_Node_Str" + response.getHref());
    return Response.ok(response).build();
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new GenericRestException(Status.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}

Fixed version (ground truth):
@POST @Consumes(MediaType.APPLICATION_XML) @Produces({MediaType.APPLICATION_XML,MediaType.TEXT_XML}) public Response createServiceInstance(@Context UriInfo uriInfo,String xml){
}
Program: 40983
Project: 40983
Buggy source:
@Override @WebMethod(exclude=true) public Document getServiceInstanceProperties(URI serviceInstanceID,List<QName> propertiesList) throws ReferenceNotFoundException {
  List<ServiceInstance> serviceInstances=this.getServiceInstances(serviceInstanceID,null,null);
  if ((serviceInstances == null) || (serviceInstances.size() != 1)) {
    String msg=String.format("String_Node_Str",serviceInstanceID);
    InstanceDataServiceImpl.LOG.warn(msg);
    throw new ReferenceNotFoundException(msg);
  }
  ServiceInstance serviceInstance=serviceInstances.get(0);
  return serviceInstance.getProperties();
}

Fixed version (ground truth):
@Override @WebMethod(exclude=true) public Document getServiceInstanceProperties(URI serviceInstanceID,List<QName> propertiesList) throws ReferenceNotFoundException {
  List<ServiceInstance> serviceInstances=this.getServiceInstances(serviceInstanceID,null,null);
  if ((serviceInstances == null) || (serviceInstances.size() != 1)) {
    String msg=String.format("String_Node_Str",serviceInstanceID);
    InstanceDataServiceImpl.LOG.warn(msg);
    throw new ReferenceNotFoundException(msg);
  }
  ServiceInstance serviceInstance=serviceInstances.get(0);
  this.updateServiceInstanceProperties(serviceInstance);
  return serviceInstance.getProperties();
}
Program: 40984
Project: 40984
Buggy source:
private NodeInstance getNodeInstanceFromMappingObject(ServiceInstance serviceInstance,Object obj){
  if (obj instanceof TNodeTemplate) {
    TNodeTemplate template=(TNodeTemplate)obj;
    List<NodeInstance> nodeInstances=serviceInstance.getNodeInstances();
    for (    NodeInstance nodeInstance : nodeInstances) {
      if (nodeInstance.getNodeTemplateID().getLocalPart().equals(template.getId())) {
        return nodeInstance;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private NodeInstance getNodeInstanceFromMappingObject(ServiceInstance serviceInstance,Object obj){
  if (obj instanceof TNodeTemplate) {
    TNodeTemplate template=(TNodeTemplate)obj;
    List<NodeInstance> nodeInstances=this.getNodeInstances(null,null,null,serviceInstance.getServiceInstanceID());
    if (nodeInstances == null) {
      return null;
    }
    for (    NodeInstance nodeInstance : nodeInstances) {
      if (nodeInstance.getNodeTemplateID().getLocalPart().equals(template.getId())) {
        return nodeInstance;
      }
    }
  }
  return null;
}