Program: 88785
Project: 88785
Buggy source:
private void initUnitSets(){
  int cap=graph.size() * 2 + 1;
  float load=0.7f;
  unitToGenerateSet=new HashMap(cap,load);
  unitToPreserveSet=new HashMap(cap,load);
  unitToAnalyzedChecksSet=new HashMap(cap,load);
  unitToArrayRefChecksSet=new HashMap(cap,load);
  unitToInstanceFieldRefChecksSet=new HashMap(cap,load);
  unitToInstanceInvokeExprChecksSet=new HashMap(cap,load);
  unitToLengthExprChecksSet=new HashMap(cap,load);
  Iterator unitIt=graph.iterator();
  while (unitIt.hasNext()) {
    Unit s=(Unit)unitIt.next();
    FlowSet genSet=(FlowSet)emptySet.clone();
    FlowSet preSet=(FlowSet)fullSet.clone();
    HashSet analyzedChecksSet=new HashSet(5,load);
    HashSet arrayRefChecksSet=new HashSet(5,load);
    HashSet instanceFieldRefChecksSet=new HashSet(5,load);
    HashSet instanceInvokeExprChecksSet=new HashSet(5,load);
    HashSet lengthExprChecksSet=new HashSet(5,load);
    if (careForMethodCalls && ((Stmt)s).containsInvokeExpr()) {
      uListAddTopToFlowSet(refTypeInstFields,genSet,preSet);
      uListAddTopToFlowSet(refTypeStaticFields,genSet,preSet);
    }
    if (careForAliases && (s instanceof AssignStmt)) {
      AssignStmt as=(AssignStmt)s;
      Value lhs=as.getLeftOp();
      if (refTypeInstFieldBases.contains(lhs)) {
        Iterator refTypeInstFieldsIt=refTypeInstFields.iterator();
        while (refTypeInstFieldsIt.hasNext()) {
          EquivalentValue eifr=(EquivalentValue)refTypeInstFieldsIt.next();
          InstanceFieldRef ifr=(InstanceFieldRef)eifr.getValue();
          if (ifr.getBase() == lhs) {
            uAddTopToFlowSet(eifr,genSet,preSet);
          }
        }
      }
      if (lhs instanceof InstanceFieldRef) {
        String lhsName=((InstanceFieldRef)lhs).getField().getName();
        Iterator refTypeInstFieldsIt=refTypeInstFields.iterator();
        while (refTypeInstFieldsIt.hasNext()) {
          EquivalentValue eifr=(EquivalentValue)refTypeInstFieldsIt.next();
          InstanceFieldRef ifr=(InstanceFieldRef)eifr.getValue();
          String name=ifr.getField().getName();
          if (name.equals(lhsName)) {
            uAddTopToFlowSet(eifr,genSet,preSet);
          }
        }
      }
    }
{
      Iterator boxIt=s.getDefBoxes().iterator();
      while (boxIt.hasNext()) {
        ValueBox box=(ValueBox)boxIt.next();
        Value boxValue=box.getValue();
        if (isAnalyzedRef(boxValue)) {
          uAddTopToFlowSet(boxValue,genSet,preSet);
        }
      }
    }
    if (s instanceof DefinitionStmt) {
      DefinitionStmt as=(DefinitionStmt)s;
      Value ro=as.getRightOp();
      Value lo=as.getLeftOp();
      if (ro instanceof CastExpr)       ro=((CastExpr)ro).getOp();
      if (isAnalyzedRef(lo)) {
        if (ro instanceof NewExpr || ro instanceof NewArrayExpr || ro instanceof NewMultiArrayExpr|| ro instanceof ThisRef|| ro instanceof CaughtExceptionRef) {
          uAddInfoToFlowSet(lo,kNonNull,genSet,preSet);
        }
 else         if (isAlwaysNull(ro)) {
          uAddInfoToFlowSet(lo,kNull,genSet,preSet);
        }
 else         if (isAlwaysTop(ro)) {
          uAddTopToFlowSet(lo,genSet,preSet);
        }
      }
    }
{
      Iterator boxIt;
      boxIt=s.getUseBoxes().iterator();
      while (boxIt.hasNext()) {
        Value boxValue=((ValueBox)boxIt.next()).getValue();
        Value base=null;
        if (boxValue instanceof InstanceFieldRef) {
          base=((InstanceFieldRef)(boxValue)).getBase();
          instanceFieldRefChecksSet.add(base);
        }
 else         if (boxValue instanceof ArrayRef) {
          base=((ArrayRef)(boxValue)).getBase();
          arrayRefChecksSet.add(base);
        }
 else         if (boxValue instanceof InstanceInvokeExpr) {
          base=((InstanceInvokeExpr)boxValue).getBase();
          instanceInvokeExprChecksSet.add(base);
        }
 else         if (boxValue instanceof LengthExpr) {
          base=((LengthExpr)boxValue).getOp();
          lengthExprChecksSet.add(base);
        }
 else         if (s instanceof ThrowStmt) {
          base=((ThrowStmt)s).getOp();
        }
 else         if (s instanceof MonitorStmt) {
          base=((MonitorStmt)s).getOp();
        }
        if (base != null && isAnalyzedRef(base)) {
          uAddInfoToFlowSet(base,kNonNull,genSet,preSet);
          analyzedChecksSet.add(base);
        }
      }
      boxIt=s.getDefBoxes().iterator();
      while (boxIt.hasNext()) {
        Value boxValue=((ValueBox)boxIt.next()).getValue();
        Value base=null;
        if (boxValue instanceof InstanceFieldRef) {
          base=((InstanceFieldRef)(boxValue)).getBase();
          instanceFieldRefChecksSet.add(base);
        }
 else         if (boxValue instanceof ArrayRef) {
          base=((ArrayRef)(boxValue)).getBase();
          arrayRefChecksSet.add(base);
        }
 else         if (boxValue instanceof InstanceInvokeExpr) {
          base=((InstanceInvokeExpr)boxValue).getBase();
          instanceInvokeExprChecksSet.add(base);
        }
 else         if (boxValue instanceof LengthExpr) {
          base=((LengthExpr)boxValue).getOp();
          lengthExprChecksSet.add(base);
        }
 else         if (s instanceof ThrowStmt) {
          base=((ThrowStmt)s).getOp();
        }
 else         if (s instanceof MonitorStmt) {
          base=((MonitorStmt)s).getOp();
        }
        if (base != null && isAnalyzedRef(base)) {
          uAddInfoToFlowSet(base,kNonNull,genSet,preSet);
          analyzedChecksSet.add(base);
        }
      }
    }
    unitToGenerateSet.put(s,genSet);
    unitToPreserveSet.put(s,preSet);
    unitToAnalyzedChecksSet.put(s,analyzedChecksSet);
    unitToArrayRefChecksSet.put(s,arrayRefChecksSet);
    unitToInstanceFieldRefChecksSet.put(s,instanceFieldRefChecksSet);
    unitToInstanceInvokeExprChecksSet.put(s,instanceInvokeExprChecksSet);
    unitToLengthExprChecksSet.put(s,lengthExprChecksSet);
  }
}

