nus-yam/ex-repair huggingface dataset:
Program: 15466
Project: 15466
Buggy source:
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper#insertKeyIntoFile
 */
public void testInsertKeyWithArrayValue(){
  YAMLFile yamlFile=(YAMLFile)myFixture.configureByText(YAMLFileType.YML,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  YAMLKeyValue yamlKeyValue=YamlPsiElementFactory.createFromText(getProject(),YAMLKeyValue.class,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull(yamlKeyValue);
  YamlHelper.insertKeyIntoFile(yamlFile,yamlKeyValue,"String_Node_Str");
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",yamlFile.getText());
}

Fixed version (ground truth):
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper#insertKeyIntoFile
 */
public void testInsertKeyWithArrayValue(){
  YAMLFile yamlFile=(YAMLFile)myFixture.configureByText(YAMLFileType.YML,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  YAMLKeyValue yamlKeyValue=YamlPsiElementFactory.createFromText(getProject(),YAMLKeyValue.class,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull(yamlKeyValue);
  YamlHelper.insertKeyIntoFile(yamlFile,yamlKeyValue,"String_Node_Str");
  ApplicationInfo instance=ApplicationInfo.getInstance();
  String minorVersion=instance.getMinorVersion();
  if ((instance.getMajorVersion().equals("String_Node_Str") && Integer.valueOf(minorVersion) >= 2)) {
    assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",yamlFile.getText());
  }
 else {
    assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",yamlFile.getText());
  }
}
Program: 15467
Project: 15467
Buggy source:
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper#insertKeyIntoFile
 */
public void testInsertKeyValueWithMissingMainKeyInRoot(){
  YAMLFile yamlFile=(YAMLFile)myFixture.configureByText(YAMLFileType.YML,"String_Node_Str");
  YAMLKeyValue yamlKeyValue=YamlPsiElementFactory.createFromText(getProject(),YAMLKeyValue.class,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  assertNotNull(yamlKeyValue);
  YamlHelper.insertKeyIntoFile(yamlFile,yamlKeyValue,"String_Node_Str");
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",yamlFile.getText());
}

Fixed version (ground truth):
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper#insertKeyIntoFile
 */
public void testInsertKeyValueWithMissingMainKeyInRoot(){
  YAMLFile yamlFile=(YAMLFile)myFixture.configureByText(YAMLFileType.YML,"String_Node_Str");
  YAMLKeyValue yamlKeyValue=YamlPsiElementFactory.createFromText(getProject(),YAMLKeyValue.class,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  assertNotNull(yamlKeyValue);
  YamlHelper.insertKeyIntoFile(yamlFile,yamlKeyValue,"String_Node_Str");
  ApplicationInfo instance=ApplicationInfo.getInstance();
  String minorVersion=instance.getMinorVersion();
  if ((instance.getMajorVersion().equals("String_Node_Str") && Integer.valueOf(minorVersion) >= 2)) {
    assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",yamlFile.getText());
  }
 else {
    assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",yamlFile.getText());
  }
}
Program: 15470
Project: 15470
Buggy source:
@Override public Collection<? extends PhpNamedElement> getBySignature(String expression,Project project){
  int endIndex=expression.lastIndexOf(TRIM_KEY);
  if (endIndex == -1) {
    return Collections.emptySet();
  }
  String originalSignature=expression.substring(0,endIndex);
  String parameter=expression.substring(endIndex + 1);
  PhpIndex phpIndex=PhpIndex.getInstance(project);
  Collection<? extends PhpNamedElement> phpNamedElementCollections=phpIndex.getBySignature(originalSignature,null,0);
  if (phpNamedElementCollections.size() == 0) {
    return Collections.emptySet();
  }
  PhpNamedElement phpNamedElement=phpNamedElementCollections.iterator().next();
  if (!(phpNamedElement instanceof Method)) {
    return Arrays.asList(phpNamedElement);
  }
  if (!new Symfony2InterfacesUtil().isCallTo((Method)phpNamedElement,"String_Node_Str","String_Node_Str")) {
    return phpNamedElementCollections;
  }
  parameter=PhpTypeProviderUtil.getResolvedParameter(phpIndex,parameter);
  if (parameter == null) {
    return phpNamedElementCollections;
  }
  PhpClass phpClass=EntityHelper.resolveShortcutName(project,parameter);
  if (phpClass == null) {
    return phpNamedElementCollections;
  }
  return Arrays.asList(phpClass);
}

Fixed version (ground truth):
@Override public Collection<? extends PhpNamedElement> getBySignature(String expression,Project project){
  int endIndex=expression.lastIndexOf(TRIM_KEY);
  if (endIndex == -1) {
    return Collections.emptySet();
  }
  String originalSignature=expression.substring(0,endIndex);
  String parameter=expression.substring(endIndex + 1);
  PhpIndex phpIndex=PhpIndex.getInstance(project);
  Collection<? extends PhpNamedElement> phpNamedElementCollections=phpIndex.getBySignature(originalSignature,null,0);
  if (phpNamedElementCollections.size() == 0) {
    return Collections.emptySet();
  }
  PhpNamedElement phpNamedElement=phpNamedElementCollections.iterator().next();
  if (!(phpNamedElement instanceof Method)) {
    return phpNamedElementCollections;
  }
  if (!new Symfony2InterfacesUtil().isCallTo((Method)phpNamedElement,"String_Node_Str","String_Node_Str")) {
    return phpNamedElementCollections;
  }
  parameter=PhpTypeProviderUtil.getResolvedParameter(phpIndex,parameter);
  if (parameter == null) {
    return phpNamedElementCollections;
  }
  PhpClass phpClass=EntityHelper.resolveShortcutName(project,parameter);
  if (phpClass == null) {
    return phpNamedElementCollections;
  }
  return PhpTypeProviderUtil.mergeSignatureResults(phpNamedElementCollections,phpClass);
}
Program: 15471
Project: 15471
Buggy source:
@Override public Collection<? extends PhpNamedElement> getBySignature(String expression,Project project){
  int endIndex=expression.lastIndexOf(TRIM_KEY);
  if (endIndex == -1) {
    return Collections.emptySet();
  }
  String originalSignature=expression.substring(0,endIndex);
  String parameter=expression.substring(endIndex + 1);
  PhpIndex phpIndex=PhpIndex.getInstance(project);
  Collection<? extends PhpNamedElement> phpNamedElementCollections=phpIndex.getBySignature(originalSignature,null,0);
  if (phpNamedElementCollections.size() == 0) {
    return Collections.emptySet();
  }
  Method method=(Method)phpNamedElementCollections.iterator().next();
  if (!new Symfony2InterfacesUtil().isObjectRepositoryCall(method)) {
    return Arrays.asList(method);
  }
  parameter=PhpTypeProviderUtil.getResolvedParameter(phpIndex,parameter);
  if (parameter == null) {
    return phpNamedElementCollections;
  }
  PhpClass phpClass=EntityHelper.resolveShortcutName(project,parameter);
  if (phpClass == null) {
    return phpNamedElementCollections;
  }
  if (method.getName().equals("String_Node_Str") || method.getName().equals("String_Node_Str")) {
    method.getType().add(phpClass.getFQN() + "String_Node_Str");
    return phpNamedElementCollections;
  }
  return Arrays.asList(phpClass);
}

Fixed version (ground truth):
@Override public Collection<? extends PhpNamedElement> getBySignature(String expression,Project project){
  int endIndex=expression.lastIndexOf(TRIM_KEY);
  if (endIndex == -1) {
    return Collections.emptySet();
  }
  String originalSignature=expression.substring(0,endIndex);
  String parameter=expression.substring(endIndex + 1);
  PhpIndex phpIndex=PhpIndex.getInstance(project);
  Collection<? extends PhpNamedElement> phpNamedElementCollections=phpIndex.getBySignature(originalSignature,null,0);
  if (phpNamedElementCollections.size() == 0) {
    return Collections.emptySet();
  }
  Method method=(Method)phpNamedElementCollections.iterator().next();
  if (!new Symfony2InterfacesUtil().isObjectRepositoryCall(method)) {
    return phpNamedElementCollections;
  }
  parameter=PhpTypeProviderUtil.getResolvedParameter(phpIndex,parameter);
  if (parameter == null) {
    return phpNamedElementCollections;
  }
  PhpClass phpClass=EntityHelper.resolveShortcutName(project,parameter);
  if (phpClass == null) {
    return phpNamedElementCollections;
  }
  if (method.getName().equals("String_Node_Str") || method.getName().equals("String_Node_Str")) {
    method.getType().add(phpClass.getFQN() + "String_Node_Str");
    return phpNamedElementCollections;
  }
  return PhpTypeProviderUtil.mergeSignatureResults(phpNamedElementCollections,phpClass);
}
Program: 15472
Project: 15472
Buggy source:
@Override public Collection<? extends PhpNamedElement> getBySignature(String expression,Project project){
  int endIndex=expression.lastIndexOf(TRIM_KEY);
  if (endIndex == -1) {
    return Collections.emptySet();
  }
  String originalSignature=expression.substring(0,endIndex);
  String parameter=expression.substring(endIndex + 1);
  PhpIndex phpIndex=PhpIndex.getInstance(project);
  Collection<? extends PhpNamedElement> phpNamedElementCollections=phpIndex.getBySignature(originalSignature,null,0);
  if (phpNamedElementCollections.size() == 0) {
    return Collections.emptySet();
  }
  PhpNamedElement phpNamedElement=phpNamedElementCollections.iterator().next();
  if (!(phpNamedElement instanceof Method)) {
    return phpNamedElementCollections;
  }
  if (!new Symfony2InterfacesUtil().isGetRepositoryCall((Method)phpNamedElement)) {
    return phpNamedElementCollections;
  }
  parameter=PhpTypeProviderUtil.getResolvedParameter(phpIndex,parameter);
  if (parameter == null) {
    return phpNamedElementCollections;
  }
  PhpClass phpClass=EntityHelper.getEntityRepositoryClass(project,parameter);
  if (phpClass == null) {
    return phpNamedElementCollections;
  }
  return Collections.singletonList(phpClass);
}

Fixed version (ground truth):
@Override public Collection<? extends PhpNamedElement> getBySignature(String expression,Project project){
  int endIndex=expression.lastIndexOf(TRIM_KEY);
  if (endIndex == -1) {
    return Collections.emptySet();
  }
  String originalSignature=expression.substring(0,endIndex);
  String parameter=expression.substring(endIndex + 1);
  PhpIndex phpIndex=PhpIndex.getInstance(project);
  Collection<? extends PhpNamedElement> phpNamedElementCollections=phpIndex.getBySignature(originalSignature,null,0);
  if (phpNamedElementCollections.size() == 0) {
    return Collections.emptySet();
  }
  PhpNamedElement phpNamedElement=phpNamedElementCollections.iterator().next();
  if (!(phpNamedElement instanceof Method)) {
    return phpNamedElementCollections;
  }
  if (!new Symfony2InterfacesUtil().isGetRepositoryCall((Method)phpNamedElement)) {
    return phpNamedElementCollections;
  }
  parameter=PhpTypeProviderUtil.getResolvedParameter(phpIndex,parameter);
  if (parameter == null) {
    return phpNamedElementCollections;
  }
  PhpClass phpClass=EntityHelper.getEntityRepositoryClass(project,parameter);
  if (phpClass == null) {
    return phpNamedElementCollections;
  }
  return PhpTypeProviderUtil.mergeSignatureResults(phpNamedElementCollections,phpClass);
}
Program: 15473
Project: 15473
Buggy source:
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.dic.SymfonyContainerTypeProvider
 */
public void testContainerServicePhpType(){
  assertPhpReferenceResolveTo(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",PlatformPatterns.psiElement(Method.class).withName("String_Node_Str"));
  assertPhpReferenceNotResolveTo(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",PlatformPatterns.psiElement(Method.class).withName("String_Node_Str"));
  assertPhpReferenceSignatureEquals(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str" + '\u0150' + "String_Node_Str"+ '\u0180'+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.dic.SymfonyContainerTypeProvider
 */
public void testContainerServicePhpType(){
  assertPhpReferenceResolveTo(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",PlatformPatterns.psiElement(Method.class).withName("String_Node_Str"));
  assertPhpReferenceNotResolveTo(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",PlatformPatterns.psiElement(Method.class).withName("String_Node_Str"));
  assertPhpReferenceSignatureEquals(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str" + '\u0150' + "String_Node_Str"+ '\u0182'+ "String_Node_Str");
}
Program: 15474
Project: 15474
Buggy source:
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.doctrine.EntityHelper#getModelClasses
 */
public void testGetModelClasses(){
  Collection<DoctrineModel> modelClasses=EntityHelper.getModelClasses(getProject());
  Map<String,String> map=new HashMap<String,String>();
  for (  DoctrineModel modelClass : modelClasses) {
    map.put(modelClass.getRepositoryName(),modelClass.getDoctrineNamespace());
  }
  assertContainsElements(map.keySet(),"String_Node_Str");
  assertContainsElements(map.keySet(),"String_Node_Str");
  assertContainsElements(map.values(),"String_Node_Str");
  assertFalse(map.values().contains("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.doctrine.EntityHelper#getModelClasses
 */
public void testGetModelClasses(){
  Collection<DoctrineModel> modelClasses=EntityHelper.getModelClasses(getProject());
  Map<String,String> map=new HashMap<String,String>();
  for (  DoctrineModel modelClass : modelClasses) {
    map.put(modelClass.getRepositoryName(),modelClass.getDoctrineNamespace());
  }
  assertContainsElements(map.keySet(),"String_Node_Str");
  assertContainsElements(map.values(),"String_Node_Str");
  assertContainsElements(map.keySet(),"String_Node_Str");
  assertFalse(map.values().contains("String_Node_Str"));
}
Program: 15475
Project: 15475
Buggy source:
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.doctrine.ObjectRepositoryTypeProvider
 */
public void testGetRepositoryResolveByRepository(){
  assertPhpReferenceResolveTo(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",PlatformPatterns.psiElement(Method.class).withName("String_Node_Str"));
  assertPhpReferenceSignatureEquals(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str" + '\u0151' + "String_Node_Str"+ '\u0180'+ "String_Node_Str");
  assertPhpReferenceResolveTo(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",PlatformPatterns.psiElement(Method.class).withName("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.doctrine.ObjectRepositoryTypeProvider
 */
public void testGetRepositoryResolveByRepository(){
  assertPhpReferenceResolveTo(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",PlatformPatterns.psiElement(Method.class).withName("String_Node_Str"));
  assertPhpReferenceSignatureEquals(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str" + '\u0151' + "String_Node_Str"+ '\u0185'+ "String_Node_Str");
  assertPhpReferenceResolveTo(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",PlatformPatterns.psiElement(Method.class).withName("String_Node_Str"));
}
Program: 15476
Project: 15476
Buggy source:
public void testGetRepositoryResolveByRepositoryApiClassConstantCompatibility(){
  String result="String_Node_Str" + '\u0151' + "String_Node_Str"+ '\u0180'+ "String_Node_Str";
  if (Integer.parseInt(PluginManager.getPlugin(PluginId.getId("String_Node_Str")).getVersion().replace("String_Node_Str","String_Node_Str")) <= 1411534) {
    result="String_Node_Str" + '\u0151' + "String_Node_Str"+ '\u0180'+ "String_Node_Str";
  }
  assertPhpReferenceSignatureEquals(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",result);
}

Fixed version (ground truth):
/** 
 * @see fr.adrienbrault.idea.symfony2plugin.doctrine.ObjectRepositoryTypeProvider
 */
public void testGetRepositoryResolveByRepositoryApiClassConstantCompatibility(){
  String result="String_Node_Str" + '\u0151' + "String_Node_Str"+ '\u0185'+ "String_Node_Str";
  if (Integer.parseInt(PluginManager.getPlugin(PluginId.getId("String_Node_Str")).getVersion().replace("String_Node_Str","String_Node_Str")) <= 1411534) {
    result="String_Node_Str" + '\u0151' + "String_Node_Str"+ '\u0185'+ "String_Node_Str";
  }
  assertPhpReferenceSignatureEquals(PhpFileType.INSTANCE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",result);
}
Program: 15477
Project: 15477
Buggy source:
@Nullable private static String getFileTemplateContent(@NotNull String filename){
  try {
    return StreamUtil.readText(PhpBundleFileFactory.class.getResourceAsStream(filename),"String_Node_Str");
  }
 catch (  IOException e) {
    return null;
  }
}

Fixed version (ground truth):
@Nullable private static String getFileTemplateContent(@NotNull String filename){
  try {
    return StreamUtil.readText(PhpBundleFileFactory.class.getResourceAsStream(filename),"String_Node_Str").replace("String_Node_Str","String_Node_Str");
  }
 catch (  IOException e) {
    return null;
  }
}
Program: 15478
Project: 15478
Buggy source:
public boolean isInstanceOf(@NotNull PhpClass subjectClass,@NotNull PhpClass expectedClass){
  if (subjectClass == expectedClass) {
    return true;
  }
  if (expectedClass.isInterface()) {
    return isImplementationOfInterface(subjectClass,expectedClass);
  }
  if (null == subjectClass.getSuperClass()) {
    return false;
  }
  return isInstanceOf(subjectClass.getSuperClass(),expectedClass);
}

Fixed version (ground truth):
public boolean isInstanceOf(@NotNull PhpClass subjectClass,@NotNull PhpClass expectedClass){
  if (subjectClass == expectedClass || PhpElementsUtil.isEqualClassName(subjectClass,expectedClass)) {
    return true;
  }
  if (expectedClass.isInterface()) {
    return isImplementationOfInterface(subjectClass,expectedClass);
  }
  if (null == subjectClass.getSuperClass()) {
    return false;
  }
  return isInstanceOf(subjectClass.getSuperClass(),expectedClass);
}
Program: 15479
Project: 15479
Buggy source:
/** 
 * Single resolve doesnt work if we have non unique class names in project context, so try a multiResolve and use first matched method
 */
@Nullable public static Method getMultiResolvedMethod(PsiReference psiReference){
  PsiElement resolvedReference=psiReference.resolve();
  if (resolvedReference instanceof Method) {
    return (Method)resolvedReference;
  }
  if (psiReference instanceof PsiPolyVariantReference) {
    for (    ResolveResult resolveResult : ((PsiPolyVariantReference)psiReference).multiResolve(false)) {
      PsiElement element=resolveResult.getElement();
      if (element instanceof Method) {
        return (Method)element;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Single resolve doesnt work if we have non unique class names in project context, so try a multiResolve
 */
@Nullable public static Method[] getMultiResolvedMethod(PsiReference psiReference){
  PsiElement resolvedReference=psiReference.resolve();
  if (resolvedReference instanceof Method) {
    return new Method[]{(Method)resolvedReference};
  }
  if (psiReference instanceof PsiPolyVariantReference) {
    Collection<Method> methods=new HashSet<Method>();
    for (    ResolveResult resolveResult : ((PsiPolyVariantReference)psiReference).multiResolve(false)) {
      PsiElement element=resolveResult.getElement();
      if (element instanceof Method) {
        methods.add((Method)element);
      }
    }
    if (methods.size() > 0) {
      return methods.toArray(new Method[methods.size()]);
    }
  }
  return null;
}
Program: 15480
Project: 15480
Buggy source:
/** 
 * Single resolve doesnt work if we have non unique class names in project context, so try a multiResolve and use first matched method
 */
@Nullable protected static Method getMultiResolvedMethod(PsiReference psiReference){
  PsiElement resolvedReference=psiReference.resolve();
  if (resolvedReference instanceof Method) {
    return (Method)resolvedReference;
  }
  if (psiReference instanceof PsiPolyVariantReference) {
    for (    ResolveResult resolveResult : ((PsiPolyVariantReference)psiReference).multiResolve(false)) {
      PsiElement element=resolveResult.getElement();
      if (element instanceof Method) {
        return (Method)element;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Single resolve doesnt work if we have non unique class names in project context, so try a multiResolve and use first matched method
 */
@Nullable public static Method getMultiResolvedMethod(PsiReference psiReference){
  PsiElement resolvedReference=psiReference.resolve();
  if (resolvedReference instanceof Method) {
    return (Method)resolvedReference;
  }
  if (psiReference instanceof PsiPolyVariantReference) {
    for (    ResolveResult resolveResult : ((PsiPolyVariantReference)psiReference).multiResolve(false)) {
      PsiElement element=resolveResult.getElement();
      if (element instanceof Method) {
        return (Method)element;
      }
    }
  }
  return null;
}
Program: 15482
Project: 15482
Buggy source:
public void addCompletions(@NotNull CompletionParameters parameters,ProcessingContext context,final @NotNull CompletionResultSet resultSet){
  PsiElement psiElement=parameters.getOriginalPosition();
  if (psiElement == null || !Symfony2ProjectComponent.isEnabled(psiElement)) {
    return;
  }
  PhpElementsUtil.visitNamespaceClassForCompletion(psiElement,parameters.getOffset(),new PhpElementsUtil.ClassForCompletionVisitor(){
    @Override public void visit(    PhpClass phpClass,    String presentableFQN,    String prefix){
      resultSet.addElement(LookupElementBuilder.create(prefix + presentableFQN).withIcon(phpClass.getIcon()));
    }
  }
);
  for (  String className : PhpIndex.getInstance(psiElement.getProject()).getAllClassNames(resultSet.getPrefixMatcher())) {
    resultSet.addElement(new PhpLookupElement(className,PhpClassIndex.KEY,parameters.getOriginalFile().getProject(),PhpClassReferenceInsertHandler.getInstance()));
  }
  for (  Map.Entry<String,ContainerParameter> entry : ContainerCollectionResolver.getParameters(psiElement.getProject()).entrySet()) {
    resultSet.addElement(new ParameterLookupElement(entry.getValue(),ParameterPercentWrapInsertHandler.getInstance(),psiElement.getText()));
  }
}

Fixed version (ground truth):
public void addCompletions(@NotNull CompletionParameters parameters,ProcessingContext context,final @NotNull CompletionResultSet resultSet){
  PsiElement psiElement=parameters.getOriginalPosition();
  if (psiElement == null || !Symfony2ProjectComponent.isEnabled(psiElement)) {
    return;
  }
  PhpClassCompletionProvider.addClassCompletion(parameters,resultSet,psiElement,false);
  for (  Map.Entry<String,ContainerParameter> entry : ContainerCollectionResolver.getParameters(psiElement.getProject()).entrySet()) {
    resultSet.addElement(new ParameterLookupElement(entry.getValue(),ParameterPercentWrapInsertHandler.getInstance(),psiElement.getText()));
  }
}
Program: 15483
Project: 15483
Buggy source:
public void addCompletions(@NotNull CompletionParameters parameters,ProcessingContext context,@NotNull CompletionResultSet resultSet){
  if (!Symfony2ProjectComponent.isEnabled(parameters.getPosition())) {
    return;
  }
  PhpIndex phpIndex=PhpIndex.getInstance(parameters.getOriginalFile().getProject());
  for (  String className : phpIndex.getAllClassNames(resultSet.getPrefixMatcher())) {
    resultSet.addElement(new PhpLookupElement(className,PhpClassIndex.KEY,parameters.getOriginalFile().getProject(),PhpClassReferenceInsertHandler.getInstance()));
  }
}

Fixed version (ground truth):
public void addCompletions(@NotNull CompletionParameters parameters,ProcessingContext context,final @NotNull CompletionResultSet resultSet){
  PsiElement psiElement=parameters.getOriginalPosition();
  if (!Symfony2ProjectComponent.isEnabled(psiElement)) {
    return;
  }
  addClassCompletion(parameters,resultSet,psiElement,withInterface);
}
Program: 15484
Project: 15484
Buggy source:
@Nullable public static YAMLKeyValue getRootKey(PsiFile psiFile,String keyName){
  if (psiFile.getFirstChild() instanceof YAMLDocument) {
    return YamlKeyFinder.find(psiFile.getFirstChild(),keyName);
  }
  return null;
}

Fixed version (ground truth):
@Nullable public static YAMLKeyValue getRootKey(PsiFile psiFile,String keyName){
  YAMLDocument yamlDocument=PsiTreeUtil.getChildOfType(psiFile,YAMLDocument.class);
  if (yamlDocument != null) {
    return YamlKeyFinder.find(yamlDocument,keyName);
  }
  return null;
}
Program: 15485
Project: 15485
Buggy source:
/** 
 * $template['var'] = $foo
 */
private static Map<String,PsiVariable> getTypesOnArrayIndex(ArrayAccessExpression arrayAccessExpression){
  HashMap<String,PsiVariable> collectedTypes=new HashMap<String,PsiVariable>();
  ArrayIndex arrayIndex=arrayAccessExpression.getIndex();
  if (arrayIndex != null && arrayIndex.getValue() instanceof StringLiteralExpression) {
    String variableName=((StringLiteralExpression)arrayIndex.getValue()).getContents();
    Set<String> variableTypes=new HashSet<String>();
    if (arrayAccessExpression.getParent() instanceof AssignmentExpression) {
      PsiElement arrayValue=((AssignmentExpression)arrayAccessExpression.getParent()).getValue();
      if (arrayValue instanceof PhpTypedElement) {
        variableTypes=((PhpTypedElement)arrayValue).getType().getTypes();
      }
    }
    collectedTypes.put(variableName,new PsiVariable(variableTypes,((AssignmentExpression)arrayAccessExpression.getParent()).getValue()));
  }
  return collectedTypes;
}

Fixed version (ground truth):
/** 
 * $template['var'] = $foo
 */
private static Map<String,PsiVariable> getTypesOnArrayIndex(ArrayAccessExpression arrayAccessExpression){
  HashMap<String,PsiVariable> collectedTypes=new HashMap<String,PsiVariable>();
  ArrayIndex arrayIndex=arrayAccessExpression.getIndex();
  if (arrayIndex != null && arrayIndex.getValue() instanceof StringLiteralExpression) {
    String variableName=((StringLiteralExpression)arrayIndex.getValue()).getContents();
    Set<String> variableTypes=new HashSet<String>();
    PsiElement parent=arrayAccessExpression.getParent();
    if (parent instanceof AssignmentExpression) {
      PsiElement arrayValue=((AssignmentExpression)parent).getValue();
      if (arrayValue instanceof PhpTypedElement) {
        variableTypes=((PhpTypedElement)arrayValue).getType().getTypes();
      }
      collectedTypes.put(variableName,new PsiVariable(variableTypes,((AssignmentExpression)parent).getValue()));
    }
 else {
      collectedTypes.put(variableName,new PsiVariable(variableTypes,null));
    }
  }
  return collectedTypes;
}
Program: 15486
Project: 15486
Buggy source:
public Map<String,String> getLocalParameterMap(PsiElement psiElement){
  Map<String,String> map=new HashMap<String,String>();
  if (!(psiElement.getContainingFile().getFirstChild() instanceof YAMLDocument)) {
    return map;
  }
  YAMLDocument yamlDocument=(YAMLDocument)psiElement.getContainingFile().getFirstChild();
  YAMLKeyValue[] yamlKeys=PsiTreeUtil.getChildrenOfType(yamlDocument,YAMLKeyValue.class);
  if (yamlKeys == null) {
    return map;
  }
  for (  YAMLKeyValue yamlKeyValue : yamlKeys) {
    String yamlConfigKey=yamlKeyValue.getName();
    if (yamlConfigKey != null && yamlConfigKey.equals("String_Node_Str")) {
      YAMLKeyValue yamlParameter[]=PsiTreeUtil.getChildrenOfType(yamlKeyValue.getValue(),YAMLKeyValue.class);
      if (yamlParameter != null) {
        for (        YAMLKeyValue yamlParameterArray : yamlParameter) {
          String keyName=yamlParameterArray.getKeyText();
          if (StringUtils.isNotBlank(keyName)) {
            PsiElement value=yamlParameterArray.getValue();
            if (value != null) {
              String valueText=value.getText();
              if (StringUtils.isNotBlank(valueText)) {
                map.put(keyName.toLowerCase(),PsiElementUtils.trimQuote(valueText));
              }
            }
          }
        }
      }
    }
  }
  return map;
}

Fixed version (ground truth):
public Map<String,String> getLocalParameterMap(PsiFile psiFile){
  Map<String,String> map=new HashMap<String,String>();
  YAMLDocument yamlDocument=PsiTreeUtil.getChildOfType(psiFile,YAMLDocument.class);
  if (yamlDocument == null) {
    return map;
  }
  YAMLKeyValue[] yamlKeys=PsiTreeUtil.getChildrenOfType(yamlDocument,YAMLKeyValue.class);
  if (yamlKeys == null) {
    return map;
  }
  for (  YAMLKeyValue yamlKeyValue : yamlKeys) {
    String yamlConfigKey=yamlKeyValue.getName();
    if (yamlConfigKey != null && yamlConfigKey.equals("String_Node_Str")) {
      YAMLKeyValue yamlParameter[]=PsiTreeUtil.getChildrenOfType(yamlKeyValue.getValue(),YAMLKeyValue.class);
      if (yamlParameter != null) {
        for (        YAMLKeyValue yamlParameterArray : yamlParameter) {
          String keyName=yamlParameterArray.getKeyText();
          if (StringUtils.isNotBlank(keyName)) {
            PsiElement value=yamlParameterArray.getValue();
            if (value != null) {
              String valueText=value.getText();
              if (StringUtils.isNotBlank(valueText)) {
                map.put(keyName.toLowerCase(),PsiElementUtils.trimQuote(valueText));
              }
            }
          }
        }
      }
    }
  }
  return map;
}
Program: 15488
Project: 15488
Buggy source:
public ServiceMap getServicesMap(){
  if (null != servicesMap) {
    return servicesMap;
  }
  String defaultServiceMapFilePath=getPath(project,Settings.getInstance(project).pathToProjectContainer);
  File xmlFile=new File(defaultServiceMapFilePath);
  if (!xmlFile.exists()) {
    return new ServiceMap();
  }
  Long xmlFileLastModified=xmlFile.lastModified();
  if (xmlFileLastModified.equals(servicesMapLastModified)) {
    return servicesMap;
  }
  try {
    ServiceMapParser serviceMapParser=new ServiceMapParser();
    servicesMap=serviceMapParser.parse(xmlFile);
    servicesMapLastModified=xmlFileLastModified;
    return servicesMap;
  }
 catch (  SAXException ignored) {
  }
catch (  IOException ignored) {
  }
catch (  ParserConfigurationException ignored) {
  }
  return new ServiceMap();
}

Fixed version (ground truth):
public ServiceMap getServicesMap(){
  String defaultServiceMapFilePath=getPath(project,Settings.getInstance(project).pathToProjectContainer);
  File xmlFile=new File(defaultServiceMapFilePath);
  if (!xmlFile.exists()) {
    return new ServiceMap();
  }
  Long xmlFileLastModified=xmlFile.lastModified();
  if (xmlFileLastModified.equals(servicesMapLastModified)) {
    return servicesMap;
  }
  try {
    ServiceMapParser serviceMapParser=new ServiceMapParser();
    servicesMap=serviceMapParser.parse(xmlFile);
    servicesMapLastModified=xmlFileLastModified;
    return servicesMap;
  }
 catch (  SAXException ignored) {
  }
catch (  IOException ignored) {
  }
catch (  ParserConfigurationException ignored) {
  }
  return new ServiceMap();
}
Program: 15489
Project: 15489
Buggy source:
public ServiceMap getServicesMap(){
  String defaultServiceMapFilePath=Settings.getInstance(project).pathToProjectContainer;
  if (!defaultServiceMapFilePath.startsWith("String_Node_Str")) {
    defaultServiceMapFilePath=project.getBasePath() + "String_Node_Str" + defaultServiceMapFilePath;
  }
  File xmlFile=new File(defaultServiceMapFilePath);
  if (!xmlFile.exists()) {
    return new ServiceMap();
  }
  Long xmlFileLastModified=xmlFile.lastModified();
  if (xmlFileLastModified.equals(servicesMapLastModified)) {
    return servicesMap;
  }
  try {
    ServiceMapParser serviceMapParser=new ServiceMapParser();
    servicesMap=serviceMapParser.parse(xmlFile);
    servicesMapLastModified=xmlFileLastModified;
    return servicesMap;
  }
 catch (  SAXException ignored) {
  }
catch (  IOException ignored) {
  }
catch (  ParserConfigurationException ignored) {
  }
  return new ServiceMap();
}

Fixed version (ground truth):
public ServiceMap getServicesMap(){
  String defaultServiceMapFilePath=Settings.getInstance(project).pathToProjectContainer;
  if (!FileUtil.isAbsolute(defaultServiceMapFilePath)) {
    defaultServiceMapFilePath=project.getBasePath() + "String_Node_Str" + defaultServiceMapFilePath;
  }
  File xmlFile=new File(defaultServiceMapFilePath);
  if (!xmlFile.exists()) {
    return new ServiceMap();
  }
  Long xmlFileLastModified=xmlFile.lastModified();
  if (xmlFileLastModified.equals(servicesMapLastModified)) {
    return servicesMap;
  }
  try {
    ServiceMapParser serviceMapParser=new ServiceMapParser();
    servicesMap=serviceMapParser.parse(xmlFile);
    servicesMapLastModified=xmlFileLastModified;
    return servicesMap;
  }
 catch (  SAXException ignored) {
  }
catch (  IOException ignored) {
  }
catch (  ParserConfigurationException ignored) {
  }
  return new ServiceMap();
}
Program: 15490
Project: 15490
Buggy source:
@Nullable @Override public PhpType getType(PsiElement e){
  if (!isContainerGetCall(e)) {
    return null;
  }
  String serviceId=getServiceId((MethodReferenceImpl)e);
  if (null == serviceId) {
    return null;
  }
  Map<String,String> serviceMap=getServicesMap(e.getProject());
  String serviceClass=serviceMap.get(serviceId);
  if (null == serviceClass) {
    return null;
  }
  return new PhpType().add(serviceClass);
}

Fixed version (ground truth):
@Nullable @Override public PhpType getType(PsiElement e){
  if (DumbService.getInstance(e.getProject()).isDumb()) {
    return null;
  }
  if (!isContainerGetCall(e)) {
    return null;
  }
  String serviceId=getServiceId((MethodReferenceImpl)e);
  if (null == serviceId) {
    return null;
  }
  Map<String,String> serviceMap=getServicesMap(e.getProject());
  String serviceClass=serviceMap.get(serviceId);
  if (null == serviceClass) {
    return null;
  }
  return new PhpType().add(serviceClass);
}
Program: 15491
Project: 15491
Buggy source:
@Override public void onTextChanged(CharSequence s,int start,int before,int end){
  if (start == 0 && before == 1 && s.length() == 0) {
    if (delegate != null) {
      delegate.focusOnPreviousField(this);
    }
  }
 else   if (!s.equals(lastValue)) {
    lastValue=s;
    textChanged(s,start,before,end);
  }
}

Fixed version (ground truth):
@Override public void onTextChanged(CharSequence s,int start,int before,int end){
  if (start == 0 && before == 1 && s.length() == 0) {
    if (delegate != null) {
      delegate.focusOnPreviousField(this);
    }
  }
 else {
    String tmp=String.valueOf(s);
    if (!tmp.equals(lastValue)) {
      lastValue=tmp;
      textChanged(s,start,before,end);
    }
  }
}
Program: 15492
Project: 15492
Buggy source:
private void closeStream(){
  logger.debug("String_Node_Str");
  if (fsDataOutputStream != null) {
    try {
      fsDataOutputStream.close();
    }
 catch (    IOException e) {
      IOUtils.closeStream(fsDataOutputStream);
      throw new StoreException("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void closeStream(){
  logger.debug("String_Node_Str");
  if (fsDataOutputStream != null) {
    try {
      fsDataOutputStream.close();
    }
 catch (    IOException e) {
      IOUtils.closeStream(fsDataOutputStream);
      throw new StoreException("String_Node_Str",e);
    }
 finally {
      fsDataOutputStream=null;
    }
  }
}
Program: 15493
Project: 15493
Buggy source:
@Override protected void doSerialize(Kryo kryo,Object object,Output output){
  kryo.register(object.getClass());
  kryo.writeObject(output,object);
}

Fixed version (ground truth):
@Override protected void doSerialize(Kryo kryo,Object object,Output output){
  kryo.writeObject(output,object);
}
Program: 15494
Project: 15494
Buggy source:
@Override protected Object doDeserialize(Kryo kryo,Input input,Class<? extends Object> type){
  kryo.register(type);
  return kryo.readObject(input,type);
}

Fixed version (ground truth):
@Override protected Object doDeserialize(Kryo kryo,Input input,Class<? extends Object> type){
  return kryo.readObject(input,type);
}
Program: 15495
Project: 15495
Buggy source:
private void closeStream(){
  logger.debug("String_Node_Str");
  if (fsDataOutputStream != null) {
    IOUtils.closeStream(fsDataOutputStream);
  }
}

Fixed version (ground truth):
private void closeStream(){
  logger.debug("String_Node_Str");
  if (fsDataOutputStream != null) {
    try {
      fsDataOutputStream.close();
    }
 catch (    IOException e) {
      IOUtils.closeStream(fsDataOutputStream);
      throw new StoreException("String_Node_Str",e);
    }
  }
}
Program: 15496
Project: 15496
Buggy source:
@Override protected boolean doSend(final Message<?> message,final long timeout){
  try {
    return retryTemplate.execute(new RetryCallback<Boolean,Exception>(){
      @Override public Boolean doWithRetry(      RetryContext context) throws Exception {
        return bridgeToModuleChannel.send(message,timeout);
      }
    }
,new RecoveryCallback<Boolean>(){
      /** 
 * Send the failed message to 'ERRORS:[name]'.
 */
      @Override public Boolean recover(      RetryContext context) throws Exception {
        logger.error("String_Node_Str",context.getLastThrowable());
        errorAdapter.handleMessage(getMessageBuilderFactory().fromMessage(message).setHeader(ERROR_HEADER,"String_Node_Str" + name).build());
        return true;
      }
    }
);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    return false;
  }
}

Fixed version (ground truth):
@Override protected boolean doSend(final Message<?> message,final long timeout){
  try {
    return retryTemplate.execute(new RetryCallback<Boolean,Exception>(){
      @Override public Boolean doWithRetry(      RetryContext context) throws Exception {
        return bridgeToModuleChannel.send(message,timeout);
      }
    }
,new RecoveryCallback<Boolean>(){
      /** 
 * Send the failed message to 'ERRORS:[name]'.
 */
      @Override public Boolean recover(      RetryContext context) throws Exception {
        logger.error("String_Node_Str" + name + "String_Node_Str"+ context.getLastThrowable());
        errorAdapter.handleMessage(getMessageBuilderFactory().fromMessage(message).setHeader(ERROR_HEADER,"String_Node_Str" + name).build());
        return true;
      }
    }
);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    return false;
  }
}
Program: 15497
Project: 15497
Buggy source:
/** 
 * Send the failed message to 'ERRORS:[name]'.
 */
@Override public Boolean recover(RetryContext context) throws Exception {
  logger.error("String_Node_Str",context.getLastThrowable());
  errorAdapter.handleMessage(getMessageBuilderFactory().fromMessage(message).setHeader(ERROR_HEADER,"String_Node_Str" + name).build());
  return true;
}

Fixed version (ground truth):
/** 
 * Send the failed message to 'ERRORS:[name]'.
 */
@Override public Boolean recover(RetryContext context) throws Exception {
  logger.error("String_Node_Str" + name + "String_Node_Str"+ context.getLastThrowable());
  errorAdapter.handleMessage(getMessageBuilderFactory().fromMessage(message).setHeader(ERROR_HEADER,"String_Node_Str" + name).build());
  return true;
}
Program: 15499
Project: 15499
Buggy source:
/** 
 * This method takes a definition String as input parameter. The method will filter out any parameters labeled   {@code --password} and will masked themusing the  {@code *} character.
 * @param definition Must not be empty
 * @return The definition string with masked passwords. Should never return null.
 */
public static String maskPasswordsInDefinition(String definition){
  Assert.hasText(definition,"String_Node_Str");
  final StringBuffer output=new StringBuffer();
  final Matcher matcher=passwordParameterPattern.matcher(definition);
  while (matcher.find()) {
    matcher.appendReplacement(output,matcher.group(1) + matcher.group(3).replaceAll("String_Node_Str","String_Node_Str"));
  }
  matcher.appendTail(output);
  return output.toString();
}

Fixed version (ground truth):
/** 
 * This method takes a definition String as input parameter. The method will filter out any parameters labeled   {@code --password} and will masked themusing the  {@code *} character.
 * @param definition Must not be empty
 * @return The definition string with masked passwords. Should never return null.
 */
public static String maskPasswordsInDefinition(String definition){
  Assert.hasText(definition,"String_Node_Str");
  final StringBuffer output=new StringBuffer();
  final Matcher matcher=passwordParameterPattern.matcher(definition);
  while (matcher.find()) {
    final String passwordValue=matcher.group(3);
    final String maskedPasswordValue;
    if (passwordValue.startsWith("String_Node_Str") && passwordValue.endsWith("String_Node_Str")) {
      final String passwordValueWithoutQuotes=passwordValue.substring(1,passwordValue.length() - 1);
      maskedPasswordValue="String_Node_Str" + passwordValueWithoutQuotes.replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str";
    }
 else {
      maskedPasswordValue=matcher.group(3).replaceAll("String_Node_Str","String_Node_Str");
    }
    matcher.appendReplacement(output,matcher.group(1) + maskedPasswordValue);
  }
  matcher.appendTail(output);
  return output.toString();
}
Program: 15500
Project: 15500
Buggy source:
@Test public void testMaskStreamDefinitionWithUnicodePasswordParameter(){
  String maskedPassword=PasswordUtils.maskPasswordsInDefinition("String_Node_Str");
  assertEquals("String_Node_Str",maskedPassword);
}

Fixed version (ground truth):
/** 
 * The password parameter value in Russian (UTF) should be masked also.
 */
@Test public void testMaskStreamDefinitionWithUnicodePasswordParameter(){
  String maskedPassword=PasswordUtils.maskPasswordsInDefinition("String_Node_Str");
  assertEquals("String_Node_Str",maskedPassword);
}
Program: 15501
Project: 15501
Buggy source:
@Test public void testMaskStreamDefinitionWithMultiplePasswordParametersAndMixedCase(){
  String maskedPassword=PasswordUtils.maskPasswordsInDefinition("String_Node_Str");
  assertEquals("String_Node_Str",maskedPassword);
}

Fixed version (ground truth):
/** 
 * The password parameter can be upper-case, lower-case or mixed-case.
 */
@Test public void testMaskStreamDefinitionWithMultiplePasswordParametersAndMixedCase(){
  String maskedPassword=PasswordUtils.maskPasswordsInDefinition("String_Node_Str");
  assertEquals("String_Node_Str",maskedPassword);
}
Program: 15502
Project: 15502
Buggy source:
@Test public void testMaskStreamDefinitionWithPasswordParameterInMiddle(){
  String maskedPassword=PasswordUtils.maskPasswordsInDefinition("String_Node_Str");
  assertEquals("String_Node_Str",maskedPassword);
}

Fixed version (ground truth):
/** 
 * A basic stream definition parameter (parameter in middle of stream) called "password" should have its value masked.
 */
@Test public void testMaskStreamDefinitionWithPasswordParameterInMiddle(){
  String maskedPassword=PasswordUtils.maskPasswordsInDefinition("String_Node_Str");
  assertEquals("String_Node_Str",maskedPassword);
}
Program: 15503
Project: 15503
Buggy source:
@Test public void testMaskStreamDefinitionWithPasswordParameterContainingADot(){
  String maskedPassword=PasswordUtils.maskPasswordsInDefinition("String_Node_Str");
  assertEquals("String_Node_Str",maskedPassword);
}

Fixed version (ground truth):
/** 
 * Mask Stream Definition With Password Parameter Containing a Dot.
 */
@Test public void testMaskStreamDefinitionWithPasswordParameterContainingADot(){
  String maskedPassword=PasswordUtils.maskPasswordsInDefinition("String_Node_Str");
  assertEquals("String_Node_Str",maskedPassword);
}
Program: 15505
Project: 15505
Buggy source:
private void unbindTapChannel(String tapChannelName){
  MessageChannel tappedChannel=tappableChannels.remove(tapChannelName);
  if (tappedChannel instanceof ChannelInterceptorAware) {
    ChannelInterceptorAware interceptorAware=((ChannelInterceptorAware)tappedChannel);
    List<ChannelInterceptor> interceptors=new ArrayList<ChannelInterceptor>();
    for (    ChannelInterceptor interceptor : interceptorAware.getChannelInterceptors()) {
      if (interceptor instanceof WireTap) {
        ((WireTap)interceptor).stop();
      }
 else {
        interceptors.add(interceptor);
      }
    }
    interceptorAware.setInterceptors(interceptors);
    messageBus.unbindProducers(tapChannelName);
  }
}

Fixed version (ground truth):
private void unbindTapChannel(String tapChannelName){
  MessageChannel tappedChannel=tappableChannels.get(tapChannelName);
  if (tappedChannel instanceof ChannelInterceptorAware) {
    ChannelInterceptorAware interceptorAware=((ChannelInterceptorAware)tappedChannel);
    List<ChannelInterceptor> interceptors=new ArrayList<ChannelInterceptor>();
    for (    ChannelInterceptor interceptor : interceptorAware.getChannelInterceptors()) {
      if (interceptor instanceof WireTap) {
        ((WireTap)interceptor).stop();
      }
 else {
        interceptors.add(interceptor);
      }
    }
    interceptorAware.setInterceptors(interceptors);
    messageBus.unbindProducers(tapChannelName);
  }
}
Program: 15506
Project: 15506
Buggy source:
/** 
 * Unbind the output channel of the module (and tap if present) from the   {@link MessageBus}(after it has been stopped).
 * @param module the module for which producers are to be unbound from the {@link MessageBus}.
 */
protected void unbindProducers(Module module){
  MessageChannel outputChannel=module.getComponent(MODULE_OUTPUT_CHANNEL,MessageChannel.class);
  if (outputChannel != null) {
    messageBus.unbindProducer(getOutputChannelName(module),outputChannel);
    unbindTapChannel(buildTapChannelName(module));
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + module.toString());
    }
  }
}

Fixed version (ground truth):
/** 
 * Unbind the output channel of the module (and tap if present) from the   {@link MessageBus}(after it has been stopped).
 * @param module the module for which producers are to be unbound from the {@link MessageBus}.
 */
protected void unbindProducers(Module module){
  MessageChannel outputChannel=module.getComponent(MODULE_OUTPUT_CHANNEL,MessageChannel.class);
  if (outputChannel != null) {
    messageBus.unbindProducer(getOutputChannelName(module),outputChannel);
    String tapChannelName=buildTapChannelName(module);
    unbindTapChannel(tapChannelName);
    tappableChannels.remove(tapChannelName);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + module.toString());
    }
  }
}
Program: 15508
Project: 15508
Buggy source:
@Override protected boolean doSend(Message<?> message,long timeout){
  tapped.countDown();
  tapThread.set(Thread.currentThread());
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
@Override protected boolean doSend(Message<?> message,long timeout){
  tapThread.set(Thread.currentThread());
  tapped.countDown();
  throw new RuntimeException("String_Node_Str");
}