nus-yam/ex-repair huggingface dataset:
Program: 124217
Project: 124217
Buggy source:
/** 
 * Deal with the bug 4402: the content <quotes_encoded>&quot;hello world&quot;</quotes_encoded>. In this case, "characters" will be called three time. first: " second: hello world third: "
 */
public void characters(char ch[],int start,int length) throws SAXException {
  if (isLooping) {
    String text=new String(ch,start,length);
    if (text.length() > 0) {
      if (outputText) {
        for (        int indexOfColumn : indexOfColumns) {
          if (indexOfColumn >= 0 && !currentRowHaveValue[indexOfColumn]) {
            if (currentRow[indexOfColumn] == null) {
              currentRow[indexOfColumn]=text;
            }
 else {
              currentRow[indexOfColumn]+=text;
            }
          }
        }
      }
      if (this.entry.hasFunctions()) {
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("String_Node_Str",loopPath);
        map.put("String_Node_Str",currentPath);
        map.put("String_Node_Str",text);
        listArgs.add(map);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Deal with the bug 4402: the content <quotes_encoded>&quot;hello world&quot;</quotes_encoded>. In this case, "characters" will be called three time. first: " second: hello world third: "
 */
public void characters(char ch[],int start,int length) throws SAXException {
  if (isLooping) {
    String text=new String(ch,start,length);
    if (text.length() > 0) {
      for (int i=0; i < selectColumns.size(); i++) {
        if (outputTexts[i] && !currentRowHaveValue[i]) {
          if (this.asXMLs.get(i) && !inCDATA) {
            text=escapeEntityHelper.escapeElementEntities(text);
          }
          if (currentRow[i] == null) {
            currentRow[i]=text;
          }
 else {
            currentRow[i]+=text;
          }
        }
      }
      if (this.entry.hasFunctions()) {
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("String_Node_Str",loopPath);
        map.put("String_Node_Str",currentPath);
        map.put("String_Node_Str",text);
        listArgs.add(map);
      }
    }
  }
}
Program: 124220
Project: 124220
Buggy source:
/** 
 * DOC hwang JobletContainerFigure constructor comment.
 * @param model
 */
public JobletContainerFigure(final JobletContainer jobletContainer){
  setLayoutManager(new FreeformLayout());
  this.jobletContainer=jobletContainer;
  outlineFigure=new RoundedRectangle();
  rectFig=new RoundedRectangle();
  titleFigure=new SimpleHtmlFigure();
  titleFigure.setOpaque(true);
  collapseFigure=new JobletCollapseFigure();
  collapseFigure.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      doCollapse();
    }
  }
);
  initSubJobTitleColor();
  updateData();
  initializejobletContainer(jobletContainer.getJobletContainerRectangle());
}

Fixed version (ground truth):
/** 
 * DOC hwang JobletContainerFigure constructor comment.
 * @param model
 */
public JobletContainerFigure(final JobletContainer jobletContainer){
  setLayoutManager(new FreeformLayout());
  this.jobletContainer=jobletContainer;
  outlineFigure=new RoundedRectangle();
  rectFig=new RoundedRectangle();
  titleFigure=new SimpleHtmlFigure();
  titleFigure.setOpaque(true);
  collapseFigure=new JobletCollapseFigure();
  collapseFigure.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      doCollapse();
    }
  }
);
  errorFigure=new ImageFigure();
  errorFigure.setImage(ImageProvider.getImage(EImage.ERROR_SMALL));
  errorFigure.setVisible(false);
  errorFigure.setSize(errorFigure.getPreferredSize());
  this.add(errorFigure);
  htmlStatusHint=new SimpleHtmlFigure();
  initSubJobTitleColor();
  updateData();
  initializejobletContainer(jobletContainer.getJobletContainerRectangle());
}
Program: 124221
Project: 124221
Buggy source:
@Override public void paint(Graphics graphics){
  graphics.setAlpha(100);
  super.paint(graphics);
}

Fixed version (ground truth):
@Override public void paint(Graphics graphics){
  graphics.setAlpha(100);
  errorFigure.setLocation(jobletContainer.getErrorLocation());
  super.paint(graphics);
}
Program: 124223
Project: 124223
Buggy source:
@Override protected IFigure createFigure(){
  JobletContainerFigure JobletContainerFigure=new JobletContainerFigure((JobletContainer)this.getModel());
  return JobletContainerFigure;
}

Fixed version (ground truth):
@Override protected IFigure createFigure(){
  JobletContainerFigure JobletContainerFigure=new JobletContainerFigure((JobletContainer)this.getModel());
  Node node=((NodeContainer)getModel()).getNode();
  JobletContainerFigure.updateStatus(node.getStatus());
  return JobletContainerFigure;
}
Program: 124224
Project: 124224
Buggy source:
public static List<String> getStatusList(ProblemStatus status,Node element){
  List<String> statusList=new ArrayList<String>();
  for (  Problem problem : problemList.getProblemList()) {
    if (problem.getNodeName() != null && problem.getNodeName().equals(element.getLabel()) && problem.getStatus().equals(status)) {
      statusList.add(problem.getDescription());
    }
  }
  return statusList;
}

Fixed version (ground truth):
public static List<String> getStatusList(ProblemStatus status,Node element){
  List<String> statusList=new ArrayList<String>();
  for (  Problem problem : problemList.getProblemList()) {
    String elementUniqueName=element.getLabel();
    if (element.isJoblet()) {
      elementUniqueName=element.getUniqueName();
    }
    if (problem.getNodeName() != null && problem.getNodeName().equals(elementUniqueName) && problem.getStatus().equals(status)) {
      statusList.add(problem.getDescription());
    }
  }
  return statusList;
}
Program: 124229
Project: 124229
Buggy source:
@Override public Object[] getChildren(Object parent){
  RepositoryNode repositoryNode=((RepositoryNode)parent);
  ERepositoryObjectType objectType=repositoryNode.getObjectType();
  if (objectType != null) {
    if (objectType == ERepositoryObjectType.METADATA_CONNECTIONS || objectType == ERepositoryObjectType.METADATA_FILE_BRMS || objectType == ERepositoryObjectType.METADATA_FILE_DELIMITED || objectType == ERepositoryObjectType.METADATA_FILE_EBCDIC || objectType == ERepositoryObjectType.METADATA_FILE_EXCEL || objectType == ERepositoryObjectType.METADATA_FILE_FTP || objectType == ERepositoryObjectType.METADATA_FILE_HL7 || objectType == ERepositoryObjectType.METADATA_FILE_LDIF || objectType == ERepositoryObjectType.METADATA_FILE_POSITIONAL || objectType == ERepositoryObjectType.METADATA_FILE_REGEXP || objectType == ERepositoryObjectType.METADATA_FILE_XML) {
      return new Object[0];
    }
  }
  if (!repositoryNode.isInitialized()) {
    if (repositoryNode.getParent() instanceof ProjectRepositoryNode) {
      ((ProjectRepositoryNode)repositoryNode.getParent()).initializeChildren(parent);
    }
    repositoryNode.setInitialized(true);
  }
  return repositoryNode.getChildren().toArray();
}

