Program: 12063
Project: 12063
Buggy source:
public Set<IType> getSubTypes(IType superType){
  if (subTypeMap.containsKey(superType)) {
    Set<IType> subTypes=subTypeMap.get(superType);
    LinkedHashSet<IType> subTypesOfAbstractSubTypes=new LinkedHashSet<IType>();
    try {
      for (      IType subType : subTypes) {
        if (Flags.isAbstract(subType.getFlags()) && !subType.equals(superType)) {
          subTypesOfAbstractSubTypes.addAll(getSubTypes(subType));
        }
      }
    }
 catch (    JavaModelException e) {
      e.printStackTrace();
    }
    LinkedHashSet<IType> finalSubTypes=new LinkedHashSet<IType>();
    finalSubTypes.addAll(subTypes);
    finalSubTypes.addAll(subTypesOfAbstractSubTypes);
    return finalSubTypes;
  }
 else {
    IPackageFragment packageFragment=superType.getPackageFragment();
    final LinkedHashSet<IType> subTypes=new LinkedHashSet<IType>();
    final LinkedHashSet<IType> subTypesOfAbstractSubTypes=new LinkedHashSet<IType>();
    try {
      SearchPattern searchPattern=SearchPattern.createPattern(superType,IJavaSearchConstants.IMPLEMENTORS);
      SearchEngine searchEngine=new SearchEngine();
      IJavaSearchScope scope=null;
      if (packageFragment.getElementName().equals("String_Node_Str") || packageFragment.getElementName().equals("String_Node_Str") || packageFragment.getElementName().equals("String_Node_Str")|| packageFragment.getElementName().equals("String_Node_Str"))       scope=SearchEngine.createJavaSearchScope(new IJavaElement[]{packageFragment},false);
 else       scope=SearchEngine.createHierarchyScope(superType);
      SearchRequestor requestor=new TypeSearchRequestor(subTypes);
      searchEngine.search(searchPattern,new SearchParticipant[]{SearchEngine.getDefaultSearchParticipant()},scope,requestor,null);
      subTypeMap.put(superType,subTypes);
      for (      IType subType : subTypes) {
        if (Flags.isAbstract(subType.getFlags()) && !subType.equals(superType)) {
          subTypesOfAbstractSubTypes.addAll(getSubTypes(subType));
        }
      }
    }
 catch (    JavaModelException e) {
      e.printStackTrace();
    }
catch (    CoreException e) {
      e.printStackTrace();
    }
    LinkedHashSet<IType> finalSubTypes=new LinkedHashSet<IType>();
    finalSubTypes.addAll(subTypes);
    finalSubTypes.addAll(subTypesOfAbstractSubTypes);
    return finalSubTypes;
  }
}

Fixed version (ground truth):
public Set<IType> getSubTypes(IType superType){
  if (subTypeMap.containsKey(superType)) {
    Set<IType> subTypes=subTypeMap.get(superType);
    LinkedHashSet<IType> subTypesOfAbstractSubTypes=new LinkedHashSet<IType>();
    try {
      for (      IType subType : subTypes) {
        if (Flags.isAbstract(subType.getFlags()) && !subType.equals(superType)) {
          subTypesOfAbstractSubTypes.addAll(getSubTypes(subType));
        }
      }
    }
 catch (    JavaModelException e) {
      e.printStackTrace();
    }
    LinkedHashSet<IType> finalSubTypes=new LinkedHashSet<IType>();
    finalSubTypes.addAll(subTypes);
    finalSubTypes.addAll(subTypesOfAbstractSubTypes);
    return finalSubTypes;
  }
 else {
    IPackageFragment packageFragment=superType.getPackageFragment();
    final LinkedHashSet<IType> subTypes=new LinkedHashSet<IType>();
    final LinkedHashSet<IType> subTypesOfAbstractSubTypes=new LinkedHashSet<IType>();
    try {
      SearchPattern searchPattern=SearchPattern.createPattern(superType,IJavaSearchConstants.IMPLEMENTORS);
      SearchEngine searchEngine=new SearchEngine();
      IJavaSearchScope scope=null;
      String packageFragmentName=packageFragment.getElementName();
      if (packageFragmentName.equals("String_Node_Str") || packageFragmentName.equals("String_Node_Str") || packageFragmentName.equals("String_Node_Str")|| packageFragmentName.equals("String_Node_Str")|| packageFragmentName.equals("String_Node_Str"))       scope=SearchEngine.createJavaSearchScope(new IJavaElement[]{packageFragment},false);
 else       scope=SearchEngine.createHierarchyScope(superType);
      SearchRequestor requestor=new TypeSearchRequestor(subTypes);
      searchEngine.search(searchPattern,new SearchParticipant[]{SearchEngine.getDefaultSearchParticipant()},scope,requestor,null);
      subTypeMap.put(superType,subTypes);
      for (      IType subType : subTypes) {
        if (Flags.isAbstract(subType.getFlags()) && !subType.equals(superType)) {
          subTypesOfAbstractSubTypes.addAll(getSubTypes(subType));
        }
      }
    }
 catch (    JavaModelException e) {
      e.printStackTrace();
    }
catch (    CoreException e) {
      e.printStackTrace();
    }
    LinkedHashSet<IType> finalSubTypes=new LinkedHashSet<IType>();
    finalSubTypes.addAll(subTypes);
    finalSubTypes.addAll(subTypesOfAbstractSubTypes);
    return finalSubTypes;
  }
}