nus-yam/ex-repair huggingface dataset:
Program: 121346
Project: 121346
Buggy source:
@SuppressWarnings("String_Node_Str") private List<UpdateResult> checkNodesParameters(EUpdateItemType type,boolean onlySimpleShow){
  List<UpdateResult> nodesResults=new ArrayList<UpdateResult>();
  IProcess2 process=getProcess();
  if (ComponentCategory.CATEGORY_4_MAPREDUCE.getName().equals(process.getComponentsType())) {
  }
 else {
    for (    Node node : (List<Node>)getProcess().getGraphicalNodes()) {
switch (type) {
case NODE_SCHEMA:
        nodesResults.addAll(checkNodeSchemaFromRepository(node,onlySimpleShow));
      break;
case NODE_PROPERTY:
    nodesResults.addAll(checkNodePropertiesFromRepository(node,onlySimpleShow));
  break;
case NODE_QUERY:
nodesResults.addAll(checkNodeQueryFromRepository(node,onlySimpleShow));
case NODE_SAP_FUNCTION:
nodesResults.addAll(checkNodeSAPFunctionFromRepository(node,onlySimpleShow));
break;
case NODE_SAP_IDOC:
nodesResults.addAll(checkNodeSAPIDocFromRepository(node,onlySimpleShow));
break;
case NODE_VALIDATION_RULE:
nodesResults.addAll(checkNodeValidationRuleFromRepository(node,onlySimpleShow));
break;
default :
return Collections.emptyList();
}
}
}
getSchemaRenamedMap().clear();
return nodesResults;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private List<UpdateResult> checkNodesParameters(EUpdateItemType type,boolean onlySimpleShow){
  List<UpdateResult> nodesResults=new ArrayList<UpdateResult>();
  for (  Node node : (List<Node>)getProcess().getGraphicalNodes()) {
switch (type) {
case NODE_SCHEMA:
      nodesResults.addAll(checkNodeSchemaFromRepository(node,onlySimpleShow));
    break;
case NODE_PROPERTY:
  nodesResults.addAll(checkNodePropertiesFromRepository(node,onlySimpleShow));
break;
case NODE_QUERY:
nodesResults.addAll(checkNodeQueryFromRepository(node,onlySimpleShow));
break;
case NODE_SAP_FUNCTION:
nodesResults.addAll(checkNodeSAPFunctionFromRepository(node,onlySimpleShow));
break;
case NODE_SAP_IDOC:
nodesResults.addAll(checkNodeSAPIDocFromRepository(node,onlySimpleShow));
break;
case NODE_VALIDATION_RULE:
nodesResults.addAll(checkNodeValidationRuleFromRepository(node,onlySimpleShow));
break;
default :
return Collections.emptyList();
}
}
getSchemaRenamedMap().clear();
return nodesResults;
}
Program: 121347
Project: 121347
Buggy source:
protected void addButtonListener(){
  IService expressionBuilderDialogService=GlobalServiceRegister.getDefault().getService(IExpressionBuilderDialogService.class);
  final IExpressionBuilderDialogController dialog=((IExpressionBuilderDialogService)expressionBuilderDialogService).getExpressionBuilderInstance(parent,null,null);
  button.addMouseListener(new MouseListener(){
    @Override public void mousePressed(    MouseEvent me){
      if (dialog instanceof TrayDialog) {
        TrayDialog parentDialog=(TrayDialog)dialog;
        dialog.setDefaultExpression(tableManager.getExpressionFilter());
        if (Window.OK == parentDialog.open()) {
          String expressionForTable=dialog.getExpressionForTable();
          tableManager.setExpressionFilter(expressionForTable);
          tableManager.getEditPart().getViewer().getEditDomain().getCommandStack().execute(getFilterChangeCommand(tableManager.getModel(),expressionForTable));
        }
      }
    }
    @Override public void mouseReleased(    MouseEvent me){
    }
    @Override public void mouseDoubleClicked(    MouseEvent me){
    }
  }
);
}

Fixed version (ground truth):
protected abstract void addButtonListener();
Program: 121354
Project: 121354
Buggy source:
/** 
 * Sets the parameters, name node uri and job tracker uri, for connection parameters. Added by Marvin Wang on Jan 8, 2013.
 * @param element
 */
private void setSpecialParamsForHiveEmbedded(IElement element){
  String nameNodeURI=getValueFromRepositoryName(element,EParameterNameForComponent.PARA_NAME_FS_DEFAULT_NAME.getName());
  connParameters.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_NAME_NODE_URL,nameNodeURI);
  String jobTrackerURI=getValueFromRepositoryName(element,EParameterNameForComponent.PARA_NAME_MAPRED_JT.getName());
  connParameters.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_JOB_TRACKER_URL,jobTrackerURI);
}

Fixed version (ground truth):
/** 
 * Sets the parameters, name node uri and job tracker uri, for connection parameters. Added by Marvin Wang on Jan 8, 2013.
 * @param element
 */