Fixed version (ground truth):
@Override public Object[] getChildren(Object parent){
  RepositoryNode repositoryNode=((RepositoryNode)parent);
  ERepositoryObjectType objectType=repositoryNode.getObjectType();
  if (objectType != null) {
    if (objectType == ERepositoryObjectType.METADATA_CONNECTIONS || objectType == ERepositoryObjectType.METADATA_FILE_BRMS || objectType == ERepositoryObjectType.METADATA_FILE_DELIMITED || objectType == ERepositoryObjectType.METADATA_FILE_EBCDIC || objectType == ERepositoryObjectType.METADATA_FILE_EXCEL || objectType == ERepositoryObjectType.METADATA_FILE_FTP || objectType == ERepositoryObjectType.METADATA_FILE_HL7 || objectType == ERepositoryObjectType.METADATA_FILE_LDIF || objectType == ERepositoryObjectType.METADATA_FILE_POSITIONAL || objectType == ERepositoryObjectType.METADATA_FILE_REGEXP || objectType == ERepositoryObjectType.METADATA_FILE_XML || objectType == ERepositoryObjectType.METADATA_GENERIC_SCHEMA) {
      return new Object[0];
    }
  }
  if (!repositoryNode.isInitialized()) {
    if (repositoryNode.getParent() instanceof ProjectRepositoryNode) {
      ((ProjectRepositoryNode)repositoryNode.getParent()).initializeChildren(parent);
    }
    repositoryNode.setInitialized(true);
  }
  return repositoryNode.getChildren().toArray();
}
Program: 124231
Project: 124231
Buggy source:
public void updateJobletNodes(boolean update){
  if (!isCollapsed()) {
    refreshJobletNodes(update,isCollapsed());
    updateSubjobContainer();
    transferLocation(update);
    refreshJobletConnections();
  }
}

Fixed version (ground truth):
public void updateJobletNodes(boolean update){
  refreshJobletNodes(update,isCollapsed());
  updateSubjobContainer();
  transferLocation(update);
  refreshJobletConnections();
}
Program: 124235
Project: 124235
Buggy source:
/** 
 * DOC dev Comment method "createHeaderComposite".
 * @param parent a TabItem 's Control
 * @param tabItem a TabItem
 */
private void createHeaderComposite(Composite parent,CTabItem tabItem){
  int labelStyle=SWT.WRAP | SWT.MULTI;
  Text tmpLabel=new Text(parent,labelStyle);
  tmpLabel.setText(TextUtil.removeLineBreaks(sqlExecution.getSqlStatement()));
  tmpLabel.setLayoutData(new FillLayout());
  int parentWidth=this.getClientArea().width;
  Point idealSize=tmpLabel.computeSize(parentWidth - 30,SWT.DEFAULT);
  if (idealSize.y > 60) {
    labelStyle=SWT.WRAP | SWT.MULTI | SWT.V_SCROLL;
  }
  tmpLabel.dispose();
  Composite headerComposite=new Composite(parent,SWT.FILL);
  headerComposite.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));
  GridLayout hLayout=new GridLayout();
  hLayout.numColumns=2;
  hLayout.marginLeft=0;
  hLayout.horizontalSpacing=0;
  hLayout.verticalSpacing=0;
  hLayout.marginWidth=0;
  hLayout.marginHeight=0;
  headerComposite.setLayout(hLayout);
  Text label=new Text(headerComposite,labelStyle);
  label.setEditable(false);
  label.setBackground(this.getBackground());
  label.setText(TextUtil.removeLineBreaks(sqlExecution.getSqlStatement()));
  label.setToolTipText(TextUtil.getWrappedText(sqlExecution.getSqlStatement()));
  GridData labelGridData=new GridData(SWT.FILL,SWT.TOP,true,true);
  label.setLayoutData(labelGridData);
  label.setVisible(true);
  ToolBarManager toolBarMgr=new ToolBarManager(SWT.FLAT);
  toolBarMgr.createControl(headerComposite);
  toolBarMgr.add(new CloseSQLResultTabAction(tabItem));
  toolBarMgr.update(true);
  GridData gid=new GridData();
  gid.horizontalAlignment=SWT.RIGHT;
  gid.verticalAlignment=SWT.TOP;
  toolBarMgr.getControl().setLayoutData(gid);
}

Fixed version (ground truth):
/** 
 * DOC dev Comment method "createHeaderComposite".
 * @param parent a TabItem 's Control
 * @param tabItem a TabItem
 */
