Program: 122268
Project: 122268
Buggy source:
private void doUpdate(AbstractNode sourceNode){
  if (targetEditPart instanceof OutputTreeNodeEditPart) {
    OutputTreeNode targetOutputNode=(OutputTreeNode)((OutputTreeNodeEditPart)targetEditPart).getModel();
    String expression=targetOutputNode.getExpression();
    if (sourceNode instanceof TreeNode) {
      if (expression == null) {
        expression=XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      }
 else {
        expression=expression + "String_Node_Str" + XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      }
    }
 else     if (sourceNode instanceof VarNode) {
      String tableName="String_Node_Str";
      if (sourceNode.eContainer() instanceof VarTable) {
        tableName=((VarTable)sourceNode.eContainer()).getName();
      }
      if (expression == null) {
        expression=tableName + "String_Node_Str" + sourceNode.getName();
      }
 else {
        expression=expression + "String_Node_Str" + tableName+ "String_Node_Str"+ sourceNode.getName();
      }
    }
    if (sourceNode instanceof TreeNode) {
      createInputLoopTable((TreeNode)sourceNode,targetOutputNode);
    }
    targetOutputNode.setExpression(expression);
    Connection conn=XmlmapFactory.eINSTANCE.createConnection();
    conn.setSource(sourceNode);
    conn.setTarget(targetOutputNode);
    targetOutputNode.getIncomingConnections().add(conn);
    sourceNode.getOutgoingConnections().add(conn);
    if (xmlMapData != null) {
      xmlMapData.getConnections().add(conn);
    }
  }
 else   if (targetEditPart instanceof TreeNodeEditPart) {
    if (sourceNode instanceof TreeNode) {
      TreeNode targetTreeNode=(TreeNode)targetEditPart.getModel();
      String expression=targetTreeNode.getExpression();
      if (expression == null) {
        expression="String_Node_Str";
      }
      expression=expression + "String_Node_Str" + XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      targetTreeNode.setExpression(expression);
      LookupConnection conn=XmlmapFactory.eINSTANCE.createLookupConnection();
      conn.setSource(sourceNode);
      conn.setTarget(targetTreeNode);
      targetTreeNode.getLookupIncomingConnections().add(conn);
      ((TreeNode)sourceNode).getLookupOutgoingConnections().add(conn);
      if (xmlMapData != null) {
        xmlMapData.getConnections().add(conn);
      }
    }
  }
 else   if (targetEditPart instanceof VarNodeEditPart) {
    if (sourceNode instanceof TreeNode) {
      VarNodeEditPart targetPart=(VarNodeEditPart)targetEditPart;
      VarNode targetNode=(VarNode)targetPart.getModel();
      String expression=targetNode.getExpression();
      if (expression == null) {
        expression="String_Node_Str";
      }
      expression=expression + "String_Node_Str" + XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      if (targetNode.getName() == null || "String_Node_Str".equals(targetNode.getName())) {
        String findUniqueVarColumnName=XmlMapUtil.findUniqueVarColumnName(sourceNode.getName(),xmlMapData.getVarTables().get(0));
        targetNode.setName(findUniqueVarColumnName);
      }
      targetNode.setExpression(expression.trim());
      targetNode.setType(sourceNode.getType());
      Connection conn=XmlmapFactory.eINSTANCE.createConnection();
      conn.setSource(sourceNode);
      conn.setTarget(targetNode);
      targetNode.getIncomingConnections().add(conn);
      sourceNode.getOutgoingConnections().add(conn);
      if (xmlMapData != null) {
        xmlMapData.getConnections().add(conn);
      }
    }
  }
 else   if (targetEditPart instanceof InputXmlTreeEditPart || targetEditPart instanceof OutputXmlTreeEditPart) {
    AbstractInOutTree treeModel=(AbstractInOutTree)targetEditPart.getModel();
    String expression=treeModel.getExpressionFilter();
    if (sourceNode instanceof TreeNode) {
      if (expression == null) {
        expression=XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      }
 else {
        expression=expression + "String_Node_Str" + XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      }
    }
 else     if (sourceNode instanceof VarNode) {
      String tableName="String_Node_Str";
      if (sourceNode.eContainer() instanceof VarTable) {
        tableName=((VarTable)sourceNode.eContainer()).getName();
      }
      if (expression == null) {
        expression=tableName + "String_Node_Str" + sourceNode.getName();
      }
 else {
        expression=expression + "String_Node_Str" + tableName+ "String_Node_Str"+ sourceNode.getName();
      }
    }
    treeModel.setExpressionFilter(expression);
    FilterConnection connection=XmlmapFactory.eINSTANCE.createFilterConnection();
    connection.setSource(sourceNode);
    connection.setTarget(treeModel);
    treeModel.getFilterIncomingConnections().add(connection);
    sourceNode.getFilterOutGoingConnections().add(connection);
    xmlMapData.getConnections().add(connection);
  }
}

