nus-yam/ex-repair huggingface dataset:
Program: 121729
Project: 121729
Buggy source:
public void joinReadNextBuffer() throws IOException {
  moveTailToHead();
  int readCount=0;
  int maxReadLength=buffer.length - count;
  try {
    readCount=inputStream.read(buffer,count,maxReadLength);
  }
 catch (  IOException ex) {
    close();
    throw ex;
  }
  if (debug) {
    System.out.println("String_Node_Str" + maxReadLength + "String_Node_Str"+ readCount);
    System.out.println(streamBuffer);
  }
  if (readCount < maxReadLength) {
    if (readCount == -1) {
      streamEndMeet=true;
    }
  }
  if (readCount > -1) {
    count+=readCount;
    lastIndexToRead=count - maxLimit;
  }
}

Fixed version (ground truth):
public void joinReadNextBuffer() throws IOException {
  moveTailToHead();
  int readCount=0;
  int maxReadLength=buffer.length - count;
  try {
    readCount=inputStream.read(buffer,count,maxReadLength);
  }
 catch (  IOException ex) {
    close();
    throw ex;
  }
  if (debug) {
    System.out.println("String_Node_Str" + maxReadLength + "String_Node_Str"+ readCount);
    System.out.println(streamBuffer);
  }
  if (readCount < maxReadLength) {
    if (readCount == -1) {
      streamEndMeet=true;
    }
 else {
      if (inputStream.markSupported()) {
        inputStream.mark(1);
        if (inputStream.read() == -1) {
          streamEndMeet=true;
        }
        inputStream.reset();
      }
    }
  }
  if (readCount > -1) {
    count+=readCount;
    lastIndexToRead=count - maxLimit;
  }
}
Program: 121730
Project: 121730
Buggy source:
public void joinReadNextBuffer() throws IOException {
  moveTailToHead();
  int readCount=0;
  int maxReadLength=buffer.length - count;
  try {
    readCount=inputStream.read(buffer,count,maxReadLength);
  }
 catch (  IOException ex) {
    close();
    throw ex;
  }
  if (debug) {
    System.out.println("String_Node_Str" + maxReadLength + "String_Node_Str"+ readCount);
    System.out.println(streamBuffer);
  }
  if (readCount < maxReadLength) {
    if (readCount == -1) {
      streamEndMeet=true;
    }
  }
  if (readCount > -1) {
    count+=readCount;
    lastIndexToRead=count - maxLimit;
  }
}

Fixed version (ground truth):
public void joinReadNextBuffer() throws IOException {
  moveTailToHead();
  int readCount=0;
  int maxReadLength=buffer.length - count;
  try {
    readCount=inputStream.read(buffer,count,maxReadLength);
  }
 catch (  IOException ex) {
    close();
    throw ex;
  }
  if (debug) {
    System.out.println("String_Node_Str" + maxReadLength + "String_Node_Str"+ readCount);
    System.out.println(streamBuffer);
  }
  if (readCount < maxReadLength) {
    if (readCount == -1) {
      streamEndMeet=true;
    }
 else {
      if (inputStream.markSupported()) {
        inputStream.mark(1);
        if (inputStream.read() == -1) {
          streamEndMeet=true;
        }
        inputStream.reset();
      }
    }
  }
  if (readCount > -1) {
    count+=readCount;
    lastIndexToRead=count - maxLimit;
  }
}
Program: 121731
Project: 121731
Buggy source:
private void addDataNode(INode dataNode){
  if (dataNode != null) {
    String addedUniqueName=dataNode.getUniqueName();
    boolean found=false;
    for (    INode node : getNodeList()) {
      String uniqueName=node.getUniqueName();
      if (addedUniqueName.equals(uniqueName)) {
        found=true;
      }
    }
    if (!found) {
      getNodeList().add(dataNode);
    }
  }
}

Fixed version (ground truth):
private INode addDataNode(INode dataNode){
  if (dataNode != null) {
    String addedUniqueName=dataNode.getUniqueName();
    for (    INode node : getNodeList()) {
      String uniqueName=node.getUniqueName();
      if (addedUniqueName.equals(uniqueName)) {
        return node;
      }
    }
    getNodeList().add(dataNode);
  }
  return dataNode;
}
Program: 121732
Project: 121732
Buggy source:
@Override public Point getReferencePoint(){
  Point ref=null;
  final VarTablePart varTablePart=(VarTablePart)MapperUtils.getMapperTablePart(entityManager.getEditPart());
  if (entityManager.isTableMinimized()) {
    if (isSource) {
      ref=varTablePart.getFigure().getBounds().getRight();
    }
 else {
      ref=varTablePart.getFigure().getBounds().getLeft();
    }
  }
 else   if (getOwner() instanceof TableTreeEntityFigure) {
    TableTreeEntityFigure nodeFigure=(TableTreeEntityFigure)getOwner();
    if (nodeFigure.getTreeBranch() == null) {
      if (isSource) {
        ref=getOwner().getBounds().getRight();
      }
 else {
        if (nodeFigure.getElement() != null) {
          ref=nodeFigure.getElement().getBounds().getLeft();
        }
 else {
          ref=getOwner().getBounds().getLeft();
        }
      }
      getOwner().translateToAbsolute(ref);
    }
  }
 else   if (getOwner() instanceof VarEntityFigure) {
    VarEntityFigure varNodeFigure=(VarEntityFigure)getOwner();
    if (isSource) {
      ref=getOwner().getBounds().getRight();
    }
 else {
      if (varNodeFigure.getExpression() != null) {
        ref=varNodeFigure.getExpression().getBounds().getLeft();
      }
 else {
        ref=getOwner().getBounds().getLeft();
      }
    }
    getOwner().translateToAbsolute(ref);
  }
 else {
    ref=getOwner().getBounds().getCenter();
    getOwner().translateToAbsolute(ref);
  }
  return ref;
}