private void createHeaderComposite(Composite parent,CTabItem tabItem){
  Composite headerComposite=new Composite(parent,SWT.FILL);
  headerComposite.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));
  GridLayout hLayout=new GridLayout();
  hLayout.numColumns=2;
  hLayout.marginLeft=0;
  hLayout.horizontalSpacing=0;
  hLayout.verticalSpacing=0;
  hLayout.marginWidth=0;
  hLayout.marginHeight=0;
  headerComposite.setLayout(hLayout);
  Text label=new Text(headerComposite,SWT.H_SCROLL);
  label.setEditable(false);
  label.setBackground(this.getBackground());
  label.setText(TextUtil.removeLineBreaks(sqlExecution.getSqlStatement()));
  label.setToolTipText(TextUtil.getWrappedText(sqlExecution.getSqlStatement()));
  GridData labelGridData=new GridData(SWT.FILL,SWT.TOP,true,true);
  label.setLayoutData(labelGridData);
  label.setVisible(true);
  ToolBarManager toolBarMgr=new ToolBarManager(SWT.FLAT);
  toolBarMgr.createControl(headerComposite);
  toolBarMgr.add(new CloseSQLResultTabAction(tabItem));
  toolBarMgr.update(true);
  GridData gid=new GridData();
  gid.horizontalAlignment=SWT.RIGHT;
  gid.verticalAlignment=SWT.TOP;
  toolBarMgr.getControl().setLayoutData(gid);
}
Program: 124237
Project: 124237
Buggy source:
private void deleteNoUseTable(){
  if (SQLBuilderRepositoryNodeManager.tList == null) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}

Fixed version (ground truth):
private void deleteNoUseTable(){
  if (SQLBuilderRepositoryNodeManager.tList == null || SQLBuilderRepositoryNodeManager.tList.size() == 0) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}
Program: 124238
Project: 124238
Buggy source:
public void initializejobletContainer(Rectangle rectangle){
  disposeColors();
  Point location=this.getLocation();
  collapseFigure.setCollapsed(jobletContainer.isCollapsed());
  titleFigure.setText("String_Node_Str" + title + "String_Node_Str");
  Dimension preferedSize=titleFigure.getPreferredSize();
  preferedSize=preferedSize.getExpanded(0,3);
  rectangle.width+=32;
  collapseFigure.setLocation(new Point(location.x,location.y));
  collapseFigure.setSize(preferedSize.height,preferedSize.height);
  titleFigure.setSize(preferedSize.width,preferedSize.height - 2);
  titleFigure.setLocation(new Point((rectangle.width - preferedSize.height) / 2 + location.x,location.y + 1));
  titleFigure.setVisible(showTitle);
  outlineFigure.setLocation(new Point(location.x,location.y));
  outlineFigure.setVisible(showTitle);
  outlineFigure.setBackgroundColor(new Color(Display.getDefault(),new RGB(130,240,100)));
  outlineFigure.setForegroundColor(new Color(Display.getDefault(),new RGB(205,190,165)));
  outlineFigure.setSize(rectangle.width,preferedSize.height);
  rectFig.setLocation(new Point(location.x,location.y));
  rectFig.setSize(new Dimension(rectangle.width,rectangle.height));
  rectFig.setBackgroundColor(new Color(Display.getDefault(),new RGB(195,240,190)));
  rectFig.setForegroundColor(new Color(Display.getDefault(),new RGB(205,190,165)));
}

Fixed version (ground truth):
public void initializejobletContainer(Rectangle rectangle){
  disposeColors();
  Point location=this.getLocation();
  collapseFigure.setCollapsed(jobletContainer.isCollapsed());
  titleFigure.setText("String_Node_Str" + title + "String_Node_Str");
  Dimension preferedSize=titleFigure.getPreferredSize();
  preferedSize=preferedSize.getExpanded(0,3);
  rectangle.width+=32;
  collapseFigure.setLocation(new Point(location.x,location.y));
  collapseFigure.setSize(preferedSize.height,preferedSize.height);
  titleFigure.setSize(preferedSize.width,preferedSize.height - 2);
  titleFigure.setLocation(new Point((rectangle.width - preferedSize.height) / 2 + location.x,location.y + 1));
  titleFigure.setVisible(showTitle);
  outlineFigure.setLocation(new Point(location.x,location.y));
  outlineFigure.setVisible(showTitle);
  outlineFigure.setBackgroundColor(new Color(Display.getDefault(),new RGB(130,240,100)));
  outlineFigure.setForegroundColor(new Color(Display.getDefault(),new RGB(220,120,120)));
  outlineFigure.setSize(rectangle.width,preferedSize.height);
  rectFig.setLocation(new Point(location.x,location.y));
  rectFig.setSize(new Dimension(rectangle.width,rectangle.height));
  rectFig.setBackgroundColor(new Color(Display.getDefault(),new RGB(130,240,100)));
  rectFig.setForegroundColor(new Color(Display.getDefault(),new RGB(220,120,120)));
}
Program: 124239
Project: 124239
Buggy source:
@Override public void paint(Graphics graphics){
  if (graphics.getAlpha() != -1) {
    graphics.setAlpha(-1);
  }
  errorFigure.setLocation(jobletContainer.getErrorLocation());
  super.paint(graphics);
}

Fixed version (ground truth):
@Override public void paint(Graphics graphics){
  graphics.setAlpha(100);
  errorFigure.setLocation(jobletContainer.getErrorLocation());
  super.paint(graphics);
}
Program: 124240
Project: 124240
Buggy source:
public void characters(char ch[],int start,int length) throws SAXException {
  String text=new String(ch,start,length);
  if (text.length() <= 0)   return;
  for (  XMLNode node : nodes.getNodesCollection()) {
    if (node.isLooping) {
      if (node.outputText && node.hasValue == false) {
        node.addTextValue(text);
      }
    }
  }
}

Fixed version (ground truth):
public void characters(char ch[],int start,int length) throws SAXException {
  String text=new String(ch,start,length);
  if (text.length() <= 0)   return;
  for (  XMLNode node : nodes.getNodesCollection()) {
    if (node.isLooping) {
      if (node.outputText && node.hasValue == false) {
        if (node.isAsXML && !inCDATA) {
          text=escapeEntityHelper.escapeElementEntities(text);
        }
        node.addTextValue(text);
      }
    }
  }
}
Program: 124242
Project: 124242
Buggy source:
public Object call() throws Exception {
  try {
    DefaultHandler hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    if (fileURL != null) {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new java.io.FileInputStream(fileURL));
      inSource.setEncoding(this.charset);
      saxParser.parse(inSource,hd);
    }
 else {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(is);
      inSource.setEncoding(this.charset);
      saxParser.parse(is,hd);
    }
  }
  finally {
    bcache.notifyErrorOccurred();
  }
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  try {
    DefaultHandler hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    saxParser.setProperty("String_Node_Str",hd);
    if (fileURL != null) {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new java.io.FileInputStream(fileURL));
      inSource.setEncoding(this.charset);
      saxParser.parse(inSource,hd);
    }
 else {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(is);
      inSource.setEncoding(this.charset);
      saxParser.parse(is,hd);
    }
  }
  finally {
    bcache.notifyErrorOccurred();
  }
  return null;
}
Program: 124245
Project: 124245
Buggy source:
public void updateJobletNodes(boolean update){
  if (!isCollapsed()) {
    refreshJobletNodes(update,isCollapsed());
    updateSubjobContainer();
    transferLocation(update);
    refreshJobletConnections();
  }
}

