nus-yam/ex-repair huggingface dataset:
Program: 41558
Project: 41558
Buggy source:
/** 
 * Returns a NodeType 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 nodeTypeId a QName
 * @return an AbstractNodeType, if nothing was found null
 */
public AbstractNodeType getNodeType(QName nodeTypeId){
  for (  AbstractNodeType nodeType : this.getNodeTypes()) {
    if (nodeType.getId().toString().equals(nodeTypeId.toString())) {
      return nodeType;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns a NodeType 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 nodeTypeId a QName
 * @return an AbstractNodeType, if nothing was found null
 */
public AbstractNodeType getNodeType(QName nodeTypeId){
  for (  AbstractNodeType nodeType : this.getNodeTypes()) {
    if (nodeType.getId().equals(nodeTypeId)) {
      return nodeType;
    }
  }
  return null;
}
Program: 41559
Project: 41559
Buggy source:
/** 
 * Checks whether the given Node is an ubuntu 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 ubuntu nodeType
 */
public static boolean isSupportedUbuntuVMNodeType(QName nodeType){
  if (nodeType.toString().equals(Types.ubuntuNodeType.toString())) {
    return true;
  }
  String nodeTypeNS=nodeType.getNamespaceURI();
  String nodeTypeLN=nodeType.getLocalPart();
  if (nodeTypeNS.equals("String_Node_Str") && PluginUtils.isProperUbuntuLocalName(nodeTypeLN)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the given Node is an ubuntu 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 ubuntu nodeType
 */
public static boolean isSupportedUbuntuVMNodeType(QName nodeType){
  if (nodeType.equals(Types.ubuntuNodeType)) {
    return true;
  }
  String nodeTypeNS=nodeType.getNamespaceURI();
  String nodeTypeLN=nodeType.getLocalPart();
  if (nodeTypeNS.equals("String_Node_Str") && PluginUtils.isProperUbuntuLocalName(nodeTypeLN)) {
    return true;
  }
  return false;
}
Program: 41560
Project: 41560
Buggy source:
/** 
 * Checks whether the given NodeType is a cloud provider 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 a cloud providernodeType
 */
public static boolean isSupportedCloudProviderNodeType(QName nodeType){
  if (nodeType.toString().equals(Types.ec2NodeType.toString()) | nodeType.toString().equals(Types.openStackNodeType.toString())) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the given NodeType is a cloud provider 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 a cloud providernodeType
 */
public static boolean isSupportedCloudProviderNodeType(QName nodeType){
  if (nodeType.equals(Types.ec2NodeType) | nodeType.equals(Types.openStackNodeType)) {
    return true;
  }
  return false;
}
Program: 41561
Project: 41561
Buggy source:
/** 
 * Checks whether the given Node is a virtual machine nodeType that can by handled by the set of plugins used by the PlanBuilder
 * @param nodeType a QName denoting some nodeType
 * @return a boolean. True if given nodeType is a virtual machine nodeType
 */
public static boolean isSupportedVMNodeType(QName nodeType){
  if (nodeType.toString().equals(Types.vmNodeType.toString())) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the given Node is a virtual machine nodeType that can by handled by the set of plugins used by the PlanBuilder
 * @param nodeType a QName denoting some nodeType
 * @return a boolean. True if given nodeType is a virtual machine nodeType
 */
public static boolean isSupportedVMNodeType(QName nodeType){
  if (nodeType.equals(Types.vmNodeType)) {
    return true;
  }
  return false;
}
Program: 41562
Project: 41562
Buggy source:
private boolean isZipArtifact(AbstractDeploymentArtifact artifact){
  if (artifact.getArtifactType().toString().equals(this.zipArtifactType.toString())) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean isZipArtifact(AbstractDeploymentArtifact artifact){
  if (artifact.getArtifactType().equals(this.zipArtifactType)) {
    return true;
  }
 else {
    return false;
  }
}
Program: 41563
Project: 41563
Buggy source:
private AbstractArtifactReference fetchPhpAppDA(List<AbstractDeploymentArtifact> das){
  for (  AbstractDeploymentArtifact da : das) {
    if (da.getArtifactType().toString().equals(this.zipArtifactType.toString())) {
      for (      AbstractArtifactReference ref : da.getArtifactRef().getArtifactReferences()) {
        if (ref.getReference().endsWith("String_Node_Str")) {
          return ref;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private AbstractArtifactReference fetchPhpAppDA(List<AbstractDeploymentArtifact> das){
  for (  AbstractDeploymentArtifact da : das) {
    if (da.getArtifactType().equals(this.zipArtifactType)) {
      for (      AbstractArtifactReference ref : da.getArtifactRef().getArtifactReferences()) {
        if (ref.getReference().endsWith("String_Node_Str")) {
          return ref;
        }
      }
    }
  }
  return null;
}
Program: 41564
Project: 41564
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){
  if (!PluginUtils.isSupportedUbuntuVMNodeType(infrastructureNodeType)) {
    return false;
  }
  boolean isSupportedArtifactType=false;
  if (this.archiveArtifactType.toString().equals(artifactType.toString())) {
    isSupportedArtifactType|=true;
  }
  if (this.scriptArtifactType.toString().equals(artifactType.toString())) {
    isSupportedArtifactType|=true;
  }
  if (this.warArtifactType.toString().equals(artifactType.toString())) {
    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
 * @return a Boolean. True if given pair of QName's denotes a pair whichthis plugin can handle
 */
private boolean isSupportedDeploymentPair(QName artifactType,QName infrastructureNodeType){
  if (!PluginUtils.isSupportedUbuntuVMNodeType(infrastructureNodeType)) {
    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;
  }
  return isSupportedArtifactType;
}
Program: 41565
Project: 41565
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean canHandle(QName artifactType){
  return artifactType.toString().equals(this.baseTypeScriptArtifact.toString());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean canHandle(QName artifactType){
  return artifactType.equals(this.baseTypeScriptArtifact);
}
Program: 41566
Project: 41566
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean canHandle(QName artifactType){
  return artifactType.toString().equals(this.openTOSCAWar.toString());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean canHandle(QName artifactType){
  return artifactType.equals(this.openTOSCAWar);
}
Program: 41567
Project: 41567
Buggy source:
/** 
 * Checks whether the given QName represents a Apache Web Server NodeType compatible with this plugin
 * @param nodeTypeId a QName denoting a TOSCA NodeType
 * @return true iff the given QName is a NodeType this plugin can handle
 */
public static boolean isApacheNodeTypeCompatible(QName nodeTypeId){
  if (nodeTypeId.toString().equals(Plugin.apacheNodeType.toString())) {
    return true;
  }
  if (nodeTypeId.toString().equals(Plugin.apacheNodeTypeTOSCASpecificType.toString())) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the given QName represents a Apache Web Server NodeType compatible with this plugin
 * @param nodeTypeId a QName denoting a TOSCA NodeType
 * @return true iff the given QName is a NodeType this plugin can handle
 */
public static boolean isApacheNodeTypeCompatible(QName nodeTypeId){
  if (nodeTypeId.equals(Plugin.apacheNodeType)) {
    return true;
  }
  if (nodeTypeId.equals(Plugin.apacheNodeTypeTOSCASpecificType)) {
    return true;
  }
  return false;
}
Program: 41568
Project: 41568
Buggy source:
public static boolean isSqlScriptArtifact(AbstractDeploymentArtifact da){
  if (da.getArtifactType().toString().equals(Constants.sqlScriptArtifactType.toString())) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean isSqlScriptArtifact(AbstractDeploymentArtifact da){
  if (da.getArtifactType().equals(Constants.sqlScriptArtifactType)) {
    return true;
  }
  return false;
}
Program: 41569
Project: 41569
Buggy source:
/** 
 * Checks whether the given QName represents a MySQL Server NodeType understood by this plugin
 * @param nodeTypeId a QName
 * @return true iff the QName represents a MySQL NodeType
 */
public static boolean isCompatibleMySQLServerNodeType(QName nodeTypeId){
  return Plugin.mySqlServerNodeType.toString().equals(nodeTypeId.toString());
}

Fixed version (ground truth):
/** 
 * Checks whether the given QName represents a MySQL Server NodeType understood by this plugin
 * @param nodeTypeId a QName
 * @return true iff the QName represents a MySQL NodeType
 */
public static boolean isCompatibleMySQLServerNodeType(QName nodeTypeId){
  return Plugin.mySqlServerNodeType.equals(nodeTypeId);
}
Program: 41570
Project: 41570
Buggy source:
/** 
 * Checks whether the given QName is accepted as an ApacheWebServer Node
 * @param nodeTypeId a QName
 * @return true iff the QName represents an ApacheWebServer
 */
private boolean isApacheWebServerNodeTypeCompatible(QName nodeTypeId){
  if (nodeTypeId.toString().equals(this.apacheNodeType.toString())) {
    return true;
  }
  if (nodeTypeId.toString().equals(this.apacheNodeTypeTOSCASpecificType.toString())) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the given QName is accepted as an ApacheWebServer Node
 * @param nodeTypeId a QName
 * @return true iff the QName represents an ApacheWebServer
 */
private boolean isApacheWebServerNodeTypeCompatible(QName nodeTypeId){
  if (nodeTypeId.equals(this.apacheNodeType)) {
    return true;
  }
  if (nodeTypeId.equals(this.apacheNodeTypeTOSCASpecificType)) {
    return true;
  }
  return false;
}
Program: 41571
Project: 41571
Buggy source:
/** 
 * Checks whether the given QName is accepted as an PhpModule Node
 * @param nodeTypeId a QName
 * @return true iff the QName represents an PhpModule
 */
private boolean isPhpModuleNodeTypeCompatible(QName nodeTypeId){
  if (nodeTypeId.toString().equals(this.phpModule.toString())) {
    return true;
  }
  if (nodeTypeId.toString().equals(this.phpModuleTOSCASpecificType.toString())) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the given QName is accepted as an PhpModule Node
 * @param nodeTypeId a QName
 * @return true iff the QName represents an PhpModule
 */
private boolean isPhpModuleNodeTypeCompatible(QName nodeTypeId){
  if (nodeTypeId.equals(this.phpModule)) {
    return true;
  }
  if (nodeTypeId.equals(this.phpModuleTOSCASpecificType)) {
    return true;
  }
  return false;
}
Program: 41572
Project: 41572
Buggy source:
private boolean isCompatiblePhpAppNodeType(AbstractNodeType nodeType){
  if (nodeType.getId().toString().equals(this.phpApp.toString())) {
    return true;
  }
  if (nodeType.getId().toString().equals(this.phpAppNodeTypePlanBuilder.toString())) {
    return true;
  }
  QName test=nodeType.getId();
  List<QName> typesInHierarchy=Utils.getNodeTypeHierarchy(nodeType);
  for (  QName hierarchyType : typesInHierarchy) {
    if (hierarchyType.toString().equals(this.phpApp.toString()) | hierarchyType.toString().equals(this.phpAppNodeTypePlanBuilder.toString())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isCompatiblePhpAppNodeType(AbstractNodeType nodeType){
  if (nodeType.getId().equals(this.phpApp)) {
    return true;
  }
  if (nodeType.getId().equals(this.phpAppNodeTypePlanBuilder)) {
    return true;
  }
  QName test=nodeType.getId();
  List<QName> typesInHierarchy=Utils.getNodeTypeHierarchy(nodeType);
  for (  QName hierarchyType : typesInHierarchy) {
    if (hierarchyType.equals(this.phpApp) | hierarchyType.equals(this.phpAppNodeTypePlanBuilder)) {
      return true;
    }
  }
  return false;
}
Program: 41573
Project: 41573
Buggy source:
private boolean hasZipArtfiactReference(AbstractDeploymentArtifact da){
  if (da.getArtifactType().toString().equals(this.zipArtifactType.toString())) {
    for (    AbstractArtifactReference ref : da.getArtifactRef().getArtifactReferences()) {
      if (ref.getReference().endsWith("String_Node_Str")) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean hasZipArtfiactReference(AbstractDeploymentArtifact da){
  if (da.getArtifactType().equals(this.zipArtifactType)) {
    for (    AbstractArtifactReference ref : da.getArtifactRef().getArtifactReferences()) {
      if (ref.getReference().endsWith("String_Node_Str")) {
        return true;
      }
    }
  }
  return false;
}
Program: 41574
Project: 41574
Buggy source:
private boolean isCompatiblePhpModuleNodeType(QName nodeTypeId){
  if (nodeTypeId.toString().equals(this.phpModule.toString())) {
    return true;
  }
  if (nodeTypeId.toString().equals(this.phpModuleNodeTypeTOSCASpecificType.toString())) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isCompatiblePhpModuleNodeType(QName nodeTypeId){
  if (nodeTypeId.equals(this.phpModule)) {
    return true;
  }
  if (nodeTypeId.equals(this.phpModuleNodeTypeTOSCASpecificType)) {
    return true;
  }
  return false;
}
Program: 41575
Project: 41575
Buggy source:
private boolean isCompatibleApacheWebServerNodeType(QName nodeTypeId){
  if (nodeTypeId.toString().equals(this.apacheWebServer.toString())) {
    return true;
  }
  if (nodeTypeId.toString().equals(this.apacheWebServerNodeTypeTOSCASpecificType.toString())) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isCompatibleApacheWebServerNodeType(QName nodeTypeId){
  if (nodeTypeId.equals(this.apacheWebServer)) {
    return true;
  }
  if (nodeTypeId.equals(this.apacheWebServerNodeTypeTOSCASpecificType)) {
    return true;
  }
  return false;
}
Program: 41576
Project: 41576
Buggy source:
private boolean isZipArtifact(AbstractDeploymentArtifact artifact){
  if (artifact.getArtifactType().toString().equals(this.zipArtifactType.toString())) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean isZipArtifact(AbstractDeploymentArtifact artifact){
  if (artifact.getArtifactType().equals(this.zipArtifactType)) {
    return true;
  }
 else {
    return false;
  }
}
Program: 41577
Project: 41577
Buggy source:
private boolean isZipArtifact(AbstractDeploymentArtifact artifact){
  if (artifact.getArtifactType().toString().equals(this.zipArtifactType.toString())) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean isZipArtifact(AbstractDeploymentArtifact artifact){
  if (artifact.getArtifactType().equals(this.zipArtifactType)) {
    return true;
  }
 else {
    return false;
  }
}
Program: 41578
Project: 41578
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();
  }
  QName id=new QName("String_Node_Str" + namespace + "String_Node_Str"+ this.relationshipType.getName());
  return id;
}

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();
  }
  QName id=new QName(namespace,this.relationshipType.getName());
  return id;
}
Program: 41579
Project: 41579
Buggy source:
public void _endpoint_show_wsdl(CommandInterpreter commandInterpreter){
  this.em.getTransaction().begin();
  Query query=this.em.createQuery("String_Node_Str");
  @SuppressWarnings("String_Node_Str") List<WSDLEndpoint> queryResults=query.getResultList();
  for (  WSDLEndpoint e : queryResults) {
    commandInterpreter.println("String_Node_Str" + e.getCSARId());
    commandInterpreter.println("String_Node_Str" + e.getPortType().toString());
    commandInterpreter.println("String_Node_Str" + (e.getPlanId() == null ? "String_Node_Str" : e.getPlanId().toString()));
    commandInterpreter.println("String_Node_Str" + (e.getNodeTypeImplementation() == null ? "String_Node_Str" : e.getNodeTypeImplementation().toString()));
    commandInterpreter.println("String_Node_Str" + (e.getIaName() == null ? "String_Node_Str" : e.getIaName()));
    commandInterpreter.println("String_Node_Str" + e.getURI().toString());
    commandInterpreter.println("String_Node_Str");
  }
  this.em.getTransaction().commit();
}

Fixed version (ground truth):
public void _endpoint_show_wsdl(CommandInterpreter commandInterpreter){
  this.em.getTransaction().begin();
  Query query=this.em.createQuery("String_Node_Str");
  @SuppressWarnings("String_Node_Str") List<WSDLEndpoint> queryResults=query.getResultList();
  for (  WSDLEndpoint e : queryResults) {
    commandInterpreter.println("String_Node_Str" + e.getCSARId());
    if (e.getPortType() != null) {
      commandInterpreter.println("String_Node_Str" + e.getPortType().toString());
    }
    commandInterpreter.println("String_Node_Str" + (e.getPlanId() == null ? "String_Node_Str" : e.getPlanId().toString()));
    commandInterpreter.println("String_Node_Str" + (e.getNodeTypeImplementation() == null ? "String_Node_Str" : e.getNodeTypeImplementation().toString()));
    commandInterpreter.println("String_Node_Str" + (e.getIaName() == null ? "String_Node_Str" : e.getIaName()));
    commandInterpreter.println("String_Node_Str" + e.getURI().toString());
    commandInterpreter.println("String_Node_Str");
  }
  this.em.getTransaction().commit();
}
Program: 41580
Project: 41580
Buggy source:
/** 
 * Checks whether the given Node is a virtual machine nodeType that can by handled by the set of plugins used by the PlanBuilder
 * @param nodeType a QName denoting some nodeType
 * @return a boolean. True if given nodeType is a virtual machine nodeType
 */
public static boolean isSupportedVMNodeType(QName nodeType){
  if (nodeType.toString().equals(Types.vmNodeType)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the given Node is a virtual machine nodeType that can by handled by the set of plugins used by the PlanBuilder
 * @param nodeType a QName denoting some nodeType
 * @return a boolean. True if given nodeType is a virtual machine nodeType
 */
public static boolean isSupportedVMNodeType(QName nodeType){
  if (nodeType.toString().equals(Types.vmNodeType.toString())) {
    return true;
  }
  return false;
}
Program: 41581
Project: 41581
Buggy source:
/** 
 * Generates BuildPlans for ServiceTemplates which don't have a BuildPlan defined inside the given Definitions document
 * @param defs an AbstractDefinitions
 * @param csarName the FileName of the CSAR the given Definitions iscontained in
 * @return a List of BuildPlans
 */
protected List<BuildPlan> buildPlans(AbstractDefinitions defs,String csarName){
  PlanBuilder planBuilder=new PlanBuilder();
  return planBuilder.buildPlans(csarName,defs);
}

Fixed version (ground truth):
/** 
 * Generates BuildPlans for ServiceTemplates, which haven't a BuildPlan defined, inside the given Definitions document
 * @param defs an AbstractDefinitions
 * @param csarName the FileName of the CSAR the given Definitions iscontained in
 * @return a List of BuildPlans
 */
public List<BuildPlan> buildPlans(AbstractDefinitions defs,String csarName){
  PlanBuilder planBuilder=new PlanBuilder();
  return planBuilder.buildPlans(csarName,defs);
}
Program: 41582
Project: 41582
Buggy source:
/** 
 * Creates a BuildPlan for the given ServiceTemplate
 * @param defs an AbstractDefinitions
 * @param csarName the File name of the CSAR the Definitions document isdefined in
 * @param serviceTemplate a QName representing a ServiceTemplate inside thegiven Definitions Document
 * @return a BuildPlan if generating a BuildPlan was successful, else null
 */
protected BuildPlan buildPlan(AbstractDefinitions defs,String csarName,QName serviceTemplate){
  PlanBuilder planBuilder=new PlanBuilder();
  return planBuilder.buildPlan(csarName,defs,serviceTemplate);
}

Fixed version (ground truth):
/** 
 * Creates a BuildPlan for the given ServiceTemplate
 * @param defs an AbstractDefinitions
 * @param csarName the File name of the CSAR the Definitions document isdefined in
 * @param serviceTemplate a QName representing a ServiceTemplate inside thegiven Definitions Document
 * @return a BuildPlan if generating a BuildPlan was successful, else null
 */
public BuildPlan buildPlan(AbstractDefinitions defs,String csarName,QName serviceTemplate){
  PlanBuilder planBuilder=new PlanBuilder();
  return planBuilder.buildPlan(csarName,defs,serviceTemplate);
}
Program: 41583
Project: 41583
Buggy source:
/** 
 * Stores a CSAR given as file object
 * @param file File referencing a CSAR
 * @return an Object representing an ID of the stored CSAR, if somethingwent wrong null is returned instead
 * @throws SystemException
 * @throws UserException
 */
public Object storeCSAR(File file) throws UserException, SystemException {
  CSARHandler.LOG.debug("String_Node_Str");
  BundleContext bundleContext=FrameworkUtil.getBundle(this.getClass()).getBundleContext();
  CSARHandler.LOG.debug("String_Node_Str");
  ServiceReference<?> fileServiceRef=bundleContext.getServiceReference(ICoreFileService.class.getName());
  CSARHandler.LOG.debug("String_Node_Str");
  ICoreFileService fileService=(ICoreFileService)bundleContext.getService(fileServiceRef);
  CSARHandler.LOG.debug("String_Node_Str");
  CSARID csarId=fileService.storeCSAR(file.toPath());
  if (csarId == null) {
    CSARHandler.LOG.warn("String_Node_Str");
    return null;
  }
  CSARHandler.LOG.info("String_Node_Str");
  return csarId;
}

Fixed version (ground truth):
/** 
 * Stores a CSAR given as file object
 * @param file File referencing a CSAR
 * @return an Object representing an ID of the stored CSAR, if somethingwent wrong null is returned instead
 * @throws SystemException
 * @throws UserException
 */
public Object storeCSAR(File file) throws UserException, SystemException {
  CSARHandler.LOG.debug("String_Node_Str");
  ICoreFileService fileService=this.fetchCoreFileService();
  CSARID csarId=fileService.storeCSAR(file.toPath());
  if (csarId == null) {
    CSARHandler.LOG.warn("String_Node_Str");
    return null;
  }
  CSARHandler.LOG.info("String_Node_Str");
  return csarId;
}
Program: 41584
Project: 41584
Buggy source:
/** 
 * Returns a CSARContent Object for the given CSARID
 * @param id a CSARID
 * @return the CSARContent for the given CSARID
 * @throws UserException is thrown when something inside the OpenTOSCA Corefails
 */
public CSARContent getCSARContentForID(CSARID id) throws UserException {
  CSARHandler.LOG.debug("String_Node_Str");
  BundleContext bundleContext=FrameworkUtil.getBundle(this.getClass()).getBundleContext();
  CSARHandler.LOG.debug("String_Node_Str");
  ServiceReference<?> fileServiceRef=bundleContext.getServiceReference(ICoreFileService.class.getName());
  CSARHandler.LOG.debug("String_Node_Str");
  ICoreFileService fileService=(ICoreFileService)bundleContext.getService(fileServiceRef);
  return fileService.getCSAR(id);
}

Fixed version (ground truth):
/** 
 * Returns a CSARContent Object for the given CSARID
 * @param id a CSARID
 * @return the CSARContent for the given CSARID
 * @throws UserException is thrown when something inside the OpenTOSCA Core fails
 */
public CSARContent getCSARContentForID(CSARID id) throws UserException {
  LOG.debug("String_Node_Str");
  return this.fetchCoreFileService().getCSAR(id);
}
Program: 41585
Project: 41585
Buggy source:
/** 
 * Deletes all CSARs in the OpenTOSCA Core
 */
public void deleteAllCsars(){
  CSARHandler.LOG.debug("String_Node_Str");
  BundleContext bundleContext=FrameworkUtil.getBundle(this.getClass()).getBundleContext();
  CSARHandler.LOG.debug("String_Node_Str");
  ServiceReference<?> fileServiceRef=bundleContext.getServiceReference(ICoreFileService.class.getName());
  CSARHandler.LOG.debug("String_Node_Str");
  ICoreFileService fileService=(ICoreFileService)bundleContext.getService(fileServiceRef);
  CSARHandler.LOG.info("String_Node_Str");
  try {
    fileService.deleteCSARs();
  }
 catch (  SystemException e) {
  }
}

Fixed version (ground truth):
/** 
 * Deletes all CSARs in the OpenTOSCA Core
 */
public void deleteAllCsars(){
  CSARHandler.LOG.info("String_Node_Str");
  ICoreFileService fileService=this.fetchCoreFileService();
  try {
    fileService.deleteCSARs();
  }
 catch (  SystemException e) {
  }
}
Program: 41588
Project: 41588
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public AbstractProperties getProperties(){
  return new PropertiesImpl(this.properties.getAny());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public AbstractProperties getProperties(){
  if (this.properties.getAny() != null) {
    return new PropertiesImpl(this.properties.getAny());
  }
 else {
    return null;
  }
}
Program: 41590
Project: 41590
Buggy source:
/** 
 * Initializes the internal IAs
 */
private void initIas(){
  for (  TImplementationArtifact artifact : this.nodeTypeImpl.getImplementationArtifacts().getImplementationArtifact()) {
    this.ias.add(new ImplementationArtifactImpl(artifact,this.definitions));
  }
}

Fixed version (ground truth):
/** 
 * Initializes the internal IAs
 */
private void initIas(){
  if (this.nodeTypeImpl.getImplementationArtifacts() != null) {
    for (    TImplementationArtifact artifact : this.nodeTypeImpl.getImplementationArtifacts().getImplementationArtifact()) {
      this.ias.add(new ImplementationArtifactImpl(artifact,this.definitions));
    }
  }
}
Program: 41591
Project: 41591
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public QName getTypeRef(){
  if (this.relationshipType.getDerivedFrom() != null) {
    for (    AbstractRelationshipType relation : this.definitions.getAllRelationshipTypes()) {
      if (relation.getId().toString().equals(this.relationshipType.getDerivedFrom().getTypeRef().toString())) {
        return relation.getTypeRef();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public QName getTypeRef(){
  if (this.relationshipType.getDerivedFrom() != null) {
    return this.relationshipType.getDerivedFrom().getTypeRef();
  }
  return null;
}
Program: 41592
Project: 41592
Buggy source:
void getRealmAuctionFileInformation(Realm realm){
  getLogger(this.getClass().getName()).log(Level.INFO,"String_Node_Str" + realm.getRealmDetail());
  Client client=ClientBuilder.newClient();
  Files files=client.target(target + realm.getSlug()).request(MediaType.TEXT_PLAIN).get(Files.class);
  files.getFiles().forEach(auctionFile -> createAuctionFile(realm,auctionFile));
}

Fixed version (ground truth):
void getRealmAuctionFileInformation(Realm realm){
  getLogger(this.getClass().getName()).log(Level.INFO,"String_Node_Str" + realm.getRealmDetail());
  try {
    Client client=ClientBuilder.newClient();
    Files files=client.target(target + realm.getSlug()).request(MediaType.TEXT_PLAIN).get(Files.class);
    files.getFiles().forEach(auctionFile -> createAuctionFile(realm,auctionFile));
  }
 catch (  Exception e) {
    getLogger(this.getClass().getName()).log(Level.INFO,"String_Node_Str" + realm.getRealmDetail());
  }
}
Program: 41593
Project: 41593
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public Object processItem(Object item) throws Exception {
  ResultSet resultSet=(ResultSet)item;
  AuctionItemStatistics auctionItemStatistics=new AuctionItemStatistics();
  auctionItemStatistics.setItemId(resultSet.getInt(1));
  auctionItemStatistics.setQuantity(resultSet.getLong(2));
  auctionItemStatistics.setBid(resultSet.getLong(3));
  auctionItemStatistics.setBuyout(resultSet.getLong(4));
  auctionItemStatistics.setMinBid(resultSet.getLong(5));
  auctionItemStatistics.setMinBuyout(resultSet.getLong(6));
  auctionItemStatistics.setMaxBid(resultSet.getLong(7));
  auctionItemStatistics.setMaxBuyout(resultSet.getLong(8));
  auctionItemStatistics.setTimestamp(getContext().getFileToProcess().getLastModified());
  auctionItemStatistics.setAvgBid((double)(auctionItemStatistics.getBid() / auctionItemStatistics.getQuantity()));
  auctionItemStatistics.setAvgBuyout((double)(auctionItemStatistics.getBuyout() / auctionItemStatistics.getQuantity()));
  auctionItemStatistics.setAuctionHouse(AuctionHouse.valueOf(auctionHouse));
  return auctionItemStatistics;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public Object processItem(Object item) throws Exception {
  ResultSet resultSet=(ResultSet)item;
  AuctionItemStatistics auctionItemStatistics=new AuctionItemStatistics();
  auctionItemStatistics.setItemId(resultSet.getInt(1));
  auctionItemStatistics.setQuantity(resultSet.getLong(2));
  auctionItemStatistics.setBid(resultSet.getLong(3));
  auctionItemStatistics.setBuyout(resultSet.getLong(4));
  auctionItemStatistics.setMinBid(resultSet.getLong(5));
  auctionItemStatistics.setMinBuyout(resultSet.getLong(6));
  auctionItemStatistics.setMaxBid(resultSet.getLong(7));
  auctionItemStatistics.setMaxBuyout(resultSet.getLong(8));
  auctionItemStatistics.setTimestamp(getContext().getFileToProcess().getLastModified());
  auctionItemStatistics.setAvgBid((double)(auctionItemStatistics.getBid() / auctionItemStatistics.getQuantity()));
  auctionItemStatistics.setAvgBuyout((double)(auctionItemStatistics.getBuyout() / auctionItemStatistics.getQuantity()));
  auctionItemStatistics.setAuctionHouse(AuctionHouse.valueOf(auctionHouse));
  auctionItemStatistics.setRealm(getContext().getRealm());
  return auctionItemStatistics;
}
Program: 41594
Project: 41594
Buggy source:
@Override public void open(Serializable checkpoint) throws Exception {
  Connection connection=dataSource.getConnection();
  preparedStatement=connection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY,ResultSet.HOLD_CURSORS_OVER_COMMIT);
  preparedStatement.setLong(1,getContext().getFileToProcess().getId());
  preparedStatement.setInt(2,AuctionHouse.valueOf(auctionHouse).ordinal());
  resultSet=preparedStatement.executeQuery();
}

Fixed version (ground truth):
@Override public void open(Serializable checkpoint) throws Exception {
  Connection connection=dataSource.getConnection();
  preparedStatement=connection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + getContext().getFileToProcess().getId() + "String_Node_Str"+ AuctionHouse.valueOf(auctionHouse).ordinal()+ "String_Node_Str"+ "String_Node_Str",ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY,ResultSet.HOLD_CURSORS_OVER_COMMIT);
  resultSet=preparedStatement.executeQuery();
}
Program: 41595
Project: 41595
Buggy source:
@Override @GET @Path("String_Node_Str") public List<AuctionItemStatistics> findAuctionItemStatisticsByRealmAndItem(@QueryParam("String_Node_Str") Long realmId,@QueryParam("String_Node_Str") Integer itemId){
  return em.createNamedQuery("String_Node_Str").setParameter("String_Node_Str",itemId).getResultList();
}

Fixed version (ground truth):
@Override @GET @Path("String_Node_Str") public List<AuctionItemStatistics> findAuctionItemStatisticsByRealmAndItem(@QueryParam("String_Node_Str") Long realmId,@QueryParam("String_Node_Str") Integer itemId){
  return em.createNamedQuery("String_Node_Str").setParameter("String_Node_Str",realmId).setParameter("String_Node_Str",itemId).getResultList();
}
Program: 41596
Project: 41596
Buggy source:
private void getRealmAuctionFileInformation(Realm realm){
  getLogger(this.getClass().getName()).log(Level.INFO,"String_Node_Str" + realm.getRealmDetail());
  Client client=ClientBuilder.newClient();
  Files files=client.target(target + realm.getSlug()).request(MediaType.TEXT_PLAIN).get(Files.class);
  files.getFiles().forEach(auctionFile -> {
    auctionFile.setRealm(realm);
    auctionFile.setFileStatus(FileStatus.LOADED);
    woWBusiness.createAuctionFile(auctionFile);
  }
);
}

Fixed version (ground truth):
private void getRealmAuctionFileInformation(Realm realm){
  getLogger(this.getClass().getName()).log(Level.INFO,"String_Node_Str" + realm.getRealmDetail());
  Client client=ClientBuilder.newClient();
  Files files=client.target(target + realm.getSlug()).request(MediaType.TEXT_PLAIN).get(Files.class);
  files.getFiles().forEach(auctionFile -> {
    auctionFile.setRealm(realm);
    auctionFile.setFileName("String_Node_Str" + auctionFile.getLastModified() + "String_Node_Str");
    auctionFile.setFileStatus(FileStatus.LOADED);
    woWBusiness.createAuctionFile(auctionFile);
  }
);
}
Program: 41597
Project: 41597
Buggy source:
private void verifyAndCreateFolder(String folderRoot,Realm realm,FolderType folderType){
  File folder=new File(batchHome + "String_Node_Str" + folderRoot+ "String_Node_Str"+ realm.getName()+ "String_Node_Str"+ folderType);
  if (!folder.exists()) {
    try {
      getLogger(this.getClass().getName()).log(Level.INFO,"String_Node_Str" + folder);
      FileUtils.forceMkdir(folder);
      woWBusiness.createRealmFolder(new RealmFolder(realm.getId(),folderType,folder.getPath()));
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
 else   if (woWBusiness.findRealmFolderById(realm.getId(),folderType) == null) {
    woWBusiness.createRealmFolder(new RealmFolder(realm.getId(),folderType,folder.getPath()));
  }
}

Fixed version (ground truth):
private void verifyAndCreateFolder(String folderRoot,Realm realm,FolderType folderType){
  File folder=new File(batchHome + "String_Node_Str" + folderRoot+ "String_Node_Str"+ realm.getRegion()+ "String_Node_Str"+ realm.getName()+ "String_Node_Str"+ folderType);
  if (!folder.exists()) {
    try {
      getLogger(this.getClass().getName()).log(Level.INFO,"String_Node_Str" + folder);
      FileUtils.forceMkdir(folder);
      woWBusiness.createRealmFolder(new RealmFolder(realm.getId(),folderType,folder.getPath()));
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
 else   if (woWBusiness.findRealmFolderById(realm.getId(),folderType) == null) {
    woWBusiness.createRealmFolder(new RealmFolder(realm.getId(),folderType,folder.getPath()));
  }
}
Program: 41600
Project: 41600
Buggy source:
@Override public int getPriority(){
  return PRIORITY.LOWEST.getValue();
}

Fixed version (ground truth):
@Override public int getPriority(){
  return PRIORITY.LOWER_STILL.getValue();
}
Program: 41601
Project: 41601
Buggy source:
/** 
 * Process the SASL authentication cycle until such time as an outcome is determine. This method must be called by the managing entity until the return value is true indicating a successful authentication or a JMSSecurityException is thrown indicating that the handshake failed.
 * @param authenticationRequest The request that is awaiting the result of authentication.
 * @return true if the authentication process completed.
 */
public boolean authenticate() throws JMSSecurityException {
  try {
switch (sasl.getState()) {
case PN_SASL_IDLE:
      handleSaslInit();
    break;
case PN_SASL_STEP:
  handleSaslStep();
break;
case PN_SASL_FAIL:
handleSaslFail();
break;
case PN_SASL_PASS:
authenticationRequest.onSuccess();
default :
break;
}
}
 catch (JMSSecurityException result) {
authenticationRequest.onFailure(result);
}
return authenticationRequest.isComplete();
}

Fixed version (ground truth):
/** 
 * Process the SASL authentication cycle until such time as an outcome is determine. This method must be called by the managing entity until the return value is true indicating a successful authentication or a JMSSecurityException is thrown indicating that the handshake failed.
 * @return true if the authentication process completed.
 */
public boolean authenticate() throws JMSSecurityException {
  try {
switch (sasl.getState()) {
case PN_SASL_IDLE:
      handleSaslInit();
    break;
case PN_SASL_STEP:
  handleSaslStep();
break;
case PN_SASL_FAIL:
handleSaslFail();
break;
case PN_SASL_PASS:
authenticationRequest.onSuccess();
default :
break;
}
}
 catch (JMSSecurityException result) {
authenticationRequest.onFailure(result);
}
return authenticationRequest.isComplete();
}
Program: 41602
Project: 41602
Buggy source:
/** 
 * When a redirect type exception is received this method is called to create the appropriate redirect exception type containing the error details needed.
 * @param error the Symbol that defines the redirection error type.
 * @param message the basic error message that should used or amended for the returned exception.
 * @param condition the ErrorCondition that describes the redirection.
 * @return an Exception that captures the details of the redirection error.
 */
public static Exception createRedirectException(Symbol error,String message,ErrorCondition condition){
  Exception result=null;
  Map<?,?> info=condition.getInfo();
  if (info == null) {
    result=new IOException(message + "String_Node_Str");
  }
 else {
    String hostname=(String)info.get(OPEN_HOSTNAME);
    String networkHost=(String)info.get(NETWORK_HOST);
    if (networkHost == null || networkHost.isEmpty()) {
      result=new IOException(message + "String_Node_Str");
    }
    int port=0;
    try {
      port=Integer.valueOf(info.get(PORT).toString());
    }
 catch (    Exception ex) {
      result=new IOException(message + "String_Node_Str");
    }
    result=new ProviderRedirectedException(message,hostname,networkHost,port);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * When a redirect type exception is received this method is called to create the appropriate redirect exception type containing the error details needed.
 * @param error the Symbol that defines the redirection error type.
 * @param message the basic error message that should used or amended for the returned exception.
 * @param condition the ErrorCondition that describes the redirection.
 * @return an Exception that captures the details of the redirection error.
 */
public static Exception createRedirectException(Symbol error,String message,ErrorCondition condition){
  Exception result=null;
  Map<?,?> info=condition.getInfo();
  if (info == null) {
    result=new IOException(message + "String_Node_Str");
  }
 else {
    String hostname=(String)info.get(OPEN_HOSTNAME);
    String networkHost=(String)info.get(NETWORK_HOST);
    if (networkHost == null || networkHost.isEmpty()) {
      result=new IOException(message + "String_Node_Str");
    }
    int port=0;
    try {
      port=Integer.parseInt(info.get(PORT).toString());
    }
 catch (    Exception ex) {
      result=new IOException(message + "String_Node_Str");
    }
    result=new ProviderRedirectedException(message,hostname,networkHost,port);
  }
  return result;
}
Program: 41603
Project: 41603
Buggy source:
@Override public void processDeliveryUpdates(AmqpProvider provider) throws IOException {
  try {
    if (pendingDelivery != null && pendingDelivery.remotelySettled()) {
      DeliveryState state=pendingDelivery.getRemoteState();
      JmsTransactionId txId=(JmsTransactionId)pendingDelivery.getContext();
      if (state instanceof Declared) {
        LOG.debug("String_Node_Str",txId);
        Declared declared=(Declared)state;
        txId.setProviderHint(declared.getTxnId());
        pendingRequest.onSuccess();
      }
 else       if (state instanceof Rejected) {
        LOG.debug("String_Node_Str",txId);
        Rejected rejected=(Rejected)state;
        Exception cause=AmqpSupport.convertToException(getEndpoint(),rejected.getError());
        JMSException failureCause=null;
        if (txId.getProviderContext() == COMMIT_MARKER) {
          failureCause=new TransactionRolledBackException(cause.getMessage());
        }
 else {
          failureCause=new JMSException(cause.getMessage());
        }
        pendingRequest.onFailure(failureCause);
      }
 else {
        LOG.debug("String_Node_Str",txId);
        pendingRequest.onSuccess();
      }
      pendingDelivery.settle();
      pendingRequest=null;
      pendingDelivery=null;
      if (pendingTimeout != null) {
        pendingTimeout.cancel(false);
        pendingTimeout=null;
      }
    }
    super.processDeliveryUpdates(provider);
  }
 catch (  Exception e) {
    throw IOExceptionSupport.create(e);
  }
}

Fixed version (ground truth):
@Override public void processDeliveryUpdates(AmqpProvider provider) throws IOException {
  try {
    if (pendingDelivery != null && pendingDelivery.remotelySettled()) {
      DeliveryState state=pendingDelivery.getRemoteState();
      JmsTransactionId txId=(JmsTransactionId)pendingDelivery.getContext();
      if (state instanceof Declared) {
        LOG.debug("String_Node_Str",txId);
        Declared declared=(Declared)state;
        txId.setProviderHint(declared.getTxnId());
        pendingRequest.onSuccess();
      }
 else       if (state instanceof Rejected) {
        LOG.debug("String_Node_Str",txId);
        Rejected rejected=(Rejected)state;
        Exception cause=AmqpSupport.convertToException(getEndpoint(),rejected.getError());
        JMSException failureCause=null;
        if (txId.getProviderContext().equals(COMMIT_MARKER)) {
          failureCause=new TransactionRolledBackException(cause.getMessage());
        }
 else {
          failureCause=new JMSException(cause.getMessage());
        }
        pendingRequest.onFailure(failureCause);
      }
 else {
        LOG.debug("String_Node_Str",txId);
        pendingRequest.onSuccess();
      }
      pendingDelivery.settle();
      pendingRequest=null;
      pendingDelivery=null;
      if (pendingTimeout != null) {
        pendingTimeout.cancel(false);
        pendingTimeout=null;
      }
    }
    super.processDeliveryUpdates(provider);
  }
 catch (  Exception e) {
    throw IOExceptionSupport.create(e);
  }
}
Program: 41604
Project: 41604
Buggy source:
@Test(timeout=30000) public void testQueueBrowserNextElementWithNoMessage() throws IOException, Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer()){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin();
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    testPeer.expectQueueBrowserAttach();
    testPeer.expectLinkFlow();
    testPeer.expectLinkFlow(true,true,equalTo(UnsignedInteger.valueOf(1)));
    testPeer.expectDetach(true,true,true);
    QueueBrowser browser=session.createBrowser(queue);
    Enumeration<?> queueView=browser.getEnumeration();
    assertNotNull(queueView);
    assertNull(queueView.nextElement());
    browser.close();
    testPeer.waitForAllHandlersToComplete(3000);
  }
 }

Fixed version (ground truth):
@Test(timeout=30000) public void testQueueBrowserNextElementWithNoMessage() throws IOException, Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer()){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin();
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    testPeer.expectQueueBrowserAttach();
    testPeer.expectLinkFlow();
    testPeer.expectLinkFlow(true,true,equalTo(UnsignedInteger.valueOf(JmsPrefetchPolicy.DEFAULT_QUEUE_BROWSER_PREFETCH)));
    testPeer.expectDetach(true,true,true);
    QueueBrowser browser=session.createBrowser(queue);
    Enumeration<?> queueView=browser.getEnumeration();
    assertNotNull(queueView);
    assertNull(queueView.nextElement());
    browser.close();
    testPeer.waitForAllHandlersToComplete(3000);
  }
 }
Program: 41609
Project: 41609
Buggy source:
/** 
 * @throws JMSException
 * @see javax.jms.MessageConsumer#close()
 */
@Override public void close() throws JMSException {
  if (!closed.get()) {
    session.getTransactionContext().addSynchronization(new JmsTxSynchronization(){
      @Override public boolean validate(      JmsTransactionContext context) throws Exception {
        if (!context.isInTransaction() || !delivered.get()) {
          doClose();
          return false;
        }
        return true;
      }
      @Override public void afterCommit() throws Exception {
        doClose();
      }
      @Override public void afterRollback() throws Exception {
        doClose();
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * @throws JMSException
 * @see javax.jms.MessageConsumer#close()
 */
@Override public void close() throws JMSException {
  if (!closed.get()) {
    session.getTransactionContext().addSynchronization(new JmsTxSynchronization(){
      @Override public boolean validate(      JmsTransactionContext context) throws Exception {
        if (!context.isInTransaction() || !delivered.get() || isBrowser()) {
          doClose();
          return false;
        }
        return true;
      }
      @Override public void afterCommit() throws Exception {
        doClose();
      }
      @Override public void afterRollback() throws Exception {
        doClose();
      }
    }
);
  }
}
Program: 41610
Project: 41610
Buggy source:
@Override public boolean validate(JmsTransactionContext context) throws Exception {
  if (!context.isInTransaction() || !delivered.get()) {
    doClose();
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean validate(JmsTransactionContext context) throws Exception {
  if (!context.isInTransaction() || !delivered.get() || isBrowser()) {
    doClose();
    return false;
  }
  return true;
}