nus-yam/ex-repair huggingface dataset:
Program: 126888
Project: 126888
Buggy source:
private String getFolderPath(FolderItem folder,String path){
  if (FolderType.FOLDER_LITERAL.equals(folder.getType())) {
    final EObject parent=folder.getParent();
    if (parent instanceof FolderItem) {
      FolderItem parentFolder=(FolderItem)parent;
      if (parentFolder.getParent() instanceof Project) {
        if (path == null) {
          path="String_Node_Str";
        }
        return path;
      }
      if (path == null || "String_Node_Str".equals(path)) {
        path=parentFolder.getProperty().getLabel();
      }
 else {
        path=parentFolder.getProperty().getLabel() + "String_Node_Str" + path;
      }
      return getFolderPath(parentFolder,path);
    }
    return path;
  }
 else {
    return path;
  }
}

Fixed version (ground truth):
private String getFolderPath(FolderItem folder,String path){
  if (FolderType.FOLDER_LITERAL.equals(folder.getType())) {
    if (folder.getProperty().getLabel().equals("String_Node_Str")) {
      System.out.println("String_Node_Str");
    }
    final EObject parent=folder.getParent();
    if (parent instanceof FolderItem) {
      FolderItem parentFolder=(FolderItem)parent;
      if (FolderType.SYSTEM_FOLDER_LITERAL.equals(parentFolder.getType())) {
        if (path == null) {
          path="String_Node_Str";
        }
        return path;
      }
      if (path == null || "String_Node_Str".equals(path)) {
        path=parentFolder.getProperty().getLabel();
      }
 else {
        path=parentFolder.getProperty().getLabel() + "String_Node_Str" + path;
      }
      return getFolderPath(parentFolder,path);
    }
    return path;
  }
 else {
    return path;
  }
}
Program: 126890
Project: 126890
Buggy source:
private String getFolderPath(FolderItem folder,String path){
  if (FolderType.FOLDER_LITERAL.equals(folder.getType())) {
    if (folder.getProperty().getLabel().equals("String_Node_Str")) {
      System.out.println("String_Node_Str");
    }
    final EObject parent=folder.getParent();
    if (parent instanceof FolderItem) {
      FolderItem parentFolder=(FolderItem)parent;
      if (FolderType.SYSTEM_FOLDER_LITERAL.equals(parentFolder.getType())) {
        if (path == null) {
          path="String_Node_Str";
        }
        return path;
      }
      if (path == null || "String_Node_Str".equals(path)) {
        path=parentFolder.getProperty().getLabel();
      }
 else {
        path=parentFolder.getProperty().getLabel() + "String_Node_Str" + path;
      }
      return getFolderPath(parentFolder,path);
    }
    return path;
  }
 else {
    return path;
  }
}

Fixed version (ground truth):
private String getFolderPath(FolderItem folder,String path){
  if (FolderType.FOLDER_LITERAL.equals(folder.getType())) {
    final EObject parent=folder.getParent();
    if (parent instanceof FolderItem) {
      FolderItem parentFolder=(FolderItem)parent;
      if (FolderType.SYSTEM_FOLDER_LITERAL.equals(parentFolder.getType())) {
        if (path == null) {
          path="String_Node_Str";
        }
        return path;
      }
      if (path == null || "String_Node_Str".equals(path)) {
        path=parentFolder.getProperty().getLabel();
      }
 else {
        path=parentFolder.getProperty().getLabel() + "String_Node_Str" + path;
      }
      return getFolderPath(parentFolder,path);
    }
    return path;
  }
 else {
    return path;
  }
}
Program: 126894
Project: 126894
Buggy source:
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
}

Fixed version (ground truth):
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
  boolean inputModel=((WSDLSchemaConnection)connectionItem.getConnection()).isIsInputModel();
  metadataNameText.setReadOnly(!inputModel);
}
Program: 126895
Project: 126895
Buggy source:
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
}

Fixed version (ground truth):
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
  boolean inputModel=((WSDLSchemaConnection)connectionItem.getConnection()).isIsInputModel();
  metadataNameText.setReadOnly(!inputModel);
}
Program: 126897
Project: 126897
Buggy source:
/** 
 * zshen Comment method "checkConnection".
 * @param metadataBean connection information.can not be null.
 * @return the object of TypedReturnCode if connected have be build the object will take a java.sql.connection elseit will take a error message.
 */
public ReturnCode checkConnection(IMetadataConnection metadataBean);

Fixed version (ground truth):
/** 
 * this is used to check a Connection and at last the connection will be closed at once.
 * @param metadataBean
 * @return
 */
