Program: 98652
Project: 98652
Buggy source:
/** 
 * Goes through all of the in transit messages and decides whether to drop, delay, or deliver.
 * @param currentRoundEvents The list of the current round's events that we should add to
 */
private void checkInTransit(ArrayList<Event> currentRoundEvents){
  if (inTransitMsgs.isEmpty()) {
    return;
  }
  ArrayList<Packet> currentPackets=inTransitMsgs;
  inTransitMsgs=new ArrayList<Packet>();
  if (userControl.compareTo(FailureLvl.DROP) < 0) {
    Iterator<Packet> iter=currentPackets.iterator();
    while (iter.hasNext()) {
      Packet p=iter.next();
      double rand=Utility.getRNG().nextDouble();
      if (rand < dropRate) {
        System.out.println("String_Node_Str" + p.toString());
        this.logInTransit(p,"String_Node_Str");
        iter.remove();
      }
    }
  }
 else {
    System.out.println("String_Node_Str");
    for (int i=0; i < currentPackets.size(); ++i) {
      System.out.println(i + "String_Node_Str" + currentPackets.get(i).toString());
    }
    try {
      System.out.println("String_Node_Str");
      String input=m_prompt ? Replay.getLine().trim() : "String_Node_Str";
      HashSet<Packet> toBeRemoved=new HashSet<Packet>();
      if (!input.equals("String_Node_Str")) {
        String[] dropList=input.split("String_Node_Str");
        Packet p;
        for (        String s : dropList) {
          p=currentPackets.get(Integer.parseInt(s));
          toBeRemoved.add(p);
          this.logInTransit(p,"String_Node_Str");
        }
      }
      if (toBeRemoved.size() == currentPackets.size()) {
        return;
      }
      if (userControl.compareTo(FailureLvl.DELAY) >= 0) {
        System.out.println("String_Node_Str");
        input=m_prompt ? Replay.getLine().trim() : "String_Node_Str";
        if (!input.equals("String_Node_Str")) {
          String[] delayList=input.split("String_Node_Str");
          Packet p;
          for (          String s : delayList) {
            p=currentPackets.get(Integer.parseInt(s));
            inTransitMsgs.add(p);
            toBeRemoved.add(p);
            this.logInTransit(p,"String_Node_Str");
          }
        }
        if (toBeRemoved.size() == currentPackets.size()) {
          return;
        }
      }
      currentPackets.removeAll(toBeRemoved);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  if (userControl.compareTo(FailureLvl.DELAY) < 0) {
    Iterator<Packet> iter=currentPackets.iterator();
    while (iter.hasNext()) {
      Packet p=iter.next();
      double rand=Utility.getRNG().nextDouble();
      double adjustedDelay=delayRate / (1 - dropRate);
      if (rand < adjustedDelay) {
        System.out.println("String_Node_Str" + p.toString());
        iter.remove();
        inTransitMsgs.add(p);
        this.logInTransit(p,"String_Node_Str");
      }
    }
  }
  for (  Packet p : currentPackets) {
    currentRoundEvents.add(Event.getDelivery(p));
  }
}

Fixed version (ground truth):
/** 
 * Goes through all of the in transit messages and decides whether to drop, delay, or deliver.
 * @param currentRoundEvents The list of the current round's events that we should add to
 */
private void checkInTransit(ArrayList<Event> currentRoundEvents){
  if (inTransitMsgs.isEmpty()) {
    return;
  }
  ArrayList<Packet> currentPackets=inTransitMsgs;
  inTransitMsgs=new ArrayList<Packet>();
  if (userControl.compareTo(FailureLvl.DROP) < 0) {
    Iterator<Packet> iter=currentPackets.iterator();
    while (iter.hasNext()) {
      Packet p=iter.next();
      double rand=Utility.getRNG().nextDouble();
      if (rand < dropRate) {
        System.out.println("String_Node_Str" + p.toString());
        this.logInTransit(p,"String_Node_Str");
        iter.remove();
      }
    }
  }
 else {
    System.out.println("String_Node_Str");
    for (int i=0; i < currentPackets.size(); ++i) {
      System.out.println(i + "String_Node_Str" + currentPackets.get(i).toString());
    }
    try {
      String input="String_Node_Str";
      if (m_prompt) {
        System.out.println("String_Node_Str");
        input=Replay.getLine().trim();
      }
      HashSet<Packet> toBeRemoved=new HashSet<Packet>();
      if (!input.equals("String_Node_Str")) {
        String[] dropList=input.split("String_Node_Str");
        Packet p;
        for (        String s : dropList) {
          p=currentPackets.get(Integer.parseInt(s));
          toBeRemoved.add(p);
          this.logInTransit(p,"String_Node_Str");
        }
      }
      if (toBeRemoved.size() == currentPackets.size()) {
        return;
      }
      if (userControl.compareTo(FailureLvl.DELAY) >= 0) {
        input="String_Node_Str";
        if (m_prompt) {
          System.out.println("String_Node_Str");
          input=Replay.getLine().trim();
        }
        if (!input.equals("String_Node_Str")) {
          String[] delayList=input.split("String_Node_Str");
          Packet p;
          for (          String s : delayList) {
            p=currentPackets.get(Integer.parseInt(s));
            inTransitMsgs.add(p);
            toBeRemoved.add(p);
            this.logInTransit(p,"String_Node_Str");
          }
        }
        if (toBeRemoved.size() == currentPackets.size()) {
          return;
        }
      }
      currentPackets.removeAll(toBeRemoved);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  if (userControl.compareTo(FailureLvl.DELAY) < 0) {
    Iterator<Packet> iter=currentPackets.iterator();
    while (iter.hasNext()) {
      Packet p=iter.next();
      double rand=Utility.getRNG().nextDouble();
      double adjustedDelay=delayRate / (1 - dropRate);
      if (rand < adjustedDelay) {
        System.out.println("String_Node_Str" + p.toString());
        iter.remove();
        inTransitMsgs.add(p);
        this.logInTransit(p,"String_Node_Str");
      }
    }
  }
  for (  Packet p : currentPackets) {
    currentRoundEvents.add(Event.getDelivery(p));
  }
}