Fixed version (ground truth):
private void doUpdate(AbstractNode sourceNode){
  if (targetEditPart instanceof OutputTreeNodeEditPart) {
    OutputTreeNode targetOutputNode=(OutputTreeNode)((OutputTreeNodeEditPart)targetEditPart).getModel();
    String expression=targetOutputNode.getExpression();
    if (sourceNode instanceof TreeNode) {
      if (expression == null) {
        expression=XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      }
 else {
        expression=expression + "String_Node_Str" + XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      }
    }
 else     if (sourceNode instanceof VarNode) {
      String tableName="String_Node_Str";
      if (sourceNode.eContainer() instanceof VarTable) {
        tableName=((VarTable)sourceNode.eContainer()).getName();
      }
      if (expression == null) {
        expression=tableName + "String_Node_Str" + sourceNode.getName();
      }
 else {
        expression=expression + "String_Node_Str" + tableName+ "String_Node_Str"+ sourceNode.getName();
      }
    }
    targetOutputNode.setExpression(expression);
    Connection conn=XmlmapFactory.eINSTANCE.createConnection();
    conn.setSource(sourceNode);
    conn.setTarget(targetOutputNode);
    targetOutputNode.getIncomingConnections().add(conn);
    sourceNode.getOutgoingConnections().add(conn);
    if (xmlMapData != null) {
      xmlMapData.getConnections().add(conn);
    }
  }
 else   if (targetEditPart instanceof TreeNodeEditPart) {
    if (sourceNode instanceof TreeNode) {
      TreeNode targetTreeNode=(TreeNode)targetEditPart.getModel();
      String expression=targetTreeNode.getExpression();
      if (expression == null) {
        expression="String_Node_Str";
      }
      expression=expression + "String_Node_Str" + XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      targetTreeNode.setExpression(expression);
      LookupConnection conn=XmlmapFactory.eINSTANCE.createLookupConnection();
      conn.setSource(sourceNode);
      conn.setTarget(targetTreeNode);
      targetTreeNode.getLookupIncomingConnections().add(conn);
      ((TreeNode)sourceNode).getLookupOutgoingConnections().add(conn);
      if (xmlMapData != null) {
        xmlMapData.getConnections().add(conn);
      }
    }
  }
 else   if (targetEditPart instanceof VarNodeEditPart) {
    if (sourceNode instanceof TreeNode) {
      VarNodeEditPart targetPart=(VarNodeEditPart)targetEditPart;
      VarNode targetNode=(VarNode)targetPart.getModel();
      String expression=targetNode.getExpression();
      if (expression == null) {
        expression="String_Node_Str";
      }
      expression=expression + "String_Node_Str" + XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      if (targetNode.getName() == null || "String_Node_Str".equals(targetNode.getName())) {
        String findUniqueVarColumnName=XmlMapUtil.findUniqueVarColumnName(sourceNode.getName(),xmlMapData.getVarTables().get(0));
        targetNode.setName(findUniqueVarColumnName);
      }
      targetNode.setExpression(expression.trim());
      targetNode.setType(sourceNode.getType());
      Connection conn=XmlmapFactory.eINSTANCE.createConnection();
      conn.setSource(sourceNode);
      conn.setTarget(targetNode);
      targetNode.getIncomingConnections().add(conn);
      sourceNode.getOutgoingConnections().add(conn);
      if (xmlMapData != null) {
        xmlMapData.getConnections().add(conn);
      }
    }
  }
 else   if (targetEditPart instanceof InputXmlTreeEditPart || targetEditPart instanceof OutputXmlTreeEditPart) {
    AbstractInOutTree treeModel=(AbstractInOutTree)targetEditPart.getModel();
    String expression=treeModel.getExpressionFilter();
    if (sourceNode instanceof TreeNode) {
      if (expression == null) {
        expression=XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      }
 else {
        expression=expression + "String_Node_Str" + XmlMapUtil.convertToExpression(((TreeNode)sourceNode).getXpath());
      }
    }
 else     if (sourceNode instanceof VarNode) {
      String tableName="String_Node_Str";
      if (sourceNode.eContainer() instanceof VarTable) {
        tableName=((VarTable)sourceNode.eContainer()).getName();
      }
      if (expression == null) {
        expression=tableName + "String_Node_Str" + sourceNode.getName();
      }
 else {
        expression=expression + "String_Node_Str" + tableName+ "String_Node_Str"+ sourceNode.getName();
      }
    }
    treeModel.setExpressionFilter(expression);
    FilterConnection connection=XmlmapFactory.eINSTANCE.createFilterConnection();
    connection.setSource(sourceNode);
    connection.setTarget(treeModel);
    treeModel.getFilterIncomingConnections().add(connection);
    sourceNode.getFilterOutGoingConnections().add(connection);
    xmlMapData.getConnections().add(connection);
  }
}