Program: 85367
Project: 85367
Buggy source:
protected void internalTransform(Body body,String phaseName,Map<String,String> options){
  if (this.throwAnalysis == null)   this.throwAnalysis=Scene.v().getDefaultThrowAnalysis();
  if (Options.v().verbose())   G.v().out.println("String_Node_Str" + body.getMethod().getName() + "String_Node_Str");
  Chain<Trap> trapChain=body.getTraps();
  Chain<Unit> unitChain=body.getUnits();
  if (trapChain.size() > 0) {
    ExceptionalUnitGraph graph=new ExceptionalUnitGraph(body,throwAnalysis,Options.v().omit_excepting_unit_edges());
    for (Iterator<Trap> trapIt=trapChain.iterator(); trapIt.hasNext(); ) {
      Trap trap=trapIt.next();
      Unit firstTrappedUnit=trap.getBeginUnit();
      Unit firstTrappedThrower=null;
      Unit firstUntrappedUnit=trap.getEndUnit();
      Unit lastTrappedUnit=unitChain.getPredOf(firstUntrappedUnit);
      Unit lastTrappedThrower=null;
      for (Unit u=firstTrappedUnit; u != null && u != firstUntrappedUnit; u=unitChain.getSuccOf(u)) {
        if (mightThrowTo(graph,u,trap)) {
          firstTrappedThrower=u;
          break;
        }
      }
      if (firstTrappedThrower != null) {
        for (Unit u=lastTrappedUnit; u != null; u=unitChain.getPredOf(u)) {
          if (mightThrowTo(graph,u,trap)) {
            lastTrappedThrower=u;
            break;
          }
        }
      }
      if (firstTrappedThrower == null)       trapIt.remove();
 else {
        if (firstTrappedThrower != null && firstTrappedUnit != firstTrappedThrower) {
          trap.setBeginUnit(firstTrappedThrower);
        }
        if (lastTrappedThrower == null) {
          lastTrappedThrower=firstTrappedUnit;
        }
        if (lastTrappedUnit != lastTrappedThrower) {
          trap.setEndUnit(unitChain.getSuccOf(lastTrappedThrower));
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void internalTransform(Body body,String phaseName,Map<String,String> options){
  if (this.throwAnalysis == null)   this.throwAnalysis=Scene.v().getDefaultThrowAnalysis();
  if (Options.v().verbose())   G.v().out.println("String_Node_Str" + body.getMethod().getName() + "String_Node_Str");
  Chain<Trap> trapChain=body.getTraps();
  Chain<Unit> unitChain=body.getUnits();
  if (trapChain.size() > 0) {
    ExceptionalUnitGraph graph=new ExceptionalUnitGraph(body,throwAnalysis,Options.v().omit_excepting_unit_edges());
    Set<Unit> unitsWithMonitor=getUnitsWithMonitor(graph);
    for (Iterator<Trap> trapIt=trapChain.iterator(); trapIt.hasNext(); ) {
      Trap trap=trapIt.next();
      boolean isCatchAll=trap.getException().getName().equals("String_Node_Str");
      Unit firstTrappedUnit=trap.getBeginUnit();
      Unit firstTrappedThrower=null;
      Unit firstUntrappedUnit=trap.getEndUnit();
      Unit lastTrappedUnit=unitChain.getPredOf(firstUntrappedUnit);
      Unit lastTrappedThrower=null;
      for (Unit u=firstTrappedUnit; u != null && u != firstUntrappedUnit; u=unitChain.getSuccOf(u)) {
        if (mightThrowTo(graph,u,trap)) {
          firstTrappedThrower=u;
          break;
        }
        if (isCatchAll && unitsWithMonitor.contains(u))         break;
      }
      if (firstTrappedThrower != null) {
        for (Unit u=lastTrappedUnit; u != null; u=unitChain.getPredOf(u)) {
          if (mightThrowTo(graph,u,trap)) {
            lastTrappedThrower=u;
            break;
          }
          if (isCatchAll && unitsWithMonitor.contains(u))           break;
        }
      }
      if (firstTrappedThrower == null)       trapIt.remove();
 else {
        if (firstTrappedThrower != null && firstTrappedUnit != firstTrappedThrower) {
          trap.setBeginUnit(firstTrappedThrower);
        }
        if (lastTrappedThrower == null) {
          lastTrappedThrower=firstTrappedUnit;
        }
        if (lastTrappedUnit != lastTrappedThrower) {
          trap.setEndUnit(unitChain.getSuccOf(lastTrappedThrower));
        }
      }
    }
  }
}