public ReturnCode checkConnection(IMetadataConnection metadataBean);
Program: 126898
Project: 126898
Buggy source:
@Override public Connection fillUIConnParams(IMetadataConnection metadataBean,Connection connection){
  if (connection == null) {
    connection=ConnectionHelper.createMDMConnection(metadataBean.getDataSourceName());
  }
  if (super.fillUIConnParams(metadataBean,connection) == null) {
    return null;
  }
  TypedReturnCode<Object> rc=this.checkConnection(metadataBean);
  if (rc.isOk()) {
    TdSoftwareSystem softwareSystem=SoftwaredeploymentFactory.eINSTANCE.createTdSoftwareSystem();
    softwareSystem.setName(metadataBean.getDatabase());
    softwareSystem.setType(SoftwareSystemConstants.DBMS.toString());
    softwareSystem.setVersion(metadataBean.getVersion());
    Component component=orgomg.cwm.foundation.softwaredeployment.SoftwaredeploymentFactory.eINSTANCE.createComponent();
    softwareSystem.getOwnedElement().add(component);
    ConnectionHelper.setSoftwareSystem(connection,softwareSystem);
    ConnectionHelper.setDataFilter(metadataBean.getDatafilter(),(MDMConnection)connection);
    ConnectionHelper.setUniverse(metadataBean.getUniverse(),connection);
    fillMetadataParams(metadataBean,connection);
  }
  return connection;
}

Fixed version (ground truth):
@Override public Connection fillUIConnParams(IMetadataConnection metadataBean,Connection connection){
  if (connection == null) {
    connection=ConnectionHelper.createMDMConnection(metadataBean.getDataSourceName());
  }
  if (super.fillUIConnParams(metadataBean,connection) == null) {
    return null;
  }
  ReturnCode rc=checkConnection(metadataBean);
  if (rc.isOk()) {
    TdSoftwareSystem softwareSystem=SoftwaredeploymentFactory.eINSTANCE.createTdSoftwareSystem();
    softwareSystem.setName(metadataBean.getDatabase());
    softwareSystem.setType(SoftwareSystemConstants.DBMS.toString());
    softwareSystem.setVersion(metadataBean.getVersion());
    Component component=orgomg.cwm.foundation.softwaredeployment.SoftwaredeploymentFactory.eINSTANCE.createComponent();
    softwareSystem.getOwnedElement().add(component);
    ConnectionHelper.setSoftwareSystem(connection,softwareSystem);
    ConnectionHelper.setDataFilter(metadataBean.getDatafilter(),(MDMConnection)connection);
    ConnectionHelper.setUniverse(metadataBean.getUniverse(),connection);
    fillMetadataParams(metadataBean,connection);
  }
  return connection;
}
Program: 126899
Project: 126899
Buggy source:
/** 
 * zshen Comment method "checkConnection".
 * @param metadataBean connection information.can not be null.
 * @return the object of TypedReturnCode if connected have be build the object will take a java.sql.connection elseit will take a error message.
 * @deprecated use {@link #createConnection(IMetadataConnection)} instead.
 */
@Deprecated public ReturnCode checkConnection(IMetadataConnection metadataBean){
  return metadataFiller.checkConnection(metadataBean);
}

Fixed version (ground truth):
/** 
 * check a Connection and at last will close connection.
 * @param metadataBean
 * @return
 */
public ReturnCode checkConnection(IMetadataConnection metadataBean){
  return metadataFiller.checkConnection(metadataBean);
}
Program: 126900
Project: 126900
Buggy source:
/** 
 * @param metadataBean connection information.can not be null.
 * @return the object of TypedReturnCode if the connection is established. The object will be a instance ofjava.sql.Connection if success, otherwise an error message will be returned.
 */
public ReturnCode createConnection(IMetadataConnection metadataBean){
  return metadataFiller.checkConnection(metadataBean);
}

Fixed version (ground truth):
/** 
 * create a Connection and at last will not close connection.
 * @param metadataBean
 * @return
 */
public ReturnCode createConnection(IMetadataConnection metadataBean){
  return metadataFiller.createConnection(metadataBean);
}
Program: 126901
Project: 126901
Buggy source:
/** 
 * zshen Comment method "checkConnection".
 * @param metadataBean connection information.can not be null.
 * @return the object of TypedReturnCode if connected have be build the object will take a java.sql.connection elseit will take a error message.
 */
public ReturnCode checkConnection(IMetadataConnection metadataBean){
  ReturnCode rc=new ReturnCode();
  if (EDataBaseType.MDM.getProductName().equalsIgnoreCase(metadataBean.getDbType())) {
    try {
      XtentisBindingStub stub=MetadataConnectionUtils.getXtentisBindingStub(metadataBean);
      stub.ping(new WSPing());
      rc.setOk(true);
      rc.setMessage("String_Node_Str");
    }
 catch (    Exception e) {
      log.warn(e,e);
      rc.setOk(false);
      rc.setMessage(e.getMessage());
    }
  }
 else {
    rc=MetadataConnectionUtils.checkConnection(metadataBean);
  }
  return rc;
}

Fixed version (ground truth):
public ReturnCode checkConnection(IMetadataConnection metadataBean){
  return createConnection(metadataBean,true);
}
Program: 126902
Project: 126902
Buggy source:
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
}

Fixed version (ground truth):
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
  boolean inputModel=((WSDLSchemaConnection)connectionItem.getConnection()).isIsInputModel();
  metadataNameText.setReadOnly(!inputModel);
}
Program: 126903
Project: 126903
Buggy source:
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
}