Fixed version (ground truth):
@Override public Point getReferencePoint(){
  Point ref=null;
  final VarTablePart varTablePart=(VarTablePart)MapperUtils.getMapperTablePart(entityManager.getEditPart());
  if (entityManager.isTableMinimized()) {
    if (isSource) {
      ref=varTablePart.getFigure().getBounds().getRight();
    }
 else {
      ref=varTablePart.getFigure().getBounds().getLeft();
    }
  }
 else   if (getOwner() instanceof TableTreeEntityFigure) {
    TableTreeEntityFigure nodeFigure=(TableTreeEntityFigure)getOwner();
    if (nodeFigure.getTreeBranch() == null) {
      if (isSource) {
        ref=getOwner().getBounds().getRight();
      }
 else {
        if (nodeFigure.getElement() != null) {
          ref=nodeFigure.getElement().getBounds().getLeft();
        }
 else {
          ref=getOwner().getBounds().getLeft();
        }
      }
      getOwner().translateToAbsolute(ref);
    }
  }
 else   if (getOwner() instanceof VarEntityFigure) {
    VarEntityFigure varNodeFigure=(VarEntityFigure)getOwner();
    if (isSource) {
      ref=getOwner().getBounds().getRight();
      ref.x=varTablePart.getFigure().getBounds().getRight().x;
    }
 else {
      if (varNodeFigure.getExpression() != null) {
        ref=varNodeFigure.getExpression().getBounds().getLeft();
      }
 else {
        ref=getOwner().getBounds().getLeft();
      }
    }
    getOwner().translateToAbsolute(ref);
  }
 else {
    ref=getOwner().getBounds().getCenter();
    getOwner().translateToAbsolute(ref);
  }
  return ref;
}
Program: 121734
Project: 121734
Buggy source:
@Override public void mousePressed(MouseEvent me){
  boolean isCheck=checkImage.getImage().equals(ImageProvider.getImage(EImage.CHECKED_ICON)) ? true : false;
  setNullable(isCheck);
  checkImage.setBackgroundColor(ColorConstants.buttonDarkest);
}

Fixed version (ground truth):
@Override public void mousePressed(MouseEvent me){
  boolean isCheck=checkImage.getImage().equals(ImageProvider.getImage(EImage.CHECKED_ICON)) ? false : true;
  setNullable(isCheck);
  checkImage.setBackgroundColor(ColorConstants.buttonDarkest);
}
Program: 121735
Project: 121735
Buggy source:
protected Figure createVariableContainer(){
  Figure container=new Figure();
  container.setBorder(new RowBorder());
  ToolbarLayout manager=new ToolbarLayout(){
    @Override public void layout(    IFigure parent){
      super.layout(parent);
      List children=parent.getChildren();
      if (children.size() == 2) {
        Figure checkImageFigure=(Figure)children.get(0);
        Figure variableFigure=(Figure)children.get(1);
        Rectangle varFigureBounds=variableFigure.getBounds().getCopy();
        int avialableWith=parent.getBounds().width - checkImageFigure.getBounds().width;
        if (avialableWith > varFigureBounds.width) {
          varFigureBounds.width=avialableWith;
        }
        variableFigure.setBounds(varFigureBounds);
      }
    }
  }
;
  manager.setVertical(false);
  manager.setStretchMinorAxis(false);
  container.setLayoutManager(manager);
  Label nullableToolTip=new Label("String_Node_Str");
  if (!isNullable()) {
    checkImage=new ImageFigure(ImageProvider.getImage(EImage.UNCHECKED_ICON));
  }
 else {
    checkImage=new ImageFigure(ImageProvider.getImage(EImage.CHECKED_ICON));
  }
  checkImage.setToolTip(nullableToolTip);
  variableLabel=new VarNodeTextLabel();
  variableLabel.setText(getVarName());
  variableLabel.setLabelAlignment(PositionConstants.LEFT);
  variableLabel.setBorder(new MarginBorder(2,5,2,-1));
  container.add(checkImage);
  container.add(variableLabel);
  addCheckListener();
  return container;
}

Fixed version (ground truth):
protected Figure createVariableContainer(){
  Figure container=new Figure();
  ToolbarLayout manager=new ToolbarLayout(){
    @Override public void layout(    IFigure parent){
      super.layout(parent);
      List children=parent.getChildren();
      if (children.size() == 2) {
        Figure checkImageFigure=(Figure)children.get(0);
        Figure variableFigure=(Figure)children.get(1);
        Rectangle varFigureBounds=variableFigure.getBounds().getCopy();
        int avialableWith=parent.getBounds().width - checkImageFigure.getBounds().width;
        if (avialableWith > varFigureBounds.width) {
          varFigureBounds.width=avialableWith;
        }
        variableFigure.setBounds(varFigureBounds);
      }
    }
  }
;
  manager.setVertical(false);
  manager.setStretchMinorAxis(false);
  container.setLayoutManager(manager);
  Label nullableToolTip=new Label("String_Node_Str");
  if (!isNullable()) {
    checkImage=new ImageFigure(ImageProvider.getImage(EImage.UNCHECKED_ICON));
  }
 else {
    checkImage=new ImageFigure(ImageProvider.getImage(EImage.CHECKED_ICON));
  }
  checkImage.setToolTip(nullableToolTip);
  variableLabel=new VarNodeTextLabel();
  variableLabel.setText(getVarName());
  variableLabel.setLabelAlignment(PositionConstants.LEFT);
  variableLabel.setBorder(new MarginBorder(2,5,2,-1));
  container.add(checkImage);
  container.add(variableLabel);
  addCheckListener();
  return container;
}
Program: 121736
Project: 121736
Buggy source:
private void addCheckListener(){
  checkImage.addMouseListener(new MouseListener(){
    @Override public void mouseReleased(    MouseEvent me){
      checkImage.setBackgroundColor(ColorConstants.button);
    }
    @Override public void mousePressed(    MouseEvent me){
      boolean isCheck=checkImage.getImage().equals(ImageProvider.getImage(EImage.CHECKED_ICON)) ? true : false;
      setNullable(isCheck);
      checkImage.setBackgroundColor(ColorConstants.buttonDarkest);
    }
    @Override public void mouseDoubleClicked(    MouseEvent me){
    }
  }
);
}

Fixed version (ground truth):
private void addCheckListener(){
  checkImage.addMouseListener(new MouseListener(){
    @Override public void mouseReleased(    MouseEvent me){
      checkImage.setBackgroundColor(ColorConstants.button);
    }
    @Override public void mousePressed(    MouseEvent me){
      boolean isCheck=checkImage.getImage().equals(ImageProvider.getImage(EImage.CHECKED_ICON)) ? false : true;
      setNullable(isCheck);
      checkImage.setBackgroundColor(ColorConstants.buttonDarkest);
    }
    @Override public void mouseDoubleClicked(    MouseEvent me){
    }
  }
);
}
Program: 121737
Project: 121737
Buggy source:
@Override public IFigure getFigure(){
  PolylineConnection figure=(PolylineConnection)super.getFigure();
  if (cr != null) {
    cr.setOffset(calculateConnOffset());
  }
  return figure;
}