private void setSpecialParamsForHiveEmbedded(IElement element){
  String distroKey=getValueFromRepositoryName(elem,"String_Node_Str");
  connParameters.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION,distroKey);
  String distroVersion=getValueFromRepositoryName(elem,"String_Node_Str");
  connParameters.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION,distroVersion);
  String hiveModel=getValueFromRepositoryName(elem,"String_Node_Str");
  connParameters.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE,hiveModel);
  String nameNodeURI=getValueFromRepositoryName(element,EParameterNameForComponent.PARA_NAME_FS_DEFAULT_NAME.getName());
  connParameters.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_NAME_NODE_URL,nameNodeURI);
  String jobTrackerURI=getValueFromRepositoryName(element,EParameterNameForComponent.PARA_NAME_MAPRED_JT.getName());
  connParameters.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_JOB_TRACKER_URL,jobTrackerURI);
}
Program: 121358
Project: 121358
Buggy source:
public void waitForEndOfQueue(){
  try {
synchronized (startedBulkloadCount) {
      while (startedBulkloadCount.get() > 0) {
        System.out.println(startedBulkloadCount.get() + "String_Node_Str");
        startedBulkloadCount.wait();
      }
    }
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void waitForEndOfQueue(){
  try {
synchronized (startedBulkloadCount) {
      while (startedBulkloadCount.get() > 0) {
        startedBulkloadCount.wait();
      }
    }
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
}
Program: 121359
Project: 121359
Buggy source:
@Override public int available() throws IOException {
  return 4096;
}

Fixed version (ground truth):
@Override public int available() throws IOException {
  if (currentStream != null) {
    return currentStream.available();
  }
  moveToNextInputStream();
  if (currentStream != null) {
    return currentStream.available();
  }
  return 4096;
}
Program: 121360
Project: 121360
Buggy source:
private void moveToNextInputStream() throws IOException {
  throwLastFailure();
  while (inputStreamBuffer.isEmpty() && !isClosed) {
synchronized (readLock) {
      try {
        debug("String_Node_Str");
        readLock.wait();
        debug("String_Node_Str");
      }
 catch (      InterruptedException e) {
        throw new RuntimeException(e);
      }
    }
  }
  if (!inputStreamBuffer.isEmpty()) {
    if (currentStream != null) {
      currentStream.close();
    }
    currentStream=inputStreamBuffer.poll();
  }
 else {
    currentStream=null;
    hasFinishedRead=true;
  }
  debug("String_Node_Str" + inputStreamBuffer.size());
}

Fixed version (ground truth):
private void moveToNextInputStream() throws IOException {
  if (hasFinishedRead.get() && isClosed) {
    return;
  }
  throwLastFailure();
  while (!warmUpStrategy.isReady(this) || (inputStreamBuffer.isEmpty() && !isClosed)) {
synchronized (consumerMonitor) {
      try {
        debug("String_Node_Str" + warmUpStrategy.isReady(this) + "String_Node_Str");
        consumerMonitor.wait(1000);
        debug("String_Node_Str");
      }
 catch (      InterruptedException e) {
        throw new RuntimeException(e);
      }
      if (isClosed) {
        break;
      }
    }
  }
  if (!inputStreamBuffer.isEmpty()) {
    if (currentStream != null) {
      currentStream.close();
    }
    currentStream=inputStreamBuffer.poll();
  }
 else {
    currentStream=null;
    hasFinishedRead.set(true);
  }
synchronized (producerMonitor) {
    producerMonitor.notifyAll();
  }
  debug("String_Node_Str" + inputStreamBuffer.size());
}
Program: 121361
Project: 121361
Buggy source:
/** 
 * <p> Close this stream and perform some checks: <ul> <li>Mark this stream as closed (no more calls to   {@link #push(java.io.InputStream)} are allowed)</li> <li>Closes any remaining stream pushed to this stream</li> </ul></p> <p> Calling this method wakes up any thread blocked on  {@link #read()} </p> <p> Wait till all streams pushedto this stream (and stored in <code>inputStreamBuffer</code>) are processed by a reader. </p> <p> When this method exits, the buffer is empty and the last stream in buffer is fully read (i.e. until read() returns -1). </p>
 * @throws IOException In case at least one stream in buffer hasn't been read.
 * @see java.io.InputStream#close()
 */
@Override public void close() throws IOException {
  super.close();
  isClosed=true;
synchronized (readLock) {
    readLock.notifyAll();
  }
  debug("String_Node_Str" + +inputStreamBuffer.size());
  debug("String_Node_Str" + hasFinishedRead);
  debug("String_Node_Str" + (!inputStreamBuffer.isEmpty() && !hasFinishedRead));
  while (!inputStreamBuffer.isEmpty() && !hasFinishedRead) {
    try {
      debug("String_Node_Str" + inputStreamBuffer.size() + "String_Node_Str");
synchronized (exhaustLock) {
        exhaustLock.wait();
      }
      throwLastFailure();
      debug("String_Node_Str");
    }
 catch (    InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
  throwLastFailure();
  debug("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * <p> Close this stream and perform some checks: <ul> <li>Mark this stream as closed (no more calls to   {@link #push(java.io.InputStream)} are allowed)</li> <li>Closes any remaining stream pushed to this stream</li> </ul></p> <p> Calling this method wakes up any thread blocked on  {@link #read()} </p> <p> Wait till all streams pushedto this stream (and stored in <code>inputStreamBuffer</code>) are processed by a reader. </p> <p> When this method exits, the buffer is empty and the last stream in buffer is fully read (i.e. until read() returns -1). </p>
 * @throws IOException In case at least one stream in buffer hasn't been read.
 * @see java.io.InputStream#close()
 */
@Override public void close() throws IOException {
  super.close();
  isClosed=true;
  warmUpStrategy=NoWarmUpStrategy.INSTANCE;
synchronized (consumerMonitor) {
    consumerMonitor.notifyAll();
  }
  debug("String_Node_Str" + inputStreamBuffer.size());
  debug("String_Node_Str" + hasFinishedRead);
  while (!inputStreamBuffer.isEmpty() && !hasFinishedRead.get()) {
    try {
      debug("String_Node_Str" + inputStreamBuffer.size() + "String_Node_Str");
synchronized (exhaustLock) {
        exhaustLock.wait(1000);
      }
      throwLastFailure();
      debug("String_Node_Str");
    }
 catch (    InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
  throwLastFailure();
  debug("String_Node_Str");
}
Program: 121362
Project: 121362
Buggy source:
public void push(InputStream inputStream) throws IOException {
  if (inputStream == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (isClosed) {
    throw new IOException("String_Node_Str");
  }
  inputStreamBuffer.add(inputStream);
  debug("String_Node_Str" + inputStreamBuffer.size() + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * "Push" new content to consumers: publish to this input stream readers new content to be read from <code>inputStream</code> parameter. This
 * @param inputStream New content for producers
 * @throws IOException If this input stream was closed.
 * @throws IllegalArgumentException If <code>inputStream</code> is <code>null</code>.
 * @see #close()
 */
public void push(InputStream inputStream) throws IOException {
  if (inputStream == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (isClosed) {
    throw new IOException("String_Node_Str");
  }
  while (!inputStreamBuffer.offer(inputStream)) {
    debug("String_Node_Str" + inputStreamBuffer.size() + "String_Node_Str");
synchronized (consumerMonitor) {
      consumerMonitor.notifyAll();
    }
    if (!inputStreamBuffer.offer(inputStream)) {
synchronized (producerMonitor) {
        try {
          producerMonitor.wait();
        }
 catch (        InterruptedException e) {
          throw new RuntimeException(e);
        }
      }
    }
    debug("String_Node_Str");
  }
  debug("String_Node_Str" + inputStreamBuffer.size() + "String_Node_Str");
}
Program: 121365
Project: 121365
Buggy source:
public boolean useData(String name){
  if (super.useData(name)) {
    return true;
  }
  if (hasOrRenameData(name,null,false)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean useData(String name){
  if (super.useData(name)) {
    return true;
  }
  if (hasOrRenameData(name,null,false)) {
    return true;
  }
  return false;
}
Program: 121366
Project: 121366
Buggy source:
public void renameData(String oldName,String newName){
  super.renameData(oldName,newName);
  hasOrRenameData(oldName,newName,true);
}

Fixed version (ground truth):
@Override public void renameData(String oldName,String newName){
  super.renameData(oldName,newName);
  hasOrRenameData(oldName,newName,true);
}
Program: 121367
Project: 121367
Buggy source:
public void initialize(){
  initElementParameters();
}

Fixed version (ground truth):
@Override public void initialize(){
  initElementParameters();
}
Program: 121369
Project: 121369
Buggy source:
public static void setupTMap(Node node){
  if (!GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMapperService.class)) {
    return;
  }
  IDesignerMapperService service=(IDesignerMapperService)GlobalServiceRegister.getDefault().getService(IDesignerMapperService.class);
  IConnection inputConnection=node.getIncomingConnections().get(0);
  IConnection outputConnection=node.getOutgoingConnections().get(0);
  outputConnection.getMetadataTable().setListColumns(inputConnection.getMetadataTable().clone(false).getListColumns());
  ((Process)node.getProcess()).checkProcess();
  service.createAutoMappedNode(node,inputConnection,outputConnection);
}

Fixed version (ground truth):
public static void setupTMap(Node node){
  if (!GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMapperService.class)) {
    return;
  }
  IConnection inputConnection=node.getIncomingConnections().get(0);
  IConnection outputConnection=node.getOutgoingConnections().get(0);
  outputConnection.getMetadataTable().setListColumns(inputConnection.getMetadataTable().clone(false).getListColumns());
  ((Process)node.getProcess()).checkProcess();
  if ("String_Node_Str".equals(node.getComponent().getName())) {
    IDesignerMapperService service=(IDesignerMapperService)GlobalServiceRegister.getDefault().getService(IDesignerMapperService.class);
    service.createAutoMappedNode(node,inputConnection,outputConnection);
  }
}
Program: 121371
Project: 121371
Buggy source:
@Override public ExecutionResult execute(Item item){
  ProcessType processType=getProcessType(item);
  if (processType == null) {
    return ExecutionResult.NOTHING_TO_DO;
  }
  String[] componentsName=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  try {
    for (    String element : componentsName) {
      IComponentFilter filter=new NameComponentFilter(element);
      ModifyComponentsAction.searchAndModify(item,processType,filter,Arrays.<IComponentConversion>asList(new IComponentConversion(){
        @Override public void transform(        NodeType node){
          String[] params={"String_Node_Str","String_Node_Str","String_Node_Str"};
          ElementParameterType ept=null;
          for (          String param : params) {
            ept=ComponentUtilities.getNodeProperty(node,param);
            if (ept != null) {
              setValue(node,ept,param);
              break;
            }
          }
        }
      }
));
    }
    return ExecutionResult.SUCCESS_NO_ALERT;
  }
 catch (  java.lang.Exception e) {
    ExceptionHandler.process(e);
    return ExecutionResult.FAILURE;
  }
}

Fixed version (ground truth):
@Override public ExecutionResult execute(Item item){
  ProcessType processType=getProcessType(item);
  if (processType == null) {
    return ExecutionResult.NOTHING_TO_DO;
  }
  String[] componentsName=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  try {
    for (    String element : componentsName) {
      IComponentFilter filter=new NameComponentFilter(element);
      ModifyComponentsAction.searchAndModify(item,processType,filter,Arrays.<IComponentConversion>asList(new IComponentConversion(){
        @Override public void transform(        NodeType node){
          String[] params={"String_Node_Str","String_Node_Str","String_Node_Str"};
          ElementParameterType ept=null;
          for (          String param : params) {
            ept=ComponentUtilities.getNodeProperty(node,param);
            if (ept != null) {
              setValue(node,ept,param);
              break;
            }
          }
        }
      }
));
    }
    return ExecutionResult.SUCCESS_NO_ALERT;
  }
 catch (  java.lang.Exception e) {
    ExceptionHandler.process(e);
    return ExecutionResult.FAILURE;
  }
}
Program: 121376
Project: 121376
Buggy source:
@Override protected boolean calculateEnabled(){
  List parts=getSelectedObjects();
  if (parts.isEmpty()) {
    return false;
  }
  if (parts.size() == 1) {
    Object o=parts.get(0);
    if (o instanceof SubjobContainerPart) {
      SubjobContainerPart part=(SubjobContainerPart)o;
      SubjobContainer subjob=(SubjobContainer)part.getModel();
      if (subjob.isDisplayed()) {
        return true;
      }
 else {
        return false;
      }
    }
 else     if (o instanceof NodePart) {
      NodePart part=(NodePart)o;
      Node node=(Node)part.getModel();
      if (node.isStart()) {
        return true;
      }
 else {
        return false;
      }
    }
 else {
      return false;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  List parts=getSelectedObjects();
  if (parts.isEmpty()) {
    return false;
  }
  if (parts.size() == 1) {
    Object o=parts.get(0);
    if (o instanceof SubjobContainerPart) {
      SubjobContainerPart part=(SubjobContainerPart)o;
      SubjobContainer subjob=(SubjobContainer)part.getModel();
      if (subjob.getProcess().getComponentsType().equals(ComponentCategory.CATEGORY_4_DI.getName())) {
        if (subjob.isDisplayed()) {
          return true;
        }
 else {
          return false;
        }
      }
 else {
        return false;
      }
    }
 else     if (o instanceof NodePart) {
      NodePart part=(NodePart)o;
      Node node=(Node)part.getModel();
      if (node.getProcess().getComponentsType().equals(ComponentCategory.CATEGORY_4_DI.getName())) {
        if (node.isStart()) {
          return true;
        }
 else {
          return false;
        }
      }
 else {
        return false;
      }
    }
 else {
      return false;
    }
  }
  return false;
}
Program: 121378
Project: 121378
Buggy source:
private void setDeparallelization(INode node){
  for (  IConnection con : node.getIncomingConnections()) {
    EConnectionType lineStyle=con.getLineStyle();
    if (lineStyle.hasConnectionCategory(IConnectionCategory.MAIN) || lineStyle.hasConnectionCategory(IConnectionCategory.MERGE)) {
      IElementParameter parElem=con.getElementParameter(EParameterName.PARTITIONER.getName());
      parElem.setValue(Boolean.FALSE);
      con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
      con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
      con.setPropertyValue(EParameterName.DEPARTITIONER.getName(),Boolean.TRUE);
    }
  }
  if (node.getOutgoingConnections().size() > 0) {
    setParallelization(node);
  }
}

Fixed version (ground truth):
private void setDeparallelization(INode node){
  if (node.isActivate()) {
    for (    IConnection con : node.getIncomingConnections()) {
      if (con.isActivate()) {
        EConnectionType lineStyle=con.getLineStyle();
        if (lineStyle.hasConnectionCategory(IConnectionCategory.MAIN) || lineStyle.hasConnectionCategory(IConnectionCategory.MERGE)) {
          IElementParameter parElem=con.getElementParameter(EParameterName.PARTITIONER.getName());
          parElem.setValue(Boolean.FALSE);
          con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
          con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
          con.setPropertyValue(EParameterName.DEPARTITIONER.getName(),Boolean.TRUE);
        }
      }
    }
    if (node.getOutgoingConnections().size() > 0) {
      setParallelization(node);
    }
  }
}
Program: 121379
Project: 121379
Buggy source:
public void updateStatus(){
  for (  IElementParameter enableParallel : figureMap.keySet()) {
    if (enableParallel != null) {
      if (enableParallel.getValue().equals(true)) {
        if (enableParallel.getName().equals(EParameterName.NONE.getName())) {
          boolean isDisplayKeepPartion=false;
          isDisplayKeepPartion=isExistPreviousParCon((Node)connection.getSource());
          if (isDisplayKeepPartion) {
            for (            ParallelFigure pf : figureMap.get(enableParallel)) {
              pf.setVisible(true);
            }
          }
 else {
            for (            ParallelFigure pf : figureMap.get(enableParallel)) {
              pf.setVisible(false);
            }
          }
        }
 else {
          for (          ParallelFigure pf : figureMap.get(enableParallel)) {
            pf.setVisible(true);
          }
        }
      }
 else {
        for (        ParallelFigure pf : figureMap.get(enableParallel)) {
          pf.setVisible(false);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void updateStatus(){
  if (connection.isActivate()) {
    for (    IElementParameter enableParallel : figureMap.keySet()) {
      if (enableParallel != null) {
        if (enableParallel.getValue().equals(true)) {
          if (enableParallel.getName().equals(EParameterName.NONE.getName())) {
            boolean isDisplayKeepPartion=false;
            isDisplayKeepPartion=ParallelExecutionUtils.isExistPreviousParCon((Node)connection.getSource());
            if (isDisplayKeepPartion) {
              for (              ParallelFigure pf : figureMap.get(enableParallel)) {
                pf.setVisible(true);
              }
            }
 else {
              for (              ParallelFigure pf : figureMap.get(enableParallel)) {
                pf.setVisible(false);
              }
            }
          }
 else {
            for (            ParallelFigure pf : figureMap.get(enableParallel)) {
              pf.setVisible(true);
            }
          }
        }
 else {
          for (          ParallelFigure pf : figureMap.get(enableParallel)) {
            pf.setVisible(false);
          }
        }
      }
    }
  }
}
Program: 121380
Project: 121380
Buggy source:
public static INode getFirstPartionerTargetNode(IConnection con){
  INode targetNode=null;
  if (con.getTarget() != null) {
    String partitioning=con.getTarget().getComponent().getPartitioning();
    if (!(partitioning.equals("String_Node_Str") || partitioning.equals("String_Node_Str"))) {
      targetNode=con.getTarget();
    }
 else {
      for (      IConnection nextCon : con.getTarget().getOutgoingConnections()) {
        if (nextCon.getLineStyle().hasConnectionCategory(IConnectionCategory.MAIN) || nextCon.getLineStyle().hasConnectionCategory(IConnectionCategory.MERGE)) {
          return getFirstPartionerTargetNode(nextCon);
        }
      }
    }
  }
  return targetNode;
}

Fixed version (ground truth):
public static INode getFirstPartionerTargetNode(IConnection con){
  INode targetNode=null;
  if (con.getTarget() != null) {
    String partitioning=con.getTarget().getComponent().getPartitioning();
    if (!(partitioning.equals("String_Node_Str"))) {
      targetNode=con.getTarget();
    }
 else {
      for (      IConnection nextCon : con.getTarget().getOutgoingConnections()) {
        if (nextCon.getLineStyle().hasConnectionCategory(IConnectionCategory.MAIN) || nextCon.getLineStyle().hasConnectionCategory(IConnectionCategory.MERGE)) {
          return getFirstPartionerTargetNode(nextCon);
        }
      }
    }
  }
  return targetNode;
}
Program: 121381
Project: 121381
Buggy source:
private static List<String> getColumnListFromTargetNode(Node target){
  List<String> columnKeyValues=new ArrayList<String>();
  IElementParameter parTableNode=target.getElementParameterFromField(EParameterFieldType.TABLE);
  Object[] itemNode=parTableNode.getListItemsValue();
  ElementParameter clumnNodeList=null;
  for (  Object itemList : itemNode) {
    if (((ElementParameter)itemList).getFieldType().equals(EParameterFieldType.PREV_COLUMN_LIST) || ((ElementParameter)itemList).getFieldType().equals(EParameterFieldType.COLUMN_LIST)) {
      clumnNodeList=((ElementParameter)itemList);
      break;
    }
  }
  if (clumnNodeList != null) {
    for (    Map nodeColumnListMap : (List<Map>)parTableNode.getValue()) {
      Object value=nodeColumnListMap.get(clumnNodeList.getName());
      if (nodeColumnListMap.get(clumnNodeList.getName()) instanceof String) {
        columnKeyValues.add((String)value);
      }
 else       if (value instanceof Integer) {
        Integer index=(Integer)value;
        if (clumnNodeList.getListItemsDisplayName().length > index) {
          columnKeyValues.add((String)clumnNodeList.getListItemsDisplayName()[index]);
        }
      }
    }
  }
  return columnKeyValues;
}

Fixed version (ground truth):
public static List<String> getColumnListFromTargetNode(Node target){
  List<String> columnKeyValues=new ArrayList<String>();
  IElementParameter parTableNode=target.getElementParameterFromField(EParameterFieldType.TABLE);
  if (parTableNode != null) {
    Object[] itemNode=parTableNode.getListItemsValue();
    ElementParameter clumnNodeList=null;
    for (    Object itemList : itemNode) {
      if (((ElementParameter)itemList).getFieldType().equals(EParameterFieldType.PREV_COLUMN_LIST) || ((ElementParameter)itemList).getFieldType().equals(EParameterFieldType.COLUMN_LIST)) {
        clumnNodeList=((ElementParameter)itemList);
        break;
      }
    }
    if (clumnNodeList != null) {
      for (      Map nodeColumnListMap : (List<Map>)parTableNode.getValue()) {
        Object value=nodeColumnListMap.get(clumnNodeList.getName());
        if (nodeColumnListMap.get(clumnNodeList.getName()) instanceof String) {
          columnKeyValues.add((String)value);
        }
 else         if (value instanceof Integer) {
          Integer index=(Integer)value;
          if (clumnNodeList.getListItemsDisplayName().length > index) {
            columnKeyValues.add((String)clumnNodeList.getListItemsDisplayName()[index]);
          }
        }
      }
    }
  }
  return columnKeyValues;
}
Program: 121384
Project: 121384
Buggy source:
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!ERepositoryObjectType.METADATA_FILE_FTP.equals(nodeType)) {
    setEnabled(false);
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case SIMPLE_FOLDER:
    if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
      setEnabled(false);
      return;
    }
case SYSTEM_FOLDER:
  if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
    setEnabled(false);
    return;
  }
this.setText(CREATE_LABEL);
this.setImageDescriptor(createImage);
collectChildNames(node);
break;
case REPOSITORY_ELEMENT:
if (factory.isPotentiallyEditable(node.getObject())) {
this.setText(EDIT_LABEL);
this.setImageDescriptor(defaultImage);
collectSiblingNames(node);
}
 else {
this.setText(OPEN_LABEL);
this.setImageDescriptor(defaultImage);
}
break;
default :
return;
}
setEnabled(true);
}

Fixed version (ground truth):
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (ERepositoryObjectType.METADATA_FILE_FTP != null && !ERepositoryObjectType.METADATA_FILE_FTP.equals(nodeType)) {
    setEnabled(false);
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case SIMPLE_FOLDER:
    if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
      setEnabled(false);
      return;
    }
case SYSTEM_FOLDER:
  if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
    setEnabled(false);
    return;
  }
this.setText(CREATE_LABEL);
this.setImageDescriptor(createImage);
collectChildNames(node);
break;
case REPOSITORY_ELEMENT:
if (factory.isPotentiallyEditable(node.getObject())) {
this.setText(EDIT_LABEL);
this.setImageDescriptor(defaultImage);
collectSiblingNames(node);
}
 else {
this.setText(OPEN_LABEL);
this.setImageDescriptor(defaultImage);
}
break;
default :
return;
}
setEnabled(true);
}
Program: 121385
Project: 121385
Buggy source:
private void expandParent(TreeViewer viewer,RepositoryNode node){
  if (node.getContentType() == ERepositoryObjectType.SVN_ROOT) {
    viewer.setExpandedState(node,true);
  }
  RepositoryNode parent=node.getParent();
  if (parent != null) {
    expandParent(viewer,parent);
    if (ERepositoryObjectType.METADATA_CONNECTIONS.equals(node.getObjectType())) {
      viewer.expandToLevel(node,TreeViewer.ALL_LEVELS);
    }
 else {
      viewer.setExpandedState(node,true);
    }
  }
}

Fixed version (ground truth):
private void expandParent(TreeViewer viewer,RepositoryNode node){
  if (node.getContentType() == ERepositoryObjectType.SVN_ROOT) {
    viewer.setExpandedState(node,true);
  }
  RepositoryNode parent=node.getParent();
  if (parent != null) {
    expandParent(viewer,parent);
    if (ERepositoryObjectType.METADATA_CONNECTIONS != null && ERepositoryObjectType.METADATA_CONNECTIONS.equals(node.getObjectType())) {
      viewer.expandToLevel(node,TreeViewer.ALL_LEVELS);
    }
 else {
      viewer.setExpandedState(node,true);
    }
  }
}
Program: 121386
Project: 121386
Buggy source:
public static INode getFirstPartionerTargetNode(IConnection con){
  INode targetNode=null;
  if (con.getTarget() != null) {
    String partitioning=con.getTarget().getComponent().getPartitioning();
    if (!(partitioning.equals("String_Node_Str"))) {
      targetNode=con.getTarget();
    }
 else {
      for (      IConnection nextCon : con.getTarget().getOutgoingConnections()) {
        if (nextCon.getLineStyle().hasConnectionCategory(IConnectionCategory.MAIN) || nextCon.getLineStyle().hasConnectionCategory(IConnectionCategory.MERGE)) {
          return getFirstPartionerTargetNode(nextCon);
        }
      }
    }
  }
  return targetNode;
}

Fixed version (ground truth):
public static INode getFirstPartionerTargetNode(IConnection con){
  INode targetNode=null;
  if (con.getTarget() != null) {
    String partitioning=con.getTarget().getComponent().getPartitioning();
    if (!(partitioning.equals("String_Node_Str") || partitioning.equals("String_Node_Str"))) {
      targetNode=con.getTarget();
    }
 else {
      for (      IConnection nextCon : con.getTarget().getOutgoingConnections()) {
        if (nextCon.getLineStyle().hasConnectionCategory(IConnectionCategory.MAIN) || nextCon.getLineStyle().hasConnectionCategory(IConnectionCategory.MERGE)) {
          return getFirstPartionerTargetNode(nextCon);
        }
      }
    }
  }
  return targetNode;
}
Program: 121387
Project: 121387
Buggy source:
public static void setHashKeysForCon(IConnection con){
  List<String> conKeyColumnList=getKeyColumnList(con.getMetadataTable());
  IElementParameter parTableCon=con.getElementParameter(HASH_KEYS);
  boolean isExistHashValue=false;
  if (parTableCon != null) {
    ((List)parTableCon.getValue()).clear();
    if (conKeyColumnList.size() > 0) {
      con.getElementParameter("String_Node_Str").setValue(true);
      Object[] itemCon=parTableCon.getListItemsValue();
      String clumnKeyListName="String_Node_Str";
      for (      Object itemList : itemCon) {
        if (((ElementParameter)itemList).getFieldType().equals(EParameterFieldType.PREV_COLUMN_LIST) || ((ElementParameter)itemList).getFieldType().equals(EParameterFieldType.COLUMN_LIST)) {
          clumnKeyListName=((ElementParameter)itemList).getName();
          break;
        }
      }
      for (      String partionValue : conKeyColumnList) {
        for (        Object keyParMap : ((List)parTableCon.getValue())) {
          Map existKeyMap=(Map)keyParMap;
          if (existKeyMap.get(clumnKeyListName).equals(partionValue)) {
            isExistHashValue=true;
            break;
          }
        }
        if (!isExistHashValue) {
          Map partionKeyMap=new HashMap<String,String>();
          partionKeyMap.put(clumnKeyListName,partionValue);
          ((List)parTableCon.getValue()).add(partionKeyMap);
        }
      }
    }
  }
}

Fixed version (ground truth):
public static void setHashKeysForCon(IConnection con){
  List<String> conKeyColumnList=getKeyColumnList(con.getMetadataTable());
  IElementParameter parTableCon=con.getElementParameter(HASH_KEYS);
  boolean isExistHashValue=false;
  if (parTableCon != null) {
    if (conKeyColumnList.size() > 0) {
      ((List)parTableCon.getValue()).clear();
      con.getElementParameter("String_Node_Str").setValue(true);
      Object[] itemCon=parTableCon.getListItemsValue();
      String clumnKeyListName="String_Node_Str";
      for (      Object itemList : itemCon) {
        if (((ElementParameter)itemList).getFieldType().equals(EParameterFieldType.PREV_COLUMN_LIST) || ((ElementParameter)itemList).getFieldType().equals(EParameterFieldType.COLUMN_LIST)) {
          clumnKeyListName=((ElementParameter)itemList).getName();
          break;
        }
      }
      for (      String partionValue : conKeyColumnList) {
        for (        Object keyParMap : ((List)parTableCon.getValue())) {
          Map existKeyMap=(Map)keyParMap;
          if (existKeyMap.get(clumnKeyListName).equals(partionValue)) {
            isExistHashValue=true;
            break;
          }
        }
        if (!isExistHashValue) {
          Map partionKeyMap=new HashMap<String,String>();
          partionKeyMap.put(clumnKeyListName,partionValue);
          ((List)parTableCon.getValue()).add(partionKeyMap);
        }
      }
    }
 else {
      con.getElementParameter("String_Node_Str").setValue(false);
    }
  }
}
Program: 121389
Project: 121389
Buggy source:
public static void setupTMap(Node node){
  if (!GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMapperService.class)) {
    return;
  }
  IDesignerMapperService service=(IDesignerMapperService)GlobalServiceRegister.getDefault().getService(IDesignerMapperService.class);
  IConnection inputConnection=node.getIncomingConnections().get(0);
  IConnection outputConnection=node.getOutgoingConnections().get(0);
  outputConnection.getMetadataTable().setListColumns(inputConnection.getMetadataTable().clone(false).getListColumns());
  ((Process)node.getProcess()).checkProcess();
  service.createAutoMappedNode(node,inputConnection,outputConnection);
}

Fixed version (ground truth):
public static void setupTMap(Node node){
  if (!GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMapperService.class)) {
    return;
  }
  IConnection inputConnection=node.getIncomingConnections().get(0);
  IConnection outputConnection=node.getOutgoingConnections().get(0);
  outputConnection.getMetadataTable().setListColumns(inputConnection.getMetadataTable().clone(false).getListColumns());
  ((Process)node.getProcess()).checkProcess();
  if ("String_Node_Str".equals(node.getComponent().getName())) {
    IDesignerMapperService service=(IDesignerMapperService)GlobalServiceRegister.getDefault().getService(IDesignerMapperService.class);
    service.createAutoMappedNode(node,inputConnection,outputConnection);
  }
}
Program: 121391
Project: 121391
Buggy source:
public void renameMapperTable(IExternalNode externalNode,String schemaId,String newSchemaId,IMetadataTable metadataTable){
  if (externalNode == null || schemaId == null || metadataTable == null)   return;
  if (externalNode instanceof MapperComponent) {
    MapperComponent component=(MapperComponent)externalNode;
    IExternalData nodeData=externalNode.getExternalData();
    if (nodeData != null && nodeData instanceof ExternalMapperData) {
      ExternalMapperData mapperData=(ExternalMapperData)nodeData;
      List<ExternalMapperTable> outputTables=mapperData.getOutputTables();
      if (outputTables != null && outputTables.size() > 0) {
        for (        ExternalMapperTable outputTable : outputTables) {
          if (!schemaId.equals(outputTable.getId())) {
            continue;
          }
          outputTable.setId(newSchemaId);
          updateEntriesByMetaColumns(newSchemaId,metadataTable,outputTable,component);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void renameMapperTable(IExternalNode externalNode,String schemaId,String newSchemaId,IMetadataTable metadataTable){
  if (externalNode == null || schemaId == null || metadataTable == null) {
    return;
  }
  if (externalNode instanceof MapperComponent) {
    MapperComponent component=(MapperComponent)externalNode;
    IExternalData nodeData=externalNode.getExternalData();
    if (nodeData != null && nodeData instanceof ExternalMapperData) {
      ExternalMapperData mapperData=(ExternalMapperData)nodeData;
      List<ExternalMapperTable> outputTables=mapperData.getOutputTables();
      if (outputTables != null && outputTables.size() > 0) {
        for (        ExternalMapperTable outputTable : outputTables) {
          if (!schemaId.equals(outputTable.getId())) {
            continue;
          }
          outputTable.setId(newSchemaId);
          updateEntriesByMetaColumns(newSchemaId,metadataTable,outputTable,component);
        }
      }
    }
  }
}
Program: 121392
Project: 121392
Buggy source:
public boolean isMetacolumnSame(ExternalMapperTableEntry extColumn,IMetadataColumn column){
  if (extColumn == null || column == null)   return false;
  if (!sameStringValue(extColumn.getName(),column.getLabel())) {
    return false;
  }
  if (!sameStringValue(extColumn.getType(),column.getTalendType())) {
    return false;
  }
  if (extColumn.isNullable() != column.isNullable()) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean isMetacolumnSame(ExternalMapperTableEntry extColumn,IMetadataColumn column){
  if (extColumn == null || column == null) {
    return false;
  }
  if (!sameStringValue(extColumn.getName(),column.getLabel())) {
    return false;
  }
  if (!sameStringValue(extColumn.getType(),column.getTalendType())) {
    return false;
  }
  if (extColumn.isNullable() != column.isNullable()) {
    return false;
  }
  return true;
}
Program: 121393
Project: 121393
Buggy source:
public List<String> getExpressionFilter(IExternalData nodeData){
  List<String> ret=new ArrayList<String>();
  if (nodeData instanceof ExternalMapperData) {
    ExternalMapperData mapperData=(ExternalMapperData)nodeData;
    List<ExternalMapperTable> mapperTables=(List<ExternalMapperTable>)mapperData.getInputTables();
    for (    ExternalMapperTable mapperTable : mapperTables) {
      ret.add(mapperTable.getExpressionFilter());
    }
  }
  return ret;
}

Fixed version (ground truth):
public List<String> getExpressionFilter(IExternalData nodeData){
  List<String> ret=new ArrayList<String>();
  if (nodeData instanceof ExternalMapperData) {
    ExternalMapperData mapperData=(ExternalMapperData)nodeData;
    List<ExternalMapperTable> mapperTables=mapperData.getInputTables();
    for (    ExternalMapperTable mapperTable : mapperTables) {
      ret.add(mapperTable.getExpressionFilter());
    }
  }
  return ret;
}
Program: 121394
Project: 121394
Buggy source:
public void updateLink(INode node,IConnection oldConnection,IConnection newConnection){
  ((MapperComponent)node.getExternalNode()).renameInputConnection(oldConnection.getName(),newConnection.getName());
}

Fixed version (ground truth):
public void updateLink(INode node,IConnection oldConnection,IConnection newConnection){
  ((MapperExternalNode)node.getExternalNode()).renameInputConnection(oldConnection.getName(),newConnection.getName());
}
Program: 121395
Project: 121395
Buggy source:
public boolean isSameMetadata(IExternalNode externalNode,String schemaId,IMetadataTable metadataTable){
  boolean isSame=true;
  if (externalNode == null || schemaId == null || metadataTable == null)   return false;
  if (externalNode instanceof MapperComponent) {
    MapperComponent component=(MapperComponent)externalNode;
    IExternalData nodeData=externalNode.getExternalData();
    if (nodeData != null && nodeData instanceof ExternalMapperData) {
      ExternalMapperData mapperData=(ExternalMapperData)nodeData;
      List<ExternalMapperTable> outputTables=mapperData.getOutputTables();
      if (outputTables != null && outputTables.size() > 0) {
        for (        ExternalMapperTable outputTable : outputTables) {
          if (schemaId.equals(outputTable.getId())) {
            final IMetadataTable mapperTable=getMetadataTable(component,outputTable.getName());
            if (mapperTable == null || !mapperTable.sameMetadataAs(metadataTable,IMetadataColumn.OPTIONS_NONE)) {
              return false;
            }
          }
        }
      }
    }
  }
  return isSame;
}

Fixed version (ground truth):
public boolean isSameMetadata(IExternalNode externalNode,String schemaId,IMetadataTable metadataTable){
  boolean isSame=true;
  if (externalNode == null || schemaId == null || metadataTable == null) {
    return false;
  }
  if (externalNode instanceof MapperComponent) {
    MapperComponent component=(MapperComponent)externalNode;
    IExternalData nodeData=externalNode.getExternalData();
    if (nodeData != null && nodeData instanceof ExternalMapperData) {
      ExternalMapperData mapperData=(ExternalMapperData)nodeData;
      List<ExternalMapperTable> outputTables=mapperData.getOutputTables();
      if (outputTables != null && outputTables.size() > 0) {
        for (        ExternalMapperTable outputTable : outputTables) {
          if (schemaId.equals(outputTable.getId())) {
            final IMetadataTable mapperTable=getMetadataTable(component,outputTable.getName());
            if (mapperTable == null || !mapperTable.sameMetadataAs(metadataTable,IMetadataColumn.OPTIONS_NONE)) {
              return false;
            }
          }
        }
      }
    }
  }
  return isSame;
}
Program: 121396
Project: 121396
Buggy source:
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
 else {
    Object s=getSelectedObjects().get(0);
    if (s instanceof List && !((List)s).isEmpty()) {
      List selectedarts=(List)s;
      Object object=selectedarts.get(selectedarts.size() - 1);
      if (object instanceof TreeNodeEditPart) {
        TreeNodeEditPart parentPart=(TreeNodeEditPart)object;
        schemaNode=(TreeNode)parentPart.getModel();
        if (schemaNode.eContainer() instanceof AbstractInOutTree && XmlMapUtil.DOCUMENT.equals(schemaNode.getType())) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
 else {
    Object s=getSelectedObjects().get(0);
    if (s instanceof List && !((List)s).isEmpty()) {
      List selectedarts=(List)s;
      Object object=selectedarts.get(selectedarts.size() - 1);
      if (object instanceof TreeNodeEditPart) {
        TreeNodeEditPart parentPart=(TreeNodeEditPart)object;
        schemaNode=(TreeNode)parentPart.getModel();
        if (schemaNode.eContainer() instanceof AbstractInOutTree && XmlMapUtil.DOCUMENT.equals(schemaNode.getType()) && ERepositoryObjectType.METADATA_MDMCONNECTION != null) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 121397
Project: 121397
Buggy source:
public static void checkComponentFolder(File currentFolder,String languageSuffix) throws BusinessException {
  checkFiles(currentFolder,languageSuffix);
  File xmlMainFile=new File(currentFolder,ComponentFilesNaming.getInstance().getMainXMLFileName(currentFolder.getName(),languageSuffix));
  XsdValidationCacheManager xsdValidationCacheManager=XsdValidationCacheManager.getInstance();
  FileInputStream fis=null;
  try {
    fis=new FileInputStream(xmlMainFile);
    String sha1=SHA1Util.calculateFromTextStream(fis);
    if (!CommonsPlugin.isHeadless() && xsdValidationCacheManager.needCheck(xmlMainFile,sha1)) {
      checkXSD(xmlMainFile);
      xsdValidationCacheManager.setChecked(xmlMainFile,sha1);
    }
  }
 catch (  FileNotFoundException e) {
    ExceptionHandler.process(e);
  }
 finally {
    if (fis != null) {
      try {
        fis.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

Fixed version (ground truth):
public static void checkComponentFolder(File currentFolder,String languageSuffix) throws BusinessException {
  checkFiles(currentFolder,languageSuffix);
  File xmlMainFile=new File(currentFolder,ComponentFilesNaming.getInstance().getMainXMLFileName(currentFolder.getName(),languageSuffix));
  FileInputStream fis=null;
  try {
    fis=new FileInputStream(xmlMainFile);
    if (!CommonsPlugin.isHeadless()) {
      checkXSD(xmlMainFile);
    }
  }
 catch (  FileNotFoundException e) {
    ExceptionHandler.process(e);
  }
 finally {
    if (fis != null) {
      try {
        fis.close();
      }
 catch (      IOException e) {
      }
    }
  }
}
Program: 121398
Project: 121398
Buggy source:
@Override public Method getMethod(){
  Method localMethod=super.getMethod();
  if (localMethod == null) {
    try {
      localMethod=loadMethod();
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
    if (localMethod == null) {
      try {
        talendEclipseHelper.initialize(BasicMonitor.toMonitor(new NullProgressMonitor()),this,componentFamily,templateName,templateLanguage,codePart);
        localMethod=super.getMethod();
      }
 catch (      JETException e) {
        ExceptionHandler.process(e);
      }
    }
 else {
      setMethod(localMethod);
    }
  }
  return localMethod;
}

Fixed version (ground truth):
@Override public Method getMethod(){
  Method localMethod=super.getMethod();
  if (localMethod == null) {
    try {
      localMethod=loadMethod();
    }
 catch (    Exception e) {
    }
    if (localMethod == null) {
      try {
        talendEclipseHelper.initialize(BasicMonitor.toMonitor(new NullProgressMonitor()),this,componentFamily,templateName,templateLanguage,codePart);
        localMethod=super.getMethod();
      }
 catch (      JETException e) {
        ExceptionHandler.process(e);
      }
    }
 else {
      setMethod(localMethod);
    }
  }
  return localMethod;
}
Program: 121399
Project: 121399
Buggy source:
@Override public void clearBlocked(){
  Dialog.getBlockedHandler().clearBlocked();
}

Fixed version (ground truth):
@Override public void clearBlocked(){
  if (CommonUIPlugin.isFullyHeadless()) {
    return;
  }
  final Display disp=DisplayUtils.getDisplay();
  disp.syncExec(new Runnable(){
    @Override public void run(){
      Dialog.getBlockedHandler().clearBlocked();
    }
  }
);
}