Fixed version (ground truth):
public void updateJobletNodes(boolean update){
  refreshJobletNodes(update,isCollapsed());
  updateSubjobContainer();
  transferLocation(update);
  refreshJobletConnections();
}
Program: 124248
Project: 124248
Buggy source:
public void initializejobletContainer(Rectangle rectangle){
  disposeColors();
  Point location=this.getLocation();
  collapseFigure.setCollapsed(jobletContainer.isCollapsed());
  titleFigure.setText("String_Node_Str" + title + "String_Node_Str");
  Dimension preferedSize=titleFigure.getPreferredSize();
  preferedSize=preferedSize.getExpanded(0,3);
  rectangle.width+=32;
  collapseFigure.setLocation(new Point(location.x,location.y));
  collapseFigure.setSize(preferedSize.height,preferedSize.height);
  titleFigure.setSize(preferedSize.width,preferedSize.height - 2);
  titleFigure.setLocation(new Point((rectangle.width - preferedSize.height) / 2 + location.x,location.y + 1));
  titleFigure.setVisible(showTitle);
  outlineFigure.setLocation(new Point(location.x,location.y));
  outlineFigure.setVisible(showTitle);
  outlineFigure.setBackgroundColor(new Color(Display.getDefault(),new RGB(130,240,100)));
  outlineFigure.setForegroundColor(new Color(Display.getDefault(),new RGB(220,120,120)));
  outlineFigure.setSize(rectangle.width,preferedSize.height);
  rectFig.setLocation(new Point(location.x,location.y));
  rectFig.setSize(new Dimension(rectangle.width,rectangle.height));
  rectFig.setBackgroundColor(new Color(Display.getDefault(),new RGB(130,240,100)));
  rectFig.setForegroundColor(new Color(Display.getDefault(),new RGB(220,120,120)));
}

Fixed version (ground truth):
public void initializejobletContainer(Rectangle rectangle){
  disposeColors();
  Point location=this.getLocation();
  collapseFigure.setCollapsed(jobletContainer.isCollapsed());
  titleFigure.setText("String_Node_Str" + title + "String_Node_Str");
  Dimension preferedSize=titleFigure.getPreferredSize();
  preferedSize=preferedSize.getExpanded(0,3);
  rectangle.width+=32;
  collapseFigure.setLocation(new Point(location.x,location.y));
  collapseFigure.setSize(preferedSize.height,preferedSize.height);
  titleFigure.setSize(preferedSize.width,preferedSize.height - 2);
  titleFigure.setLocation(new Point((rectangle.width - preferedSize.height) / 2 + location.x,location.y + 1));
  titleFigure.setVisible(showTitle);
  outlineFigure.setLocation(new Point(location.x,location.y));
  outlineFigure.setVisible(showTitle);
  outlineFigure.setBackgroundColor(new Color(Display.getDefault(),new RGB(130,240,100)));
  outlineFigure.setForegroundColor(new Color(Display.getDefault(),new RGB(205,190,165)));
  outlineFigure.setSize(rectangle.width,preferedSize.height);
  rectFig.setLocation(new Point(location.x,location.y));
  rectFig.setSize(new Dimension(rectangle.width,rectangle.height));
  rectFig.setBackgroundColor(new Color(Display.getDefault(),new RGB(195,240,190)));
  rectFig.setForegroundColor(new Color(Display.getDefault(),new RGB(205,190,165)));
}
Program: 124249
Project: 124249
Buggy source:
/** 
 * DOC hwang JobletContainerFigure constructor comment.
 * @param model
 */
public JobletContainerFigure(final JobletContainer jobletContainer){
  setLayoutManager(new FreeformLayout());
  this.jobletContainer=jobletContainer;
  outlineFigure=new RoundedRectangle();
  rectFig=new RoundedRectangle();
  titleFigure=new SimpleHtmlFigure();
  titleFigure.setOpaque(true);
  collapseFigure=new JobletCollapseFigure();
  collapseFigure.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      doCollapse();
    }
  }
);
  initSubJobTitleColor();
  updateData();
  initializejobletContainer(jobletContainer.getJobletContainerRectangle());
}

Fixed version (ground truth):
/** 
 * DOC hwang JobletContainerFigure constructor comment.
 * @param model
 */
public JobletContainerFigure(final JobletContainer jobletContainer){
  setLayoutManager(new FreeformLayout());
  this.jobletContainer=jobletContainer;
  outlineFigure=new RoundedRectangle();
  rectFig=new RoundedRectangle();
  titleFigure=new SimpleHtmlFigure();
  titleFigure.setOpaque(true);
  collapseFigure=new JobletCollapseFigure();
  collapseFigure.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      doCollapse();
    }
  }
);
  errorFigure=new ImageFigure();
  errorFigure.setImage(ImageProvider.getImage(EImage.ERROR_SMALL));
  errorFigure.setVisible(false);
  errorFigure.setSize(errorFigure.getPreferredSize());
  this.add(errorFigure);
  htmlStatusHint=new SimpleHtmlFigure();
  initSubJobTitleColor();
  updateData();
  initializejobletContainer(jobletContainer.getJobletContainerRectangle());
}
Program: 124250
Project: 124250
Buggy source:
@Override public void paint(Graphics graphics){
  graphics.setAlpha(100);
  super.paint(graphics);
}