Fixed version (ground truth):
@Override public IFigure getFigure(){
  PolylineConnection figure=(PolylineConnection)super.getFigure();
  if (getTarget() instanceof OutputTablePart) {
    if (curvrRouter == null) {
      curvrRouter=new CurveConnectionRouter();
      figure.setConnectionRouter(curvrRouter);
    }
  }
 else   if (getTarget() instanceof InputTablePart) {
    if (cr == null) {
      cr=new LookupConnectionRouter();
      figure.setConnectionRouter(cr);
    }
  }
  if (cr != null) {
    cr.setOffset(calculateConnOffset());
  }
  return figure;
}
Program: 121738
Project: 121738
Buggy source:
@Override protected IFigure createFigure(){
  PolylineConnection connection=new PolylineConnection();
  connection.setTargetDecoration(new PolygonDecoration());
  connection.setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_UNSELECTED_FILTER_LINK));
  connection.setLineWidth(2);
  if (getTarget() instanceof OutputTablePart) {
    if (curvrRouter == null) {
      curvrRouter=new CurveConnectionRouter();
      connection.setConnectionRouter(curvrRouter);
    }
  }
 else   if (getTarget() instanceof InputTablePart) {
    if (cr == null) {
      cr=new LookupConnectionRouter();
      connection.setConnectionRouter(cr);
    }
  }
  return connection;
}

Fixed version (ground truth):
@Override protected IFigure createFigure(){
  PolylineConnection connection=new PolylineConnection();
  connection.setTargetDecoration(new PolygonDecoration());
  connection.setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_UNSELECTED_FILTER_LINK));
  connection.setLineWidth(2);
  return connection;
}
Program: 121739
Project: 121739
Buggy source:
public void updateForegroundColor(boolean selected){
  if (selected) {
    getFigure().setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_SELECTED_LOOKUP_LINKS));
  }
 else {
    getFigure().setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_UNSELECTED_LOOKUP_LINKS));
  }
}

Fixed version (ground truth):
@Override public void updateForegroundColor(boolean selected){
  if (selected) {
    getFigure().setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_SELECTED_LOOKUP_LINKS));
  }
 else {
    getFigure().setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_UNSELECTED_LOOKUP_LINKS));
  }
}
Program: 121741
Project: 121741
Buggy source:
public void joinReadNextBuffer() throws IOException {
  moveTailToHead();
  int readCount=0;
  int maxReadLength=buffer.length - count;
  try {
    readCount=inputStream.read(buffer,count,maxReadLength);
  }
 catch (  IOException ex) {
    close();
    throw ex;
  }
  if (debug) {
    System.out.println("String_Node_Str" + maxReadLength + "String_Node_Str"+ readCount);
    System.out.println(streamBuffer);
  }
  if (readCount < maxReadLength) {
    if (readCount == -1) {
      streamEndMeet=true;
    }
  }
  if (readCount > -1) {
    count+=readCount;
    lastIndexToRead=count - maxLimit;
  }
}

Fixed version (ground truth):
public void joinReadNextBuffer() throws IOException {
  moveTailToHead();
  int readCount=0;
  int maxReadLength=buffer.length - count;
  try {
    readCount=inputStream.read(buffer,count,maxReadLength);
  }
 catch (  IOException ex) {
    close();
    throw ex;
  }
  if (debug) {
    System.out.println("String_Node_Str" + maxReadLength + "String_Node_Str"+ readCount);
    System.out.println(streamBuffer);
  }
  if (readCount < maxReadLength) {
    if (readCount == -1) {
      streamEndMeet=true;
    }
 else {
      if (inputStream.markSupported()) {
        inputStream.mark(1);
        if (inputStream.read() == -1) {
          streamEndMeet=true;
        }
        inputStream.reset();
      }
    }
  }
  if (readCount > -1) {
    count+=readCount;
    lastIndexToRead=count - maxLimit;
  }
}
Program: 121744
Project: 121744
Buggy source:
private void addDataNode(INode dataNode){
  if (dataNode != null) {
    String addedUniqueName=dataNode.getUniqueName();
    boolean found=false;
    for (    INode node : getNodeList()) {
      String uniqueName=node.getUniqueName();
      if (addedUniqueName.equals(uniqueName)) {
        found=true;
      }
    }
    if (!found) {
      getNodeList().add(dataNode);
    }
  }
}

Fixed version (ground truth):
private INode addDataNode(INode dataNode){
  if (dataNode != null) {
    String addedUniqueName=dataNode.getUniqueName();
    for (    INode node : getNodeList()) {
      String uniqueName=node.getUniqueName();
      if (addedUniqueName.equals(uniqueName)) {
        return node;
      }
    }
    getNodeList().add(dataNode);
  }
  return dataNode;
}
Program: 121745
Project: 121745
Buggy source:
@Override protected void createColumns(){
  TableColumn column=new TableColumn(ColumnKeyConstant.KEY_EXPRESSION);
  column.setText("String_Node_Str");
  addColumn(column);
  layoutManager.setWeight(0,0.333333);
  ColumnSash sash=new ColumnSash(this);
  sash.setLeftColumn(column);
  addSeparator(sash);
  column=new TableColumn(ColumnKeyConstant.KEY_TYPE);
  column.setText("String_Node_Str");
  sash.setRightColumn(column);
  addColumn(column);
  layoutManager.setWeight(1,0.333333);
  sash=new ColumnSash(this);
  sash.setLeftColumn(column);
  addSeparator(sash);
  column=new TableColumn(ColumnKeyConstant.KEY_VARIABLE);
  column.setText("String_Node_Str");
  sash.setRightColumn(column);
  addColumn(column);
  layoutManager.setWeight(2,0.333333);
}

