nus-yam/ex-repair huggingface dataset:
Program: 40640
Project: 40640
Buggy source:
/** 
 * Compute outgoing edges in the control flow graph.
 */
private void computeEdges(){
  for (Iterator it=iterator(); it.hasNext(); ) {
    BasicBlock b=(BasicBlock)it.next();
    if (b.equals(exit()))     continue;
    b.computeOutgoingEdges();
  }
}

Fixed version (ground truth):
/** 
 * Compute outgoing edges in the control flow graph.
 */
private void computeEdges(){
  for (Iterator it=iterator(); it.hasNext(); ) {
    BasicBlock b=(BasicBlock)it.next();
    if (b.equals(exit()))     continue;
    if (b.equals(entry())) {
      addNormalEdge(b,getNode(b.getGraphNodeId() + 1));
      continue;
    }
    SSAInstruction last=(SSAInstruction)getInstructions()[b.getLastInstructionIndex()];
    if (last.isPEI()) {
      addExceptionalEdge(b,exit());
    }
    if (true) {
      if (DEBUG) {
        Trace.println("String_Node_Str" + getNode(b.getGraphNodeId() + 1));
      }
      addNormalEdge(b,getNode(b.getGraphNodeId() + 1));
    }
    if (last instanceof SSAReturnInstruction) {
      BasicBlock exit=exit();
      addNormalEdge(b,exit);
    }
  }
}
Program: 40641
Project: 40641
Buggy source:
public void testSlice2() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA,CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.SLICE2_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,new AnalysisCache(),cha,scope);
  CallGraph cg=builder.makeCallGraph(options);
  CGNode main=findMethod(cg,"String_Node_Str");
  Statement s=findCallTo(main,"String_Node_Str");
  System.err.println("String_Node_Str" + s);
  Collection<Statement> computeBackwardSlice=Slicer.computeBackwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.FULL,ControlDependenceOptions.NONE);
  Collection<Statement> slice=computeBackwardSlice;
  dumpSlice(slice);
  assertEquals(22,slice.size());
}

Fixed version (ground truth):
public void testSlice2() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA,CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.SLICE2_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,new AnalysisCache(),cha,scope);
  CallGraph cg=builder.makeCallGraph(options);
  CGNode main=findMethod(cg,"String_Node_Str");
  Statement s=findCallTo(main,"String_Node_Str");
  System.err.println("String_Node_Str" + s);
  Collection<Statement> computeBackwardSlice=Slicer.computeBackwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.FULL,ControlDependenceOptions.NONE);
  Collection<Statement> slice=computeBackwardSlice;
  dumpSlice(slice);
  assertEquals(30,slice.size());
}
Program: 40642
Project: 40642
Buggy source:
/** 
 * Get the WCCM archive representing a particular module
 * @param M the module to analyze
 * @return Archive, or null if no WCCM conversion is possible
 */
