nus-yam/ex-repair huggingface dataset:
Program: 41463
Project: 41463
Buggy source:
public boolean addInstanceIDVarToTemplatePlan(final BPELScopeActivity templatePlan){
  final String xsdPrefix="String_Node_Str" + System.currentTimeMillis();
  final String xsdNamespace="String_Node_Str";
  this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix,xsdNamespace,templatePlan.getBuildPlan());
  String templateId="String_Node_Str";
  String prefix="String_Node_Str";
  if (templatePlan.getNodeTemplate() != null) {
    templateId=templatePlan.getNodeTemplate().getId();
    prefix="String_Node_Str";
  }
 else {
    templateId=templatePlan.getRelationshipTemplate().getId();
    prefix="String_Node_Str";
  }
  final String instanceIdVarName=prefix + InstanceIDVarKeyword + "String_Node_Str"+ templateId+ "String_Node_Str"+ System.currentTimeMillis();
  return this.bpelProcessHandler.addVariable(instanceIdVarName,VariableType.TYPE,new QName(xsdNamespace,"String_Node_Str",xsdPrefix),templatePlan.getBuildPlan());
}

Fixed version (ground truth):
public boolean addInstanceIDVarToTemplatePlan(final BPELScopeActivity templatePlan){
  final String xsdPrefix="String_Node_Str" + System.currentTimeMillis();
  final String xsdNamespace="String_Node_Str";
  this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix,xsdNamespace,templatePlan.getBuildPlan());
  String templateId="String_Node_Str";
  String prefix="String_Node_Str";
  if (templatePlan.getNodeTemplate() != null) {
    templateId=templatePlan.getNodeTemplate().getId();
    prefix="String_Node_Str";
  }
 else {
    templateId=templatePlan.getRelationshipTemplate().getId();
    prefix="String_Node_Str";
  }
  final String instanceIdVarName=prefix + InstanceIDVarKeyword + "String_Node_Str"+ templateId.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ System.currentTimeMillis();
  return this.bpelProcessHandler.addVariable(instanceIdVarName,VariableType.TYPE,new QName(xsdNamespace,"String_Node_Str",xsdPrefix),templatePlan.getBuildPlan());
}
Program: 41464
Project: 41464
Buggy source:
private String findInstanceIdVarName(final List<String> varNames,final String templateId,final boolean isNode){
  final String instanceURLVarName=(isNode ? "String_Node_Str" : "String_Node_Str") + InstanceURLVarKeyword + "String_Node_Str"+ templateId+ "String_Node_Str";
  for (  final String varName : varNames) {
    if (varName.contains(instanceURLVarName)) {
      return varName;
    }
  }
  return null;
}

Fixed version (ground truth):
private String findInstanceIdVarName(final List<String> varNames,final String templateId,final boolean isNode){
  final String instanceURLVarName=(isNode ? "String_Node_Str" : "String_Node_Str") + InstanceURLVarKeyword + "String_Node_Str"+ templateId.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str";
  for (  final String varName : varNames) {
    if (varName.contains(instanceURLVarName)) {
      return varName;
    }
  }
  return null;
}
Program: 41465
Project: 41465
Buggy source:
/** 
 * Adds a NodeInstanceID Variable to the given TemplatePlan
 * @param templatePlan a TemplatePlan
 * @return true iff adding a NodeInstanceID Var was successful
 */
public boolean addInstanceURLVarToTemplatePlan(final BPELScopeActivity templatePlan){
  final String xsdPrefix="String_Node_Str" + System.currentTimeMillis();
  final String xsdNamespace="String_Node_Str";
  this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix,xsdNamespace,templatePlan.getBuildPlan());
  String templateId="String_Node_Str";
  String prefix="String_Node_Str";
  if (templatePlan.getNodeTemplate() != null) {
    templateId=templatePlan.getNodeTemplate().getId();
    prefix="String_Node_Str";
  }
 else {
    templateId=templatePlan.getRelationshipTemplate().getId();
    prefix="String_Node_Str";
  }
  final String instanceIdVarName=prefix + InstanceURLVarKeyword + "String_Node_Str"+ templateId+ "String_Node_Str"+ System.currentTimeMillis();
  return this.bpelProcessHandler.addVariable(instanceIdVarName,VariableType.TYPE,new QName(xsdNamespace,"String_Node_Str",xsdPrefix),templatePlan.getBuildPlan());
}