Fixed version (ground truth):
@Override protected void createColumns(){
  TableColumn column=new TableColumn(ColumnKeyConstant.KEY_EXPRESSION);
  column.setText("String_Node_Str");
  addColumn(column);
  ColumnSash sash=new ColumnSash(this);
  sash.setLeftColumn(column);
  addSeparator(sash);
  column=new TableColumn(ColumnKeyConstant.KEY_TYPE);
  column.setText("String_Node_Str");
  sash.setRightColumn(column);
  addColumn(column);
  sash=new ColumnSash(this);
  sash.setLeftColumn(column);
  addSeparator(sash);
  column=new TableColumn(ColumnKeyConstant.KEY_VARIABLE);
  column.setText("String_Node_Str");
  sash.setRightColumn(column);
  addColumn(column);
}
Program: 121746
Project: 121746
Buggy source:
@Override protected void createColumns(){
  MapperTable xmlTree=tableModelManager.getModel();
  boolean hasExpression=false;
  if (xmlTree instanceof InputXmlTree) {
    InputXmlTree inputTree=(InputXmlTree)xmlTree;
    if (inputTree.isLookup()) {
      expressionColumn=new TableColumn(ColumnKeyConstant.KEY_EXPRESSION);
      expressionColumn.setText("String_Node_Str");
      this.addColumn(expressionColumn);
      columnSash=new ColumnSash(this);
      columnSash.setLeftColumn(expressionColumn);
      this.addSeparator(columnSash);
      hasExpression=true;
    }
  }
 else {
    expressionColumn=new TableColumn(ColumnKeyConstant.KEY_EXPRESSION);
    expressionColumn.setText("String_Node_Str");
    this.addColumn(expressionColumn);
    columnSash=new ColumnSash(this);
    columnSash.setLeftColumn(expressionColumn);
    this.addSeparator(columnSash);
    hasExpression=true;
  }
  nameColumn=new TableColumn(ColumnKeyConstant.KEY_NAME);
  nameColumn.setText("String_Node_Str");
  if (columnSash != null) {
    columnSash.setRightColumn(nameColumn);
  }
  this.addColumn(nameColumn);
  if (hasExpression) {
    layoutManager.setWeight(0,0.5);
  }
}

Fixed version (ground truth):
@Override protected void createColumns(){
  layoutManager.setAjustToTableWidth(false);
  MapperTable xmlTree=tableModelManager.getModel();
  boolean hasExpression=false;
  if (xmlTree instanceof InputXmlTree) {
    InputXmlTree inputTree=(InputXmlTree)xmlTree;
    if (inputTree.isLookup()) {
      expressionColumn=new TableColumn(ColumnKeyConstant.KEY_EXPRESSION);
      expressionColumn.setText("String_Node_Str");
      this.addColumn(expressionColumn);
      columnSash=new ColumnSash(this);
      columnSash.setLeftColumn(expressionColumn);
      this.addSeparator(columnSash);
      hasExpression=true;
    }
  }
 else {
    expressionColumn=new TableColumn(ColumnKeyConstant.KEY_EXPRESSION);
    expressionColumn.setText("String_Node_Str");
    this.addColumn(expressionColumn);
    columnSash=new ColumnSash(this);
    columnSash.setLeftColumn(expressionColumn);
    this.addSeparator(columnSash);
    hasExpression=true;
  }
  nameColumn=new TableColumn(ColumnKeyConstant.KEY_NAME);
  nameColumn.setText("String_Node_Str");
  if (columnSash != null) {
    columnSash.setRightColumn(nameColumn);
  }
  this.addColumn(nameColumn);
  if (hasExpression) {
    layoutManager.setWeight(0,0.5);
  }
}
Program: 121758
Project: 121758
Buggy source:
/** 
 * Remove a connection output.
 * @param connection
 */
@Override public void removeOutput(final IConnection connection){
  if (connection instanceof Connection) {
    int order=getOrder(connection);
    if (order != -1) {
      ((Connection)connection).setOrder(order);
    }
  }
  this.outputs.remove(connection);
  ((Connection)connection).updateAllId();
  removeTargetMetaData(connection);
  fireStructureChange(OUTPUTS,connection);
}

Fixed version (ground truth):
/** 
 * Remove a connection output.
 * @param connection
 */
