nus-yam/ex-repair huggingface dataset:
Program: 41502
Project: 41502
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: 41503
Project: 41503
Buggy source:
public Map<AbstractActivity,AbstractActivity> getLinks(){
  return links;
}

Fixed version (ground truth):
public Set<Link> getLinks(){
  return links;
}
Program: 41504
Project: 41504
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: 41505
Project: 41505
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: 41508
Project: 41508
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: 41509
Project: 41509
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: 41511
Project: 41511
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: 41513
Project: 41513
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: 41515
Project: 41515
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: 41516
Project: 41516
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: 41517
Project: 41517
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: 41518
Project: 41518
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: 41519
Project: 41519
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: 41521
Project: 41521
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: 41522
Project: 41522
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;
}
Program: 41531
Project: 41531
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean handle(TemplatePlanContext templateContext){
  AbstractNodeTemplate nodeTemplate=templateContext.getNodeTemplate();
  if (nodeTemplate == null) {
    return false;
  }
  if (Utils.isSupportedVMNodeType(nodeTemplate.getType().getId())) {
    return true;
  }
  if (Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) {
    return true;
  }
  if (Utils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) {
    if (nodeTemplate.getType().getId().equals(Types.openStackLiberty12NodeType) | nodeTemplate.getType().getId().equals(Types.vmWareVsphere55NodeType)) {
      return this.handler.handleWithCloudProviderInterface(templateContext,nodeTemplate);
    }
 else {
      return this.handler.handle(templateContext,nodeTemplate);
    }
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean handle(TemplatePlanContext templateContext){
  AbstractNodeTemplate nodeTemplate=templateContext.getNodeTemplate();
  if (nodeTemplate == null) {
    return false;
  }
  LOG.debug("String_Node_Str" + nodeTemplate.getId() + "String_Node_Str");
  if (Utils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) {
    return true;
  }
  if (Utils.isSupportedVMNodeType(nodeTemplate.getType().getId()) | Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) {
    for (    AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()) {
      if (Utils.isSupportedCloudProviderNodeType(relation.getTarget().getType().getId())) {
        if (relation.getTarget().getType().getId().equals(Types.openStackLiberty12NodeType) | relation.getTarget().getType().getId().equals(Types.vmWareVsphere55NodeType)) {
          return this.handler.handleWithCloudProviderInterface(templateContext,nodeTemplate);
        }
 else {
          return this.handler.handle(templateContext,nodeTemplate);
        }
      }
    }
    return true;
  }
  return false;
}
Program: 41533
Project: 41533
Buggy source:
/** 
 * Search from the given NodeTemplate for an Ubuntu NodeTemplate
 * @param nodeTemplate an AbstractNodeTemplate
 * @return an Ubuntu NodeTemplate, may be null
 */
private AbstractNodeTemplate findUbuntuNode(AbstractNodeTemplate nodeTemplate){
  for (  AbstractRelationshipTemplate relationTemplate : nodeTemplate.getIngoingRelations()) {
    if (org.opentosca.model.tosca.conventions.Utils.isSupportedInfrastructureNodeType(relationTemplate.getSource().getType().getId())) {
      return relationTemplate.getSource();
    }
    for (    AbstractRelationshipTemplate relationTemplate2 : relationTemplate.getSource().getIngoingRelations()) {
      if (org.opentosca.model.tosca.conventions.Utils.isSupportedInfrastructureNodeType(relationTemplate2.getSource().getType().getId())) {
        return relationTemplate2.getSource();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Search from the given NodeTemplate for an Ubuntu NodeTemplate
 * @param nodeTemplate an AbstractNodeTemplate
 * @return an Ubuntu NodeTemplate, may be null
 */
private AbstractNodeTemplate findUbuntuNode(AbstractNodeTemplate nodeTemplate){
  if (org.opentosca.model.tosca.conventions.Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) {
    return nodeTemplate;
  }
  for (  AbstractRelationshipTemplate relationTemplate : nodeTemplate.getIngoingRelations()) {
    if (org.opentosca.model.tosca.conventions.Utils.isSupportedInfrastructureNodeType(relationTemplate.getSource().getType().getId())) {
      return relationTemplate.getSource();
    }
    for (    AbstractRelationshipTemplate relationTemplate2 : relationTemplate.getSource().getIngoingRelations()) {
      if (org.opentosca.model.tosca.conventions.Utils.isSupportedInfrastructureNodeType(relationTemplate2.getSource().getType().getId())) {
        return relationTemplate2.getSource();
      }
    }
  }
  return null;
}
Program: 41534
Project: 41534
Buggy source:
/** 
 * Creates a string representing an ubuntu image id on a cloud provider
 * @param nodeType a QName of an Ubuntu ImplicitImage NodeType
 * @return a String containing an ubuntuImageId, if given QName is notpresenting an Ubuntu image then null
 */
private String createUbuntuImageStringFromNodeType(QName nodeType){
  if (!PluginUtils.isSupportedUbuntuVMNodeType(nodeType)) {
    return null;
  }
  String localName=nodeType.getLocalPart();
  String[] dotSplit=localName.split("String_Node_Str");
  if (dotSplit.length != 2) {
    return null;
  }
  String[] leftDashSplit=dotSplit[0].split("String_Node_Str");
  String[] rightDashSplit=dotSplit[1].split("String_Node_Str");
  if (leftDashSplit.length != 2 && rightDashSplit.length != 2) {
    return null;
  }
  if (!leftDashSplit[0].equals("String_Node_Str")) {
    return null;
  }
  int majorVers;
  try {
    majorVers=Integer.parseInt(leftDashSplit[1]);
  }
 catch (  NumberFormatException e) {
    return null;
  }
  if (!rightDashSplit[1].equals("String_Node_Str")) {
    return null;
  }
  int minorVers;
  try {
    minorVers=Integer.parseInt(rightDashSplit[0]);
  }
 catch (  NumberFormatException e) {
    return null;
  }
  String ubuntuAMIId="String_Node_Str" + majorVers + "String_Node_Str"+ minorVers+ "String_Node_Str";
  return ubuntuAMIId;
}

Fixed version (ground truth):
/** 
 * Creates a string representing an ubuntu image id on a cloud provider
 * @param nodeType a QName of an Ubuntu ImplicitImage NodeType
 * @return a String containing an ubuntuImageId, if given QName is notpresenting an Ubuntu image then null
 */
private String createUbuntuImageStringFromNodeType(QName nodeType){
  if (!PluginUtils.isSupportedUbuntuVMNodeType(nodeType)) {
    return null;
  }
  String localName=nodeType.getLocalPart();
  String[] dotSplit=localName.split("String_Node_Str");
  if (dotSplit.length != 2) {
    return null;
  }
  String[] leftDashSplit=dotSplit[0].split("String_Node_Str");
  String[] rightDashSplit=dotSplit[1].split("String_Node_Str");
  if (leftDashSplit.length != 2 && rightDashSplit.length != 2) {
    return null;
  }
  if (!leftDashSplit[0].equals("String_Node_Str")) {
    return null;
  }
  int majorVers;
  try {
    majorVers=Integer.parseInt(leftDashSplit[1]);
  }
 catch (  NumberFormatException e) {
    return null;
  }
  if (!rightDashSplit[1].equals("String_Node_Str")) {
    return null;
  }
  int minorVers;
  String minorVersString;
  try {
    minorVers=Integer.parseInt(rightDashSplit[0]);
    minorVersString=String.valueOf(minorVers).trim();
    if (minorVersString.length() != 2) {
      minorVersString="String_Node_Str" + minorVersString;
    }
  }
 catch (  NumberFormatException e) {
    return null;
  }
  String ubuntuAMIId="String_Node_Str" + majorVers + "String_Node_Str"+ minorVersString+ "String_Node_Str";
  return ubuntuAMIId;
}
Program: 41535
Project: 41535
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean handle(TemplatePlanContext templateContext){
  AbstractNodeTemplate nodeTemplate=templateContext.getNodeTemplate();
  if (nodeTemplate == null) {
    return false;
  }
  if (PluginUtils.isSupportedVMNodeType(nodeTemplate.getType().getId())) {
    return true;
  }
  if (PluginUtils.isSupportedUbuntuVMNodeType(nodeTemplate.getType().getId())) {
    return true;
  }
  if (PluginUtils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) {
    return this.handler.handle(templateContext,nodeTemplate);
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean handle(TemplatePlanContext templateContext){
  AbstractNodeTemplate nodeTemplate=templateContext.getNodeTemplate();
  if (nodeTemplate == null) {
    return false;
  }
  if (PluginUtils.isSupportedVMNodeType(nodeTemplate.getType().getId())) {
    return true;
  }
  if (PluginUtils.isSupportedUbuntuVMNodeType(nodeTemplate.getType().getId())) {
    return true;
  }
  if (PluginUtils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) {
    if (nodeTemplate.getType().getId().equals(Types.openStackLiberty12NodeType)) {
      return this.handler.handleOpenStackLiberty12WithUbuntu1404(templateContext,nodeTemplate);
    }
 else {
      return this.handler.handle(templateContext,nodeTemplate);
    }
  }
 else {
    return false;
  }
}
Program: 41536
Project: 41536
Buggy source:
/** 
 * Creates a string representing an ubuntu image id on a cloud provider
 * @param nodeType a QName of an Ubuntu ImplicitImage NodeType
 * @return a String containing an ubuntuImageId, if given QName is notpresenting an Ubuntu image then null
 */
private String createUbuntuImageStringFromNodeType(QName nodeType){
  if (!PluginUtils.isSupportedUbuntuVMNodeType(nodeType)) {
    return null;
  }
  String localName=nodeType.getLocalPart();
  String[] dotSplit=localName.split("String_Node_Str");
  if (dotSplit.length != 2) {
    return null;
  }
  String[] leftDashSplit=dotSplit[0].split("String_Node_Str");
  String[] rightDashSplit=dotSplit[1].split("String_Node_Str");
  if (leftDashSplit.length != 2 && rightDashSplit.length != 2) {
    return null;
  }
  if (!leftDashSplit[0].equals("String_Node_Str")) {
    return null;
  }
  int majorVers;
  try {
    majorVers=Integer.parseInt(leftDashSplit[1]);
  }
 catch (  NumberFormatException e) {
    return null;
  }
  if (!rightDashSplit[1].equals("String_Node_Str")) {
    return null;
  }
  int minorVers;
  String minorVersString;
  try {
    minorVers=Integer.parseInt(rightDashSplit[0]);
    minorVersString=String.valueOf(minorVers).trim();
    if (minorVersString.length() != 2) {
      minorVersString="String_Node_Str" + minorVersString;
    }
  }
 catch (  NumberFormatException e) {
    return null;
  }
  String ubuntuAMIId="String_Node_Str" + majorVers + "String_Node_Str"+ minorVersString+ "String_Node_Str";
  return ubuntuAMIId;
}

Fixed version (ground truth):
/** 
 * Creates a string representing an ubuntu image id on a cloud provider
 * @param nodeType a QName of an Ubuntu ImplicitImage NodeType
 * @return a String containing an ubuntuImageId, if given QName is notpresenting an Ubuntu image then null
 */
private String createUbuntuImageStringFromNodeType(QName nodeType){
  if (!PluginUtils.isSupportedUbuntuVMNodeType(nodeType)) {
    return null;
  }
  String localName=nodeType.getLocalPart();
  String[] dotSplit=localName.split("String_Node_Str");
  if (dotSplit.length != 2) {
    return null;
  }
  String[] leftDashSplit=dotSplit[0].split("String_Node_Str");
  String[] rightDashSplit=dotSplit[1].split("String_Node_Str");
  if (leftDashSplit.length != 2 && rightDashSplit.length != 2) {
    return null;
  }
  if (!leftDashSplit[0].equals("String_Node_Str")) {
    return null;
  }
  int majorVers;
  try {
    majorVers=Integer.parseInt(leftDashSplit[1]);
  }
 catch (  NumberFormatException e) {
    return null;
  }
  if (!rightDashSplit[1].equals("String_Node_Str") & !rightDashSplit[1].equals("String_Node_Str")) {
    return null;
  }
  int minorVers;
  String minorVersString;
  try {
    minorVers=Integer.parseInt(rightDashSplit[0]);
    minorVersString=String.valueOf(minorVers).trim();
    if (minorVersString.length() != 2) {
      minorVersString="String_Node_Str" + minorVersString;
    }
  }
 catch (  NumberFormatException e) {
    return null;
  }
  String ubuntuAMIId="String_Node_Str" + majorVers + "String_Node_Str"+ minorVersString+ "String_Node_Str";
  return ubuntuAMIId;
}
Program: 41541
Project: 41541
Buggy source:
/** 
 * Checks whether this Plugin can handle deploying artifacts of the given artfiactType to a given InfrastructureNode of the given infrastructureNodeType
 * @param scriptArtifactType a QName denoting an scriptArtifactType
 * @param infrastructureNodeType a QName denoting an infrastructureNodeType
 * @return a Boolean. True if given pair of QName's denotes a pair whichthis plugin can handle
 */
private boolean isSupportedDeploymentPair(QName artifactType,QName infrastructureNodeType){
  boolean isSupportedInfrastructureNode=false;
  isSupportedInfrastructureNode|=PluginUtils.isSupportedUbuntuVMNodeType(infrastructureNodeType);
  isSupportedInfrastructureNode|=infrastructureNodeType.equals(Utils.externalResourceNodeType);
  if (!isSupportedInfrastructureNode) {
    return false;
  }
  boolean isSupportedArtifactType=false;
  if (this.archiveArtifactType.equals(artifactType)) {
    isSupportedArtifactType|=true;
  }
  if (this.scriptArtifactType.equals(artifactType)) {
    isSupportedArtifactType|=true;
  }
  if (this.warArtifactType.equals(artifactType)) {
    isSupportedArtifactType|=true;
  }
  if (this.bpelArchiveArtifactType.equals(artifactType)) {
    isSupportedArtifactType|=true;
  }
  if (this.sqlArtifactType.equals(artifactType)) {
    isSupportedArtifactType|=true;
  }
  return isSupportedArtifactType;
}

Fixed version (ground truth):
/** 
 * Checks whether this Plugin can handle deploying artifacts of the given artfiactType to a given InfrastructureNode of the given infrastructureNodeType
 * @param scriptArtifactType a QName denoting an scriptArtifactType
 * @param infrastructureNodeType a QName denoting an infrastructureNodeType
 * @param isDA indicates whether this check is on an IA or DA with the given artifactType
 * @return a Boolean. True if given pair of QName's denotes a pair whichthis plugin can handle
 */
private boolean isSupportedDeploymentPair(QName artifactType,QName infrastructureNodeType,boolean isDA){
  if (!isDA && this.warArtifactType.equals(artifactType) && infrastructureNodeType.equals(new QName("String_Node_Str","String_Node_Str"))) {
    return true;
  }
  boolean isSupportedArtifactType=false;
  if (this.archiveArtifactType.equals(artifactType)) {
    isSupportedArtifactType|=true;
  }
  if (this.scriptArtifactType.equals(artifactType)) {
    isSupportedArtifactType|=true;
  }
  if (this.bpelArchiveArtifactType.equals(artifactType)) {
    isSupportedArtifactType|=true;
  }
  if (this.warArtifactType.equals(artifactType)) {
    isSupportedArtifactType|=true;
  }
  if (this.sqlArtifactType.equals(artifactType)) {
    isSupportedArtifactType|=true;
  }
  if (!PluginUtils.isSupportedUbuntuVMNodeType(infrastructureNodeType)) {
    return false;
  }
  return isSupportedArtifactType;
}
Program: 41542
Project: 41542
Buggy source:
@Override public boolean canHandle(AbstractImplementationArtifact ia,AbstractNodeType infrastructureNodeType){
  QName type=ia.getArtifactType();
  PrePhasePlugin.LOG.debug("String_Node_Str" + type.toString() + "String_Node_Str"+ infrastructureNodeType.getId().toString()+ "String_Node_Str");
  return this.isSupportedDeploymentPair(type,infrastructureNodeType.getId());
}

Fixed version (ground truth):
@Override public boolean canHandle(AbstractImplementationArtifact ia,AbstractNodeType infrastructureNodeType){
  QName type=ia.getArtifactType();
  PrePhasePlugin.LOG.debug("String_Node_Str" + type.toString() + "String_Node_Str"+ infrastructureNodeType.getId().toString()+ "String_Node_Str");
  return this.isSupportedDeploymentPair(type,infrastructureNodeType.getId(),false);
}
Program: 41548
Project: 41548
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  DeploymentArtifactImpl other=(DeploymentArtifactImpl)obj;
  if (artifact == null) {
    if (other.artifact != null)     return false;
  }
 else   if (!artifact.equals(other.artifact))   return false;
  if (def == null) {
    if (other.def != null)     return false;
  }
 else   if (!def.equals(other.def))   return false;
  if (!other.getArtifactType().toString().equals(this.getArtifactType().toString())) {
    return false;
  }
  if (!this.getName().equals(other.getName())) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  DeploymentArtifactImpl other=(DeploymentArtifactImpl)obj;
  if (artifact == null) {
    if (other.artifact != null)     return false;
  }
 else   if (!artifact.equals(other.artifact))   return false;
  if (def == null) {
    if (other.def != null)     return false;
  }
 else   if (!def.equals(other.def))   return false;
  if (!other.getArtifactType().equals(this.getArtifactType())) {
    return false;
  }
  if (!this.getName().equals(other.getName())) {
    return false;
  }
  return true;
}
Program: 41549
Project: 41549
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<AbstractNodeTypeImplementation> getImplementations(){
  List<AbstractNodeTypeImplementation> impls=new ArrayList<AbstractNodeTypeImplementation>();
  List<AbstractNodeTypeImplementation> foundImpls=this.findNodeTypeImpls(this.definitions);
  for (  AbstractNodeTypeImplementation impl : foundImpls) {
    if (impl == null) {
      NodeTemplateImpl.LOG.debug("String_Node_Str");
    }
    if (impl.getNodeType() == null) {
      NodeTemplateImpl.LOG.debug("String_Node_Str");
    }
    if (this.nodeTemplate == null) {
      NodeTemplateImpl.LOG.debug("String_Node_Str");
    }
    if (this.nodeTemplate.getType() == null) {
      NodeTemplateImpl.LOG.debug("String_Node_Str");
    }
    NodeTemplateImpl.LOG.debug("String_Node_Str" + impl.getName() + "String_Node_Str"+ this.nodeTemplate.getId());
    if (impl.getNodeType().getId().toString().equals(this.nodeTemplate.getType().toString())) {
      NodeTemplateImpl.LOG.debug("String_Node_Str" + this.nodeTemplate.getId() + "String_Node_Str"+ impl.getName());
      impls.add(impl);
    }
  }
  return impls;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public List<AbstractNodeTypeImplementation> getImplementations(){
  List<AbstractNodeTypeImplementation> impls=new ArrayList<AbstractNodeTypeImplementation>();
  List<AbstractNodeTypeImplementation> foundImpls=this.findNodeTypeImpls(this.definitions);
  for (  AbstractNodeTypeImplementation impl : foundImpls) {
    if (impl == null) {
      NodeTemplateImpl.LOG.debug("String_Node_Str");
    }
    if (impl.getNodeType() == null) {
      NodeTemplateImpl.LOG.debug("String_Node_Str");
    }
    if (this.nodeTemplate == null) {
      NodeTemplateImpl.LOG.debug("String_Node_Str");
    }
    if (this.nodeTemplate.getType() == null) {
      NodeTemplateImpl.LOG.debug("String_Node_Str");
    }
    NodeTemplateImpl.LOG.debug("String_Node_Str" + impl.getName() + "String_Node_Str"+ this.nodeTemplate.getId());
    if (impl.getNodeType().getId().equals(this.nodeTemplate.getType())) {
      NodeTemplateImpl.LOG.debug("String_Node_Str" + this.nodeTemplate.getId() + "String_Node_Str"+ impl.getName());
      impls.add(impl);
    }
  }
  return impls;
}
Program: 41550
Project: 41550
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public AbstractNodeType getType(){
  if (this.nodeTemplate == null) {
    NodeTemplateImpl.LOG.debug("String_Node_Str");
  }
  if (this.nodeTemplate.getType() == null) {
    NodeTemplateImpl.LOG.debug("String_Node_Str");
  }
  for (  AbstractNodeType nodeType : this.definitions.getAllNodeTypes()) {
    if (nodeType.getId().toString().equals(this.nodeTemplate.getType().toString())) {
      return nodeType;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public AbstractNodeType getType(){
  if (this.nodeTemplate == null) {
    NodeTemplateImpl.LOG.debug("String_Node_Str");
  }
  if (this.nodeTemplate.getType() == null) {
    NodeTemplateImpl.LOG.debug("String_Node_Str");
  }
  for (  AbstractNodeType nodeType : this.definitions.getAllNodeTypes()) {
    if (nodeType.getId().equals(this.nodeTemplate.getType())) {
      return nodeType;
    }
  }
  return null;
}
Program: 41551
Project: 41551
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public AbstractNodeType getTypeRef(){
  if (this.nodeType.getDerivedFrom() != null) {
    for (    AbstractNodeType nodeType : this.definitions.getAllNodeTypes()) {
      if (nodeType.getId().toString().equals(this.nodeType.getDerivedFrom().getTypeRef().toString())) {
        return nodeType;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public AbstractNodeType getTypeRef(){
  if (this.nodeType.getDerivedFrom() != null) {
    for (    AbstractNodeType nodeType : this.definitions.getAllNodeTypes()) {
      if (nodeType.getId().equals(this.nodeType.getDerivedFrom().getTypeRef())) {
        return nodeType;
      }
    }
  }
  return null;
}
Program: 41552
Project: 41552
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public QName getId(){
  String namespace;
  if ((this.getTargetNamespace() != null) && !this.getTargetNamespace().equals("String_Node_Str")) {
    namespace=this.getTargetNamespace();
  }
 else {
    namespace=this.definitions.getTargetNamespace();
  }
  return new QName("String_Node_Str" + namespace + "String_Node_Str"+ this.getName());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public QName getId(){
  String namespace;
  if ((this.getTargetNamespace() != null) && !this.getTargetNamespace().equals("String_Node_Str")) {
    namespace=this.getTargetNamespace();
  }
 else {
    namespace=this.definitions.getTargetNamespace();
  }
  return new QName(namespace,this.getName());
}
Program: 41553
Project: 41553
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public AbstractNodeType getNodeType(){
  if (this.nodeTypeImpl.getNodeType() == null) {
    NodeTypeImplementationImpl.LOG.error("String_Node_Str","String_Node_Str" + this.getTargetNamespace() + "String_Node_Str"+ this.getName());
  }
  for (  AbstractNodeType nodeType : this.definitions.getAllNodeTypes()) {
    if (nodeType.getId().toString().equals(this.nodeTypeImpl.getNodeType().toString())) {
      return nodeType;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public AbstractNodeType getNodeType(){
  if (this.nodeTypeImpl.getNodeType() == null) {
    NodeTypeImplementationImpl.LOG.error("String_Node_Str","String_Node_Str" + this.getTargetNamespace() + "String_Node_Str"+ this.getName());
  }
  for (  AbstractNodeType nodeType : this.definitions.getAllNodeTypes()) {
    if (nodeType.getId().equals(this.nodeTypeImpl.getNodeType())) {
      return nodeType;
    }
  }
  return null;
}
Program: 41554
Project: 41554
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<AbstractRelationshipTypeImplementation> getImplementations(){
  List<AbstractRelationshipTypeImplementation> impls=new ArrayList<AbstractRelationshipTypeImplementation>();
  for (  AbstractRelationshipTypeImplementation impl : this.findRelationshipTypeImpls(this.definitions)) {
    if (impl.getRelationshipType().getId().equals(this.relationshipTemplate.getType().getLocalPart())) {
      impls.add(impl);
    }
  }
  return impls;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public List<AbstractRelationshipTypeImplementation> getImplementations(){
  List<AbstractRelationshipTypeImplementation> impls=new ArrayList<AbstractRelationshipTypeImplementation>();
  for (  AbstractRelationshipTypeImplementation impl : this.findRelationshipTypeImpls(this.definitions)) {
    if (impl.getRelationshipType().getId().equals(this.relationshipTemplate.getType())) {
      impls.add(impl);
    }
  }
  return impls;
}
Program: 41555
Project: 41555
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public AbstractRelationshipType getReferencedType(){
  if (this.getTypeRef() != null) {
    for (    AbstractRelationshipType relation : this.definitions.getAllRelationshipTypes()) {
      if (relation.getId().toString().equals(this.getTypeRef().toString())) {
        return relation;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public AbstractRelationshipType getReferencedType(){
  if (this.getTypeRef() != null) {
    for (    AbstractRelationshipType relation : this.definitions.getAllRelationshipTypes()) {
      if (relation.getId().equals(this.getTypeRef())) {
        return relation;
      }
    }
  }
  return null;
}
Program: 41556
Project: 41556
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public AbstractRelationshipType getRelationshipType(){
  for (  AbstractRelationshipType relation : this.defs.getAllRelationshipTypes()) {
    if (relation.getId().toString().equals(this.relationshipTypeImpl.getRelationshipType().toString())) {
      return relation;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public AbstractRelationshipType getRelationshipType(){
  for (  AbstractRelationshipType relation : this.defs.getAllRelationshipTypes()) {
    if (relation.getId().equals(this.relationshipTypeImpl.getRelationshipType())) {
      return relation;
    }
  }
  return null;
}
Program: 41557
Project: 41557
Buggy source:
/** 
 * Returns a RelationshipType for the given QName. This method looks trough the whole Definitions space, which means the search looks trough the imported Definitions of this Definitions.
 * @param relationshipTypeId a QName
 * @return an AbstractRelationshipType, if nothing was found null
 */
public AbstractRelationshipType getRelationshipType(QName relationshipTypeId){
  for (  AbstractRelationshipType relationshipType : this.getRelationshipTypes()) {
    if (relationshipType.getId().toString().equals(relationshipTypeId.toString())) {
      return relationshipType;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns a RelationshipType for the given QName. This method looks trough the whole Definitions space, which means the search looks trough the imported Definitions of this Definitions.
 * @param relationshipTypeId a QName
 * @return an AbstractRelationshipType, if nothing was found null
 */
public AbstractRelationshipType getRelationshipType(QName relationshipTypeId){
  for (  AbstractRelationshipType relationshipType : this.getRelationshipTypes()) {
    if (relationshipType.getId().equals(relationshipTypeId)) {
      return relationshipType;
    }
  }
  return null;
}