Program: 122071
Project: 122071
Buggy source:
public TreeBranchContent(final TreeNodeEditPart treeNodePart){
  setDirectEditType(DirectEditType.NODE_NAME);
  this.treeNode=(TreeNode)treeNodePart.getModel();
  inputMainTable=((XmlMapGraphicViewer)treeNodePart.getViewer()).getMapperManager().getMainInputTree();
  GridLayout manager=new GridLayout(4,false);
  manager.horizontalSpacing=5;
  manager.verticalSpacing=1;
  manager.marginHeight=-1;
  manager.marginWidth=5;
  setLayoutManager(manager);
  nameFigure=new Label();
  nameFigure.setText(getTreeBranchName(treeNode));
  statusFigure=new Label();
  statusFigure.setForegroundColor(ColorConstants.red);
  statusFigure.setText(getStatus(treeNode));
  defaultValue=new Label();
  defaultValue.setForegroundColor(ColorConstants.blue);
  defaultValue.setText(getDefaultValue(treeNode));
  setOpaque(true);
  this.add(nameFigure);
  ImageInfo infor=ImageInfo.SETLOOPFUNCTION_BUTTON;
  if (treeNode instanceof OutputTreeNode) {
    InputLoopNodesTable inputLoopNodesTable=((OutputTreeNode)treeNode).getInputLoopNodesTable();
    infor=(inputLoopNodesTable == null || inputLoopNodesTable.getInputloopnodes().isEmpty()) ? ImageInfo.SETLOOPFUNCTION_BUTTON_ERROR : ImageInfo.SETLOOPFUNCTION_BUTTON;
  }
  loopButtonFigure=new ToolBarButtonImageFigure(ImageProviderMapper.getImage(infor));
  loopButtonFigure.addMouseListener(new MouseListener.Stub(){
    @Override public void mousePressed(    MouseEvent me){
      OutputTreeNode outputTreeNode=(OutputTreeNode)treeNode;
      List<TreeNode> loopNodes=new ArrayList<TreeNode>();
      if (inputMainTable != null && inputMainTable.isMultiLoops()) {
        loopNodes.addAll(XmlMapUtil.getMultiLoopsForInputTree(inputMainTable));
      }
      InputLoopNodesTable inputLoopNodesTable=null;
      if (outputTreeNode.getInputLoopNodesTable() != null) {
        inputLoopNodesTable=outputTreeNode.getInputLoopNodesTable();
      }
 else {
        inputLoopNodesTable=XmlmapFactory.eINSTANCE.createInputLoopNodesTable();
        outputTreeNode.setInputLoopNodesTable(inputLoopNodesTable);
        AbstractInOutTree abstractInOutTree=XmlMapUtil.getAbstractInOutTree(outputTreeNode);
        if (abstractInOutTree != null) {
          ((OutputXmlTree)abstractInOutTree).getInputLoopNodesTables().add(inputLoopNodesTable);
        }
      }
      SetLoopFunctionDialog nsDialog=new SetLoopFunctionDialog(null,outputTreeNode.getInputLoopNodesTable(),loopNodes);
      if (nsDialog.open() == Window.OK) {
        ((XmlMapGraphicViewer)treeNodePart.getViewer()).getMapperManager().getProblemsAnalyser().checkProblems(XmlMapUtil.getAbstractInOutTree(outputTreeNode));
        ((XmlMapGraphicViewer)treeNodePart.getViewer()).getMapperManager().getMapperUI().updateStatusBar();
      }
    }
  }
);
  if (treeNode != null && treeNode instanceof OutputTreeNode) {
    if (treeNode.isLoop() && inputMainTable != null && inputMainTable.isMultiLoops()) {
      this.add(loopButtonFigure);
    }
  }
  this.add(statusFigure);
  this.add(defaultValue);
}

Fixed version (ground truth):
public TreeBranchContent(final TreeNodeEditPart treeNodePart){
  setDirectEditType(DirectEditType.NODE_NAME);
  this.treeNode=(TreeNode)treeNodePart.getModel();
  inputMainTable=((XmlMapGraphicViewer)treeNodePart.getViewer()).getMapperManager().getMainInputTree();
  GridLayout manager=new GridLayout(4,false);
  manager.horizontalSpacing=5;
  manager.verticalSpacing=1;
  manager.marginHeight=-1;
  manager.marginWidth=5;
  setLayoutManager(manager);
  nameFigure=new Label();
  nameFigure.setText(getTreeBranchName(treeNode));
  statusFigure=new Label();
  statusFigure.setForegroundColor(ColorConstants.red);
  statusFigure.setText(getStatus(treeNode));
  defaultValue=new Label();
  defaultValue.setForegroundColor(ColorConstants.blue);
  defaultValue.setText(getDefaultValue(treeNode));
  setOpaque(true);
  this.add(nameFigure);
  ImageInfo infor=ImageInfo.SETLOOPFUNCTION_BUTTON;
  if (treeNode instanceof OutputTreeNode) {
    InputLoopNodesTable inputLoopNodesTable=((OutputTreeNode)treeNode).getInputLoopNodesTable();
    infor=(inputLoopNodesTable == null || inputLoopNodesTable.getInputloopnodes().isEmpty()) ? ImageInfo.SETLOOPFUNCTION_BUTTON_ERROR : ImageInfo.SETLOOPFUNCTION_BUTTON;
  }
  loopButtonFigure=new ToolBarButtonImageFigure(ImageProviderMapper.getImage(infor));
  loopButtonFigure.addMouseListener(new MouseListener.Stub(){
    @Override public void mousePressed(    MouseEvent me){
      OutputTreeNode outputTreeNode=(OutputTreeNode)treeNode;
      List<TreeNode> loopNodes=new ArrayList<TreeNode>();
      if (inputMainTable != null && inputMainTable.isMultiLoops()) {
        loopNodes.addAll(XmlMapUtil.getMultiLoopsForXmlTree(inputMainTable));
      }
      InputLoopNodesTable inputLoopNodesTable=null;
      if (outputTreeNode.getInputLoopNodesTable() != null) {
        inputLoopNodesTable=outputTreeNode.getInputLoopNodesTable();
      }
 else {
        inputLoopNodesTable=XmlmapFactory.eINSTANCE.createInputLoopNodesTable();
        outputTreeNode.setInputLoopNodesTable(inputLoopNodesTable);
        AbstractInOutTree abstractInOutTree=XmlMapUtil.getAbstractInOutTree(outputTreeNode);
        if (abstractInOutTree != null) {
          ((OutputXmlTree)abstractInOutTree).getInputLoopNodesTables().add(inputLoopNodesTable);
        }
      }
      SetLoopFunctionDialog nsDialog=new SetLoopFunctionDialog(null,outputTreeNode.getInputLoopNodesTable(),loopNodes);
      if (nsDialog.open() == Window.OK) {
        ((XmlMapGraphicViewer)treeNodePart.getViewer()).getMapperManager().getProblemsAnalyser().checkProblems(XmlMapUtil.getAbstractInOutTree(outputTreeNode));
        ((XmlMapGraphicViewer)treeNodePart.getViewer()).getMapperManager().getMapperUI().updateStatusBar();
      }
    }
  }
);
  if (treeNode != null && treeNode instanceof OutputTreeNode) {
    if (treeNode.isLoop() && inputMainTable != null && inputMainTable.isMultiLoops()) {
      this.add(loopButtonFigure);
    }
  }
  this.add(statusFigure);
  this.add(defaultValue);
}