Fixed version (ground truth):
/** 
 * Adds a NodeInstanceID Variable to the given TemplatePlan
 * @param templatePlan a TemplatePlan
 * @return true iff adding a NodeInstanceID Var was successful
 */
public boolean addInstanceURLVarToTemplatePlan(final BPELScopeActivity templatePlan){
  final String xsdPrefix="String_Node_Str" + System.currentTimeMillis();
  final String xsdNamespace="String_Node_Str";
  this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix,xsdNamespace,templatePlan.getBuildPlan());
  String templateId="String_Node_Str";
  String prefix="String_Node_Str";
  if (templatePlan.getNodeTemplate() != null) {
    templateId=templatePlan.getNodeTemplate().getId();
    prefix="String_Node_Str";
  }
 else {
    templateId=templatePlan.getRelationshipTemplate().getId();
    prefix="String_Node_Str";
  }
  final String instanceIdVarName=prefix + InstanceURLVarKeyword + "String_Node_Str"+ templateId.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ System.currentTimeMillis();
  return this.bpelProcessHandler.addVariable(instanceIdVarName,VariableType.TYPE,new QName(xsdNamespace,"String_Node_Str",xsdPrefix),templatePlan.getBuildPlan());
}
Program: 41468
Project: 41468
Buggy source:
/** 
 * Initializes Properties inside the given PropertyMap of the given TemplateBuildPlan
 * @param map a PropertyMap to save the mappings to
 * @param templatePlan the TemplateBuildPlan to initialize its properties
 */
public void initializePropertiesAsVariables(final PropertyMap map,final BPELScopeActivity templatePlan){
  if (templatePlan.getRelationshipTemplate() != null) {
    this.initPropsAsVarsInRelationship(map,templatePlan);
  }
 else {
    this.initPropsAsVarsInNode(map,templatePlan);
  }
}

Fixed version (ground truth):
/** 
 * Initializes Properties inside the given PropertyMap of the given TemplateBuildPlan
 * @param map a PropertyMap to save the mappings to
 * @param templatePlan the TemplateBuildPlan to initialize its properties
 */
public void initializePropertiesAsVariables(final PropertyMap map,final BPELScopeActivity templatePlan){
  if (templatePlan.getRelationshipTemplate() != null) {
    initPropsAsVarsInRelationship(map,templatePlan);
  }
 else {
    initPropsAsVarsInNode(map,templatePlan);
  }
}
Program: 41469
Project: 41469
Buggy source:
@Override public void start(final BundleContext bundleContext) throws Exception {
  logger.info("String_Node_Str",bundleContext.getBundle().getSymbolicName(),bundleContext.getBundle().getVersion());
  context=bundleContext;
  this.services.add(bundleContext.registerService(RootController.class,new RootController(),null));
  configurator(bundleContext);
  this.services.add(bundleContext.registerService(ApplicationConfiguration.class,this,null));
  this.services.add(bundleContext.registerService(CorsFilter.class,new CorsFilter(),null));
  this.services.add(bundleContext.registerService(PlainTextMessageBodyWriter.class,new PlainTextMessageBodyWriter(),null));
  this.services.add(bundleContext.registerService(ObjectMapperProvider.class,new ObjectMapperProvider(),null));
  this.services.add(bundleContext.registerService(JacksonFeature.class,new JacksonFeature(),null));
  this.services.add(bundleContext.registerService(MultiPartFeature.class,new MultiPartFeature(),null));
  this.services.add(bundleContext.registerService(JAXBContextProvider.class,new JAXBContextProvider(),null));
}