@SuppressWarnings("String_Node_Str") public static Archive getArchive(Module M){
  CommonarchiveFactory factory=CommonarchiveFactoryImpl.getActiveFactory();
  try {
    if (M instanceof JarFileModule) {
      String fileName=((JarFileModule)M).getAbsolutePath();
      return factory.openArchive(fileName);
    }
 else     if (M instanceof TopLevelArchiveModule) {
      TopLevelArchiveModule AM=(TopLevelArchiveModule)M;
      return AM.materializeArchive();
    }
 else     if (M instanceof ClassFileModule) {
      return null;
    }
 else {
      Assertions.UNREACHABLE("String_Node_Str" + M.getClass());
      return null;
    }
  }
 catch (  OpenFailureException e) {
    e.printStackTrace();
    Assertions.UNREACHABLE();
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Get the WCCM archive representing a particular module
 * @param M the module to analyze
 * @return Archive, or null if no WCCM conversion is possible
 */
@SuppressWarnings("String_Node_Str") public static Archive getArchive(Module M){
  CommonarchiveFactory factory=CommonarchiveFactoryImpl.getActiveFactory();
  try {
    if (M instanceof JarFileModule) {
      String fileName=((JarFileModule)M).getAbsolutePath();
      return factory.openArchive(fileName);
    }
 else     if (M instanceof TopLevelArchiveModule) {
      TopLevelArchiveModule AM=(TopLevelArchiveModule)M;
      return AM.materializeArchive();
    }
 else     if (M instanceof ClassFileModule) {
      return null;
    }
 else {
      return null;
    }
  }
 catch (  OpenFailureException e) {
    e.printStackTrace();
    Assertions.UNREACHABLE();
    return null;
  }
}
Program: 40643
Project: 40643
Buggy source:
/** 
 * Dump stats about the class hierarchy to stdout.
 * @param cha
 */
public static void printStats(ClassHierarchy cha) throws IllegalArgumentException {
  if (cha == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  IClassLoader[] loaders=cha.getLoaders();
  for (int i=0; i < loaders.length; i++) {
    System.out.println("String_Node_Str" + loaders[i]);
    System.out.println("String_Node_Str" + loaders[i].getNumberOfClasses());
    System.out.println("String_Node_Str" + loaders[i].getNumberOfMethods());
  }
}

Fixed version (ground truth):
/** 
 * Dump stats about the class hierarchy to stdout.
 * @param cha
 */
public static void printStats(IClassHierarchy cha) throws IllegalArgumentException {
  if (cha == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  IClassLoader[] loaders=cha.getLoaders();
  for (int i=0; i < loaders.length; i++) {
    System.out.println("String_Node_Str" + loaders[i]);
    System.out.println("String_Node_Str" + loaders[i].getNumberOfClasses());
    System.out.println("String_Node_Str" + loaders[i].getNumberOfMethods());
  }
}
Program: 40644
Project: 40644
Buggy source:
/** 
 * Does m represent a static factory method we know about from the standard libraries, that we usually wish to model with one level of call-string context?
 */
public static boolean isWellKnownStaticFactory(MethodReference m){
  if (m.equals(synthArraycopy)) {
    return true;
  }
  if (m.equals(ArraysAsList)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Does m represent a static factory method we know about from the standard libraries, that we usually wish to model with one level of call-string context?
 */
public static boolean isWellKnownStaticFactory(MethodReference m){
  if (m.getDeclaringClass().equals(TypeReference.JavaLangSystem)) {
    if (m.getName().toString().equals("String_Node_Str")) {
      return true;
    }
  }
  if (m.equals(synthArraycopy)) {
    return true;
  }
  if (m.equals(ArraysAsList)) {
    return true;
  }
  return false;
}
Program: 40645
Project: 40645
Buggy source:
/** 
 * For a statement s, compute the set of statements that may def the heap value read by s.
 */
OrdinalSet<Statement> computeResult(Statement s,Map<PointerKey,MutableIntSet> pointerKeyMod,BitVectorSolver<? extends ISSABasicBlock> solver,OrdinalSetMapping<Statement> domain,CGNode node,ExtendedHeapModel h,PointerAnalysis pa,Map<CGNode,OrdinalSet<PointerKey>> mod,ExplodedControlFlowGraph cfg,Map<Integer,NormalStatement> ssaInstructionIndex2Statement){
switch (s.getKind()) {
case NORMAL:
    NormalStatement n=(NormalStatement)s;
  Collection<PointerKey> ref=modRef.getRef(node,h,pa,n.getInstruction(),exclusions);
if (!ref.isEmpty()) {
  ISSABasicBlock bb=cfg.getBlockForInstruction(n.getInstructionIndex());
  BitVectorVariable v=solver.getIn(bb);
  MutableSparseIntSet defs=MutableSparseIntSet.makeEmpty();
  for (  PointerKey p : ref) {
    if (pointerKeyMod.get(p) != null) {
      defs.addAll(pointerKeyMod.get(p).intersection(v.getValue()));
    }
  }
  return new OrdinalSet<Statement>(defs,domain);
}
 else {
  return OrdinalSet.empty();
}
case HEAP_RET_CALLEE:
{
HeapStatement.ReturnCallee r=(HeapStatement.ReturnCallee)s;
PointerKey p=r.getLocation();
BitVectorVariable v=solver.getIn(cfg.exit());
if (pointerKeyMod.get(p) == null) {
  return OrdinalSet.empty();
}
return new OrdinalSet<Statement>(pointerKeyMod.get(p).intersection(v.getValue()),domain);
}
case HEAP_RET_CALLER:
{
HeapStatement.ReturnCaller r=(HeapStatement.ReturnCaller)s;
ISSABasicBlock bb=cfg.getBlockForInstruction(r.getCallIndex());
BitVectorVariable v=solver.getIn(bb);
if (allCalleesMod(cg,r,mod) || pointerKeyMod.get(r.getLocation()) == null || v.getValue() == null) {
return OrdinalSet.empty();
}
 else {
return new OrdinalSet<Statement>(pointerKeyMod.get(r.getLocation()).intersection(v.getValue()),domain);
}
}
case HEAP_PARAM_CALLER:
{
HeapStatement.ParamCaller r=(HeapStatement.ParamCaller)s;
NormalStatement call=ssaInstructionIndex2Statement.get(r.getCallIndex());
ISSABasicBlock callBlock=cfg.getBlockForInstruction(call.getInstructionIndex());
BitVectorVariable v=solver.getIn(callBlock);
if (pointerKeyMod.get(r.getLocation()) == null || v.getValue() == null) {
return OrdinalSet.empty();
}
 else {
return new OrdinalSet<Statement>(pointerKeyMod.get(r.getLocation()).intersection(v.getValue()),domain);
}
}
case NORMAL_RET_CALLEE:
case NORMAL_RET_CALLER:
case PARAM_CALLEE:
case PARAM_CALLER:
case EXC_RET_CALLEE:
case EXC_RET_CALLER:
case PHI:
case PI:
case CATCH:
case METHOD_ENTRY:
return OrdinalSet.empty();
case HEAP_PARAM_CALLEE:
return OrdinalSet.empty();
default :
Assertions.UNREACHABLE(s.getKind().toString());
return null;
}
}

Fixed version (ground truth):
/** 
 * For a statement s, compute the set of statements that may def the heap value read by s.
 */
OrdinalSet<Statement> computeResult(Statement s,Map<PointerKey,MutableIntSet> pointerKeyMod,BitVectorSolver<? extends ISSABasicBlock> solver,OrdinalSetMapping<Statement> domain,CGNode node,ExtendedHeapModel h,PointerAnalysis pa,Map<CGNode,OrdinalSet<PointerKey>> mod,ExplodedControlFlowGraph cfg,Map<Integer,NormalStatement> ssaInstructionIndex2Statement){
}
Program: 40646
Project: 40646
Buggy source:
private Set getTypesForContext(Context context){
  XMLReflectionReader spec=(XMLReflectionReader)userSpec;
  if (spec != null && context instanceof CallerSiteContext) {
    CallerSiteContext site=(CallerSiteContext)context;
    MemberReference m=site.getCaller().getMethod().getReference();
    ReflectionSummary summary=spec.getSummary(m);
    if (summary != null) {
      Set types=summary.getTypesForProgramLocation(site.getSite().getProgramCounter());
      if (types != null) {
        return types;
      }
    }
  }
  Set types=map.get(context);
  return types;
}

Fixed version (ground truth):
private Set getTypesForContext(Context context){
  XMLReflectionReader spec=(XMLReflectionReader)userSpec;
  if (spec != null && context instanceof CallerSiteContext) {
    CallerSiteContext site=(CallerSiteContext)context;
    MemberReference m=site.getCaller().getMethod().getReference();
    ReflectionSummary summary=spec.getSummary(m);
    if (summary != null) {
      Set types=summary.getTypesForProgramLocation(site.getCallSite().getProgramCounter());
      if (types != null) {
        return types;
      }
    }
  }
  Set types=map.get(context);
  return types;
}
Program: 40647
Project: 40647
Buggy source:
@Override public int hashCode(){
  return programCounter;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return programCounter + 77;
}
Program: 40648
Project: 40648
Buggy source:
@Override public int hashCode(){
  return callSite.hashCode() * super.hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  return callSite.hashCode() * 19 + super.hashCode();
}
Program: 40649
Project: 40649
Buggy source:
/** 
 * Compute an analysis scope for the current selection
 */
protected AnalysisScope computeScope(){
  IStructuredSelection selection=(IStructuredSelection)currentSelection;
  Collection<EclipseProjectPath> projectPaths=HashSetFactory.make();
  for (Iterator it=selection.iterator(); it.hasNext(); ) {
    Object object=it.next();
    if (object instanceof IJavaElement) {
      IJavaElement e=(IJavaElement)object;
      IJavaProject jp=e.getJavaProject();
      projectPaths.add(EclipseProjectPath.make(ResourcesPlugin.getWorkspace().getRoot().getLocation(),jp));
    }
 else {
      Assertions.UNREACHABLE(object.getClass());
    }
  }
  AnalysisScope scope=mergeProjectPaths(projectPaths);
  return scope;
}

Fixed version (ground truth):
/** 
 * Compute an analysis scope for the current selection
 * @throws IOException 
 * @throws JavaModelException 
 */
protected AnalysisScope computeScope() throws JavaModelException, IOException {
  IStructuredSelection selection=(IStructuredSelection)currentSelection;
  Collection<EclipseProjectPath> projectPaths=HashSetFactory.make();
  for (Iterator it=selection.iterator(); it.hasNext(); ) {
    Object object=it.next();
    if (object instanceof IJavaElement) {
      IJavaElement e=(IJavaElement)object;
      IJavaProject jp=e.getJavaProject();
      projectPaths.add(EclipseProjectPath.make(ResourcesPlugin.getWorkspace().getRoot().getLocation(),jp));
    }
 else {
      Assertions.UNREACHABLE(object.getClass());
    }
  }
  AnalysisScope scope=mergeProjectPaths(projectPaths);
  return scope;
}
Program: 40650
Project: 40650
Buggy source:
private EclipseProjectPath(IPath workspaceRootPath,IJavaProject project){
}

Fixed version (ground truth):
private EclipseProjectPath(IPath workspaceRootPath,IJavaProject project) throws JavaModelException, IOException {
}
Program: 40651
Project: 40651
Buggy source:
public static EclipseProjectPath make(IPath workspaceRootPath,IJavaProject project){
  if (workspaceRootPath == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return new EclipseProjectPath(workspaceRootPath,project);
}

Fixed version (ground truth):
public static EclipseProjectPath make(IPath workspaceRootPath,IJavaProject project) throws JavaModelException, IOException {
  if (workspaceRootPath == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return new EclipseProjectPath(workspaceRootPath,project);
}
Program: 40652
Project: 40652
Buggy source:
/** 
 * compute the analysis scope for a project in the current workspace
 */
public static AnalysisScope computeScope(String projectName){
  IJavaProject jp=getProjectFromWorkspace(projectName);
  IWorkspaceRoot workspaceRoot=ResourcesPlugin.getWorkspace().getRoot();
  EclipseProjectPath path=EclipseProjectPath.make(workspaceRoot.getLocation(),jp);
  return path.toAnalysisScope(null);
}

Fixed version (ground truth):
/** 
 * compute the analysis scope for a project in the current workspace
 * @throws IOException 
 * @throws JavaModelException 
 */
public static AnalysisScope computeScope(String projectName) throws JavaModelException, IOException {
  IJavaProject jp=getProjectFromWorkspace(projectName);
  IWorkspaceRoot workspaceRoot=ResourcesPlugin.getWorkspace().getRoot();
  EclipseProjectPath path=EclipseProjectPath.make(workspaceRoot.getLocation(),jp);
  return path.toAnalysisScope(null);
}
Program: 40654
Project: 40654
Buggy source:
private void processBytecodesWithShrikeBT(BytecodeInfo info) throws InvalidClassFileException {
  info.decoder=makeDecoder();
  if (Assertions.verifyAssertions) {
    if (!isAbstract() && info.decoder == null) {
      Assertions.UNREACHABLE("String_Node_Str" + getReference());
    }
  }
  if (info.decoder == null) {
    return;
  }
  info.pcMap=info.decoder.getInstructionsToBytecodes();
  processDebugInfo(info);
  SimpleVisitor simpleVisitor=new SimpleVisitor(info);
  Instruction[] instructions=info.decoder.getInstructions();
  for (int i=0; i < instructions.length; i++) {
    simpleVisitor.setInstructionIndex(i);
    instructions[i].visit(simpleVisitor);
    if (Exceptions.isPEI(instructions[i])) {
      Collection<TypeReference> t=Exceptions.getIndependentExceptionTypes(instructions[i]);
      simpleVisitor.implicitExceptions.addAll(t);
    }
  }
  copyVisitorSetsToArrays(simpleVisitor,info);
}

Fixed version (ground truth):
private void processBytecodesWithShrikeBT(BytecodeInfo info) throws InvalidClassFileException {
  info.decoder=makeDecoder();
  if (Assertions.verifyAssertions) {
    if (!isAbstract() && info.decoder == null) {
      Assertions.UNREACHABLE("String_Node_Str" + getReference());
    }
  }
  if (info.decoder == null) {
    return;
  }
  info.pcMap=info.decoder.getInstructionsToBytecodes();
  processDebugInfo(info);
  SimpleVisitor simpleVisitor=new SimpleVisitor(info);
  Instruction[] instructions=info.decoder.getInstructions();
  for (int i=0; i < instructions.length; i++) {
    simpleVisitor.setInstructionIndex(i);
    instructions[i].visit(simpleVisitor);
    if (Exceptions.isPEI(instructions[i])) {
      Collection<TypeReference> t=Exceptions.getIndependentExceptionTypes(instructions[i]);
      if (t != null) {
        simpleVisitor.implicitExceptions.addAll(t);
      }
    }
  }
  copyVisitorSetsToArrays(simpleVisitor,info);
}
Program: 40655
Project: 40655
Buggy source:
@Override public Collection<TypeReference> getExceptionTypes(){
  return Exceptions.getNullPointerException();
}

Fixed version (ground truth):
@Override public Collection<TypeReference> getExceptionTypes(){
  Collection<TypeReference> empty=Collections.emptySet();
  return isStatic() ? empty : Exceptions.getNullPointerException();
}
Program: 40657
Project: 40657
Buggy source:
/** 
 * @param lifecycleEntrypoints Should EJB lifecycle entrypoints be considered as call graph entrypoints?
 */
public J2EEAnalysisScope(String baseScope,ClassLoader loader,String exclusionsFile,boolean lifecycleEntrypoints){
  super(baseScope,exclusionsFile,loader);
  this.lifecycleEntrypoints=lifecycleEntrypoints;
}

Fixed version (ground truth):
/** 
 * @param lifecycleEntrypoints Should EJB lifecycle entrypoints be considered as call graph entrypoints?
 */
public J2EEAnalysisScope(String baseScope,ClassLoader loader,String exclusionsFile,boolean lifecycleEntrypoints){
  super(Collections.singleton(Language.JAVA));
  AnalysisScope base=AnalysisScopeReader.read(baseScope,exclusionsFile,loader);
  for (  ClassLoaderReference cl : base.getLoaders()) {
    for (    Module m : base.getModules(cl)) {
      addToScope(cl,m);
    }
  }
  if (exclusionsFile != null) {
    FileOfClasses file=new FileOfClasses(exclusionsFile,loader);
    setExclusions(file);
  }
  this.lifecycleEntrypoints=lifecycleEntrypoints;
}
Program: 40658
Project: 40658
Buggy source:
/** 
 * @throws IllegalArgumentException  if method == null
 */
protected TypeReference[][] makeParameterTypes(IMethod method) throws IllegalArgumentException {
  if (method == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  TypeReference[][] result=new TypeReference[method.getNumberOfParameters()][];
  for (int i=0; i < result.length; i++) {
    TypeReference t=method.getParameterType(i);
    if (!t.isPrimitiveType()) {
      IClass klass=cha.lookupClass(t);
      if (klass == null) {
        t=null;
      }
 else       if (klass.isAbstract()) {
        t=chooseAConcreteSubClass(klass);
      }
 else       if (klass.isInterface()) {
        t=chooseAnImplementor(klass);
      }
 else       if (klass.isArrayClass()) {
        ArrayClass arrayKlass=(ArrayClass)klass;
        IClass innermost=arrayKlass.getInnermostElementClass();
        if (innermost != null && innermost.isInterface()) {
          TypeReference impl=chooseAnImplementor(innermost);
          if (impl == null) {
            t=null;
          }
 else {
            t=TypeReference.findOrCreateArrayOf(impl);
            for (int dim=1; dim < arrayKlass.getDimensionality(); dim++) {
              t=TypeReference.findOrCreateArrayOf(t);
            }
          }
        }
      }
    }
    result[i]=(t == null) ? new TypeReference[0] : new TypeReference[]{t};
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @throws IllegalArgumentException  if method == null
 */
protected TypeReference[][] makeParameterTypes(IMethod method) throws IllegalArgumentException {
  if (method == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  TypeReference[][] result=new TypeReference[method.getNumberOfParameters()][];
  for (int i=0; i < result.length; i++) {
    TypeReference t=method.getParameterType(i);
    if (!t.isPrimitiveType()) {
      IClass klass=cha.lookupClass(t);
      if (klass == null) {
        t=null;
      }
 else       if (!klass.isInterface() && klass.isAbstract()) {
        t=chooseAConcreteSubClass(klass);
      }
 else       if (klass.isInterface()) {
        t=chooseAnImplementor(klass);
      }
 else       if (klass.isArrayClass()) {
        ArrayClass arrayKlass=(ArrayClass)klass;
        IClass innermost=arrayKlass.getInnermostElementClass();
        if (innermost != null && innermost.isInterface()) {
          TypeReference impl=chooseAnImplementor(innermost);
          if (impl == null) {
            t=null;
          }
 else {
            t=TypeReference.findOrCreateArrayOf(impl);
            for (int dim=1; dim < arrayKlass.getDimensionality(); dim++) {
              t=TypeReference.findOrCreateArrayOf(t);
            }
          }
        }
      }
    }
    result[i]=(t == null) ? new TypeReference[0] : new TypeReference[]{t};
  }
  return result;
}
Program: 40659
Project: 40659
Buggy source:
public IVocabulary getVocabulary(){
  return BasicVocabulary.make(Collections.emptySet());
}

Fixed version (ground truth):
public IVocabulary getVocabulary(){
  return BasicVocabulary.make(Collections.<IFunction>emptySet());
}
Program: 40660
Project: 40660
Buggy source:
protected IClassHierarchy buildClassHierarchy(){
  try {
    return ClassHierarchy.make(getScope(),loaderFactory,JavaScriptLoader.JS);
  }
 catch (  ClassHierarchyException e) {
    Assertions.UNREACHABLE(e.toString());
    return null;
  }
}

Fixed version (ground truth):
public IClassHierarchy buildClassHierarchy(){
  try {
    return ClassHierarchy.make(getScope(),loaderFactory,JavaScriptLoader.JS);
  }
 catch (  ClassHierarchyException e) {
    Assertions.UNREACHABLE(e.toString());
    return null;
  }
}
Program: 40661
Project: 40661
Buggy source:
/** 
 * If s is a call statement, return the statement representing the normal return from s
 */
public static Statement getReturnStatementForCall(Statement s){
  if (s.getKind() == Kind.NORMAL) {
    SSAInstruction st=((NormalStatement)s).getInstruction();
    if (st instanceof SSAInvokeInstruction) {
      return new ParamStatement.NormalReturnCaller(s.getNode(),(SSAInvokeInstruction)st);
    }
 else {
      return s;
    }
  }
 else {
    return s;
  }
}

Fixed version (ground truth):
/** 
 * If s is a call statement, return the statement representing the normal return from s
 */
public static Statement getReturnStatementForCall(Statement s){
  if (s.getKind() == Kind.NORMAL) {
    SSAInstruction st=((NormalStatement)s).getInstruction();
    if (st instanceof SSAInvokeInstruction) {
      SSAAbstractInvokeInstruction call=(SSAAbstractInvokeInstruction)st;
      if (call.getCallSite().getDeclaredTarget().getReturnType().equals(TypeReference.Void)) {
        throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + call.getCallSite().getDeclaredTarget().getSignature() + "String_Node_Str");
      }
      return new ParamStatement.NormalReturnCaller(s.getNode(),(SSAInvokeInstruction)st);
    }
 else {
      return s;
    }
  }
 else {
    return s;
  }
}
Program: 40662
Project: 40662
Buggy source:
protected IClassHierarchy buildClassHierarchy(){
  IClassHierarchy cha=null;
  ClassLoaderFactory factory=getClassLoaderFactory(scope.getExclusions(),getTranslatorExtension());
  try {
    cha=ClassHierarchy.make(getScope(),factory);
  }
 catch (  ClassHierarchyException e) {
    System.err.println("String_Node_Str");
    System.err.println(e.toString());
    e.printStackTrace();
  }
  return cha;
}

Fixed version (ground truth):
public IClassHierarchy buildClassHierarchy(){
  IClassHierarchy cha=null;
  ClassLoaderFactory factory=getClassLoaderFactory(scope.getExclusions(),getTranslatorExtension());
  try {
    cha=ClassHierarchy.make(getScope(),factory);
  }
 catch (  ClassHierarchyException e) {
    System.err.println("String_Node_Str");
    System.err.println(e.toString());
    e.printStackTrace();
  }
  return cha;
}
Program: 40663
Project: 40663
Buggy source:
public static AnalysisScope makeScope(URL[] files,JavaScriptLoaderFactory loaders) throws IOException {
  return new CAstAnalysisScope(files,loaders);
}

Fixed version (ground truth):
public static AnalysisScope makeScope(URL[] files,JavaScriptLoaderFactory loaders) throws IOException {
  AnalysisScope result=new CAstAnalysisScope(files,loaders);
  result.addLanguageToScope(JavaScriptLoader.JS);
  return result;
}
Program: 40664
Project: 40664
Buggy source:
public boolean implementsInterface(IClass c,TypeReference T){
  return getHierarchy(c).implementsInterface(c,T);
}

Fixed version (ground truth):
public boolean implementsInterface(IClass c,IClass i){
  return getHierarchy(c).implementsInterface(c,i);
}
Program: 40665
Project: 40665
Buggy source:
public Collection<IClass> getAllImplementedInterfaces() throws ClassHierarchyException {
  Assertions._assert(!isInterface());
  return gatherInterfaces();
}

Fixed version (ground truth):
public Collection<IClass> getAllImplementedInterfaces() throws ClassHierarchyException {
  return gatherInterfaces();
}
Program: 40666
Project: 40666
Buggy source:
/** 
 * delete all files (recursively) in a directory. This is dangerous. Use with care.
 * @throws IOException if there's a problem deleting some file
 */
public static void deleteContents(String directory) throws IOException {
  Collection fl=listFiles(directory,null,true);
  for (Iterator it=fl.iterator(); it.hasNext(); ) {
    File f=(File)it.next();
    if (!f.isDirectory()) {
      boolean result=f.delete();
      if (!result) {
        throw new IOException("String_Node_Str" + f);
      }
    }
  }
  int lastCount=Integer.MAX_VALUE;
  do {
    Collection f2=listFiles(directory,null,true);
    if (f2.size() == lastCount) {
      throw new IOException("String_Node_Str");
    }
    for (Iterator it=f2.iterator(); it.hasNext(); ) {
      File f=(File)it.next();
      f.delete();
    }
  }
 while (listFiles(directory,null,true).size() > 0);
}

Fixed version (ground truth):
/** 
 * delete all files (recursively) in a directory. This is dangerous. Use with care.
 * @throws IOException if there's a problem deleting some file
 */
public static void deleteContents(String directory) throws IOException {
  Collection fl=listFiles(directory,null,true);
  for (Iterator it=fl.iterator(); it.hasNext(); ) {
    File f=(File)it.next();
    if (!f.isDirectory()) {
      boolean result=f.delete();
      if (!result) {
        throw new IOException("String_Node_Str" + f);
      }
    }
  }
  int lastCount=Integer.MAX_VALUE;
  do {
    Collection f2=listFiles(directory,null,true);
    if (f2.size() == lastCount) {
      throw new IOException("String_Node_Str");
    }
    lastCount=f2.size();
    for (Iterator it=f2.iterator(); it.hasNext(); ) {
      File f=(File)it.next();
      f.delete();
    }
  }
 while (listFiles(directory,null,true).size() > 0);
}
Program: 40667
Project: 40667
Buggy source:
public IMethod getCalleeTarget(CGNode N,CallSiteReference site,IClass receiver){
  MethodReference m=site.getDeclaredTarget();
  if (isEJBSuperInterface(m.getDeclaringClass())) {
    IClass inferred=getReceiverClassFromTypeInference(N,site);
    if (inferred != null) {
      receiver=inferred;
    }
  }
  if (FakeRootMethod.isFakeRootMethod(N.getMethod().getReference())) {
    if (deployment.isMessageDriven(m.getDeclaringClass())) {
      if (m.getName().equals(onMessageAtom) && m.getDescriptor().equals(onMessageDesc)) {
        return hijackOnMessageEntrypoint(m);
      }
    }
 else     if (receiver != null && cha.implementsInterface(receiver,ServletEntrypoints.Servlet)) {
      IMethod resolved=cha.resolveMethod(receiver,m.getSelector());
      if (!resolved.isInit() && !resolved.isClinit()) {
        return hijackServletEntrypoint(m);
      }
    }
  }
  m=specializeForReceiverType(receiver,m);
  SyntheticMethod X=methodReferenceIntercept(m);
  if (X != null) {
    return X;
  }
  IMethod target=parent.getCalleeTarget(N,site,receiver);
  if (target == null) {
    return null;
  }
  X=methodReferenceIntercept(target.getReference());
  if (X != null) {
    return X;
  }
 else {
    return target;
  }
}

Fixed version (ground truth):
public IMethod getCalleeTarget(CGNode N,CallSiteReference site,IClass receiver){
  MethodReference m=site.getDeclaredTarget();
  if (isEJBSuperInterface(m.getDeclaringClass())) {
    IClass inferred=getReceiverClassFromTypeInference(N,site);
    if (inferred != null) {
      receiver=inferred;
    }
  }
  IClass servlet=cha.lookupClass(ServletEntrypoints.Servlet);
  if (FakeRootMethod.isFakeRootMethod(N.getMethod().getReference())) {
    if (deployment.isMessageDriven(m.getDeclaringClass())) {
      if (m.getName().equals(onMessageAtom) && m.getDescriptor().equals(onMessageDesc)) {
        return hijackOnMessageEntrypoint(m);
      }
    }
 else     if (receiver != null && cha.implementsInterface(receiver,servlet)) {
      IMethod resolved=cha.resolveMethod(receiver,m.getSelector());
      if (!resolved.isInit() && !resolved.isClinit()) {
        return hijackServletEntrypoint(m);
      }
    }
  }
  m=specializeForReceiverType(receiver,m);
  SyntheticMethod X=methodReferenceIntercept(m);
  if (X != null) {
    return X;
  }
  IMethod target=parent.getCalleeTarget(N,site,receiver);
  if (target == null) {
    return null;
  }
  X=methodReferenceIntercept(target.getReference());
  if (X != null) {
    return X;
  }
 else {
    return target;
  }
}
Program: 40669
Project: 40669
Buggy source:
@Override public TypeAbstraction meet(TypeAbstraction rhs){
  if (rhs == TOP) {
    return this;
  }
 else {
    if (rhs instanceof PointType) {
      PointType other=(PointType)rhs;
      if (type.equals(other.type)) {
        return this;
      }
 else       if (type.isArrayClass() || other.type.isArrayClass()) {
        return new ConeType(type.getClassHierarchy().getRootClass());
      }
 else {
        return new ConeType(type.getClassHierarchy().getLeastCommonSuperclass(this.type,other.type));
      }
    }
 else     if (rhs instanceof ConeType) {
      ConeType other=(ConeType)rhs;
      TypeReference T=other.getType().getReference();
      if (type.isArrayClass() || T.isArrayType()) {
        return new ConeType(type.getClassHierarchy().getRootClass());
      }
      IClass typeKlass=type;
      if (type.getClassHierarchy().isSubclassOf(typeKlass,other.getType())) {
        return other;
      }
 else       if (other.isInterface()) {
        if (type.getClassHierarchy().implementsInterface(typeKlass,T)) {
          return other;
        }
      }
      return other.meet(new ConeType(other.getType()));
    }
 else {
      Assertions.UNREACHABLE("String_Node_Str" + rhs.getClass());
      return null;
    }
  }
}

Fixed version (ground truth):
@Override public TypeAbstraction meet(TypeAbstraction rhs){
  if (rhs == TOP) {
    return this;
  }
 else {
    if (rhs instanceof PointType) {
      PointType other=(PointType)rhs;
      if (type.equals(other.type)) {
        return this;
      }
 else       if (type.isArrayClass() || other.type.isArrayClass()) {
        return new ConeType(type.getClassHierarchy().getRootClass());
      }
 else {
        return new ConeType(type.getClassHierarchy().getLeastCommonSuperclass(this.type,other.type));
      }
    }
 else     if (rhs instanceof ConeType) {
      ConeType other=(ConeType)rhs;
      TypeReference T=other.getType().getReference();
      if (type.isArrayClass() || T.isArrayType()) {
        return new ConeType(type.getClassHierarchy().getRootClass());
      }
      IClass typeKlass=type;
      if (type.getClassHierarchy().isSubclassOf(typeKlass,other.getType())) {
        return other;
      }
 else       if (other.isInterface()) {
        if (type.getClassHierarchy().implementsInterface(typeKlass,other.getType())) {
          return other;
        }
      }
      return other.meet(new ConeType(other.getType()));
    }
 else {
      Assertions.UNREACHABLE("String_Node_Str" + rhs.getClass());
      return null;
    }
  }
}
Program: 40670
Project: 40670
Buggy source:
/** 
 * @return Collection of (IClass) interfaces this class implements, includingall ancestors of interfaces immediately implemented
 */
Collection<IClass> getAllImplementedInterfaces() throws ClassHierarchyException ;

Fixed version (ground truth):
/** 
 * @return Collection of (IClass) interfaces this class implements, includingall ancestors of interfaces immediately implemented.
 */
Collection<IClass> getAllImplementedInterfaces() throws ClassHierarchyException ;
Program: 40671
Project: 40671
Buggy source:
/** 
 * @return Collection of (IClass) interfaces this class directly implements
 */
Collection<IClass> getDirectInterfaces() throws ClassHierarchyException ;

Fixed version (ground truth):
/** 
 * @return Collection of (IClass) interfaces this class directly implementsIf this class is an interface, returns the interfaces it immediately extends.
 */
Collection<IClass> getDirectInterfaces() throws ClassHierarchyException ;
Program: 40673
Project: 40673
Buggy source:
public IField getField(Atom name){
  if (fieldMap.containsKey(name)) {
    return fieldMap.get(name);
  }
 else {
    IField f=findDeclaredField(name);
    if (f != null) {
      fieldMap.put(name,f);
      return f;
    }
 else     if (superClass != null) {
      f=superClass.getField(name);
      if (f != null) {
        fieldMap.put(name,f);
        return f;
      }
    }
    try {
      Collection<IClass> ifaces=isInterface() ? getAllAncestorInterfaces() : getAllImplementedInterfaces();
      for (      IClass i : ifaces) {
        f=i.getField(name);
        if (f != null) {
          fieldMap.put(name,f);
          return f;
        }
      }
    }
 catch (    ClassHierarchyException e) {
    }
  }
  return null;
}

Fixed version (ground truth):
public IField getField(Atom name){
  if (fieldMap.containsKey(name)) {
    return fieldMap.get(name);
  }
 else {
    IField f=findDeclaredField(name);
    if (f != null) {
      fieldMap.put(name,f);
      return f;
    }
 else     if (superClass != null) {
      f=superClass.getField(name);
      if (f != null) {
        fieldMap.put(name,f);
        return f;
      }
    }
    try {
      for (      IClass i : getAllImplementedInterfaces()) {
        f=i.getField(name);
        if (f != null) {
          fieldMap.put(name,f);
          return f;
        }
      }
    }
 catch (    ClassHierarchyException e) {
    }
  }
  return null;
}
Program: 40674
Project: 40674
Buggy source:
public Collection<IClass> getAllImplementedInterfaces() throws ClassHierarchyException {
  if (Assertions.verifyAssertions) {
    if (isInterface()) {
      Assertions.UNREACHABLE("String_Node_Str" + this);
    }
  }
  if (allInterfaces != null) {
    return allInterfaces;
  }
 else {
    Collection<IClass> C=computeAllInterfacesAsCollection();
    allInterfaces=Collections.unmodifiableCollection(C);
    return allInterfaces;
  }
}

Fixed version (ground truth):
public Collection<IClass> getAllImplementedInterfaces() throws ClassHierarchyException {
  if (allInterfaces != null) {
    return allInterfaces;
  }
 else {
    Collection<IClass> C=computeAllInterfacesAsCollection();
    allInterfaces=Collections.unmodifiableCollection(C);
    return allInterfaces;
  }
}
Program: 40675
Project: 40675
Buggy source:
/** 
 * @return true if it may be possible to resolve a call to a site on the concrete type dispatchType
 */
public static boolean feasibleChaResolution(IClassHierarchy cha,CallSiteReference site,IClass dispatchType){
  if (dispatchType == null) {
    return false;
  }
  if (dispatchType.isInterface()) {
    if (site.getDeclaredTarget().getSelector().equals(MethodReference.clinitSelector)) {
      return true;
    }
 else {
      return false;
    }
  }
  TypeReference targetType=site.getDeclaredTarget().getDeclaringClass();
  IClass resolvedType=cha.lookupClass(targetType);
  if (resolvedType == null) {
    return false;
  }
 else {
    if (resolvedType.isInterface()) {
      return cha.implementsInterface(dispatchType,resolvedType.getReference());
    }
 else {
      return cha.isSubclassOf(dispatchType,resolvedType);
    }
  }
}

Fixed version (ground truth):
/** 
 * @return true if it may be possible to resolve a call to a site on the concrete type dispatchType
 */
public static boolean feasibleChaResolution(IClassHierarchy cha,CallSiteReference site,IClass dispatchType){
  if (dispatchType == null) {
    return false;
  }
  if (dispatchType.isInterface()) {
    if (site.getDeclaredTarget().getSelector().equals(MethodReference.clinitSelector)) {
      return true;
    }
 else {
      return false;
    }
  }
  TypeReference targetType=site.getDeclaredTarget().getDeclaringClass();
  IClass resolvedType=cha.lookupClass(targetType);
  if (resolvedType == null) {
    return false;
  }
 else {
    if (resolvedType.isInterface()) {
      return cha.implementsInterface(dispatchType,resolvedType);
    }
 else {
      return cha.isSubclassOf(dispatchType,resolvedType);
    }
  }
}
Program: 40676
Project: 40676
Buggy source:
/** 
 * @param C
 * @return true iff C is a container class from java.util
 * @throws IllegalArgumentException  if C is null
 */
public static boolean isContainer(IClass C,IClassHierarchy cha){
  if (C == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (ClassLoaderReference.Primordial.equals(C.getClassLoader().getReference()) && TypeReference.JavaUtilCollection.getName().getPackage().equals(C.getReference().getName().getPackage())) {
    if (C.isInterface()) {
      IClass collection=cha.lookupClass(TypeReference.JavaUtilCollection);
      IClass map=cha.lookupClass(TypeReference.JavaUtilMap);
      if (Assertions.verifyAssertions) {
        Assertions._assert(collection != null);
        Assertions._assert(map != null);
      }
      Collection s;
      try {
        s=C.getAllAncestorInterfaces();
      }
 catch (      ClassHierarchyException e) {
        return false;
      }
      if (s.contains(collection) || s.contains(map)) {
        return true;
      }
    }
 else {
      if (cha.implementsInterface(C,TypeReference.JavaUtilCollection) || cha.implementsInterface(C,TypeReference.JavaUtilMap)) {
        return true;
      }
    }
  }
  if (miscContainers.contains(C.getReference())) {
    return true;
  }
  if (C.isArrayClass() && ((ArrayClass)C).getElementClass() != null && ((ArrayClass)C).getElementClass().getReference().isReferenceType()) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param C
 * @return true iff C is a container class from java.util
 * @throws IllegalArgumentException  if C is null
 */
public static boolean isContainer(IClass C,IClassHierarchy cha){
  if (C == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (ClassLoaderReference.Primordial.equals(C.getClassLoader().getReference()) && TypeReference.JavaUtilCollection.getName().getPackage().equals(C.getReference().getName().getPackage())) {
    IClass collection=cha.lookupClass(TypeReference.JavaUtilCollection);
    IClass map=cha.lookupClass(TypeReference.JavaUtilMap);
    if (C.isInterface()) {
      if (Assertions.verifyAssertions) {
        Assertions._assert(collection != null);
        Assertions._assert(map != null);
      }
      Collection s;
      try {
        s=C.getAllImplementedInterfaces();
      }
 catch (      ClassHierarchyException e) {
        return false;
      }
      if (s.contains(collection) || s.contains(map)) {
        return true;
      }
    }
 else {
      if (cha.implementsInterface(C,collection) || cha.implementsInterface(C,map)) {
        return true;
      }
    }
  }
  if (miscContainers.contains(C.getReference())) {
    return true;
  }
  if (C.isArrayClass() && ((ArrayClass)C).getElementClass() != null && ((ArrayClass)C).getElementClass().getReference().isReferenceType()) {
    return true;
  }
  return false;
}
Program: 40677
Project: 40677
Buggy source:
private OrdinalSet<InstanceKey> computeImplicitPointsToSetAtCheckCast(CGNode node,SSACheckCastInstruction instruction){
  PointerKey rhs=pointerKeys.getPointerKeyForLocal(node,instruction.getVal());
  OrdinalSet<InstanceKey> rhsSet=getPointsToSet(rhs);
  MutableSparseIntSet S=MutableSparseIntSet.makeEmpty();
  IClass klass=getCallGraph().getClassHierarchy().lookupClass(instruction.getDeclaredResultType());
  if (klass == null) {
    return rhsSet;
  }
 else {
    if (klass.isInterface()) {
      for (Iterator it=rhsSet.iterator(); it.hasNext(); ) {
        InstanceKey ik=(InstanceKey)it.next();
        if (getCallGraph().getClassHierarchy().implementsInterface(ik.getConcreteType(),klass.getReference())) {
          S.add(getInstanceKeyMapping().getMappedIndex(ik));
        }
      }
    }
 else {
      for (Iterator it=rhsSet.iterator(); it.hasNext(); ) {
        InstanceKey ik=(InstanceKey)it.next();
        if (getCallGraph().getClassHierarchy().isSubclassOf(ik.getConcreteType(),klass)) {
          S.add(getInstanceKeyMapping().getMappedIndex(ik));
        }
      }
    }
  }
  return new OrdinalSet<InstanceKey>(S,instanceKeys);
}

Fixed version (ground truth):
private OrdinalSet<InstanceKey> computeImplicitPointsToSetAtCheckCast(CGNode node,SSACheckCastInstruction instruction){
  PointerKey rhs=pointerKeys.getPointerKeyForLocal(node,instruction.getVal());
  OrdinalSet<InstanceKey> rhsSet=getPointsToSet(rhs);
  MutableSparseIntSet S=MutableSparseIntSet.makeEmpty();
  IClass klass=getCallGraph().getClassHierarchy().lookupClass(instruction.getDeclaredResultType());
  if (klass == null) {
    return rhsSet;
  }
 else {
    if (klass.isInterface()) {
      for (Iterator it=rhsSet.iterator(); it.hasNext(); ) {
        InstanceKey ik=(InstanceKey)it.next();
        if (getCallGraph().getClassHierarchy().implementsInterface(ik.getConcreteType(),klass)) {
          S.add(getInstanceKeyMapping().getMappedIndex(ik));
        }
      }
    }
 else {
      for (Iterator it=rhsSet.iterator(); it.hasNext(); ) {
        InstanceKey ik=(InstanceKey)it.next();
        if (getCallGraph().getClassHierarchy().isSubclassOf(ik.getConcreteType(),klass)) {
          S.add(getInstanceKeyMapping().getMappedIndex(ik));
        }
      }
    }
  }
  return new OrdinalSet<InstanceKey>(S,instanceKeys);
}
Program: 40678
Project: 40678
Buggy source:
public void act(int i){
  InstanceKey I=system.getInstanceKey(i);
  if (!I.getConcreteType().isArrayClass()) {
    return;
  }
  TypeReference C=I.getConcreteType().getReference().getArrayElementType();
  if (C.isPrimitiveType()) {
    return;
  }
  IClass contents=getClassHierarchy().lookupClass(C);
  if (Assertions.verifyAssertions) {
    if (contents == null) {
      Assertions._assert(false,"String_Node_Str" + C + "String_Node_Str"+ I.getConcreteType());
    }
  }
  PointerKey p=getPointerKeyForArrayContents(I);
  if (contents.isInterface()) {
    if (getClassHierarchy().implementsInterface(instance.getConcreteType(),contents.getReference())) {
      sideEffect.b|=system.newConstraint(p,instance);
    }
  }
 else {
    if (getClassHierarchy().isSubclassOf(instance.getConcreteType(),contents)) {
      sideEffect.b|=system.newConstraint(p,instance);
    }
  }
}

Fixed version (ground truth):
public void act(int i){
  InstanceKey I=system.getInstanceKey(i);
  if (!I.getConcreteType().isArrayClass()) {
    return;
  }
  TypeReference C=I.getConcreteType().getReference().getArrayElementType();
  if (C.isPrimitiveType()) {
    return;
  }
  IClass contents=getClassHierarchy().lookupClass(C);
  if (Assertions.verifyAssertions) {
    if (contents == null) {
      Assertions._assert(false,"String_Node_Str" + C + "String_Node_Str"+ I.getConcreteType());
    }
  }
  PointerKey p=getPointerKeyForArrayContents(I);
  if (contents.isInterface()) {
    if (getClassHierarchy().implementsInterface(instance.getConcreteType(),contents)) {
      sideEffect.b|=system.newConstraint(p,instance);
    }
  }
 else {
    if (getClassHierarchy().isSubclassOf(instance.getConcreteType(),contents)) {
      sideEffect.b|=system.newConstraint(p,instance);
    }
  }
}
Program: 40679
Project: 40679
Buggy source:
private void registerArrayInstanceWithAllInterfacesOfElement(int index,IClass elementClass,int dim){
  Collection ifaces=null;
  try {
    ifaces=(elementClass.isInterface()) ? elementClass.getAllAncestorInterfaces() : elementClass.getAllImplementedInterfaces();
  }
 catch (  ClassHierarchyException e) {
    Warnings.add(ClassHierarchyWarning.create(e.getMessage()));
    return;
  }
  for (Iterator it=ifaces.iterator(); it.hasNext(); ) {
    IClass I=(IClass)it.next();
    TypeReference iArrayRef=makeArray(I.getReference(),dim);
    IClass iArrayClass=null;
    iArrayClass=I.getClassLoader().lookupClass(iArrayRef.getName());
    MutableIntSet set=findOrCreateSparseSetForClass(iArrayClass);
    set.add(index);
    if (DEBUG) {
      Trace.println("String_Node_Str" + iArrayClass + "String_Node_Str"+ set);
    }
  }
}

Fixed version (ground truth):
private void registerArrayInstanceWithAllInterfacesOfElement(int index,IClass elementClass,int dim){
  Collection ifaces=null;
  try {
    ifaces=elementClass.getAllImplementedInterfaces();
  }
 catch (  ClassHierarchyException e) {
    Warnings.add(ClassHierarchyWarning.create(e.getMessage()));
    return;
  }
  for (Iterator it=ifaces.iterator(); it.hasNext(); ) {
    IClass I=(IClass)it.next();
    TypeReference iArrayRef=makeArray(I.getReference(),dim);
    IClass iArrayClass=null;
    iArrayClass=I.getClassLoader().lookupClass(iArrayRef.getName());
    MutableIntSet set=findOrCreateSparseSetForClass(iArrayClass);
    set.add(index);
    if (DEBUG) {
      Trace.println("String_Node_Str" + iArrayClass + "String_Node_Str"+ set);
    }
  }
}
Program: 40680
Project: 40680
Buggy source:
/** 
 * Does c implement T?
 * @param c
 * @param T
 * @return true iff T is an interface and c is a class that implements T,
 */
public boolean implementsInterface(IClass c,TypeReference T){
  IClass tClass=lookupClass(T);
  if (Assertions.verifyAssertions) {
    if (tClass == null) {
      Assertions._assert(false,"String_Node_Str" + T);
    }
  }
  if (!tClass.isInterface()) {
    return false;
  }
  Set impls=implementors.get(tClass);
  if (impls != null && impls.contains(c)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Does c implement i?
 * @return true iff i is an interface and c is a class that implements i, rc is an interface that extends i.
 */
public boolean implementsInterface(IClass c,IClass i){
  if (!i.isInterface()) {
    return false;
  }
  Set impls=implementors.get(i);
  if (impls != null && impls.contains(c)) {
    return true;
  }
  return false;
}