@Override public void removeOutput(final IConnection connection){
  if (connection instanceof Connection) {
    int order=getOrder(connection);
    if (order != -1) {
      ((Connection)connection).setOrder(order);
    }
  }
  this.outputs.remove(connection);
  ((Connection)connection).updateAllId();
  removeSourceMatadata(connection);
  removeTargetMetaData(connection);
  fireStructureChange(OUTPUTS,connection);
}
Program: 121759
Project: 121759
Buggy source:
protected void resetTopLevelNode(RepositoryNode topLevelNode){
  super.resetTopLevelNode(topLevelNode);
  if (topLevelNode != null) {
    IRepositoryNode generatedNode=topLevelNode.getRoot().getRootRepositoryNode(ERepositoryObjectType.GENERATED);
    if (generatedNode != null) {
      if (!topLevelNode.getChildren().contains(topLevelNode)) {
        topLevelNode.getChildren().add(generatedNode);
      }
      IRepositoryNode clearJobs=generatedNode.getRoot().getRootRepositoryNode(ERepositoryObjectType.JOBS);
      IRepositoryNode clearJoblets=generatedNode.getRoot().getRootRepositoryNode(ERepositoryObjectType.JOBLETS);
      if (clearJobs != null) {
        clearJobs.getChildren().clear();
      }
      if (clearJoblets != null) {
        clearJoblets.getChildren().clear();
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void resetTopLevelNode(RepositoryNode topLevelNode){
  super.resetTopLevelNode(topLevelNode);
  if (topLevelNode != null) {
    IRepositoryNode generatedNode=topLevelNode.getRoot().getRootRepositoryNode(ERepositoryObjectType.GENERATED);
    if (generatedNode != null) {
      if (!topLevelNode.getChildren().contains(generatedNode)) {
        topLevelNode.getChildren().add(generatedNode);
      }
      IRepositoryNode clearJobs=generatedNode.getRoot().getRootRepositoryNode(ERepositoryObjectType.JOBS);
      IRepositoryNode clearJoblets=generatedNode.getRoot().getRootRepositoryNode(ERepositoryObjectType.JOBLETS);
      if (clearJobs != null) {
        clearJobs.getChildren().clear();
      }
      if (clearJoblets != null) {
        clearJoblets.getChildren().clear();
      }
    }
  }
}
Program: 121760
Project: 121760
Buggy source:
/** 
 * Remove a connection output.
 * @param connection
 */
@Override public void removeOutput(final IConnection connection){
  if (connection instanceof Connection) {
    int order=getOrder(connection);
    if (order != -1) {
      ((Connection)connection).setOrder(order);
    }
  }
  this.outputs.remove(connection);
  ((Connection)connection).updateAllId();
  removeTargetMetaData(connection);
  fireStructureChange(OUTPUTS,connection);
}

Fixed version (ground truth):
/** 
 * Remove a connection output.
 * @param connection
 */
@Override public void removeOutput(final IConnection connection){
  if (connection instanceof Connection) {
    int order=getOrder(connection);
    if (order != -1) {
      ((Connection)connection).setOrder(order);
    }
  }
  this.outputs.remove(connection);
  ((Connection)connection).updateAllId();
  removeSourceMatadata(connection);
  removeTargetMetaData(connection);
  fireStructureChange(OUTPUTS,connection);
}
Program: 121763
Project: 121763
Buggy source:
private void reSelection(){
  if (jobletContainer.isCollapsed()) {
    IProcess2 process=jobletContainer.getProcess();
    AbstractMultiPageTalendEditor editor=(AbstractMultiPageTalendEditor)process.getEditor();
    Node startNode=jobletContainer.getJobletStartNode();
    if (startNode != null && editor != null) {
      editor.selectNode(startNode);
    }
  }
 else {
    if (!jobletContainer.getNode().isActivate()) {
      if (jobletContainer.getNode().getIncomingConnections() != null && jobletContainer.getNode().getIncomingConnections().size() > 0 && (jobletContainer.getNode().getOutgoingConnections() == null || jobletContainer.getNode().getOutgoingConnections().size() == 0)) {
        for (int i=0; i < jobletContainer.getNode().getIncomingConnections().size(); i++) {
          jobletContainer.getNode().getIncomingConnections().get(i).setPropertyValue(EParameterName.ACTIVATE.getName(),jobletContainer.getNode().isActivate());
        }
      }
    }
  }
}

Fixed version (ground truth):
private void reSelection(){
  if (jobletContainer.isCollapsed()) {
    IProcess2 process=jobletContainer.getProcess();
    AbstractMultiPageTalendEditor editor=(AbstractMultiPageTalendEditor)process.getEditor();
    Node startNode=jobletContainer.getJobletStartNode();
    if (startNode != null && editor != null) {
      editor.selectNode(startNode);
    }
  }
}
Program: 121766
Project: 121766
Buggy source:
private MetadataTable getMetadataTable(String[] entitiesName){
  MetadataTable table=new MetadataTable();
  for (int i=0; i < entitiesName.length; i++) {
    MetadataColumn column=new MetadataColumn();
    column.setLabel(entitiesName[i]);
    table.getListColumns().add(column);
  }
  return table;
}

Fixed version (ground truth):
private MetadataTable getMetadataTable(String[] entitiesName){
  MetadataTable table=new MetadataTable();
  for (  String element : entitiesName) {
    MetadataColumn column=new MetadataColumn();
    column.setLabel(element);
    table.getListColumns().add(column);
  }
  return table;
}
Program: 121767
Project: 121767
Buggy source:
private IConnection mockConnection(String schemaName,String tableName){
  Connection connection=mock(Connection.class);
  Node node=mock(Node.class);
  ElementParameter param=new ElementParameter(node);
  param.setName("String_Node_Str");
  param.setValue(schemaName);
  when(node.getElementParameter("String_Node_Str")).thenReturn(param);
  param=new ElementParameter(node);
  param.setName("String_Node_Str");
  param.setValue(tableName);
  when(node.getElementParameter("String_Node_Str")).thenReturn(param);
  when(connection.getName()).thenReturn(schemaName + "String_Node_Str" + tableName);
  when(connection.getSource()).thenReturn(node);
  return connection;
}

Fixed version (ground truth):
private IConnection mockConnection(String schemaName,String tableName,String[] columns){
  Connection connection=mock(Connection.class);
  Node node=mock(Node.class);
  ElementParameter param=new ElementParameter(node);
  param.setName("String_Node_Str");
  param.setValue(schemaName);
  when(node.getElementParameter("String_Node_Str")).thenReturn(param);
  param=new ElementParameter(node);
  param.setName("String_Node_Str");
  param.setValue(tableName);
  when(node.getElementParameter("String_Node_Str")).thenReturn(param);
  when(connection.getName()).thenReturn(schemaName + "String_Node_Str" + tableName);
  when(connection.getSource()).thenReturn(node);
  IMetadataTable table=new MetadataTable();
  table.setLabel(tableName);
  table.setTableName(tableName);
  List<IMetadataColumn> listColumns=new ArrayList<IMetadataColumn>();
  for (  String columnName : columns) {
    IMetadataColumn column=new MetadataColumn();
    column.setLabel(columnName);
    column.setOriginalDbColumnName(columnName);
    listColumns.add(column);
  }
  table.setListColumns(listColumns);
  when(connection.getMetadataTable()).thenReturn(table);
  return connection;
}
Program: 121770
Project: 121770
Buggy source:
private void addDataNode(INode dataNode){
  if (dataNode != null) {
    String addedUniqueName=dataNode.getUniqueName();
    boolean found=false;
    for (    INode node : getNodeList()) {
      String uniqueName=node.getUniqueName();
      if (addedUniqueName.equals(uniqueName)) {
        found=true;
      }
    }
    if (!found) {
      getNodeList().add(dataNode);
    }
  }
}

Fixed version (ground truth):
private INode addDataNode(INode dataNode){
  if (dataNode != null) {
    String addedUniqueName=dataNode.getUniqueName();
    for (    INode node : getNodeList()) {
      String uniqueName=node.getUniqueName();
      if (addedUniqueName.equals(uniqueName)) {
        return node;
      }
    }
    getNodeList().add(dataNode);
  }
  return dataNode;
}
Program: 121773
Project: 121773
Buggy source:
public void dragStart(DragSourceEvent event){
  Object template=getTemplate(event);
  TemplateTransfer.getInstance().setTemplate(template);
}

Fixed version (ground truth):
@Override public void dragStart(DragSourceEvent event){
  Object template=getTemplate(event);
  TemplateTransfer.getInstance().setTemplate(template);
}
Program: 121774
Project: 121774
Buggy source:
public void dragSetData(DragSourceEvent event){
  event.data=getTemplate(event);
}

Fixed version (ground truth):
@Override public void dragSetData(DragSourceEvent event){
  event.data=getTemplate(event);
}
Program: 121775
Project: 121775
Buggy source:
protected boolean handleButtonUp(int button){
  if (isInState(STATE_DRAG)) {
    performSelection();
    if (hasSelectionOccurred())     performDirectEdit();
    if (button == 1 && getSourceEditPart().getSelected() != EditPart.SELECTED_NONE)     getCurrentViewer().reveal(getSourceEditPart());
    setState(STATE_TERMINAL);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean handleButtonUp(int button){
  if (isInState(STATE_DRAG)) {
    performSelection();
    if (hasSelectionOccurred()) {
      performDirectEdit();
    }
    if (button == 1 && getSourceEditPart().getSelected() != EditPart.SELECTED_NONE) {
      getCurrentViewer().reveal(getSourceEditPart());
    }
    setState(STATE_TERMINAL);
    return true;
  }
  return false;
}
Program: 121776
Project: 121776
Buggy source:
@Override protected void performSelection(){
  if (hasSelectionOccurred())   return;
  setFlag(FLAG_SELECTION_PERFORMED,true);
  EditPartViewer viewer=getCurrentViewer();
  List selectedObjects=viewer.getSelectedEditParts();
  if (getCurrentInput().isModKeyDown(SWT.MOD1)) {
    lastSelectedShiftPart=null;
    if (selectedObjects.contains(getSourceEditPart()))     viewer.deselect(getSourceEditPart());
 else     viewer.appendSelection(getSourceEditPart());
  }
 else   if (getCurrentInput().isShiftKeyDown()) {
    if (lastSelectedShiftPart == null) {
      if (!selectedObjects.isEmpty()) {
        Object object=selectedObjects.get(selectedObjects.size() - 1);
        if (object instanceof TreeNodeEditPart) {
          lastSelectedShiftPart=(EditPart)object;
        }
      }
 else {
        lastSelectedShiftPart=getSourceEditPart();
      }
    }
    List<EditPart> toselect=new ArrayList<EditPart>();
    List<EditPart> deSelect=new ArrayList<EditPart>();
    getShiftAffactedEditPart(toselect,deSelect);
    for (    EditPart part : deSelect) {
      viewer.deselect(part);
    }
    for (    EditPart part : toselect) {
      if (!viewer.getSelectedEditParts().contains(part)) {
        viewer.appendSelection(part);
      }
    }
  }
 else {
    lastSelectedShiftPart=null;
    viewer.select(getSourceEditPart());
  }
}

Fixed version (ground truth):
@Override protected void performSelection(){
  if (hasSelectionOccurred()) {
    return;
  }
  setFlag(FLAG_SELECTION_PERFORMED,true);
  EditPartViewer viewer=getCurrentViewer();
  List selectedObjects=viewer.getSelectedEditParts();
  if (getCurrentInput().isModKeyDown(SWT.MOD1)) {
    lastSelectedShiftPart=null;
    if (selectedObjects.contains(getSourceEditPart())) {
      viewer.deselect(getSourceEditPart());
    }
 else     if (canAppend()) {
      viewer.appendSelection(getSourceEditPart());
    }
 else {
      viewer.select(getSourceEditPart());
    }
  }
 else   if (getCurrentInput().isShiftKeyDown()) {
    if (lastSelectedShiftPart == null) {
      if (!selectedObjects.isEmpty()) {
        Object object=selectedObjects.get(selectedObjects.size() - 1);
        if (object instanceof TreeNodeEditPart || object instanceof VarNodeEditPart) {
          lastSelectedShiftPart=(EditPart)object;
        }
      }
 else {
        lastSelectedShiftPart=getSourceEditPart();
      }
    }
    if (canAppend()) {
      List<EditPart> toselect=new ArrayList<EditPart>();
      List<EditPart> deSelect=new ArrayList<EditPart>();
      getShiftAffactedEditPart(toselect,deSelect);
      for (      EditPart part : deSelect) {
        viewer.deselect(part);
      }
      for (      EditPart part : toselect) {
        if (!viewer.getSelectedEditParts().contains(part)) {
          viewer.appendSelection(part);
        }
      }
    }
 else {
      viewer.select(getSourceEditPart());
    }
  }
 else {
    lastSelectedShiftPart=null;
    viewer.select(getSourceEditPart());
  }
}
Program: 121777
Project: 121777
Buggy source:
private void getShiftAffactedEditPart(List toSelect,List deSelect){
  if (lastSelectedShiftPart == null || lastSelectedShiftPart == getSourceEditPart()) {
    toSelect.add(getSourceEditPart());
    return;
  }
  if (lastSelectedShiftPart instanceof TreeNodeEditPart) {
    AbstractInOutTreeEditPart treePart=getTreeNodeNodePart((TreeNodeEditPart)lastSelectedShiftPart);
    if (treePart != null) {
      List<TreeNodeEditPart> partList=new ArrayList<TreeNodeEditPart>();
      getChildNodeList(partList,treePart.getChildren());
      int index=partList.indexOf(lastSelectedShiftPart);
      int index2=partList.indexOf(getSourceEditPart());
      if (index2 != -1) {
        for (int i=Math.min(index,index2); i < Math.max(index,index2) + 1; i++) {
          if (!toSelect.contains(partList.get(i))) {
            toSelect.add(partList.get(i));
          }
        }
        List selectedEditParts=getCurrentViewer().getSelectedEditParts();
        for (int i=0; i < selectedEditParts.size(); i++) {
          if (partList.contains(selectedEditParts.get(i)) && !toSelect.contains(selectedEditParts.get(i))) {
            deSelect.add(selectedEditParts.get(i));
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void getShiftAffactedEditPart(List toSelect,List deSelect){
  if (lastSelectedShiftPart == null || lastSelectedShiftPart == getSourceEditPart()) {
    toSelect.add(getSourceEditPart());
    return;
  }
  List<EditPart> partList=new ArrayList<EditPart>();
  if (lastSelectedShiftPart instanceof TreeNodeEditPart) {
    AbstractInOutTreeEditPart treePart=XmlMapUtil.getAbstractInOutTreePart((TreeNodeEditPart)lastSelectedShiftPart);
    if (treePart != null) {
      partList=XmlMapUtil.getFlatChildrenPartList(treePart);
    }
  }
 else   if (lastSelectedShiftPart instanceof VarNodeEditPart) {
    partList.addAll(lastSelectedShiftPart.getParent().getChildren());
  }
  int index=partList.indexOf(lastSelectedShiftPart);
  int index2=partList.indexOf(getSourceEditPart());
  if (index2 != -1) {
    for (int i=Math.min(index,index2); i < Math.max(index,index2) + 1; i++) {
      if (!toSelect.contains(partList.get(i))) {
        toSelect.add(partList.get(i));
      }
    }
    List selectedEditParts=getCurrentViewer().getSelectedEditParts();
    for (int i=0; i < selectedEditParts.size(); i++) {
      if (partList.contains(selectedEditParts.get(i)) && !toSelect.contains(selectedEditParts.get(i))) {
        deSelect.add(selectedEditParts.get(i));
      }
    }
  }
}
Program: 121778
Project: 121778
Buggy source:
protected void performDirectEdit(){
  DirectEditRequest req=new DirectEditRequest();
  req.setLocation(getCurrentInput().getMouseLocation());
  new XmlDelayedDirectEditHelper(getSourceEditPart().getViewer(),req,getSourceEditPart());
}

Fixed version (ground truth):
@Override protected void performDirectEdit(){
  DirectEditRequest req=new DirectEditRequest();
  req.setLocation(getCurrentInput().getMouseLocation());
  new XmlDelayedDirectEditHelper(getSourceEditPart().getViewer(),req,getSourceEditPart());
}
Program: 121779
Project: 121779
Buggy source:
public void mouseReleased(MouseEvent me){
}

Fixed version (ground truth):
@Override public void mouseReleased(MouseEvent me){
}
Program: 121780
Project: 121780
Buggy source:
public void mouseDoubleClicked(MouseEvent me){
}

Fixed version (ground truth):
@Override public void mouseDoubleClicked(MouseEvent me){
}
Program: 121782
Project: 121782
Buggy source:
public void update(int type){
switch (type) {
case XmlmapPackage.INPUT_XML_TREE__LOOKUP_MODE:
    lookupModel.setText(getLookupDisplayName(inputxmlTree.getLookupMode()));
  break;
case XmlmapPackage.INPUT_XML_TREE__MATCHING_MODE:
matchModel.setText(getMatchModelDisplayName(inputxmlTree.getMatchingMode()));
break;
case XmlmapPackage.INPUT_XML_TREE__INNER_JOIN:
joinModel.setText(String.valueOf(inputxmlTree.isInnerJoin()));
break;
case XmlmapPackage.INPUT_XML_TREE__PERSISTENT:
persistentModel.setText(String.valueOf(inputxmlTree.isPersistent()));
default :
break;
}
}

Fixed version (ground truth):
@Override public void update(int type){
switch (type) {
case XmlmapPackage.INPUT_XML_TREE__LOOKUP_MODE:
    lookupModel.setText(getLookupDisplayName(inputxmlTree.getLookupMode()));
  break;
case XmlmapPackage.INPUT_XML_TREE__MATCHING_MODE:
matchModel.setText(getMatchModelDisplayName(inputxmlTree.getMatchingMode()));
break;
case XmlmapPackage.INPUT_XML_TREE__INNER_JOIN:
joinModel.setText(String.valueOf(inputxmlTree.isInnerJoin()));
break;
case XmlmapPackage.INPUT_XML_TREE__PERSISTENT:
persistentModel.setText(String.valueOf(inputxmlTree.isPersistent()));
default :
break;
}
}
Program: 121783
Project: 121783
Buggy source:
public void mousePressed(MouseEvent me){
  boolean lookup=lookupModelRow.containsPoint(me.x,me.y);
  if (lookup) {
    if (selectedFigure != lookupModelRow) {
      lookupModelRow.setOpaque(true);
      lookupModelRow.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_SELECTION));
      matchModelRow.setOpaque(false);
      joinModelRow.setOpaque(false);
    }
    return;
  }
  boolean matchModel=matchModelRow.containsPoint(me.x,me.y);
  if (matchModel) {
    if (selectedFigure != matchModelRow) {
      matchModelRow.setOpaque(true);
      matchModelRow.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_SELECTION));
      lookupModelRow.setOpaque(false);
      joinModelRow.setOpaque(false);
    }
    return;
  }
  boolean joinModel=joinModelRow.containsPoint(me.x,me.y);
  if (joinModel) {
    if (selectedFigure != joinModelRow) {
      joinModelRow.setOpaque(true);
      joinModelRow.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_SELECTION));
      lookupModelRow.setOpaque(false);
      matchModelRow.setOpaque(false);
    }
    return;
  }
}

Fixed version (ground truth):
@Override public void mousePressed(MouseEvent me){
  boolean lookup=lookupModelRow.containsPoint(me.x,me.y);
  if (lookup) {
    if (selectedFigure != lookupModelRow) {
      lookupModelRow.setOpaque(true);
      lookupModelRow.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_COLUMN_TREE_SETTING));
      matchModelRow.setOpaque(false);
      joinModelRow.setOpaque(false);
    }
    return;
  }
  boolean matchModel=matchModelRow.containsPoint(me.x,me.y);
  if (matchModel) {
    if (selectedFigure != matchModelRow) {
      matchModelRow.setOpaque(true);
      matchModelRow.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_COLUMN_TREE_SETTING));
      lookupModelRow.setOpaque(false);
      joinModelRow.setOpaque(false);
    }
    return;
  }
  boolean joinModel=joinModelRow.containsPoint(me.x,me.y);
  if (joinModel) {
    if (selectedFigure != joinModelRow) {
      joinModelRow.setOpaque(true);
      joinModelRow.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_COLUMN_TREE_SETTING));
      lookupModelRow.setOpaque(false);
      matchModelRow.setOpaque(false);
    }
    return;
  }
}
Program: 121786
Project: 121786
Buggy source:
private void reSelection(){
  if (jobletContainer.isCollapsed()) {
    IProcess2 process=jobletContainer.getProcess();
    AbstractMultiPageTalendEditor editor=(AbstractMultiPageTalendEditor)process.getEditor();
    Node startNode=jobletContainer.getJobletStartNode();
    if (startNode != null && editor != null) {
      editor.selectNode(startNode);
    }
  }
 else {
    if (!jobletContainer.getNode().isActivate()) {
      if (jobletContainer.getNode().getIncomingConnections() != null && jobletContainer.getNode().getIncomingConnections().size() > 0 && (jobletContainer.getNode().getOutgoingConnections() == null || jobletContainer.getNode().getOutgoingConnections().size() == 0)) {
        for (int i=0; i < jobletContainer.getNode().getIncomingConnections().size(); i++) {
          jobletContainer.getNode().getIncomingConnections().get(i).setPropertyValue(EParameterName.ACTIVATE.getName(),jobletContainer.getNode().isActivate());
        }
      }
    }
  }
}

