Program: 85319
Project: 85319
Buggy source:
/** 
 * Constructs a hierarchy from the current scene. 
 */
public Hierarchy(){
  this.sc=Scene.v();
  state=sc.getState();
{
    Chain<SootClass> allClasses=sc.getClasses();
    classToSubclasses=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    interfaceToSubinterfaces=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    interfaceToSuperinterfaces=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    classToDirSubclasses=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    interfaceToDirSubinterfaces=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    interfaceToDirSuperinterfaces=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    interfaceToDirImplementers=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    Iterator<SootClass> classesIt=allClasses.iterator();
    while (classesIt.hasNext()) {
      SootClass c=classesIt.next();
      if (c.resolvingLevel() < SootClass.HIERARCHY)       continue;
      if (c.isInterface()) {
        interfaceToDirSubinterfaces.put(c,new ArrayList<SootClass>());
        interfaceToDirSuperinterfaces.put(c,new ArrayList<SootClass>());
        interfaceToDirImplementers.put(c,new ArrayList<SootClass>());
      }
 else       classToDirSubclasses.put(c,new ArrayList<SootClass>());
    }
    classesIt=allClasses.iterator();
    while (classesIt.hasNext()) {
      SootClass c=classesIt.next();
      if (c.resolvingLevel() < SootClass.HIERARCHY)       continue;
      List<SootClass> l2=interfaceToDirSuperinterfaces.get(c);
      if (c.hasSuperclass()) {
        if (c.isInterface()) {
          for (          SootClass i : c.getInterfaces()) {
            if (c.resolvingLevel() < SootClass.HIERARCHY)             continue;
            List<SootClass> l=interfaceToDirSubinterfaces.get(i);
            if (l != null)             l.add(c);
            if (l2 != null)             l2.add(i);
          }
        }
 else {
          List<SootClass> l=classToDirSubclasses.get(c.getSuperclass());
          l.add(c);
          Iterator<SootClass> subIt=c.getInterfaces().iterator();
          while (subIt.hasNext()) {
            SootClass i=subIt.next();
            if (c.resolvingLevel() < SootClass.HIERARCHY)             continue;
            l=interfaceToDirImplementers.get(i);
            if (l != null)             l.add(c);
          }
        }
      }
    }
{
      classesIt=allClasses.iterator();
      while (classesIt.hasNext()) {
        SootClass c=classesIt.next();
        if (c.resolvingLevel() < SootClass.HIERARCHY)         continue;
        if (c.isInterface()) {
          List<SootClass> imp=interfaceToDirImplementers.get(c);
          Set<SootClass> s=new ArraySet<SootClass>();
          Iterator<SootClass> impIt=imp.iterator();
          while (impIt.hasNext()) {
            SootClass c0=impIt.next();
            if (c.resolvingLevel() < SootClass.HIERARCHY)             continue;
            s.addAll(getSubclassesOfIncluding(c0));
          }
          imp.clear();
          imp.addAll(s);
        }
      }
    }
    classesIt=allClasses.iterator();
    while (classesIt.hasNext()) {
      SootClass c=classesIt.next();
      if (c.resolvingLevel() < SootClass.HIERARCHY)       continue;
      if (c.isInterface()) {
        interfaceToDirSubinterfaces.put(c,Collections.unmodifiableList(interfaceToDirSubinterfaces.get(c)));
        interfaceToDirSuperinterfaces.put(c,Collections.unmodifiableList(interfaceToDirSuperinterfaces.get(c)));
        interfaceToDirImplementers.put(c,Collections.unmodifiableList(interfaceToDirImplementers.get(c)));
      }
 else       classToDirSubclasses.put(c,Collections.unmodifiableList(classToDirSubclasses.get(c)));
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructs a hierarchy from the current scene. 
 */
public Hierarchy(){
  this.sc=Scene.v();
  state=sc.getState();
{
    Chain<SootClass> allClasses=sc.getClasses();
    classToSubclasses=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    interfaceToSubinterfaces=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    interfaceToSuperinterfaces=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    classToDirSubclasses=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    interfaceToDirSubinterfaces=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    interfaceToDirSuperinterfaces=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    interfaceToDirImplementers=new HashMap<SootClass,List<SootClass>>(allClasses.size() * 2 + 1,0.7f);
    for (    SootClass c : allClasses) {
      if (c.resolvingLevel() < SootClass.HIERARCHY)       continue;
      if (c.isInterface()) {
        interfaceToDirSubinterfaces.put(c,new ArrayList<SootClass>());
        interfaceToDirSuperinterfaces.put(c,new ArrayList<SootClass>());
        interfaceToDirImplementers.put(c,new ArrayList<SootClass>());
      }
 else       classToDirSubclasses.put(c,new ArrayList<SootClass>());
    }
    for (    SootClass c : allClasses) {
      if (c.resolvingLevel() < SootClass.HIERARCHY)       continue;
      if (c.hasSuperclass()) {
        if (c.isInterface()) {
          List<SootClass> l2=interfaceToDirSuperinterfaces.get(c);
          for (          SootClass i : c.getInterfaces()) {
            if (c.resolvingLevel() < SootClass.HIERARCHY)             continue;
            List<SootClass> l=interfaceToDirSubinterfaces.get(i);
            if (l != null)             l.add(c);
            if (l2 != null)             l2.add(i);
          }
        }
 else {
          List<SootClass> l=classToDirSubclasses.get(c.getSuperclass());
          if (l != null)           l.add(c);
          for (          SootClass i : c.getInterfaces()) {
            if (c.resolvingLevel() < SootClass.HIERARCHY)             continue;
            l=interfaceToDirImplementers.get(i);
            if (l != null)             l.add(c);
          }
        }
      }
    }
    for (    SootClass c : allClasses) {
      if (c.resolvingLevel() < SootClass.HIERARCHY)       continue;
      if (c.isInterface()) {
        List<SootClass> imp=interfaceToDirImplementers.get(c);
        Set<SootClass> s=new ArraySet<SootClass>();
        for (        SootClass c0 : imp) {
          if (c.resolvingLevel() < SootClass.HIERARCHY)           continue;
          s.addAll(getSubclassesOfIncluding(c0));
        }
        imp.clear();
        imp.addAll(s);
      }
    }
    for (    SootClass c : allClasses) {
      if (c.resolvingLevel() < SootClass.HIERARCHY)       continue;
      if (c.isInterface()) {
        interfaceToDirSubinterfaces.put(c,Collections.unmodifiableList(interfaceToDirSubinterfaces.get(c)));
        interfaceToDirSuperinterfaces.put(c,Collections.unmodifiableList(interfaceToDirSuperinterfaces.get(c)));
        interfaceToDirImplementers.put(c,Collections.unmodifiableList(interfaceToDirImplementers.get(c)));
      }
 else       classToDirSubclasses.put(c,Collections.unmodifiableList(classToDirSubclasses.get(c)));
    }
  }
}