Fixed version (ground truth):
@Override public void paint(Graphics graphics){
  if (graphics.getAlpha() != -1) {
    graphics.setAlpha(-1);
  }
  errorFigure.setLocation(jobletContainer.getErrorLocation());
  super.paint(graphics);
}
Program: 124252
Project: 124252
Buggy source:
@Override protected IFigure createFigure(){
  JobletContainerFigure JobletContainerFigure=new JobletContainerFigure((JobletContainer)this.getModel());
  return JobletContainerFigure;
}

Fixed version (ground truth):
@Override protected IFigure createFigure(){
  JobletContainerFigure JobletContainerFigure=new JobletContainerFigure((JobletContainer)this.getModel());
  Node node=((NodeContainer)getModel()).getNode();
  JobletContainerFigure.updateStatus(node.getStatus());
  return JobletContainerFigure;
}
Program: 124253
Project: 124253
Buggy source:
public static List<String> getStatusList(ProblemStatus status,Node element){
  List<String> statusList=new ArrayList<String>();
  for (  Problem problem : problemList.getProblemList()) {
    if (problem.getNodeName() != null && problem.getNodeName().equals(element.getLabel()) && problem.getStatus().equals(status)) {
      statusList.add(problem.getDescription());
    }
  }
  return statusList;
}

Fixed version (ground truth):
public static List<String> getStatusList(ProblemStatus status,Node element){
  List<String> statusList=new ArrayList<String>();
  for (  Problem problem : problemList.getProblemList()) {
    String elementUniqueName=element.getLabel();
    if (element.isJoblet()) {
      elementUniqueName=element.getUniqueName();
    }
    if (problem.getNodeName() != null && problem.getNodeName().equals(elementUniqueName) && problem.getStatus().equals(status)) {
      statusList.add(problem.getDescription());
    }
  }
  return statusList;
}
Program: 124257
Project: 124257
Buggy source:
public void characters(char ch[],int start,int length) throws SAXException {
  String text=new String(ch,start,length);
  if (text.length() <= 0)   return;
  for (  XMLNode node : nodes.getNodesCollection()) {
    if (node.isLooping) {
      if (node.outputText && node.hasValue == false) {
        node.addTextValue(text);
      }
    }
  }
}

Fixed version (ground truth):
public void characters(char ch[],int start,int length) throws SAXException {
  String text=new String(ch,start,length);
  if (text.length() <= 0)   return;
  for (  XMLNode node : nodes.getNodesCollection()) {
    if (node.isLooping) {
      if (node.outputText && node.hasValue == false) {
        if (node.isAsXML && !inCDATA) {
          text=escapeEntityHelper.escapeElementEntities(text);
        }
        node.addTextValue(text);
      }
    }
  }
}
Program: 124259
Project: 124259
Buggy source:
public Object call() throws Exception {
  try {
    DefaultHandler hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    if (fileURL != null) {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new java.io.FileInputStream(fileURL));
      inSource.setEncoding(this.charset);
      saxParser.parse(inSource,hd);
    }
 else {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(is);
      inSource.setEncoding(this.charset);
      saxParser.parse(is,hd);
    }
  }
  finally {
    bcache.notifyErrorOccurred();
  }
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  try {
    DefaultHandler hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    saxParser.setProperty("String_Node_Str",hd);
    if (fileURL != null) {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new java.io.FileInputStream(fileURL));
      inSource.setEncoding(this.charset);
      saxParser.parse(inSource,hd);
    }
 else {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(is);
      inSource.setEncoding(this.charset);
      saxParser.parse(is,hd);
    }
  }
  finally {
    bcache.notifyErrorOccurred();
  }
  return null;
}
Program: 124260
Project: 124260
Buggy source:
private void createTisBlankArea(Composite parent){
  tisBlankCompoiste=toolkit.createComposite(parent);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.heightHint=-20;
  tisBlankCompoiste.setLayoutData(gd);
  tisBlankCompoiste.setVisible(false);
  tisBlankCompoiste.setBackgroundMode(SWT.INHERIT_DEFAULT);
  tisBlankCompoiste.setBackground(parent.getBackground());
}

Fixed version (ground truth):
private void createTisBlankArea(Composite parent){
  tisBlankCompoiste=toolkit.createComposite(parent);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.heightHint=20;
  tisBlankCompoiste.setLayoutData(gd);
  tisBlankCompoiste.setVisible(true);
  tisBlankCompoiste.setBackgroundMode(SWT.INHERIT_DEFAULT);
  tisBlankCompoiste.setBackground(parent.getBackground());
}
Program: 124263
Project: 124263
Buggy source:
private static void copyFileL(String srcFileName,FileInputStream srcInputStream,String desFileName,boolean delSrc) throws Exception {
  File source=new File(srcFileName);
  File dest=new File(desFileName);
  FileChannel in=null, out=null;
  try {
    in=srcInputStream.getChannel();
    out=new FileOutputStream(dest).getChannel();
    long size=in.size();
    long position=0;
    final long MAP_SIZE=102400000;
    MappedByteBuffer buf=null;
    while (true) {
      if (position + MAP_SIZE >= size) {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,size - position);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        break;
      }
 else {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,MAP_SIZE);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        position+=MAP_SIZE;
      }
    }
    in.close();
    out.close();
    if (delSrc) {
      source.delete();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}

Fixed version (ground truth):
private static void copyFileL(String srcFileName,FileInputStream srcInputStream,String desFileName,boolean delSrc) throws Exception {
  File source=new File(srcFileName);
  File dest=new File(desFileName);
  FileChannel in=null, out=null;
  try {
    in=srcInputStream.getChannel();
    out=new FileOutputStream(dest).getChannel();
    long size=in.size();
    long position=0;
    final long MAP_SIZE=33525760;
    MappedByteBuffer buf=null;
    while (true) {
      if (position + MAP_SIZE >= size) {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,size - position);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        break;
      }
 else {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,MAP_SIZE);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        position+=MAP_SIZE;
      }
    }
    in.close();
    out.close();
    if (delSrc) {
      source.delete();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}
Program: 124265
Project: 124265
Buggy source:
private void deleteNoUseTable(){
  if (SQLBuilderRepositoryNodeManager.tList == null) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}

Fixed version (ground truth):
private void deleteNoUseTable(){
  if (SQLBuilderRepositoryNodeManager.tList == null || SQLBuilderRepositoryNodeManager.tList.size() == 0) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}