Fixed version (ground truth):
private void reSelection(){
  if (jobletContainer.isCollapsed()) {
    IProcess2 process=jobletContainer.getProcess();
    AbstractMultiPageTalendEditor editor=(AbstractMultiPageTalendEditor)process.getEditor();
    Node startNode=jobletContainer.getJobletStartNode();
    if (startNode != null && editor != null) {
      editor.selectNode(startNode);
    }
  }
}
Program: 121788
Project: 121788
Buggy source:
protected void adaptWidgetToReadOnly(){
  this.clearTextAction.setEnabled(!isReadOnly());
  this.saveSQLAction.setEnabled(!isReadOnly());
  this.openFileAction.setEnabled(!isReadOnly());
  this.guiModificationQueryAction.setEnabled(!isReadOnly());
  this.contextModeAction.setEnabled(!isReadOnly());
}

Fixed version (ground truth):
protected void adaptWidgetToReadOnly(){
  this.clearTextAction.setEnabled(!isReadOnly());
  this.openFileAction.setEnabled(!isReadOnly());
  this.guiModificationQueryAction.setEnabled(!isReadOnly());
  this.contextModeAction.setEnabled(!isReadOnly());
}
Program: 121790
Project: 121790
Buggy source:
@Override public void partOpened(IWorkbenchPart part){
  IProcess2 process=getProcess();
  ((Process)process).setEditor(AbstractMultiPageTalendEditor.this);
}