Fixed version (ground truth):
@Override public void start(final BundleContext bundleContext) throws Exception {
  logger.info("String_Node_Str",bundleContext.getBundle().getSymbolicName(),bundleContext.getBundle().getVersion());
  context=bundleContext;
  this.services.add(bundleContext.registerService(RootController.class,new RootController(),null));
  configurator(bundleContext);
  this.services.add(bundleContext.registerService(ApplicationConfiguration.class,this,null));
  this.services.add(bundleContext.registerService(CorsFilter.class,new CorsFilter(),null));
  this.services.add(bundleContext.registerService(PlainTextMessageBodyWriter.class,new PlainTextMessageBodyWriter(),null));
  this.services.add(bundleContext.registerService(URI2XMLMessageBodyWriter.class,new URI2XMLMessageBodyWriter(),null));
  this.services.add(bundleContext.registerService(ObjectMapperProvider.class,new ObjectMapperProvider(),null));
  this.services.add(bundleContext.registerService(JacksonFeature.class,new JacksonFeature(),null));
  this.services.add(bundleContext.registerService(MultiPartFeature.class,new MultiPartFeature(),null));
  this.services.add(bundleContext.registerService(JAXBContextProvider.class,new JAXBContextProvider(),null));
}
Program: 41471
Project: 41471
Buggy source:
@Path("String_Node_Str") public NodeTemplateInstanceController getInstances(@ApiParam(hidden=true) @PathParam("String_Node_Str") final String nodeTemplateId){
  if (!this.nodeTemplateService.hasNodeTemplate(csarId,serviceTemplateId,nodeTemplateId)) {
    logger.info("String_Node_Str" + nodeTemplateId + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + nodeTemplateId + "String_Node_Str");
  }
  NodeTemplateInstanceController child=new NodeTemplateInstanceController(instanceService);
  this.resourceContext.initResource(child);
  return child;
}

