Program: 87992
Project: 87992
Buggy source:
/** 
 * Compute the addresses and sizes of an ordered node array. This method takes a node array and will update its cached address and size values so that they can be written into a file. It determines the smallest size each of the nodes can be given the addresses of its children and attributes, and store that into each node. The order of the node is given by the order of the array. This method makes no effort to find a good order; it only mechanically computes the size this order results in.
 * @param dict the dictionary
 * @param flatNodes the ordered array of nodes
 * @return the same array it was passed. The nodes have been updated for address and size.
 */
private static ArrayList<Node> computeAddresses(FusionDictionary dict,ArrayList<Node> flatNodes){
  for (  Node n : flatNodes)   setNodeMaximumSize(n);
  final int offset=stackNodes(flatNodes);
  MakedictLog.i("String_Node_Str" + offset);
  MakedictLog.i("String_Node_Str" + offset + "String_Node_Str");
  int passes=0;
  boolean changesDone=false;
  do {
    changesDone=false;
    for (    Node n : flatNodes) {
      final int oldNodeSize=n.mCachedSize;
      computeActualNodeSize(n,dict);
      final int newNodeSize=n.mCachedSize;
      if (oldNodeSize < newNodeSize)       throw new RuntimeException("String_Node_Str");
      if (oldNodeSize != newNodeSize)       changesDone=true;
    }
    stackNodes(flatNodes);
    ++passes;
  }
 while (changesDone);
  final Node lastNode=flatNodes.get(flatNodes.size() - 1);
  MakedictLog.i("String_Node_Str" + passes + "String_Node_Str");
  MakedictLog.i("String_Node_Str" + (lastNode.mCachedAddress + lastNode.mCachedSize));
  return flatNodes;
}

Fixed version (ground truth):
/** 
 * Compute the addresses and sizes of an ordered node array. This method takes a node array and will update its cached address and size values so that they can be written into a file. It determines the smallest size each of the nodes can be given the addresses of its children and attributes, and store that into each node. The order of the node is given by the order of the array. This method makes no effort to find a good order; it only mechanically computes the size this order results in.
 * @param dict the dictionary
 * @param flatNodes the ordered array of nodes
 * @return the same array it was passed. The nodes have been updated for address and size.
 */
private static ArrayList<Node> computeAddresses(FusionDictionary dict,ArrayList<Node> flatNodes){
  for (  Node n : flatNodes)   setNodeMaximumSize(n);
  final int offset=stackNodes(flatNodes);
  MakedictLog.i("String_Node_Str" + offset);
  MakedictLog.i("String_Node_Str" + offset + "String_Node_Str");
  int passes=0;
  boolean changesDone=false;
  do {
    changesDone=false;
    for (    Node n : flatNodes) {
      final int oldNodeSize=n.mCachedSize;
      final boolean changed=computeActualNodeSize(n,dict);
      final int newNodeSize=n.mCachedSize;
      if (oldNodeSize < newNodeSize)       throw new RuntimeException("String_Node_Str");
      changesDone|=changed;
    }
    stackNodes(flatNodes);
    ++passes;
    if (passes > MAX_PASSES)     throw new RuntimeException("String_Node_Str");
  }
 while (changesDone);
  final Node lastNode=flatNodes.get(flatNodes.size() - 1);
  MakedictLog.i("String_Node_Str" + passes + "String_Node_Str");
  MakedictLog.i("String_Node_Str" + (lastNode.mCachedAddress + lastNode.mCachedSize));
  return flatNodes;
}