Fixed version (ground truth):
@Override public void partOpened(IWorkbenchPart part){
  if (part == AbstractMultiPageTalendEditor.this) {
    IProcess2 process=getProcess();
    ((Process)process).setEditor(AbstractMultiPageTalendEditor.this);
  }
}
Program: 121791
Project: 121791
Buggy source:
protected void adaptWidgetToReadOnly(){
  this.clearTextAction.setEnabled(!isReadOnly());
  this.saveSQLAction.setEnabled(!isReadOnly());
  this.openFileAction.setEnabled(!isReadOnly());
  this.guiModificationQueryAction.setEnabled(!isReadOnly());
  this.contextModeAction.setEnabled(!isReadOnly());
}

Fixed version (ground truth):
protected void adaptWidgetToReadOnly(){
  this.clearTextAction.setEnabled(!isReadOnly());
  this.openFileAction.setEnabled(!isReadOnly());
  this.guiModificationQueryAction.setEnabled(!isReadOnly());
  this.contextModeAction.setEnabled(!isReadOnly());
}
Program: 121793
Project: 121793
Buggy source:
private String initFileContent(XmlFileConnection connection) throws IOException {
  byte[] bytes=connection.getFileContent();
  Project project=ProjectManager.getInstance().getCurrentProject();
  IProject fsProject=null;
  try {
    fsProject=ResourceUtils.getProject(project.getTechnicalLabel());
  }
 catch (  PersistenceException e2) {
    ExceptionHandler.process(e2);
  }
  if (fsProject == null) {
    return null;
  }
  String temPath=fsProject.getLocationURI().getPath() + File.separator + "String_Node_Str";
  String fileName="String_Node_Str";
  String pathStr=connection.getXmlFilePath();
  if (connection.isContextMode()) {
    ContextType contextType=ConnectionContextHelper.getContextTypeForContextMode(connection,true);
    pathStr=TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType,pathStr));
  }
  if (pathStr != null && XmlUtil.isXMLFile(pathStr)) {
    fileName=StringUtil.TMP_XML_FILE;
  }
 else   if (pathStr != null && XmlUtil.isXSDFile(pathStr)) {
    fileName=StringUtil.TMP_XSD_FILE;
  }
 else   if (pathStr.contains("String_Node_Str")) {
    fileName=new Path(pathStr).lastSegment();
  }
  File temfile=new File(temPath + File.separator + fileName);
  if (!temfile.exists()) {
    temfile.createNewFile();
  }
  FileOutputStream outStream;
  outStream=new FileOutputStream(temfile);
  outStream.write(bytes);
  outStream.close();
  return temfile.getPath();
}