Fixed version (ground truth):
@Path("String_Node_Str") public NodeTemplateInstanceController getInstances(@ApiParam(hidden=true) @PathParam("String_Node_Str") final String nodeTemplateId){
  if (!this.nodeTemplateService.hasNodeTemplate(csarId,QName.valueOf(serviceTemplateId),QName.valueOf(nodeTemplateId))) {
    logger.info("String_Node_Str" + nodeTemplateId + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + nodeTemplateId + "String_Node_Str");
  }
  NodeTemplateInstanceController child=new NodeTemplateInstanceController(instanceService);
  this.resourceContext.initResource(child);
  return child;
}
Program: 41472
Project: 41472
Buggy source:
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @ApiOperation(value="String_Node_Str",response=NodeTemplateDTO.class) public Response getNodeTemplate(@PathParam("String_Node_Str") final String nodeTemplateId) throws NotFoundException {
  final NodeTemplateDTO result=this.nodeTemplateService.getNodeTemplateById(csarId,serviceTemplateId,nodeTemplateId);
  result.add(UriUtils.generateSubResourceLink(uriInfo,"String_Node_Str",false,"String_Node_Str"));
  result.add(UriUtils.generateSelfLink(uriInfo));
  return Response.ok(result).build();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @ApiOperation(value="String_Node_Str",response=NodeTemplateDTO.class) public Response getNodeTemplate(@PathParam("String_Node_Str") final String nodeTemplateId) throws NotFoundException {
  final NodeTemplateDTO result=this.nodeTemplateService.getNodeTemplateById(csarId,QName.valueOf(serviceTemplateId),QName.valueOf(nodeTemplateId));
  result.add(UriUtils.generateSubResourceLink(uriInfo,"String_Node_Str",false,"String_Node_Str"));
  result.add(UriUtils.generateSelfLink(uriInfo));
  return Response.ok(result).build();
}
Program: 41473
Project: 41473
Buggy source:
public Collection<NodeTemplateInstance> getNodeTemplateInstances(final QName nodeTemplate){
  logger.debug("String_Node_Str",nodeTemplate);
  return this.nodeTemplateInstanceRepository.findByTemplateId(nodeTemplate);
}

Fixed version (ground truth):
public Collection<NodeTemplateInstance> getNodeTemplateInstances(final QName nodeTemplateQName){
  logger.debug("String_Node_Str",nodeTemplateQName);
  return this.nodeTemplateInstanceRepository.findByTemplateId(nodeTemplateQName);
}
Program: 41474
Project: 41474
Buggy source:
/** 
 * Gets the node template specified by its id
 * @param csarId The id of the CSAR
 * @param serviceTemplateId The id of the service template within the given CSAR
 * @param nodeTemplateId The id of the node template we want to get and that belongs to the specified service template
 * @return The node template specified by the given id
 * @throws NotFoundException If the service template does not contain the specified node template
 */
public NodeTemplateDTO getNodeTemplateById(String csarId,String serviceTemplateId,String nodeTemplateId) throws NotFoundException {
  final CSARContent csarContent=this.csarService.findById(csarId);
  final CSARID idOfCsar=csarContent.getCSARID();
  final QName serviceTemplateQName=QName.valueOf(serviceTemplateId);
  if (!this.toscaEngineService.getNodeTemplatesOfServiceTemplate(idOfCsar,serviceTemplateQName).contains(nodeTemplateId)) {
    logger.info("String_Node_Str" + nodeTemplateId + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + nodeTemplateId + "String_Node_Str");
  }
  return createNodeTemplate(idOfCsar,serviceTemplateQName,nodeTemplateId);
}

Fixed version (ground truth):
/** 
 * Gets the node template specified by its id
 * @param csarId The id of the CSAR
 * @param serviceTemplateQName The QName of the service template within the given CSAR
 * @param nodeTemplateQName The QName of the node template we want to get and that belongs to the specified service template
 * @return The node template specified by the given id
 * @throws NotFoundException If the service template does not contain the specified node template
 */
public NodeTemplateDTO getNodeTemplateById(String csarId,QName serviceTemplateQName,QName nodeTemplateQName) throws NotFoundException {
  final CSARContent csarContent=this.csarService.findById(csarId);
  final CSARID idOfCsar=csarContent.getCSARID();
  if (!this.toscaEngineService.getNodeTemplatesOfServiceTemplate(idOfCsar,serviceTemplateQName).contains(nodeTemplateQName.getLocalPart())) {
    logger.info("String_Node_Str" + nodeTemplateQName + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + nodeTemplateQName + "String_Node_Str");
  }
  return createNodeTemplate(idOfCsar,serviceTemplateQName,nodeTemplateQName);
}
Program: 41475
Project: 41475
Buggy source:
/** 
 * Gets a collection of node templates associated to a given service template.
 * @param csarId The id of the CSAR
 * @param serviceTemplateId The id of the service template within the given CSAR
 * @return A collection of node templates stored within the given servicetemplate.
 */
public List<NodeTemplateDTO> getNodeTemplatesOfServiceTemplate(String csarId,String serviceTemplateId){
  final CSARContent csarContent=this.csarService.findById(csarId);
  final List<String> nodeTemplateIds=toscaEngineService.getNodeTemplatesOfServiceTemplate(csarContent.getCSARID(),QName.valueOf(serviceTemplateId));
  final List<NodeTemplateDTO> nodeTemplates=Lists.newArrayList();
  NodeTemplateDTO currentNodeTemplate;
  for (  final String id : nodeTemplateIds) {
    currentNodeTemplate=createNodeTemplate(csarContent.getCSARID(),QName.valueOf(serviceTemplateId),id);
    nodeTemplates.add(currentNodeTemplate);
  }
  return nodeTemplates;
}

Fixed version (ground truth):
/** 
 * Gets a collection of node templates associated to a given service template.
 * @param csarId The id of the CSAR
 * @param serviceTemplateQName The QName of the service template within the given CSAR
 * @return A collection of node templates stored within the given servicetemplate.
 */
public List<NodeTemplateDTO> getNodeTemplatesOfServiceTemplate(String csarId,String serviceTemplateQName){
  final CSARContent csarContent=this.csarService.findById(csarId);
  final List<String> nodeTemplateIds=toscaEngineService.getNodeTemplatesOfServiceTemplate(csarContent.getCSARID(),QName.valueOf(serviceTemplateQName));
  final List<NodeTemplateDTO> nodeTemplates=Lists.newArrayList();
  NodeTemplateDTO currentNodeTemplate;
  for (  final String id : nodeTemplateIds) {
    currentNodeTemplate=createNodeTemplate(csarContent.getCSARID(),QName.valueOf(serviceTemplateQName),id);
    nodeTemplates.add(currentNodeTemplate);
  }
  return nodeTemplates;
}
Program: 41476
Project: 41476
Buggy source:
/** 
 * Checks whether the specified service template contains a given node template.
 * @param csarId The id of the CSAR
 * @param serviceTemplateId the id of the service template
 * @param nodeTemplateId the id of the node template to check for
 * @return <code>true</code> when the CSAR contains the service template and theservice template contains the node template, otherwise <code>false</code>
 */
public boolean hasNodeTemplate(String csarId,String serviceTemplateId,String nodeTemplateId){
  return this.getNodeTemplateIdsOfServiceTemplate(csarId,serviceTemplateId).contains(nodeTemplateId);
}

Fixed version (ground truth):
/** 
 * Checks whether the specified service template contains a given node template.
 * @param csarId The id of the CSAR
 * @param serviceTemplateQName the QName of the service template
 * @param nodeTemplateId the QName of the node template to check for
 * @return <code>true</code> when the CSAR contains the service template and theservice template contains the node template, otherwise <code>false</code>
 */
public boolean hasNodeTemplate(String csarId,QName serviceTemplateQName,QName nodeTemplateQName){
  return this.getNodeTemplateIdsOfServiceTemplate(csarId,serviceTemplateQName.toString()).contains(nodeTemplateQName.getLocalPart());
}
Program: 41477
Project: 41477
Buggy source:
private NodeTemplateDTO createNodeTemplate(CSARID csarId,QName serviceTemplateId,String nodeTemplateId){
  final NodeTemplateDTO currentNodeTemplate=new NodeTemplateDTO();
  currentNodeTemplate.setId(nodeTemplateId);
  currentNodeTemplate.setName(nodeTemplateId);
  currentNodeTemplate.setNodeType(this.toscaEngineService.getNodeTypeOfNodeTemplate(csarId,serviceTemplateId,nodeTemplateId).toString());
  return currentNodeTemplate;
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the NodeTemplateDTO class. It fetches the qualified name of node type of the node template.
 * @param csarId
 * @param serviceTemplateQName
 * @param nodeTemplateQName
 * @return
 */
private NodeTemplateDTO createNodeTemplate(CSARID csarId,QName serviceTemplateQName,QName nodeTemplateQName){
  final NodeTemplateDTO currentNodeTemplate=new NodeTemplateDTO();
  currentNodeTemplate.setId(nodeTemplateQName.toString());
  currentNodeTemplate.setName(nodeTemplateQName.toString());
  currentNodeTemplate.setNodeType(this.toscaEngineService.getNodeTypeOfNodeTemplate(csarId,serviceTemplateQName,nodeTemplateQName.getLocalPart()).toString());
  return currentNodeTemplate;
}
Program: 41478
Project: 41478
Buggy source:
/** 
 * Gets a collection of node template ids associated to a given service template.
 * @param csarId The id of the CSAR
 * @param serviceTemplateId the id of the service template within the given CSAR
 * @return A collection of node template ids stored within the given servicetemplate.
 */
private List<String> getNodeTemplateIdsOfServiceTemplate(String csarId,String serviceTemplateId){
  final CSARContent csarContent=this.csarService.findById(csarId);
  return toscaEngineService.getNodeTemplatesOfServiceTemplate(csarContent.getCSARID(),QName.valueOf(serviceTemplateId));
}

Fixed version (ground truth):
/** 
 * Gets a collection of node template ids associated to a given service template.
 * @param csarId The id of the CSAR
 * @param serviceTemplateQName the QName of the service template within the given CSAR
 * @return A collection of node template ids stored within the given servicetemplate.
 */
private List<String> getNodeTemplateIdsOfServiceTemplate(String csarId,String serviceTemplateQName){
  final CSARContent csarContent=this.csarService.findById(csarId);
  return toscaEngineService.getNodeTemplatesOfServiceTemplate(csarContent.getCSARID(),QName.valueOf(serviceTemplateQName));
}
Program: 41479
Project: 41479
Buggy source:
@Override public void start(final BundleContext bundleContext) throws Exception {
  logger.info("String_Node_Str",bundleContext.getBundle().getSymbolicName(),bundleContext.getBundle().getVersion());
  context=bundleContext;
  this.services.add(bundleContext.registerService(RootController.class,new RootController(),null));
  this.configurator(bundleContext);
  this.configureSwagger(bundleContext);
  this.services.add(bundleContext.registerService(ApplicationConfiguration.class,this,null));
  this.services.add(bundleContext.registerService(CorsFilter.class,new CorsFilter(),null));
  this.services.add(bundleContext.registerService(PlainTextMessageBodyWriter.class,new PlainTextMessageBodyWriter(),null));
  this.services.add(bundleContext.registerService(ObjectMapperProvider.class,new ObjectMapperProvider(),null));
  this.services.add(bundleContext.registerService(JacksonFeature.class,new JacksonFeature(),null));
  this.services.add(bundleContext.registerService(MultiPartFeature.class,new MultiPartFeature(),null));
  this.services.add(bundleContext.registerService(JAXBContextProvider.class,new JAXBContextProvider(),null));
}

Fixed version (ground truth):
@Override public void start(final BundleContext bundleContext) throws Exception {
  logger.info("String_Node_Str",bundleContext.getBundle().getSymbolicName(),bundleContext.getBundle().getVersion());
  context=bundleContext;
  this.services.add(bundleContext.registerService(RootController.class,new RootController(),null));
  this.configurator(bundleContext);
  this.services.add(bundleContext.registerService(ApplicationConfiguration.class,this,null));
  this.services.add(bundleContext.registerService(CorsFilter.class,new CorsFilter(),null));
  this.services.add(bundleContext.registerService(PlainTextMessageBodyWriter.class,new PlainTextMessageBodyWriter(),null));
  this.services.add(bundleContext.registerService(ObjectMapperProvider.class,new ObjectMapperProvider(),null));
  this.services.add(bundleContext.registerService(JacksonFeature.class,new JacksonFeature(),null));
  this.services.add(bundleContext.registerService(MultiPartFeature.class,new MultiPartFeature(),null));
  this.services.add(bundleContext.registerService(JAXBContextProvider.class,new JAXBContextProvider(),null));
}
Program: 41480
Project: 41480
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: 41481
Project: 41481
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: 41482
Project: 41482
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: 41483
Project: 41483
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: 41484
Project: 41484
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: 41485
Project: 41485
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: 41486
Project: 41486
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: 41487
Project: 41487
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: 41488
Project: 41488
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: 41489
Project: 41489
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: 41491
Project: 41491
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: 41492
Project: 41492
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: 41494
Project: 41494
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: 41495
Project: 41495
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: 41496
Project: 41496
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: 41497
Project: 41497
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: 41498
Project: 41498
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: 41499
Project: 41499
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);
}