Program: 122262
Project: 122262
Buggy source:
@Override public void execute(){
  OutputTreeNode targetOutputNode=(OutputTreeNode)targetEditPart.getModel();
  String expression="String_Node_Str";
  if (objects.getToTransfer() != null) {
    for (    Object obj : objects.getToTransfer()) {
      OutputTreeNode createdNode=(OutputTreeNode)rq.getNewObject();
      AbstractNode source=null;
      if (objects.getType() == TransferdType.INPUT) {
        TreeNodeEditPart part=(TreeNodeEditPart)obj;
        TreeNode sourceNode=(TreeNode)part.getModel();
        source=sourceNode;
        createdNode.setName(sourceNode.getName());
        createdNode.setType(sourceNode.getType());
        createdNode.setPattern(sourceNode.getPattern());
        expression=XmlMapUtil.convertToExpression(sourceNode.getXpath());
        createdNode.setExpression(expression);
        if (createdNode instanceof OutputTreeNode) {
          if (NodeType.NAME_SPACE.equals(sourceNode.getNodeType())) {
            createdNode.setDefaultValue(sourceNode.getDefaultValue());
          }
          createdNode.setXpath(XmlMapUtil.getXPath(targetOutputNode.getXpath(),createdNode.getName(),createdNode.getNodeType()));
          createdNode.setExpression(XmlMapUtil.convertToExpression(sourceNode.getXpath()));
          EList<TreeNode> sourceChildren=sourceNode.getChildren();
          if (!sourceChildren.isEmpty()) {
            for (            TreeNode child : sourceChildren) {
              OutputTreeNode childTarget=XmlmapFactory.eINSTANCE.createOutputTreeNode();
              childTarget.setName(child.getName());
              childTarget.setType(child.getType());
              childTarget.setPattern(child.getPattern());
              childTarget.setNodeType(child.getNodeType());
              childTarget.setXpath(XmlMapUtil.getXPath(createdNode.getXpath(),childTarget.getName(),childTarget.getNodeType()));
              createdNode.getChildren().add(childTarget);
              if (NodeType.NAME_SPACE.equals(child.getNodeType())) {
                childTarget.setDefaultValue(child.getDefaultValue());
                childTarget.setExpression("String_Node_Str");
              }
 else {
                childTarget.setExpression(XmlMapUtil.convertToExpression(((TreeNode)child).getXpath()));
                createConnection(child,childTarget);
              }
            }
          }
          InputLoopTableUtil.addSourceLoopToInputLoopTable(sourceNode,targetOutputNode,manager.getMainInputTree());
        }
      }
 else       if (objects.getType() == TransferdType.VAR) {
        VarNodeEditPart part=(VarNodeEditPart)obj;
        VarNode sourceNode=(VarNode)part.getModel();
        source=sourceNode;
        String variable=sourceNode.getName();
        createdNode.setName(variable);
        createdNode.setXpath(XmlMapUtil.getXPath(targetOutputNode.getXpath(),createdNode.getName(),createdNode.getNodeType()));
        if (sourceNode.eContainer() instanceof VarTable) {
          VarTable container=(VarTable)sourceNode.eContainer();
          variable=container.getName() + TalendTextUtils.JAVA_END_STRING + variable;
        }
        createdNode.setExpression(variable);
      }
      targetOutputNode.getChildren().add(createdNode);
      createConnection(source,createdNode);
      if (!XmlMapUtil.isExpressionEditable(targetOutputNode)) {
        targetOutputNode.setExpression("String_Node_Str");
        if (targetOutputNode.isAggregate()) {
          targetOutputNode.setAggregate(false);
        }
      }
    }
  }
  manager.refreshOutputTreeSchemaEditor((OutputXmlTree)XmlMapUtil.getAbstractInOutTree(targetOutputNode));
}

Fixed version (ground truth):
@Override public void execute(){
  OutputTreeNode targetOutputNode=(OutputTreeNode)targetEditPart.getModel();
  String expression="String_Node_Str";
  if (objects.getToTransfer() != null) {
    for (    Object obj : objects.getToTransfer()) {
      OutputTreeNode createdNode=(OutputTreeNode)rq.getNewObject();
      AbstractNode source=null;
      if (objects.getType() == TransferdType.INPUT) {
        TreeNodeEditPart part=(TreeNodeEditPart)obj;
        TreeNode sourceNode=(TreeNode)part.getModel();
        source=sourceNode;
        createdNode.setName(sourceNode.getName());
        createdNode.setType(sourceNode.getType());
        createdNode.setPattern(sourceNode.getPattern());
        expression=XmlMapUtil.convertToExpression(sourceNode.getXpath());
        createdNode.setExpression(expression);
        if (createdNode instanceof OutputTreeNode) {
          if (NodeType.NAME_SPACE.equals(sourceNode.getNodeType())) {
            createdNode.setDefaultValue(sourceNode.getDefaultValue());
          }
          createdNode.setXpath(XmlMapUtil.getXPath(targetOutputNode.getXpath(),createdNode.getName(),createdNode.getNodeType()));
          createdNode.setExpression(XmlMapUtil.convertToExpression(sourceNode.getXpath()));
          EList<TreeNode> sourceChildren=sourceNode.getChildren();
          if (!sourceChildren.isEmpty()) {
            for (            TreeNode child : sourceChildren) {
              OutputTreeNode childTarget=XmlmapFactory.eINSTANCE.createOutputTreeNode();
              childTarget.setName(child.getName());
              childTarget.setType(child.getType());
              childTarget.setPattern(child.getPattern());
              childTarget.setNodeType(child.getNodeType());
              childTarget.setXpath(XmlMapUtil.getXPath(createdNode.getXpath(),childTarget.getName(),childTarget.getNodeType()));
              createdNode.getChildren().add(childTarget);
              if (NodeType.NAME_SPACE.equals(child.getNodeType())) {
                childTarget.setDefaultValue(child.getDefaultValue());
                childTarget.setExpression("String_Node_Str");
              }
 else {
                childTarget.setExpression(XmlMapUtil.convertToExpression(child.getXpath()));
                createConnection(child,childTarget);
              }
            }
          }
        }
      }
 else       if (objects.getType() == TransferdType.VAR) {
        VarNodeEditPart part=(VarNodeEditPart)obj;
        VarNode sourceNode=(VarNode)part.getModel();
        source=sourceNode;
        String variable=sourceNode.getName();
        createdNode.setName(variable);
        createdNode.setXpath(XmlMapUtil.getXPath(targetOutputNode.getXpath(),createdNode.getName(),createdNode.getNodeType()));
        if (sourceNode.eContainer() instanceof VarTable) {
          VarTable container=(VarTable)sourceNode.eContainer();
          variable=container.getName() + TalendTextUtils.JAVA_END_STRING + variable;
        }
        createdNode.setExpression(variable);
      }
      targetOutputNode.getChildren().add(createdNode);
      createConnection(source,createdNode);
      if (!XmlMapUtil.isExpressionEditable(targetOutputNode)) {
        targetOutputNode.setExpression("String_Node_Str");
        if (targetOutputNode.isAggregate()) {
          targetOutputNode.setAggregate(false);
        }
      }
    }
  }
  manager.refreshOutputTreeSchemaEditor((OutputXmlTree)XmlMapUtil.getAbstractInOutTree(targetOutputNode));
}