Fixed version (ground truth):
private String initFileContent(XmlFileConnection connection) throws IOException {
  byte[] bytes=connection.getFileContent();
  Project project=ProjectManager.getInstance().getCurrentProject();
  IProject fsProject=null;
  try {
    fsProject=ResourceUtils.getProject(project.getTechnicalLabel());
  }
 catch (  PersistenceException e2) {
    ExceptionHandler.process(e2);
  }
  if (fsProject == null) {
    return null;
  }
  String temPath=fsProject.getLocationURI().getPath() + File.separator + "String_Node_Str";
  String fileName="String_Node_Str";
  String pathStr=connection.getXmlFilePath();
  if (connection.isContextMode()) {
    ContextType contextType=ConnectionContextHelper.getContextTypeForContextMode(connection,true);
    pathStr=TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType,pathStr));
  }
  if (pathStr != null && XmlUtil.isXMLFile(pathStr)) {
    fileName=StringUtil.TMP_XML_FILE;
  }
 else   if (pathStr != null && XmlUtil.isXSDFile(pathStr)) {
    fileName=StringUtil.TMP_XSD_FILE;
  }
 else   if (pathStr.contains("String_Node_Str")) {
    fileName=new Path(pathStr).lastSegment();
  }
 else {
    return null;
  }
  File temfile=new File(temPath + File.separator + fileName);
  if (!temfile.exists()) {
    temfile.createNewFile();
  }
  FileOutputStream outStream;
  outStream=new FileOutputStream(temfile);
  outStream.write(bytes);
  outStream.close();
  return temfile.getPath();
}
Program: 121796
Project: 121796
Buggy source:
private void reSelection(){
  if (jobletContainer.isCollapsed()) {
    IProcess2 process=jobletContainer.getProcess();
    AbstractMultiPageTalendEditor editor=(AbstractMultiPageTalendEditor)process.getEditor();
    Node startNode=jobletContainer.getJobletStartNode();
    if (startNode != null && editor != null) {
      editor.selectNode(startNode);
    }
  }
}

Fixed version (ground truth):
private void reSelection(){
  if (jobletContainer.isCollapsed()) {
    IProcess2 process=jobletContainer.getProcess();
    AbstractMultiPageTalendEditor editor=(AbstractMultiPageTalendEditor)process.getEditor();
    Node startNode=jobletContainer.getJobletStartNode();
    if (startNode != null && editor != null) {
      editor.selectNode(startNode);
    }
  }
 else {
    if (!jobletContainer.getNode().isActivate()) {
      if (jobletContainer.getNode().getIncomingConnections() != null && jobletContainer.getNode().getIncomingConnections().size() > 0 && (jobletContainer.getNode().getOutgoingConnections() == null || jobletContainer.getNode().getOutgoingConnections().size() == 0)) {
        for (int i=0; i < jobletContainer.getNode().getIncomingConnections().size(); i++) {
          jobletContainer.getNode().getIncomingConnections().get(i).setPropertyValue(EParameterName.ACTIVATE.getName(),jobletContainer.getNode().isActivate());
        }
      }
    }
  }
}