Fixed version (ground truth):
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
  boolean inputModel=((WSDLSchemaConnection)connectionItem.getConnection()).isIsInputModel();
  metadataNameText.setReadOnly(!inputModel);
}
Program: 126904
Project: 126904
Buggy source:
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
}

Fixed version (ground truth):
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
  boolean inputModel=((WSDLSchemaConnection)connectionItem.getConnection()).isIsInputModel();
  metadataNameText.setReadOnly(!inputModel);
}
Program: 126905
Project: 126905
Buggy source:
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
}

Fixed version (ground truth):
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  guessButton.setEnabled(!isReadOnly());
  metadataNameText.setReadOnly(isReadOnly());
  metadataCommentText.setReadOnly(isReadOnly());
  tableEditorView.setReadOnly(isReadOnly());
  boolean inputModel=((WSDLSchemaConnection)connectionItem.getConnection()).isIsInputModel();
  metadataNameText.setReadOnly(!inputModel);
}
Program: 126906
Project: 126906
Buggy source:
@Override public void run(){
synchronized (this) {
    try {
      while (!jobIsFinished) {
        wait(100);
      }
    }
 catch (    InterruptedException e) {
      System.out.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void run(){
synchronized (this) {
    try {
      while (!jobIsFinished) {
        wait(100);
      }
    }
 catch (    InterruptedException e) {
      System.out.println("String_Node_Str");
    }
  }
}
Program: 126910
Project: 126910
Buggy source:
/** 
 * DOC wliu <p> get the original connection instance className of the pamameter:conn.\n It is used to help optimize the code to avoid 65535 bytes in a method </p> Notice: It is used in tFileOutputMSXML in TDI-21606
 * @param connection
 * @return
 */
public static String getPrivateConnClassName(final IConnection conn){
  if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
    INode node=conn.getSource();
    if (node.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(node))) {
      return conn.getUniqueName();
    }
    List<? extends IConnection> listInConns=node.getIncomingConnections();
    if (listInConns != null && listInConns.size() > 0) {
      String retResult=getPrivateConnClassName(listInConns.get(0));
      if (retResult == null) {
        return conn.getUniqueName();
      }
 else {
        return retResult;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC wliu <p> get the original connection instance className of the pamameter:conn.\n It is used to help optimize the code to avoid 65535 bytes in a method </p> Notice: It is used in tFileOutputMSXML in TDI-21606
 * @param connection
 * @return
 */
public static String getPrivateConnClassName(final IConnection conn){
  if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
    INode node=conn.getSource();
    if (node.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(node))) {
      return conn.getName();
    }
    List<? extends IConnection> listInConns=node.getIncomingConnections();
    if (listInConns != null && listInConns.size() > 0) {
      String retResult=getPrivateConnClassName(listInConns.get(0));
      if (retResult == null) {
        return conn.getName();
      }
 else {
        return retResult;
      }
    }
  }
  return null;
}
Program: 126916
Project: 126916
Buggy source:
protected ResultSet getColumnsResultSet(DatabaseMetaData dbMetaData,String catalogName,String schemaName,String tableName) throws SQLException {
  ResultSet columns=null;
  if (dbMetaData != null) {
    columns=dbMetaData.getColumns(catalogName,schemaName,tableName,null);
  }
  return columns;
}

Fixed version (ground truth):
protected ResultSet getColumnsResultSet(DatabaseMetaData dbMetaData,String catalogName,String schemaName,String tableName) throws SQLException {
  ResultSet columns=null;
  if (dbMetaData != null) {
    if (tableName.contains("String_Node_Str")) {
      tableName=tableName.replaceAll("String_Node_Str","String_Node_Str");
    }
    columns=dbMetaData.getColumns(catalogName,schemaName,tableName,null);
  }
  return columns;
}
Program: 126918
Project: 126918
Buggy source:
public static boolean isOracle(Connection connection){
  if (connection != null && connection instanceof DatabaseConnection) {
    DatabaseConnection dbConn=(DatabaseConnection)connection;
    if (EDatabaseTypeName.ORACLEFORSID.getDisplayName().equals(dbConn.getDatabaseType()) || EDatabaseTypeName.ORACLESN.getDisplayName().equals(dbConn.getDatabaseType()) || EDatabaseTypeName.ORACLE_RAC.getDisplayName().equals(dbConn.getDatabaseType())|| EDatabaseTypeName.ORACLE_OCI.getDisplayName().equals(dbConn.getDatabaseType())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isOracle(DatabaseMetaData metadata){
  if (metadata != null) {
    try {
      String name=metadata.getDatabaseProductName().toUpperCase();
      if (name != null && name.equals(EDatabaseTypeName.ORACLEFORSID.getProduct().toUpperCase())) {
        return true;
      }
    }
 catch (    SQLException e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}
Program: 126919
Project: 126919
Buggy source:
@Override public void run(){
synchronized (this) {
    try {
      while (!jobIsFinished) {
        wait(100);
      }
    }
 catch (    InterruptedException e) {
      System.out.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void run(){
synchronized (this) {
    try {
      while (!jobIsFinished) {
        wait(100);
      }
    }
 catch (    InterruptedException e) {
      System.out.println("String_Node_Str");
    }
  }
}
Program: 126920
Project: 126920
Buggy source:
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  Object firstElement=selection.getFirstElement();
  if (!(firstElement instanceof RepositoryNode)) {
    setEnabled(false);
    return;
  }
  RepositoryNode node=(RepositoryNode)firstElement;
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  ERepositoryObjectType objectType=null;
  for (  Object obj : ((StructuredSelection)selection).toArray()) {
    if (canWork) {
      RepositoryNode sourceNode=(RepositoryNode)obj;
      ERepositoryObjectType type=sourceNode.getObjectType();
      if (objectType != null && objectType != type) {
        canWork=false;
        break;
      }
 else {
        objectType=type;
      }
      if (!CopyObjectAction.getInstance().validateAction(sourceNode,null)) {
        canWork=false;
      }
 else       if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SALESFORCE_MODULE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESOPERATION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESPORT) {
        canWork=false;
      }
    }
 else {
      break;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  Object firstElement=selection.getFirstElement();
  if (!(firstElement instanceof RepositoryNode)) {
    setEnabled(false);
    return;
  }
  RepositoryNode node=(RepositoryNode)firstElement;
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  ERepositoryObjectType objectType=null;
  for (  Object obj : ((StructuredSelection)selection).toArray()) {
    if (canWork) {
      RepositoryNode sourceNode=(RepositoryNode)obj;
      ERepositoryObjectType type=sourceNode.getObjectType();
      if (objectType != null && objectType != type) {
        canWork=false;
        break;
      }
 else {
        objectType=type;
      }
      if (!CopyObjectAction.getInstance().validateAction(sourceNode,null)) {
        canWork=false;
      }
 else       if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SALESFORCE_MODULE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESOPERATION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESPORT || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_VALIDATION_RULES) {
        canWork=false;
      }
    }
 else {
      break;
    }
  }
  setEnabled(canWork);
}
Program: 126922
Project: 126922
Buggy source:
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  Object firstElement=selection.getFirstElement();
  if (!(firstElement instanceof RepositoryNode)) {
    setEnabled(false);
    return;
  }
  RepositoryNode node=(RepositoryNode)firstElement;
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  ERepositoryObjectType objectType=null;
  for (  Object obj : ((StructuredSelection)selection).toArray()) {
    if (canWork) {
      RepositoryNode sourceNode=(RepositoryNode)obj;
      ERepositoryObjectType type=sourceNode.getObjectType();
      if (objectType != null && objectType != type) {
        canWork=false;
        break;
      }
 else {
        objectType=type;
      }
      if (!CopyObjectAction.getInstance().validateAction(sourceNode,null)) {
        canWork=false;
      }
 else       if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SALESFORCE_MODULE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESOPERATION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESPORT) {
        canWork=false;
      }
    }
 else {
      break;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  Object firstElement=selection.getFirstElement();
  if (!(firstElement instanceof RepositoryNode)) {
    setEnabled(false);
    return;
  }
  RepositoryNode node=(RepositoryNode)firstElement;
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  ERepositoryObjectType objectType=null;
  for (  Object obj : ((StructuredSelection)selection).toArray()) {
    if (canWork) {
      RepositoryNode sourceNode=(RepositoryNode)obj;
      ERepositoryObjectType type=sourceNode.getObjectType();
      if (objectType != null && objectType != type) {
        canWork=false;
        break;
      }
 else {
        objectType=type;
      }
      if (!CopyObjectAction.getInstance().validateAction(sourceNode,null)) {
        canWork=false;
      }
 else       if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SALESFORCE_MODULE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESOPERATION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESPORT || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_VALIDATION_RULES) {
        canWork=false;
      }
    }
 else {
      break;
    }
  }
  setEnabled(canWork);
}
Program: 126930
Project: 126930
Buggy source:
@Override public boolean equals(TraceBean traceBean){
  return false;
}

Fixed version (ground truth):
public boolean equals(TraceBean traceBean){
  return false;
}
Program: 126932
Project: 126932
Buggy source:
@Override public boolean equals(TraceBean traceBean){
  return false;
}

Fixed version (ground truth):
public boolean equals(TraceBean traceBean){
  return false;
}
Program: 126933
Project: 126933
Buggy source:
/** 
 * @author jyhu
 * @aim Get unique name of the graphica node from generating node.
 * @param node: Generated node
 * @return unique name of the graphica node.
 */
public static String getVirtualUniqueName(INode node){
  String uniqueName=node.getUniqueName();
  if (node.isVirtualGenerateNode()) {
    List<? extends INode> nodeList=node.getProcess().getGraphicalNodes();
    for (    INode graphicnode : nodeList) {
      if (graphicnode.isGeneratedAsVirtualComponent()) {
        String nodeUniqueName=graphicnode.getUniqueName();
        if (uniqueName.indexOf(nodeUniqueName + "String_Node_Str") == 0) {
          uniqueName=nodeUniqueName;
          break;
        }
      }
    }
  }
  return uniqueName;
}

Fixed version (ground truth):
/** 
 * @author jyhu
 * @aim Get unique name of the graphica node from generating node.
 * @param node: Generated node
 * @return unique name of the graphica node.
 */
public static String getVirtualUniqueName(INode node){
  return getVirtualNode(node).getUniqueName();
}
Program: 126934
Project: 126934
Buggy source:
/** 
 * @author jyhu
 * @aim Get unique name of the graphica node from generating node.
 * @param node: Generated node
 * @return unique name of the graphica node.
 */
public static String getVirtualUniqueName(INode node){
  String uniqueName=node.getUniqueName();
  if (node.isVirtualGenerateNode()) {
    List<? extends INode> nodeList=node.getProcess().getGraphicalNodes();
    for (    INode graphicnode : nodeList) {
      if (graphicnode.isGeneratedAsVirtualComponent()) {
        String nodeUniqueName=graphicnode.getUniqueName();
        if (uniqueName.indexOf(nodeUniqueName + "String_Node_Str") == 0) {
          uniqueName=nodeUniqueName;
          break;
        }
      }
    }
  }
  return uniqueName;
}

Fixed version (ground truth):
/** 
 * @author jyhu
 * @aim Get unique name of the graphica node from generating node.
 * @param node: Generated node
 * @return unique name of the graphica node.
 */
public static String getVirtualUniqueName(INode node){
  return getVirtualNode(node).getUniqueName();
}
Program: 126942
Project: 126942
Buggy source:
private synchronized Connection getConnection(String dbDriver,String url,String dbConnectionName) throws ClassNotFoundException, SQLException {
  debugSharedConnections();
  Connection connection=sharedConnections.get(dbConnectionName);
  if (connection == null) {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbConnectionName+ "String_Node_Str"+ "String_Node_Str");
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbDriver+ "String_Node_Str");
    Class.forName(dbDriver);
    logMessage(Level.INFO,cid + "String_Node_Str" + url+ "String_Node_Str");
    connection=DriverManager.getConnection(url);
    logMessage(Level.INFO,cid + "String_Node_Str" + url+ "String_Node_Str");
    sharedConnections.put(dbConnectionName,connection);
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbConnectionName+ "String_Node_Str");
  }
 else   if (connection.isClosed()) {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbConnectionName+ "String_Node_Str"+ "String_Node_Str");
    logMessage(Level.INFO,cid + "String_Node_Str" + url+ "String_Node_Str");
    connection=DriverManager.getConnection(url);
    logMessage(Level.INFO,cid + "String_Node_Str" + url+ "String_Node_Str");
    sharedConnections.put(dbConnectionName,connection);
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbConnectionName+ "String_Node_Str");
  }
 else {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbConnectionName+ "String_Node_Str"+ "String_Node_Str");
  }
  return connection;
}

Fixed version (ground truth):
private synchronized Connection getConnection(String dbDriver,String url,String dbConnectionName) throws ClassNotFoundException, SQLException {
  if (DEBUG) {
    Set<String> keySet=sharedConnections.keySet();
    System.out.print("String_Node_Str");
    for (    String key : keySet) {
      System.out.print("String_Node_Str" + key);
    }
    System.out.println();
  }
  Connection connection=sharedConnections.get(dbConnectionName);
  if (connection == null) {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
    Class.forName(dbDriver);
    connection=DriverManager.getConnection(url);
    sharedConnections.put(dbConnectionName,connection);
  }
 else   if (connection.isClosed()) {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
    connection=DriverManager.getConnection(url);
    sharedConnections.put(dbConnectionName,connection);
  }
 else {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
  }
  return connection;
}
Program: 126943
Project: 126943
Buggy source:
public static String addQuotesWithSpaceField(String fieldName,String dbType){
  if (fieldName == null) {
    fieldName="String_Node_Str";
  }
  if (fieldName.startsWith("String_Node_Str") && fieldName.endsWith("String_Node_Str")) {
    return fieldName;
  }
  boolean b=true;
  for (int i=0; i < fieldName.length(); i++) {
    char c=fieldName.charAt(i);
    b=b && c >= '0' && c <= '9';
  }
  boolean check=Pattern.matches("String_Node_Str",fieldName);
  EDatabaseTypeName name=EDatabaseTypeName.getTypeFromDbType(dbType);
  if (name.equals(EDatabaseTypeName.MYSQL) && fieldName.contains(JAVA_END_STRING)) {
    String newFieldName=TalendQuoteUtils.addQuotes(fieldName);
    return newFieldName;
  }
  boolean isCheck=!CorePlugin.getDefault().getPreferenceStore().getBoolean(ITalendCorePrefConstants.SQL_ADD_QUOTE);
  if (!b) {
    if (isCheck && isPSQLSimilar(name) && check) {
      return fieldName;
    }
  }
  String newFieldName=fieldName;
  String quote=getQuoteByDBType(name);
  if (!newFieldName.contains(quote)) {
    newFieldName=addQuotes(newFieldName,quote);
  }
  return newFieldName;
}

Fixed version (ground truth):
public static String addQuotesWithSpaceField(String fieldName,String dbType){
  if (fieldName == null) {
    fieldName="String_Node_Str";
  }
  if (fieldName.startsWith("String_Node_Str") && fieldName.endsWith("String_Node_Str")) {
    return fieldName;
  }
  boolean b=true;
  for (int i=0; i < fieldName.length(); i++) {
    char c=fieldName.charAt(i);
    b=b && c >= '0' && c <= '9';
  }
  boolean check=Pattern.matches("String_Node_Str",fieldName);
  EDatabaseTypeName name=EDatabaseTypeName.getTypeFromDbType(dbType);
  boolean isCheck=!CorePlugin.getDefault().getPreferenceStore().getBoolean(ITalendCorePrefConstants.SQL_ADD_QUOTE);
  if (!b) {
    if (isCheck && isPSQLSimilar(name) && check) {
      return fieldName;
    }
  }
  String newFieldName=fieldName;
  String quote=getQuoteByDBType(name);
  if (!newFieldName.contains(quote)) {
    newFieldName=addQuotes(newFieldName,quote);
  }
  return newFieldName;
}
Program: 126944
Project: 126944
Buggy source:
private synchronized Connection getConnection(String dbDriver,String url,String dbConnectionName) throws ClassNotFoundException, SQLException {
  if (DEBUG) {
    Set<String> keySet=sharedConnections.keySet();
    System.out.print("String_Node_Str");
    for (    String key : keySet) {
      System.out.print("String_Node_Str" + key);
    }
    System.out.println();
  }
  Connection connection=sharedConnections.get(dbConnectionName);
  if (connection == null) {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
    Class.forName(dbDriver);
    connection=DriverManager.getConnection(url);
    sharedConnections.put(dbConnectionName,connection);
  }
 else   if (connection.isClosed()) {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
    connection=DriverManager.getConnection(url);
    sharedConnections.put(dbConnectionName,connection);
  }
 else {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
  }
  return connection;
}

Fixed version (ground truth):
private synchronized Connection getConnection(String dbDriver,String url,String dbConnectionName) throws ClassNotFoundException, SQLException {
  debugSharedConnections();
  Connection connection=sharedConnections.get(dbConnectionName);
  if (connection == null) {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbConnectionName+ "String_Node_Str"+ "String_Node_Str");
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbDriver+ "String_Node_Str");
    Class.forName(dbDriver);
    logMessage(Level.INFO,cid + "String_Node_Str" + url+ "String_Node_Str");
    connection=DriverManager.getConnection(url);
    logMessage(Level.INFO,cid + "String_Node_Str" + url+ "String_Node_Str");
    sharedConnections.put(dbConnectionName,connection);
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbConnectionName+ "String_Node_Str");
  }
 else   if (connection.isClosed()) {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbConnectionName+ "String_Node_Str"+ "String_Node_Str");
    logMessage(Level.INFO,cid + "String_Node_Str" + url+ "String_Node_Str");
    connection=DriverManager.getConnection(url);
    logMessage(Level.INFO,cid + "String_Node_Str" + url+ "String_Node_Str");
    sharedConnections.put(dbConnectionName,connection);
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbConnectionName+ "String_Node_Str");
  }
 else {
    if (DEBUG) {
      System.out.println("String_Node_Str" + dbConnectionName + "String_Node_Str"+ "String_Node_Str");
    }
    logMessage(Level.DEBUG,cid + "String_Node_Str" + dbConnectionName+ "String_Node_Str"+ "String_Node_Str");
  }
  return connection;
}
Program: 126948
Project: 126948
Buggy source:
public void closeConnection(boolean force){
  try {
    if (conn != null && !conn.isClosed()) {
      if (isReconnect || force) {
        conn.close();
      }
    }
  }
 catch (  SQLException e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
catch (  Exception e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void closeConnection(boolean force){
  try {
    if (conn != null && !conn.isClosed()) {
      if (isReconnect || force) {
        if (conn.getMetaData() != null) {
          String url=conn.getMetaData().getURL();
          boolean isHsql=ConnectionUtils.isHsql(url);
          if (isHsql) {
            Statement statement=conn.createStatement();
            statement.executeUpdate("String_Node_Str");
          }
        }
        conn.close();
      }
    }
  }
 catch (  SQLException e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
catch (  Exception e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
}
Program: 126964
Project: 126964
Buggy source:
public static String getNormalizeParameterValue(INode node,IElementParameter ep){
  String value="String_Node_Str";
  List<EParameterFieldType> needQuoteList=Arrays.asList(EParameterFieldType.CLOSED_LIST,EParameterFieldType.OPENED_LIST,EParameterFieldType.COMPONENT_LIST,EParameterFieldType.COLUMN_LIST);
  value=ElementParameterParser.getValue(node,"String_Node_Str" + ep.getName() + "String_Node_Str");
  if (needQuoteList.contains(ep.getFieldType())) {
    value="String_Node_Str" + value + "String_Node_Str";
  }
  List<EParameterFieldType> needRemoveCRLFList=Arrays.asList(EParameterFieldType.MEMO,EParameterFieldType.MEMO_JAVA,EParameterFieldType.MEMO_SQL);
  if (needRemoveCRLFList.contains(ep.getFieldType())) {
    value=value.replaceAll("String_Node_Str","String_Node_Str");
  }
  return value;
}

Fixed version (ground truth):
public static String getNormalizeParameterValue(INode node,IElementParameter ep){
  String value="String_Node_Str";
  List<EParameterFieldType> needQuoteList=Arrays.asList(EParameterFieldType.CLOSED_LIST,EParameterFieldType.OPENED_LIST,EParameterFieldType.COMPONENT_LIST,EParameterFieldType.COLUMN_LIST,EParameterFieldType.PREV_COLUMN_LIST);
  value=ElementParameterParser.getValue(node,"String_Node_Str" + ep.getName() + "String_Node_Str");
  if (needQuoteList.contains(ep.getFieldType())) {
    value="String_Node_Str" + value + "String_Node_Str";
  }
  List<EParameterFieldType> needRemoveCRLFList=Arrays.asList(EParameterFieldType.MEMO,EParameterFieldType.MEMO_JAVA,EParameterFieldType.MEMO_SQL);
  if (needRemoveCRLFList.contains(ep.getFieldType())) {
    value=value.replaceAll("String_Node_Str","String_Node_Str");
  }
  return value;
}
Program: 126966
Project: 126966
Buggy source:
public void startThreadTrace(String clientHost,int portTraces) throws java.io.IOException, java.net.UnknownHostException {
  if (!openSocket) {
    return;
  }
  System.out.println("String_Node_Str" + portTraces);
  s=new java.net.Socket(clientHost,portTraces);
  pred=new java.io.PrintWriter(new java.io.BufferedWriter(new java.io.OutputStreamWriter(s.getOutputStream())),true);
  System.out.println("String_Node_Str");
  t=new Thread(this);
  t.start();
}

Fixed version (ground truth):
public void startThreadTrace(String clientHost,int portTraces) throws java.io.IOException, java.net.UnknownHostException {
  if (!openSocket) {
    return;
  }
  System.out.println("String_Node_Str" + portTraces);
  s=new java.net.Socket(clientHost,portTraces);
  oos=new NoHeaderObjectOutputStream(s.getOutputStream());
  System.out.println("String_Node_Str");
  t=new Thread(this);
  t.start();
}
Program: 126967
Project: 126967
Buggy source:
public void stopThreadTrace(){
  if (!openSocket) {
    return;
  }
  jobIsFinished=true;
  try {
    pred.close();
    s.close();
    System.out.println("String_Node_Str");
  }
 catch (  java.io.IOException ie) {
  }
}

Fixed version (ground truth):
public void stopThreadTrace(){
  if (!openSocket) {
    return;
  }
  jobIsFinished=true;
  try {
    oos.close();
    s.close();
    System.out.println("String_Node_Str");
  }
 catch (  java.io.IOException ie) {
  }
}
Program: 126968
Project: 126968
Buggy source:
public void sendTrace(String componentId,String startNodeCid,String datas){
  if (!openSocket) {
    return;
  }
  subjobMap.put(componentId,startNodeCid);
  Iterator<Entry<String,String>> ite=subjobMap.entrySet().iterator();
  boolean sameSub=false;
  while (ite.hasNext()) {
    Entry<String,String> en=ite.next();
    if (en.getKey().equals(componentId)) {
      continue;
    }
    if (en.getValue().equals(startNodeCid)) {
      sameSub=true;
      break;
    }
  }
  if (sameSub && processTraces.size() > 1) {
    if (componentId.equals(componentName)) {
      return;
    }
  }
  TraceBean bean;
  if (processTraces.containsKey(componentId)) {
    bean=processTraces.get(componentId);
  }
 else {
    bean=new TraceBean(componentId);
  }
  bean.setNbLine(bean.getNbLine() + 1);
  processTraces.put(componentId,bean);
  str=bean.getComponentId() + "String_Node_Str" + bean.getNbLine()+ "String_Node_Str"+ datas;
  pred.println(str);
  componentName=componentId;
}

Fixed version (ground truth):
public void sendTrace(String connectionId,String startNodeCid,LinkedHashMap datas) throws IOException {
  if (!openSocket) {
    return;
  }
  subjobMap.put(connectionId,startNodeCid);
  Iterator<Entry<String,String>> ite=subjobMap.entrySet().iterator();
  boolean sameSub=false;
  while (ite.hasNext()) {
    Entry<String,String> en=ite.next();
    if (en.getKey().equals(connectionId)) {
      continue;
    }
    if (en.getValue().equals(startNodeCid)) {
      sameSub=true;
      break;
    }
  }
  if (sameSub && processTraces.size() > 1) {
    if (connectionId.equals(this.connectionId)) {
      return;
    }
  }
  TraceDataBean bean;
  if (processTraces.containsKey(connectionId)) {
    bean=processTraces.get(connectionId);
  }
 else {
    bean=new TraceDataBean(connectionId);
  }
  bean.setNbLine(bean.getNbLine() + 1);
  processTraces.put(connectionId,bean);
  bean.setData(datas);
  oos.writeUnshared(bean);
  oos.flush();
  this.connectionId=connectionId;
}
Program: 126969
Project: 126969
Buggy source:
public void waitForUserAction() throws InterruptedException {
  if (!openSocket) {
    return;
  }
  InputStream in;
  try {
    boolean action=false;
    pred.println("String_Node_Str");
    do {
      in=s.getInputStream();
      LineNumberReader reader=new LineNumberReader(new InputStreamReader(in));
      String line=reader.readLine();
      if ("String_Node_Str".equals(line)) {
        pred.println("String_Node_Str");
        Thread.sleep(100);
      }
 else {
        action=true;
      }
    }
 while (!action);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void waitForUserAction() throws InterruptedException {
  if (!openSocket) {
    return;
  }
  try {
    boolean action=false;
    oos.writeObject(TraceStatusBean.UI_STATUS);
    do {
      ois=new NoHeaderObjectInputStream(s.getInputStream());
      TraceBean traceBean=(TraceBean)ois.readObject();
      if (traceBean.equals(TraceStatusBean.STATUS_WAITING)) {
        oos.writeObject(TraceStatusBean.UI_STATUS);
        Thread.sleep(100);
      }
 else {
        action=true;
      }
    }
 while (!action);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
}
Program: 126970
Project: 126970
Buggy source:
public void run(){
synchronized (this) {
    try {
      while (!jobIsFinished) {
        wait(100);
      }
    }
 catch (    InterruptedException e) {
      System.out.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
synchronized (this) {
    try {
      while (!jobIsFinished) {
        wait(100);
      }
    }
 catch (    InterruptedException e) {
      System.out.println("String_Node_Str");
    }
  }
}
Program: 126971
Project: 126971
Buggy source:
public boolean isPause(){
  if (!openSocket) {
    return false;
  }
  InputStream in;
  try {
    askForStatus();
    in=s.getInputStream();
    LineNumberReader reader=new LineNumberReader(new InputStreamReader(in));
    return "String_Node_Str".equals(reader.readLine());
  }
 catch (  IOException e) {
    e.printStackTrace();
    return false;
  }
}

Fixed version (ground truth):
public boolean isPause(){
  if (!openSocket) {
    return false;
  }
  try {
    askForStatus();
    ois=new NoHeaderObjectInputStream(s.getInputStream());
    TraceBean traceBean=(TraceBean)ois.readObject();
    return traceBean.equals(TraceStatusBean.PAUSE);
  }
 catch (  IOException e) {
    e.printStackTrace();
    return false;
  }
catch (  ClassNotFoundException e) {
    e.printStackTrace();
    return false;
  }
}
Program: 126972
Project: 126972
Buggy source:
public boolean isNextBreakpoint(){
  if (!openSocket) {
    return false;
  }
  InputStream in;
  try {
    askForStatus();
    in=s.getInputStream();
    LineNumberReader reader=new LineNumberReader(new InputStreamReader(in));
    return "String_Node_Str".equals(reader.readLine());
  }
 catch (  IOException e) {
    e.printStackTrace();
    return false;
  }
}

Fixed version (ground truth):
public boolean isNextBreakpoint(){
  if (!openSocket) {
    return false;
  }
  try {
    askForStatus();
    ois=new NoHeaderObjectInputStream(s.getInputStream());
    TraceBean traceBean=(TraceBean)ois.readObject();
    return traceBean.equals(TraceStatusBean.NEXT_BREAKPOINT);
  }
 catch (  IOException e) {
    e.printStackTrace();
    return false;
  }
catch (  ClassNotFoundException e) {
    e.printStackTrace();
    return false;
  }
}
Program: 126973
Project: 126973
Buggy source:
private void askForStatus(){
  pred.println("String_Node_Str");
}

Fixed version (ground truth):
private void askForStatus() throws IOException {
  oos.writeObject(TraceStatusBean.ID_STATUS);
}
Program: 126974
Project: 126974
Buggy source:
public boolean isNextRow(){
  if (!openSocket) {
    return false;
  }
  InputStream in;
  try {
    askForStatus();
    in=s.getInputStream();
    LineNumberReader reader=new LineNumberReader(new InputStreamReader(in));
    return "String_Node_Str".equals(reader.readLine());
  }
 catch (  IOException e) {
    e.printStackTrace();
    return false;
  }
}

Fixed version (ground truth):
public boolean isNextRow(){
  if (!openSocket) {
    return false;
  }
  try {
    askForStatus();
    ois=new NoHeaderObjectInputStream(s.getInputStream());
    TraceBean traceBean=(TraceBean)ois.readObject();
    return traceBean.equals(TraceStatusBean.NEXT_ROW);
  }
 catch (  IOException e) {
    e.printStackTrace();
    return false;
  }
catch (  ClassNotFoundException e) {
    e.printStackTrace();
    return false;
  }
}