Program: 124266
Project: 124266
Buggy source:
private static void copyFileL(String srcFileName,FileInputStream srcInputStream,String desFileName,boolean delSrc) throws Exception {
  File source=new File(srcFileName);
  File dest=new File(desFileName);
  FileChannel in=null, out=null;
  try {
    in=srcInputStream.getChannel();
    out=new FileOutputStream(dest).getChannel();
    long size=in.size();
    long position=0;
    final long MAP_SIZE=102400000;
    MappedByteBuffer buf=null;
    while (true) {
      if (position + MAP_SIZE >= size) {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,size - position);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        break;
      }
 else {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,MAP_SIZE);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        position+=MAP_SIZE;
      }
    }
    in.close();
    out.close();
    if (delSrc) {
      source.delete();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}

Fixed version (ground truth):
private static void copyFileL(String srcFileName,FileInputStream srcInputStream,String desFileName,boolean delSrc) throws Exception {
  File source=new File(srcFileName);
  File dest=new File(desFileName);
  FileChannel in=null, out=null;
  try {
    in=srcInputStream.getChannel();
    out=new FileOutputStream(dest).getChannel();
    long size=in.size();
    long position=0;
    final long MAP_SIZE=33525760;
    MappedByteBuffer buf=null;
    while (true) {
      if (position + MAP_SIZE >= size) {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,size - position);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        break;
      }
 else {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,MAP_SIZE);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        position+=MAP_SIZE;
      }
    }
    in.close();
    out.close();
    if (delSrc) {
      source.delete();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}
