Program: 122332
Project: 122332
Buggy source:
private static void updateTargetExpression(TreeNode treeNode,String oldXpath,XmlMapExpressionManager expressionManager){
  String convertToExpression=convertToExpression(oldXpath);
  TableEntryLocation previousLocation=expressionManager.parseTableEntryLocation(convertToExpression).get(0);
  TableEntryLocation newLocation=expressionManager.parseTableEntryLocation(XmlMapUtil.convertToExpression(treeNode.getXpath())).get(0);
  List<INodeConnection> connections=new ArrayList<INodeConnection>();
  connections.addAll(treeNode.getOutgoingConnections());
  connections.addAll(treeNode.getLookupOutgoingConnections());
  for (  INodeConnection connection : connections) {
    AbstractNode target=connection.getTarget();
    List<TableEntryLocation> targetLocaitons=expressionManager.parseTableEntryLocation(target.getExpression());
    for (    TableEntryLocation current : targetLocaitons) {
      if (current.equals(previousLocation)) {
        String newExpression=expressionManager.replaceExpression(target.getExpression(),current,newLocation);
        target.setExpression(newExpression);
      }
    }
  }
  for (  FilterConnection connection : treeNode.getFilterOutGoingConnections()) {
    AbstractInOutTree target=connection.getTarget();
    List<TableEntryLocation> targetLocaitons=expressionManager.parseTableEntryLocation(target.getExpressionFilter());
    for (    TableEntryLocation current : targetLocaitons) {
      if (current.equals(previousLocation)) {
        String newExpression=expressionManager.replaceExpression(target.getExpressionFilter(),current,newLocation);
        target.setExpressionFilter(newExpression);
      }
    }
  }
}

Fixed version (ground truth):
public static void updateTargetExpression(AbstractNode renamedNode,String oldExpression,String newExpression,XmlMapExpressionManager expressionManager){
  TableEntryLocation previousLocation=expressionManager.parseTableEntryLocation(oldExpression).get(0);
  TableEntryLocation newLocation=expressionManager.parseTableEntryLocation(newExpression).get(0);
  List<INodeConnection> connections=new ArrayList<INodeConnection>();
  connections.addAll(renamedNode.getOutgoingConnections());
  if (renamedNode instanceof TreeNode) {
    connections.addAll(((TreeNode)renamedNode).getLookupOutgoingConnections());
  }
  for (  INodeConnection connection : connections) {
    AbstractNode target=connection.getTarget();
    List<TableEntryLocation> targetLocaitons=expressionManager.parseTableEntryLocation(target.getExpression());
    for (    TableEntryLocation current : targetLocaitons) {
      if (current.equals(previousLocation)) {
        String replaced=expressionManager.replaceExpression(target.getExpression(),current,newLocation);
        target.setExpression(replaced);
      }
    }
  }
  for (  FilterConnection connection : renamedNode.getFilterOutGoingConnections()) {
    AbstractInOutTree target=connection.getTarget();
    List<TableEntryLocation> targetLocaitons=expressionManager.parseTableEntryLocation(target.getExpressionFilter());
    for (    TableEntryLocation current : targetLocaitons) {
      if (current.equals(previousLocation)) {
        String replaced=expressionManager.replaceExpression(target.getExpressionFilter(),current,newLocation);
        target.setExpressionFilter(replaced);
      }
    }
  }
}