Fixed version (ground truth):
private void initUnitSets(){
  int cap=graph.size() * 2 + 1;
  float load=0.7f;
  unitToGenerateSet=new HashMap(cap,load);
  unitToPreserveSet=new HashMap(cap,load);
  unitToAnalyzedChecksSet=new HashMap(cap,load);
  unitToArrayRefChecksSet=new HashMap(cap,load);
  unitToInstanceFieldRefChecksSet=new HashMap(cap,load);
  unitToInstanceInvokeExprChecksSet=new HashMap(cap,load);
  unitToLengthExprChecksSet=new HashMap(cap,load);
  Iterator unitIt=graph.iterator();
  while (unitIt.hasNext()) {
    Unit s=(Unit)unitIt.next();
    FlowSet genSet=(FlowSet)emptySet.clone();
    FlowSet preSet=(FlowSet)fullSet.clone();
    HashSet analyzedChecksSet=new HashSet(5,load);
    HashSet arrayRefChecksSet=new HashSet(5,load);
    HashSet instanceFieldRefChecksSet=new HashSet(5,load);
    HashSet instanceInvokeExprChecksSet=new HashSet(5,load);
    HashSet lengthExprChecksSet=new HashSet(5,load);
    if (careForMethodCalls && ((Stmt)s).containsInvokeExpr()) {
      uListAddTopToFlowSet(refTypeInstFields,genSet,preSet);
      uListAddTopToFlowSet(refTypeStaticFields,genSet,preSet);
    }
    if (careForAliases && (s instanceof AssignStmt)) {
      AssignStmt as=(AssignStmt)s;
      Value lhs=as.getLeftOp();
      if (refTypeInstFieldBases.contains(lhs)) {
        Iterator refTypeInstFieldsIt=refTypeInstFields.iterator();
        while (refTypeInstFieldsIt.hasNext()) {
          EquivalentValue eifr=(EquivalentValue)refTypeInstFieldsIt.next();
          InstanceFieldRef ifr=(InstanceFieldRef)eifr.getValue();
          if (ifr.getBase() == lhs) {
            uAddTopToFlowSet(eifr,genSet,preSet);
          }
        }
      }
      if (lhs instanceof InstanceFieldRef) {
        String lhsName=((InstanceFieldRef)lhs).getField().getName();
        Iterator refTypeInstFieldsIt=refTypeInstFields.iterator();
        while (refTypeInstFieldsIt.hasNext()) {
          EquivalentValue eifr=(EquivalentValue)refTypeInstFieldsIt.next();
          InstanceFieldRef ifr=(InstanceFieldRef)eifr.getValue();
          String name=ifr.getField().getName();
          if (name.equals(lhsName)) {
            uAddTopToFlowSet(eifr,genSet,preSet);
          }
        }
      }
    }
{
      Iterator boxIt=s.getDefBoxes().iterator();
      while (boxIt.hasNext()) {
        ValueBox box=(ValueBox)boxIt.next();
        Value boxValue=box.getValue();
        if (isAnalyzedRef(boxValue)) {
          uAddTopToFlowSet(boxValue,genSet,preSet);
        }
      }
    }
    if (s instanceof DefinitionStmt) {
      DefinitionStmt as=(DefinitionStmt)s;
      Value ro=as.getRightOp();
      Value lo=as.getLeftOp();
      if (ro instanceof CastExpr)       ro=((CastExpr)ro).getOp();
      if (isAnalyzedRef(lo)) {
        if (isAlwaysNonNull(ro)) {
          uAddInfoToFlowSet(lo,kNonNull,genSet,preSet);
        }
 else         if (isAlwaysNull(ro)) {
          uAddInfoToFlowSet(lo,kNull,genSet,preSet);
        }
 else         if (isAlwaysTop(ro)) {
          uAddTopToFlowSet(lo,genSet,preSet);
        }
      }
    }
{
      Iterator boxIt;
      boxIt=s.getUseBoxes().iterator();
      while (boxIt.hasNext()) {
        Value boxValue=((ValueBox)boxIt.next()).getValue();
        Value base=null;
        if (boxValue instanceof InstanceFieldRef) {
          base=((InstanceFieldRef)(boxValue)).getBase();
          instanceFieldRefChecksSet.add(base);
        }
 else         if (boxValue instanceof ArrayRef) {
          base=((ArrayRef)(boxValue)).getBase();
          arrayRefChecksSet.add(base);
        }
 else         if (boxValue instanceof InstanceInvokeExpr) {
          base=((InstanceInvokeExpr)boxValue).getBase();
          instanceInvokeExprChecksSet.add(base);
        }
 else         if (boxValue instanceof LengthExpr) {
          base=((LengthExpr)boxValue).getOp();
          lengthExprChecksSet.add(base);
        }
 else         if (s instanceof ThrowStmt) {
          base=((ThrowStmt)s).getOp();
        }
 else         if (s instanceof MonitorStmt) {
          base=((MonitorStmt)s).getOp();
        }
        if (base != null && isAnalyzedRef(base)) {
          uAddInfoToFlowSet(base,kNonNull,genSet,preSet);
          analyzedChecksSet.add(base);
        }
      }
      boxIt=s.getDefBoxes().iterator();
      while (boxIt.hasNext()) {
        Value boxValue=((ValueBox)boxIt.next()).getValue();
        Value base=null;
        if (boxValue instanceof InstanceFieldRef) {
          base=((InstanceFieldRef)(boxValue)).getBase();
          instanceFieldRefChecksSet.add(base);
        }
 else         if (boxValue instanceof ArrayRef) {
          base=((ArrayRef)(boxValue)).getBase();
          arrayRefChecksSet.add(base);
        }
 else         if (boxValue instanceof InstanceInvokeExpr) {
          base=((InstanceInvokeExpr)boxValue).getBase();
          instanceInvokeExprChecksSet.add(base);
        }
 else         if (boxValue instanceof LengthExpr) {
          base=((LengthExpr)boxValue).getOp();
          lengthExprChecksSet.add(base);
        }
 else         if (s instanceof ThrowStmt) {
          base=((ThrowStmt)s).getOp();
        }
 else         if (s instanceof MonitorStmt) {
          base=((MonitorStmt)s).getOp();
        }
        if (base != null && isAnalyzedRef(base)) {
          uAddInfoToFlowSet(base,kNonNull,genSet,preSet);
          analyzedChecksSet.add(base);
        }
      }
    }
    unitToGenerateSet.put(s,genSet);
    unitToPreserveSet.put(s,preSet);
    unitToAnalyzedChecksSet.put(s,analyzedChecksSet);
    unitToArrayRefChecksSet.put(s,arrayRefChecksSet);
    unitToInstanceFieldRefChecksSet.put(s,instanceFieldRefChecksSet);
    unitToInstanceInvokeExprChecksSet.put(s,instanceInvokeExprChecksSet);
    unitToLengthExprChecksSet.put(s,lengthExprChecksSet);
  }
}