Program: 124271
Project: 124271
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  try {
    ICoreTisService tisService=(ICoreTisService)GlobalServiceRegister.getDefault().getService(ICoreTisService.class);
    afterUpdate=false;
    if (tisService != null) {
      JSONObject archivaProperties=getArchivaServicesProperties(getAdminURL());
      String archivaServicesURL=archivaProperties.getString(ARCHIVA_SERVICES_URL_KEY) + ARCHIVA_SERVICES_SEGMENT;
      String repository=archivaProperties.getString(ARCHIVA_REPOSITORY_KEY);
      String username=archivaProperties.getString(ARCHIVA_USER);
      String password=archivaProperties.getString(ARCHIVA_USER_PWD);
      List<String> repositories=new ArrayList<String>();
      if (repository != null) {
        repositories.add(repository);
      }
      tisService.downLoadAndInstallUpdateSites(archivaServicesURL,username,password,updateSiteToInstall,repositories);
      afterUpdate=true;
      tisService.setNeedResartAfterUpdate(afterUpdate);
      updateSiteToInstall.clear();
    }
    setStatusArea();
    validateUpdate();
  }
 catch (  Exception e1) {
    ExceptionHandler.process(e1);
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  try {
    ICoreTisService tisService=(ICoreTisService)GlobalServiceRegister.getDefault().getService(ICoreTisService.class);
    afterUpdate=false;
    if (tisService != null) {
      JSONObject archivaProperties=getArchivaServicesProperties(getAdminURL());
      String archivaServicesURL=archivaProperties.getString(ARCHIVA_SERVICES_URL_KEY) + ARCHIVA_SERVICES_SEGMENT;
      String repository=archivaProperties.getString(ARCHIVA_REPOSITORY_KEY);
      String username=archivaProperties.getString(ARCHIVA_USER);
      String password=archivaProperties.getString(ARCHIVA_USER_PWD);
      List<String> repositories=new ArrayList<String>();
      if (repository != null) {
        repositories.add(repository);
      }
      tisService.downLoadAndInstallUpdateSites(archivaServicesURL,username,password,updateSiteToInstall,repositories);
      afterUpdate=true;
      tisService.setNeedResartAfterUpdate(afterUpdate);
      updateSiteToInstall.clear();
    }
    isRestart=true;
    perReader.saveLastConnectionBean(getConnection());
    dialog.okPressed();
  }
 catch (  Exception e1) {
    ExceptionHandler.process(e1);
  }
}
Program: 124272
Project: 124272
Buggy source:
@Override public void run(){
  try {
    TreeNode docRoot=null;
    for (    Object obj : getSelectedObjects()) {
      TreeNodeEditPart nodePart=(TreeNodeEditPart)obj;
      TreeNode treeNode=(TreeNode)nodePart.getModel();
      if (treeNode.eContainer() instanceof TreeNode) {
        TreeNode parent=(TreeNode)treeNode.eContainer();
        if (docRoot == null) {
          docRoot=XmlMapUtil.getTreeNodeRoot(parent);
        }
        XmlMapUtil.detachNodeConnections(treeNode,mapperManager.getCopyOfMapData(),true);
        parent.getChildren().remove(treeNode);
      }
    }
    if (mapperManager != null) {
      if (input) {
        if (docRoot != null && docRoot.eContainer() instanceof InputXmlTree) {
          mapperManager.refreshInputTreeSchemaEditor((InputXmlTree)docRoot.eContainer());
        }
      }
 else {
        if (docRoot != null && docRoot.eContainer() instanceof OutputXmlTree) {
          mapperManager.refreshOutputTreeSchemaEditor((OutputXmlTree)docRoot.eContainer());
        }
      }
      if (docRoot != null && docRoot.eContainer() instanceof AbstractInOutTree) {
        mapperManager.getProblemsAnalyser().checkLoopProblems((AbstractInOutTree)docRoot.eContainer());
        mapperManager.getMapperUI().updateStatusBar();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    TreeNode docRoot=null;
    for (    Object obj : getSelectedObjects()) {
      TreeNodeEditPart nodePart=(TreeNodeEditPart)obj;
      TreeNode treeNode=(TreeNode)nodePart.getModel();
      if (treeNode.eContainer() instanceof TreeNode) {
        TreeNode parent=(TreeNode)treeNode.eContainer();
        if (docRoot == null) {
          docRoot=XmlMapUtil.getTreeNodeRoot(parent);
        }
        XmlMapUtil.detachNodeConnections(treeNode,mapperManager.getCopyOfMapData(),true);
        if (treeNode.isLoop()) {
          if (treeNode instanceof OutputTreeNode && XmlMapUtil.findUpGroupNode((OutputTreeNode)treeNode) != null) {
            XmlMapUtil.cleanSubGroup(docRoot);
          }
          XmlMapUtil.clearMainNode(docRoot);
        }
        parent.getChildren().remove(treeNode);
      }
    }
    if (mapperManager != null) {
      if (input) {
        if (docRoot != null && docRoot.eContainer() instanceof InputXmlTree) {
          mapperManager.refreshInputTreeSchemaEditor((InputXmlTree)docRoot.eContainer());
        }
      }
 else {
        if (docRoot != null && docRoot.eContainer() instanceof OutputXmlTree) {
          mapperManager.refreshOutputTreeSchemaEditor((OutputXmlTree)docRoot.eContainer());
        }
      }
      if (docRoot != null && docRoot.eContainer() instanceof AbstractInOutTree) {
        mapperManager.getProblemsAnalyser().checkLoopProblems((AbstractInOutTree)docRoot.eContainer());
        mapperManager.getMapperUI().updateStatusBar();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 124273
Project: 124273
Buggy source:
@Override public void run(){
  TreeNodeEditPart nodePart=(TreeNodeEditPart)getSelectedObjects().get(0);
  TreeNode model=(TreeNode)nodePart.getModel();
  AbstractInOutTree abstractTree=null;
  TreeNode docRoot=null;
  if (model instanceof OutputTreeNode) {
    OutputTreeNode outputNode=(OutputTreeNode)model;
    docRoot=(OutputTreeNode)XmlMapUtil.getTreeNodeRoot(outputNode);
    if (docRoot != null) {
      cleanSubLoop(docRoot);
      XmlMapUtil.cleanSubGroup(outputNode);
      if (findUpGroupNode(outputNode) == null) {
        XmlMapUtil.cleanSubGroup(docRoot);
      }
      if (docRoot.eContainer() instanceof AbstractInOutTree) {
        abstractTree=(AbstractInOutTree)docRoot.eContainer();
      }
    }
  }
 else   if (model instanceof TreeNode) {
    docRoot=XmlMapUtil.getTreeNodeRoot(model);
    if (docRoot != null) {
      cleanSubLoop(docRoot);
    }
    if (docRoot.eContainer() instanceof AbstractInOutTree) {
      abstractTree=(AbstractInOutTree)docRoot.eContainer();
    }
  }
  model.setLoop(true);
  XmlMapUtil.clearMainNode(docRoot);
  XmlMapUtil.upsetMainNode(model);
  if (abstractTree != null) {
    mapperManager.getProblemsAnalyser().checkLoopProblems(abstractTree);
    mapperManager.getMapperUI().updateStatusBar();
  }
}

Fixed version (ground truth):
@Override public void run(){
  TreeNodeEditPart nodePart=(TreeNodeEditPart)getSelectedObjects().get(0);
  TreeNode model=(TreeNode)nodePart.getModel();
  AbstractInOutTree abstractTree=null;
  TreeNode docRoot=null;
  if (model instanceof OutputTreeNode) {
    OutputTreeNode outputNode=(OutputTreeNode)model;
    docRoot=(OutputTreeNode)XmlMapUtil.getTreeNodeRoot(outputNode);
    if (docRoot != null) {
      cleanSubLoop(docRoot);
      XmlMapUtil.cleanSubGroup(outputNode);
      List<TreeNode> newLoopUpGroups=new ArrayList<TreeNode>();
      findUpGroupNode(newLoopUpGroups,outputNode);
      XmlMapUtil.cleanSubGroup(docRoot,newLoopUpGroups);
      if (!newLoopUpGroups.isEmpty()) {
        TreeNode rootGroup=newLoopUpGroups.get(newLoopUpGroups.size() - 1);
        upsetGroup(outputNode,rootGroup);
      }
      if (docRoot.eContainer() instanceof AbstractInOutTree) {
        abstractTree=(AbstractInOutTree)docRoot.eContainer();
      }
    }
  }
 else   if (model instanceof TreeNode) {
    docRoot=XmlMapUtil.getTreeNodeRoot(model);
    if (docRoot != null) {
      cleanSubLoop(docRoot);
    }
    if (docRoot.eContainer() instanceof AbstractInOutTree) {
      abstractTree=(AbstractInOutTree)docRoot.eContainer();
    }
  }
  model.setLoop(true);
  XmlMapUtil.clearMainNode(docRoot);
  XmlMapUtil.upsetMainNode(model);
  if (abstractTree != null) {
    mapperManager.getProblemsAnalyser().checkLoopProblems(abstractTree);
    mapperManager.getMapperUI().updateStatusBar();
  }
}
Program: 124274
Project: 124274
Buggy source:
private TreeNode findUpGroupNode(OutputTreeNode node){
  if (node.eContainer() instanceof OutputTreeNode) {
    OutputTreeNode parent=(OutputTreeNode)node.eContainer();
    if (parent.isGroup()) {
      return parent;
    }
 else {
      return findUpGroupNode(parent);
    }
  }
  return null;
}

Fixed version (ground truth):
private void findUpGroupNode(List<TreeNode> newLoopUpGroups,OutputTreeNode node){
  if (node.eContainer() instanceof OutputTreeNode) {
    OutputTreeNode parent=(OutputTreeNode)node.eContainer();
    if (parent.isGroup()) {
      newLoopUpGroups.add(parent);
    }
    findUpGroupNode(newLoopUpGroups,parent);
  }
}
Program: 124275
Project: 124275
Buggy source:
public static void cleanSubGroup(TreeNode node){
  for (  TreeNode treeNode : node.getChildren()) {
    TreeNode child=treeNode;
    if (child.isGroup()) {
      child.setGroup(false);
    }
    cleanSubGroup(child);
  }
}

Fixed version (ground truth):
public static void cleanSubGroup(TreeNode node){
  cleanSubGroup(node,null);
}
Program: 124277
Project: 124277
Buggy source:
@Override public void run(){
  OutputTreeNodeEditPart nodePart=(OutputTreeNodeEditPart)getSelectedObjects().get(0);
  OutputTreeNode model=(OutputTreeNode)nodePart.getModel();
  OutputTreeNode outputDocumentRoot=(OutputTreeNode)XmlMapUtil.getTreeNodeRoot(model);
  if (outputDocumentRoot != null) {
    XmlMapUtil.cleanSubGroup(outputDocumentRoot);
  }
  if (!isRemove) {
    model.setGroup(true);
    if (!subGroupTraceNames.isEmpty()) {
      for (      TreeNode groupNode : subGroupTraceNames) {
        groupNode.setGroup(true);
      }
    }
  }
 else {
    model.setMain(false);
    model.setGroup(false);
    if (!subGroupTraceNames.isEmpty()) {
      for (      TreeNode groupNode : subGroupTraceNames) {
        groupNode.setGroup(false);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  OutputTreeNodeEditPart nodePart=(OutputTreeNodeEditPart)getSelectedObjects().get(0);
  OutputTreeNode model=(OutputTreeNode)nodePart.getModel();
  OutputTreeNode outputDocumentRoot=(OutputTreeNode)XmlMapUtil.getTreeNodeRoot(model);
  if (outputDocumentRoot != null) {
    XmlMapUtil.cleanSubGroup(outputDocumentRoot);
  }
  if (!isRemove) {
    model.setGroup(true);
    if (!subGroupTraceNames.isEmpty()) {
      for (      TreeNode groupNode : subGroupTraceNames) {
        groupNode.setGroup(true);
      }
    }
  }
 else {
    model.setGroup(false);
    if (!subGroupTraceNames.isEmpty()) {
      for (      TreeNode groupNode : subGroupTraceNames) {
        groupNode.setGroup(false);
      }
    }
  }
}
Program: 124278
Project: 124278
Buggy source:
@Override public void run(){
  TreeNodeEditPart nodePart=(TreeNodeEditPart)getSelectedObjects().get(0);
  TreeNode model=(TreeNode)nodePart.getModel();
  AbstractInOutTree abstractTree=null;
  if (model instanceof OutputTreeNode) {
    OutputTreeNode outputNode=(OutputTreeNode)model;
    OutputTreeNode outputDocumentRoot=(OutputTreeNode)XmlMapUtil.getTreeNodeRoot(outputNode);
    if (outputDocumentRoot != null) {
      cleanSubLoop(outputDocumentRoot);
      XmlMapUtil.cleanSubGroup(outputNode);
      if (findUpGroupNode(outputNode) == null) {
        XmlMapUtil.cleanSubGroup(outputDocumentRoot);
      }
      if (outputDocumentRoot.eContainer() instanceof AbstractInOutTree) {
        abstractTree=(AbstractInOutTree)outputDocumentRoot.eContainer();
      }
    }
  }
 else   if (model instanceof TreeNode) {
    TreeNode inputDocumentRoot=XmlMapUtil.getTreeNodeRoot(model);
    if (inputDocumentRoot != null) {
      cleanSubLoop(inputDocumentRoot);
    }
    if (inputDocumentRoot.eContainer() instanceof AbstractInOutTree) {
      abstractTree=(AbstractInOutTree)inputDocumentRoot.eContainer();
    }
  }
  model.setLoop(true);
  if (abstractTree != null) {
    mapperManager.getProblemsAnalyser().checkLoopProblems(abstractTree);
    mapperManager.getMapperUI().updateStatusBar();
  }
}

Fixed version (ground truth):
@Override public void run(){
  TreeNodeEditPart nodePart=(TreeNodeEditPart)getSelectedObjects().get(0);
  TreeNode model=(TreeNode)nodePart.getModel();
  AbstractInOutTree abstractTree=null;
  TreeNode docRoot=null;
  if (model instanceof OutputTreeNode) {
    OutputTreeNode outputNode=(OutputTreeNode)model;
    docRoot=(OutputTreeNode)XmlMapUtil.getTreeNodeRoot(outputNode);
    if (docRoot != null) {
      cleanSubLoop(docRoot);
      XmlMapUtil.cleanSubGroup(outputNode);
      if (findUpGroupNode(outputNode) == null) {
        XmlMapUtil.cleanSubGroup(docRoot);
      }
      if (docRoot.eContainer() instanceof AbstractInOutTree) {
        abstractTree=(AbstractInOutTree)docRoot.eContainer();
      }
    }
  }
 else   if (model instanceof TreeNode) {
    docRoot=XmlMapUtil.getTreeNodeRoot(model);
    if (docRoot != null) {
      cleanSubLoop(docRoot);
    }
    if (docRoot.eContainer() instanceof AbstractInOutTree) {
      abstractTree=(AbstractInOutTree)docRoot.eContainer();
    }
  }
  model.setLoop(true);
  XmlMapUtil.clearMainNode(docRoot);
  XmlMapUtil.upsetMainNode(model);
  if (abstractTree != null) {
    mapperManager.getProblemsAnalyser().checkLoopProblems(abstractTree);
    mapperManager.getMapperUI().updateStatusBar();
  }
}
Program: 124279
Project: 124279
Buggy source:
public static void cleanSubGroup(OutputTreeNode node){
  for (  TreeNode treeNode : node.getChildren()) {
    OutputTreeNode outputNode=(OutputTreeNode)treeNode;
    if (outputNode.isGroup()) {
      outputNode.setGroup(false);
    }
    cleanSubGroup(outputNode);
  }
}

Fixed version (ground truth):
public static void cleanSubGroup(TreeNode node){
  for (  TreeNode treeNode : node.getChildren()) {
    TreeNode child=treeNode;
    if (child.isGroup()) {
      child.setGroup(false);
    }
    cleanSubGroup(child);
  }
}
Program: 124290
Project: 124290
Buggy source:
/** 
 * create parameters for tabbed page 'Job Settings'.
 */
protected void createJobSettingsParameters(){
  JobSettingsManager.createJobSettingsParemeters(this);
}

Fixed version (ground truth):
/** 
 * create parameters for tabbed page 'Job Settings'.
 */
protected void createJobSettingsParameters(){
  ((List<IElementParameter>)this.getElementParameters()).addAll(JobSettingsManager.getJobSettingsParameters(this));
}