nus-yam/ex-repair huggingface dataset:
Program: 128069
Project: 128069
Buggy source:
@Override public void logOnProject(Project project) throws PersistenceException, LoginException {
  if (getRepositoryContext().getUser().getLogin() == null) {
    throw new LoginException(Messages.getString("String_Node_Str"));
  }
  super.logOnProject(project);
  if (!doesLoggedUserExist()) {
    createUser(project);
  }
  IProject project2=ResourceModelUtils.getProject(project);
  createFolders(project2,project.getEmfProject());
  synchronizeRoutines(project2);
  synchronizeSqlpatterns(project2);
  synchronizeFolders(project2,project.getEmfProject());
  changeRoutinesPackage(project);
  saveProject(project);
}

Fixed version (ground truth):
@Override public void logOnProject(Project project) throws PersistenceException, LoginException {
  if (getRepositoryContext().getUser().getLogin() == null) {
    throw new LoginException(Messages.getString("String_Node_Str"));
  }
  if (project.getEmfProject().eResource() == null) {
    IProject iProject=ResourceModelUtils.getProject(getRepositoryContext().getProject());
    project.setEmfProject(xmiResourceManager.loadProject(iProject));
  }
  super.logOnProject(project);
  if (!doesLoggedUserExist()) {
    createUser(project);
  }
  IProject project2=ResourceModelUtils.getProject(project);
  createFolders(project2,project.getEmfProject());
  synchronizeRoutines(project2);
  synchronizeSqlpatterns(project2);
  synchronizeFolders(project2,project.getEmfProject());
  changeRoutinesPackage(project);
  saveProject(project);
}
Program: 128070
Project: 128070
Buggy source:
@Override public List<IRepositoryViewObject> collectRelatedRoutines(Set<String> includeRoutineIdOrNames,boolean system){
  return RoutinesUtil.collectRelatedRoutines(includeRoutineIdOrNames,true);
}

Fixed version (ground truth):
@Override public List<IRepositoryViewObject> collectRelatedRoutines(Set<String> includeRoutineIdOrNames,boolean system){
  return RoutinesUtil.collectRelatedRoutines(includeRoutineIdOrNames,system);
}
Program: 128071
Project: 128071
Buggy source:
public static String checkStringQuotationMarks(String str){
  if (str == null) {
    return "String_Node_Str";
  }
  return str.replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static String checkStringQuotationMarks(String str){
  if (str == null) {
    return "String_Node_Str";
  }
 else   if (!str.contains("String_Node_Str")) {
    return str;
  }
  return str.replace("String_Node_Str","String_Node_Str");
}
Program: 128073
Project: 128073
Buggy source:
public synchronized Property loadProperty(IResource iResource){
  URI propertyUri=URIHelper.convert(iResource.getFullPath());
  URI itemResourceURI=getItemResourceURI(propertyUri);
  List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
  for (  Resource res : resources) {
    if (res != null) {
      if (propertyUri.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
      if (itemResourceURI.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
    }
  }
  Resource propertyResource=resourceSet.getResource(propertyUri,true);
  Property property=(Property)EcoreUtil.getObjectByType(propertyResource.getContents(),PropertiesPackage.eINSTANCE.getProperty());
  return property;
}

Fixed version (ground truth):
public synchronized Property loadProperty(IResource iResource){
  URI propertyUri=URIHelper.convert(iResource.getFullPath());
  URI itemResourceURI=getItemResourceURI(propertyUri);
  URI screenshotResourceURI=getScreenshotResourceURI(itemResourceURI);
  List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
  for (  Resource res : resources) {
    if (res != null) {
      if (propertyUri.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
      if (itemResourceURI.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
      if (screenshotResourceURI.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
    }
  }
  Resource propertyResource=resourceSet.getResource(propertyUri,true);
  Property property=(Property)EcoreUtil.getObjectByType(propertyResource.getContents(),PropertiesPackage.eINSTANCE.getProperty());
  return property;
}
Program: 128075
Project: 128075
Buggy source:
public Resource getScreenshotResource(Item item,boolean createIfNotExist){
  URI itemResourceURI=null;
  itemResourceURI=getScreenshotResourceURI(getItemURI(item));
  boolean fileExist=false;
  if (itemResourceURI.isFile()) {
    fileExist=new File(itemResourceURI.toFileString()).exists();
  }
 else {
    IPath path=URIHelper.convert(itemResourceURI);
    if (path != null) {
      IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(path);
      if (file.exists()) {
        fileExist=true;
      }
    }
 else {
      fileExist=false;
    }
  }
  Resource itemResource=null;
  if (fileExist) {
    List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
    for (    Resource res : resources) {
      if (res != null) {
        if (itemResourceURI.toString().equals(res.getURI().toString())) {
          res.unload();
          resourceSet.getResources().remove(res);
          break;
        }
      }
    }
    try {
      itemResource=resourceSet.getResource(itemResourceURI,true);
    }
 catch (    Exception e) {
      itemResource=null;
    }
  }
  if (itemResource == null && createIfNotExist) {
    itemResource=resourceSet.createResource(itemResourceURI);
  }
  return itemResource;
}

Fixed version (ground truth):
public Resource getScreenshotResource(Item item,boolean createIfNotExist){
  URI itemResourceURI=null;
  itemResourceURI=getScreenshotResourceURI(getItemURI(item));
  boolean fileExist=false;
  if (itemResourceURI.isFile()) {
    fileExist=new File(itemResourceURI.toFileString()).exists();
  }
 else {
    IPath path=URIHelper.convert(itemResourceURI);
    if (path != null) {
      IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(path);
      if (file.exists()) {
        fileExist=true;
      }
    }
 else {
      fileExist=false;
    }
  }
  Resource itemResource=null;
  if (fileExist) {
    List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
    try {
      itemResource=resourceSet.getResource(itemResourceURI,true);
    }
 catch (    Exception e) {
      itemResource=null;
    }
  }
  if (itemResource == null && createIfNotExist) {
    itemResource=resourceSet.createResource(itemResourceURI);
  }
  return itemResource;
}
Program: 128077
Project: 128077
Buggy source:
protected String getText(String label,String version,String path,String projectLabel,boolean isDeleted,boolean isModified,boolean isFolder,boolean inRef){
  Assert.isNotNull(label);
  StringBuffer text=new StringBuffer(50);
  if (isModified) {
    text.append('>');
    text.append(SPACE);
  }
  text.append(label);
  if (isAllowChengeVersion() && !isFolder && version != null) {
    text.append(SPACE);
    text.append(version);
  }
  if (isRefMerged() && inRef && projectLabel != null) {
    text.append(SPACE);
    text.append('(');
    text.append('@');
    text.append(projectLabel);
    text.append(')');
  }
  if (!isFolder && isDeleted && path != null) {
    text.append(SPACE);
    text.append('(');
    text.append(path);
    text.append(')');
  }
  return text.toString();
}

Fixed version (ground truth):
protected String getText(String label,String version,String path,String projectLabel,boolean isDeleted,boolean isModified,boolean isFolder,boolean inRef){
  Assert.isNotNull(label);
  StringBuffer text=new StringBuffer(50);
  if (isModified) {
    text.append('>');
    text.append(SPACE);
  }
  text.append(label);
  if (isAllowChengeVersion() && !isFolder && version != null) {
    text.append(SPACE);
    text.append(version);
  }
  if (isRefMerged() && inRef && projectLabel != null) {
    text.append(SPACE);
    text.append('(');
    text.append('@');
    text.append(projectLabel);
    text.append(')');
  }
  if (!isFolder && isDeleted && path != null && path.length() > 0) {
    text.append(SPACE);
    text.append('(');
    text.append(path);
    text.append(')');
  }
  return text.toString();
}
Program: 128078
Project: 128078
Buggy source:
@Override public String getText(Object element){
  if (isRecycleBin(element)) {
    return ERepositoryObjectType.RECYCLE_BIN.toString();
  }
  return super.getText(element);
}

Fixed version (ground truth):
@Override public String getText(Object element){
  if (isRecycleBin(element)) {
    return ERepositoryObjectType.RECYCLE_BIN.toString();
  }
  return null;
}
Program: 128079
Project: 128079
Buggy source:
@Override public Image getImage(Object element){
  if (isRecycleBin(element)) {
    RepositoryNode recyclebinNode=(RepositoryNode)element;
    if (recyclebinNode.getChildren().isEmpty()) {
      return ImageProvider.getImage(ECoreImage.RECYCLE_BIN_EMPTY_ICON);
    }
 else {
      return ImageProvider.getImage(ECoreImage.RECYCLE_BIN_FULL_ICON);
    }
  }
  return super.getImage(element);
}

Fixed version (ground truth):
@Override public Image getImage(Object element){
  if (isRecycleBin(element)) {
    RepositoryNode recyclebinNode=(RepositoryNode)element;
    if (recyclebinNode.getChildren().isEmpty()) {
      return ImageProvider.getImage(ECoreImage.RECYCLE_BIN_EMPTY_ICON);
    }
 else {
      return ImageProvider.getImage(ECoreImage.RECYCLE_BIN_FULL_ICON);
    }
  }
  return null;
}
Program: 128081
Project: 128081
Buggy source:
protected String getText(String label,String version,String path,String projectLabel,boolean isDeleted,boolean isModified,boolean addVersion,boolean inRef){
  Assert.isNotNull(label);
  StringBuffer text=new StringBuffer(50);
  if (isModified) {
    text.append('>');
    text.append(SPACE);
  }
  text.append(label);
  if (isAllowChengeVersion() && addVersion && version != null) {
    text.append(SPACE);
    text.append(version);
  }
  if (isRefMerged() && inRef && projectLabel != null) {
    text.append(SPACE);
    text.append('(');
    text.append('@');
    text.append(projectLabel);
    text.append(')');
  }
  if (isDeleted && path != null) {
    text.append(SPACE);
    text.append('(');
    text.append(path);
    text.append(')');
  }
  return text.toString();
}

Fixed version (ground truth):
protected String getText(String label,String version,String path,String projectLabel,boolean isDeleted,boolean isModified,boolean isFolder,boolean inRef){
  Assert.isNotNull(label);
  StringBuffer text=new StringBuffer(50);
  if (isModified) {
    text.append('>');
    text.append(SPACE);
  }
  text.append(label);
  if (isAllowChengeVersion() && !isFolder && version != null) {
    text.append(SPACE);
    text.append(version);
  }
  if (isRefMerged() && inRef && projectLabel != null) {
    text.append(SPACE);
    text.append('(');
    text.append('@');
    text.append(projectLabel);
    text.append(')');
  }
  if (!isFolder && isDeleted && path != null) {
    text.append(SPACE);
    text.append('(');
    text.append(path);
    text.append(')');
  }
  return text.toString();
}
Program: 128082
Project: 128082
Buggy source:
protected String getElementText(RepositoryNode node){
  if (node.getType() == ENodeType.REPOSITORY_ELEMENT || node.getType() == ENodeType.SIMPLE_FOLDER) {
    boolean isDeleted=false;
    boolean isModified=false;
    boolean inRef=false;
    boolean addVersion=true;
    IRepositoryViewObject object=node.getObject();
    isModified=object.isModified();
    isDeleted=object.isDeleted();
    org.talend.core.model.properties.Project mainProject=ProjectManager.getInstance().getCurrentProject().getEmfProject();
    inRef=!mainProject.getLabel().equals(object.getProjectLabel());
    if (node.getType() == ENodeType.SIMPLE_FOLDER) {
      addVersion=false;
    }
    return getText(object.getLabel(),object.getVersion(),object.getPath(),object.getProjectLabel(),isDeleted,isModified,addVersion,inRef);
  }
 else {
    return getText(node.getLabel(),null,null,null,false,false,false,false);
  }
}

Fixed version (ground truth):
protected String getElementText(RepositoryNode node){
  if (node.getType() == ENodeType.REPOSITORY_ELEMENT || node.getType() == ENodeType.SIMPLE_FOLDER) {
    boolean isDeleted=false;
    boolean isModified=false;
    boolean inRef=false;
    boolean isFolder=false;
    IRepositoryViewObject object=node.getObject();
    isModified=object.isModified();
    isDeleted=object.isDeleted();
    org.talend.core.model.properties.Project mainProject=ProjectManager.getInstance().getCurrentProject().getEmfProject();
    inRef=!mainProject.getLabel().equals(object.getProjectLabel());
    if (node.getType() == ENodeType.SIMPLE_FOLDER) {
      isFolder=true;
    }
    return getText(object.getLabel(),object.getVersion(),object.getPath(),object.getProjectLabel(),isDeleted,isModified,isFolder,inRef);
  }
 else {
    return getText(node.getLabel(),null,null,null,false,false,false,false);
  }
}
Program: 128083
Project: 128083
Buggy source:
@Override public Font getFont(Object element){
  return JFaceResources.getFontRegistry().defaultFont();
}

Fixed version (ground truth):
@Override public Font getFont(Object element){
  if (element instanceof RepositoryNode) {
    RepositoryNode node=(RepositoryNode)element;
switch (node.getType()) {
case SYSTEM_FOLDER:
      return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
case STABLE_SYSTEM_FOLDER:
default :
  }
}
return JFaceResources.getFontRegistry().defaultFont();
}
Program: 128084
Project: 128084
Buggy source:
@Override public String getText(Object element){
  return ERepositoryObjectType.RECYCLE_BIN.toString();
}

Fixed version (ground truth):
@Override public String getText(Object element){
  if (isRecycleBin(element)) {
    return ERepositoryObjectType.RECYCLE_BIN.toString();
  }
  return super.getText(element);
}
Program: 128085
Project: 128085
Buggy source:
@Override public Image getImage(Object element){
  if (element instanceof RepositoryNode) {
    RepositoryNode recyclebinNode=(RepositoryNode)element;
    if (recyclebinNode.getChildren().isEmpty()) {
      return ImageProvider.getImage(ECoreImage.RECYCLE_BIN_EMPTY_ICON);
    }
 else {
      return ImageProvider.getImage(ECoreImage.RECYCLE_BIN_FULL_ICON);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Image getImage(Object element){
  if (isRecycleBin(element)) {
    RepositoryNode recyclebinNode=(RepositoryNode)element;
    if (recyclebinNode.getChildren().isEmpty()) {
      return ImageProvider.getImage(ECoreImage.RECYCLE_BIN_EMPTY_ICON);
    }
 else {
      return ImageProvider.getImage(ECoreImage.RECYCLE_BIN_FULL_ICON);
    }
  }
  return super.getImage(element);
}
Program: 128088
Project: 128088
Buggy source:
public static String checkStringQuotationMarks(String str){
  if (str == null) {
    return "String_Node_Str";
  }
  return str.replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static String checkStringQuotationMarks(String str){
  if (str == null) {
    return "String_Node_Str";
  }
 else   if (!str.contains("String_Node_Str")) {
    return str;
  }
  return str.replace("String_Node_Str","String_Node_Str");
}
Program: 128089
Project: 128089
Buggy source:
/** 
 * Parse SF field to Talend data type <p> DOC YeXiaowei Comment method "parseFieldToMetadataColumn".
 * @param field
 * @return
 */
private IMetadataColumn parseFieldToMetadataColumn(Field field){
  if (field == null) {
    return null;
  }
  IMetadataColumn mdColumn=new org.talend.core.model.metadata.MetadataColumn();
  mdColumn.setLabel(field.getName());
  mdColumn.setKey(false);
  String type=field.getType().toString();
  String talendType="String_Node_Str";
  if (type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str") || type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else {
    talendType="String_Node_Str";
  }
  mdColumn.setTalendType("String_Node_Str" + talendType);
  mdColumn.setNullable(field.isNillable());
  if (type.equals("String_Node_Str")) {
    mdColumn.setPattern("String_Node_Str");
  }
 else   if (type.equals("String_Node_Str")) {
    mdColumn.setPattern("String_Node_Str");
  }
 else {
    mdColumn.setPattern(null);
  }
  mdColumn.setLength(field.getLength());
  mdColumn.setPrecision(field.getPrecision());
  mdColumn.setDefault(field.getDefaultValueFormula());
  return mdColumn;
}

Fixed version (ground truth):
/** 
 * Parse SF field to Talend data type <p> DOC YeXiaowei Comment method "parseFieldToMetadataColumn".
 * @param field
 * @return
 */
private IMetadataColumn parseFieldToMetadataColumn(Field field){
  if (field == null) {
    return null;
  }
  IMetadataColumn mdColumn=new org.talend.core.model.metadata.MetadataColumn();
  mdColumn.setLabel(field.getName());
  mdColumn.setKey(false);
  String type=field.getType().toString();
  String talendType="String_Node_Str";
  if (type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str") || type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str") || type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else {
    talendType="String_Node_Str";
  }
  mdColumn.setTalendType("String_Node_Str" + talendType);
  mdColumn.setNullable(field.isNillable());
  if (type.equals("String_Node_Str")) {
    mdColumn.setPattern("String_Node_Str");
  }
 else   if (type.equals("String_Node_Str")) {
    mdColumn.setPattern("String_Node_Str");
  }
 else {
    mdColumn.setPattern(null);
  }
  if ("String_Node_Str".equals(talendType)) {
    mdColumn.setLength(field.getLength());
    mdColumn.setPrecision(field.getPrecision());
  }
 else {
    mdColumn.setLength(field.getPrecision());
    mdColumn.setPrecision(field.getScale());
  }
  mdColumn.setDefault(field.getDefaultValueFormula());
  return mdColumn;
}
Program: 128090
Project: 128090
Buggy source:
public List<IMetadataColumn> getCurrentMetadataColumns(){
  return this.currentMetadataColumns;
}

Fixed version (ground truth):
@Override public List<IMetadataColumn> getCurrentMetadataColumns(){
  return this.currentMetadataColumns;
}
Program: 128091
Project: 128091
Buggy source:
public ArrayList login(String endPoint,String username,String password,String timeOut) throws Exception {
  if (endPoint == null) {
    throw new RemoteException(Messages.getString("String_Node_Str"));
  }
  if (username == null || password == null) {
    throw new Exception(Messages.getString("String_Node_Str"));
  }
  ArrayList doLoginList=null;
  if (name != null && pwd != null && url != null) {
    if (!url.equals(endPoint) || !name.equals(username) || !pwd.equals(password)) {
      doLoginList=doLogin(endPoint,username,password);
    }
 else {
      if (isLogin()) {
        return doLoginList;
      }
    }
  }
 else {
    doLoginList=doLogin(endPoint,username,password);
  }
  this.name=username;
  this.pwd=password;
  this.url=endPoint;
  return doLoginList;
}

Fixed version (ground truth):
@Override public ArrayList login(String endPoint,String username,String password,String timeOut) throws Exception {
  if (endPoint == null) {
    throw new RemoteException(Messages.getString("String_Node_Str"));
  }
  if (username == null || password == null) {
    throw new Exception(Messages.getString("String_Node_Str"));
  }
  ArrayList doLoginList=null;
  if (name != null && pwd != null && url != null) {
    if (!url.equals(endPoint) || !name.equals(username) || !pwd.equals(password)) {
      doLoginList=doLogin(endPoint,username,password);
    }
 else {
      if (isLogin()) {
        return doLoginList;
      }
    }
  }
 else {
    doLoginList=doLogin(endPoint,username,password);
  }
  this.name=username;
  this.pwd=password;
  this.url=endPoint;
  return doLoginList;
}
Program: 128092
Project: 128092
Buggy source:
public boolean isLogin(){
  return this.loginOk;
}

Fixed version (ground truth):
@Override public boolean isLogin(){
  return this.loginOk;
}
Program: 128093
Project: 128093
Buggy source:
public void setCurrentMetadataColumns(List<IMetadataColumn> currentMetadataColumns){
  this.currentMetadataColumns=currentMetadataColumns;
}

Fixed version (ground truth):
@Override public void setCurrentMetadataColumns(List<IMetadataColumn> currentMetadataColumns){
  this.currentMetadataColumns=currentMetadataColumns;
}
Program: 128094
Project: 128094
Buggy source:
public void setLogin(boolean login){
  this.loginOk=login;
}

Fixed version (ground truth):
@Override public void setLogin(boolean login){
  this.loginOk=login;
}
Program: 128095
Project: 128095
Buggy source:
public void describeGlobalSample(){
  try {
    DescribeGlobalResult describeGlobalResult=null;
    describeGlobalResult=binding.describeGlobal();
    String[] types=describeGlobalResult.getTypes();
    for (int i=0; i < types.length; i++)     System.out.println(types[i]);
    System.out.println("String_Node_Str");
  }
 catch (  Exception ex) {
    System.out.println("String_Node_Str" + ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public void describeGlobalSample(){
  try {
    DescribeGlobalResult describeGlobalResult=null;
    describeGlobalResult=binding.describeGlobal();
    String[] types=describeGlobalResult.getTypes();
    for (    String type : types) {
      System.out.println(type);
    }
    System.out.println("String_Node_Str");
  }
 catch (  Exception ex) {
    System.out.println("String_Node_Str" + ex.getMessage());
  }
}
Program: 128096
Project: 128096
Buggy source:
public void setCurrentModuleName(String currentModuleName){
  this.currentModuleName=currentModuleName;
}

Fixed version (ground truth):
@Override public void setCurrentModuleName(String currentModuleName){
  this.currentModuleName=currentModuleName;
}
Program: 128097
Project: 128097
Buggy source:
public String getCurrentModuleName(){
  return this.currentModuleName;
}

Fixed version (ground truth):
@Override public String getCurrentModuleName(){
  return this.currentModuleName;
}
Program: 128098
Project: 128098
Buggy source:
public List<IMetadataColumn> fetchMetaDataColumns(String module){
  Field[] fields=fetchSFDescriptionField(module);
  if (fields == null || fields.length <= 0) {
    return null;
  }
  List<IMetadataColumn> res=new ArrayList<IMetadataColumn>();
  for (  Field field : fields) {
    res.add(parseFieldToMetadataColumn(field));
  }
  setCurrentMetadataColumns(res);
  return res;
}

Fixed version (ground truth):
@Override public List<IMetadataColumn> fetchMetaDataColumns(String module){
  Field[] fields=fetchSFDescriptionField(module);
  if (fields == null || fields.length <= 0) {
    return null;
  }
  List<IMetadataColumn> res=new ArrayList<IMetadataColumn>();
  for (  Field field : fields) {
    res.add(parseFieldToMetadataColumn(field));
  }
  setCurrentMetadataColumns(res);
  return res;
}
Program: 128099
Project: 128099
Buggy source:
/** 
 * Parse SF field to Talend data type <p> DOC YeXiaowei Comment method "parseFieldToMetadataColumn".
 * @param field
 * @return
 */
private IMetadataColumn parseFieldToMetadataColumn(Field field){
  if (field == null) {
    return null;
  }
  IMetadataColumn mdColumn=new org.talend.core.model.metadata.MetadataColumn();
  mdColumn.setLabel(field.getName());
  mdColumn.setKey(false);
  String type=field.getType().toString();
  String talendType="String_Node_Str";
  if (type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str") || type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else {
    talendType="String_Node_Str";
  }
  mdColumn.setTalendType("String_Node_Str" + talendType);
  mdColumn.setNullable(field.getNillable());
  if (type.equals("String_Node_Str")) {
    mdColumn.setPattern("String_Node_Str");
  }
 else   if (type.equals("String_Node_Str")) {
    mdColumn.setPattern("String_Node_Str");
  }
 else {
    mdColumn.setPattern(null);
  }
  mdColumn.setLength(field.getLength());
  mdColumn.setPrecision(field.getPrecision());
  mdColumn.setDefault(field.getDefaultValueFormula());
  return mdColumn;
}

Fixed version (ground truth):
/** 
 * Parse SF field to Talend data type <p> DOC YeXiaowei Comment method "parseFieldToMetadataColumn".
 * @param field
 * @return
 */
private IMetadataColumn parseFieldToMetadataColumn(Field field){
  if (field == null) {
    return null;
  }
  IMetadataColumn mdColumn=new org.talend.core.model.metadata.MetadataColumn();
  mdColumn.setLabel(field.getName());
  mdColumn.setKey(false);
  String type=field.getType().toString();
  String talendType="String_Node_Str";
  if (type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str") || type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else   if (type.equals("String_Node_Str") || type.equals("String_Node_Str")) {
    talendType="String_Node_Str";
  }
 else {
    talendType="String_Node_Str";
  }
  mdColumn.setTalendType("String_Node_Str" + talendType);
  mdColumn.setNullable(field.getNillable());
  if (type.equals("String_Node_Str")) {
    mdColumn.setPattern("String_Node_Str");
  }
 else   if (type.equals("String_Node_Str")) {
    mdColumn.setPattern("String_Node_Str");
  }
 else {
    mdColumn.setPattern(null);
  }
  if ("String_Node_Str".equals(talendType)) {
    mdColumn.setLength(field.getLength());
    mdColumn.setPrecision(field.getPrecision());
  }
 else {
    mdColumn.setLength(field.getPrecision());
    mdColumn.setPrecision(field.getScale());
  }
  mdColumn.setDefault(field.getDefaultValueFormula());
  return mdColumn;
}
Program: 128100
Project: 128100
Buggy source:
/** 
 * Getter for currentMetadataColumns.
 * @return the currentMetadataColumns
 */
public List<IMetadataColumn> getCurrentMetadataColumns(){
  return this.currentMetadataColumns;
}

Fixed version (ground truth):
/** 
 * Getter for currentMetadataColumns.
 * @return the currentMetadataColumns
 */
@Override public List<IMetadataColumn> getCurrentMetadataColumns(){
  return this.currentMetadataColumns;
}
Program: 128101
Project: 128101
Buggy source:
public ArrayList login(String endPoint,String username,String password,String timeOut) throws Exception {
  if (endPoint == null) {
    throw new RemoteException(Messages.getString("String_Node_Str"));
  }
  if (username == null || password == null) {
    throw new Exception(Messages.getString("String_Node_Str"));
  }
  int time=Integer.valueOf(timeOut);
  ArrayList doLoginList=null;
  sforceManagement=new SforceManagementImpl();
  boolean login=false;
  if (name != null && pwd != null && url != null) {
    if (!url.equals(endPoint) || !name.equals(username) || !pwd.equals(password)) {
      login=sforceManagement.login(endPoint,username,password,time,false);
    }
 else {
      if (isLogin()) {
        return doLoginList;
      }
    }
  }
 else {
    login=sforceManagement.login(endPoint,username,password,time,false);
    doLoginList=new ArrayList();
    doLoginList.add(sforceManagement.getStub());
  }
  setLogin(login);
  setSforceManagement(sforceManagement);
  this.name=username;
  this.pwd=password;
  this.url=endPoint;
  return doLoginList;
}

Fixed version (ground truth):
@Override public ArrayList login(String endPoint,String username,String password,String timeOut) throws Exception {
  if (endPoint == null) {
    throw new RemoteException(Messages.getString("String_Node_Str"));
  }
  if (username == null || password == null) {
    throw new Exception(Messages.getString("String_Node_Str"));
  }
  int time=Integer.valueOf(timeOut);
  ArrayList doLoginList=null;
  sforceManagement=new SforceManagementImpl();
  boolean login=false;
  if (name != null && pwd != null && url != null) {
    if (!url.equals(endPoint) || !name.equals(username) || !pwd.equals(password)) {
      login=sforceManagement.login(endPoint,username,password,time,false);
    }
 else {
      if (isLogin()) {
        return doLoginList;
      }
    }
  }
 else {
    login=sforceManagement.login(endPoint,username,password,time,false);
    doLoginList=new ArrayList();
    doLoginList.add(sforceManagement.getStub());
  }
  setLogin(login);
  setSforceManagement(sforceManagement);
  this.name=username;
  this.pwd=password;
  this.url=endPoint;
  return doLoginList;
}
Program: 128102
Project: 128102
Buggy source:
/** 
 * Getter for login.
 * @return the login
 */
public boolean isLogin(){
  return this.loginOk;
}

Fixed version (ground truth):
/** 
 * Getter for login.
 * @return the login
 */
@Override public boolean isLogin(){
  return this.loginOk;
}
Program: 128103
Project: 128103
Buggy source:
/** 
 * Sets the currentMetadataColumns.
 * @param currentMetadataColumns the currentMetadataColumns to set
 */
public void setCurrentMetadataColumns(List<IMetadataColumn> currentMetadataColumns){
  this.currentMetadataColumns=currentMetadataColumns;
}

Fixed version (ground truth):
/** 
 * Sets the currentMetadataColumns.
 * @param currentMetadataColumns the currentMetadataColumns to set
 */
@Override public void setCurrentMetadataColumns(List<IMetadataColumn> currentMetadataColumns){
  this.currentMetadataColumns=currentMetadataColumns;
}
Program: 128104
Project: 128104
Buggy source:
/** 
 * Sets the login.
 * @param login the login to set
 */
public void setLogin(boolean login){
  this.loginOk=login;
}

Fixed version (ground truth):
/** 
 * Sets the login.
 * @param login the login to set
 */
@Override public void setLogin(boolean login){
  this.loginOk=login;
}
Program: 128105
Project: 128105
Buggy source:
public void describeGlobalSample(){
}

Fixed version (ground truth):
@Override public void describeGlobalSample(){
}
Program: 128106
Project: 128106
Buggy source:
/** 
 * Sets the currentModuleName.
 * @param currentModuleName the currentModuleName to set
 */
public void setCurrentModuleName(String currentModuleName){
  this.currentModuleName=currentModuleName;
}

Fixed version (ground truth):
/** 
 * Sets the currentModuleName.
 * @param currentModuleName the currentModuleName to set
 */
@Override public void setCurrentModuleName(String currentModuleName){
  this.currentModuleName=currentModuleName;
}
Program: 128107
Project: 128107
Buggy source:
/** 
 * Getter for currentModuleName.
 * @return the currentModuleName
 */
public String getCurrentModuleName(){
  return this.currentModuleName;
}

Fixed version (ground truth):
/** 
 * Getter for currentModuleName.
 * @return the currentModuleName
 */
@Override public String getCurrentModuleName(){
  return this.currentModuleName;
}
Program: 128108
Project: 128108
Buggy source:
/** 
 * Fetch a module from SF and transfor to Talend metadata data type. DOC YeXiaowei Comment method "fetchMetaDataColumns".
 * @param module
 * @return
 */
public List<IMetadataColumn> fetchMetaDataColumns(String module){
  Field[] fields=fetchSFDescriptionField(module);
  if (fields == null || fields.length <= 0) {
    return null;
  }
  List<IMetadataColumn> res=new ArrayList<IMetadataColumn>();
  for (  Field field : fields) {
    res.add(parseFieldToMetadataColumn(field));
  }
  setCurrentMetadataColumns(res);
  return res;
}

Fixed version (ground truth):
/** 
 * Fetch a module from SF and transfor to Talend metadata data type. DOC YeXiaowei Comment method "fetchMetaDataColumns".
 * @param module
 * @return
 */
@Override public List<IMetadataColumn> fetchMetaDataColumns(String module){
  Field[] fields=fetchSFDescriptionField(module);
  if (fields == null || fields.length <= 0) {
    return null;
  }
  List<IMetadataColumn> res=new ArrayList<IMetadataColumn>();
  for (  Field field : fields) {
    res.add(parseFieldToMetadataColumn(field));
  }
  setCurrentMetadataColumns(res);
  return res;
}
Program: 128109
Project: 128109
Buggy source:
private static void getImportFiles(String xsdFile,String newPath){
  File file=new File(xsdFile);
  if (!file.exists()) {
    return;
  }
  String xsdFolder=file.getParent();
  SAXReader saxReader=new SAXReader();
  Document doc;
  try {
    URL url=file.toURI().toURL();
    doc=saxReader.read(url.getFile());
    Element root=doc.getRootElement();
    List<Element> elementsList=new ArrayList<Element>();
    List<Element> importList=root.elements("String_Node_Str");
    if (importList != null) {
      elementsList.addAll(importList);
    }
    List<Element> includeList=root.elements("String_Node_Str");
    if (includeList != null) {
      elementsList.addAll(includeList);
    }
    if (elementsList.size() <= 0) {
      return;
    }
    for (    Element n : elementsList) {
      Attribute attr=n.attribute("String_Node_Str");
      if (attr != null) {
        String importFile=xsdFolder + File.separator + attr.getValue();
        File f=new File(importFile);
        if (f.exists()) {
          File newFile=new File(newPath + attr.getValue());
          if (!newFile.exists()) {
            FilesUtils.copyFile(f,newFile);
            getImportFiles(importFile,newFile.getParent() + File.separator);
          }
        }
      }
    }
  }
 catch (  DocumentException e) {
    ExceptionHandler.process(e);
  }
catch (  MalformedURLException e) {
    ExceptionHandler.process(e);
  }
catch (  IOException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
private static void getImportFiles(String xsdFile,String newPath){
  File file=new File(xsdFile);
  if (!file.exists()) {
    return;
  }
  String xsdFolder=file.getParent();
  SAXReader saxReader=new SAXReader();
  Document doc;
  try {
    URL url=file.toURI().toURL();
    doc=saxReader.read(url.getFile());
    Element root=doc.getRootElement();
    List<Element> elementsList=new ArrayList<Element>();
    List<Element> importList=root.elements("String_Node_Str");
    if (importList != null) {
      elementsList.addAll(importList);
    }
    List<Element> includeList=root.elements("String_Node_Str");
    if (includeList != null) {
      elementsList.addAll(includeList);
    }
    if (elementsList.size() <= 0) {
      return;
    }
    for (    Element n : elementsList) {
      Attribute attr=n.attribute("String_Node_Str");
      if (attr != null) {
        String importFile=xsdFolder + File.separator + attr.getValue();
        File f=new File(importFile);
        if (f.exists()) {
          File newFile=new File(newPath + attr.getValue());
          FilesUtils.copyFile(f,newFile);
          getImportFiles(importFile,newFile.getParent() + File.separator);
        }
      }
    }
  }
 catch (  DocumentException e) {
    ExceptionHandler.process(e);
  }
catch (  MalformedURLException e) {
    ExceptionHandler.process(e);
  }
catch (  IOException e) {
    ExceptionHandler.process(e);
  }
}
Program: 128112
Project: 128112
Buggy source:
@Override public RootContainer<String,IRepositoryViewObject> getRoutineFromProject(Project project) throws PersistenceException {
  RootContainer<String,IRepositoryViewObject> toReturn=new RootContainer<String,IRepositoryViewObject>();
  ERepositoryObjectType type=ERepositoryObjectType.ROUTINES;
  IProject fsProject=ResourceModelUtils.getProject(project);
  IFolder objectFolder=ResourceUtils.getFolder(fsProject,ERepositoryObjectType.getFolderName(ERepositoryObjectType.ROUTINES),true);
  addFolderMembers(project,type,toReturn,objectFolder,true);
  saveProject(project);
  return toReturn;
}

Fixed version (ground truth):
@Override public RootContainer<String,IRepositoryViewObject> getRoutineFromProject(Project project) throws PersistenceException {
  RootContainer<String,IRepositoryViewObject> toReturn=new RootContainer<String,IRepositoryViewObject>();
  ERepositoryObjectType type=ERepositoryObjectType.ROUTINES;
  if (type != null) {
    IProject fsProject=ResourceModelUtils.getProject(project);
    IFolder objectFolder=ResourceUtils.getFolder(fsProject,ERepositoryObjectType.getFolderName(type),true);
    addFolderMembers(project,type,toReturn,objectFolder,true);
    saveProject(project);
  }
  return toReturn;
}
Program: 128113
Project: 128113
Buggy source:
@Override public List<ModuleNeeded> getModulesNeededForJobs() throws PersistenceException {
  List<ModuleNeeded> importNeedsList=new ArrayList<ModuleNeeded>();
  IProxyRepositoryFactory repositoryFactory=CoreRuntimePlugin.getInstance().getRepositoryService().getProxyRepositoryFactory();
  List<IRepositoryViewObject> jobs=repositoryFactory.getAll(ERepositoryObjectType.PROCESS,true);
  for (  IRepositoryViewObject cur : jobs) {
    if (!cur.isDeleted()) {
      ProcessItem item=(ProcessItem)cur.getProperty().getItem();
      if (item == null || item.getProcess() == null) {
        continue;
      }
      List<NodeType> nodes=item.getProcess().getNode();
      for (      NodeType node : nodes) {
        List<ElementParameterType> elementParameter=node.getElementParameter();
        for (        ElementParameterType elementParam : elementParameter) {
          if (elementParam.getField() != null && elementParam.getField().equals(EParameterFieldType.MODULE_LIST.getName())) {
            String uniquename=coreSerivce.getParameterUNIQUENAME(node);
            ModuleNeeded toAdd=new ModuleNeeded(Messages.getString("String_Node_Str") + item.getProperty().getLabel(),elementParam.getValue(),Messages.getString("String_Node_Str") + uniquename + "String_Node_Str",true);
            importNeedsList.add(toAdd);
          }
        }
      }
    }
  }
  return importNeedsList;
}

Fixed version (ground truth):
@Override public List<ModuleNeeded> getModulesNeededForJobs() throws PersistenceException {
  List<ModuleNeeded> importNeedsList=new ArrayList<ModuleNeeded>();
  IProxyRepositoryFactory repositoryFactory=CoreRuntimePlugin.getInstance().getRepositoryService().getProxyRepositoryFactory();
  ERepositoryObjectType jobType=ERepositoryObjectType.PROCESS;
  if (jobType != null) {
    List<IRepositoryViewObject> jobs=repositoryFactory.getAll(jobType,true);
    for (    IRepositoryViewObject cur : jobs) {
      if (!cur.isDeleted()) {
        ProcessItem item=(ProcessItem)cur.getProperty().getItem();
        if (item == null || item.getProcess() == null) {
          continue;
        }
        List<NodeType> nodes=item.getProcess().getNode();
        for (        NodeType node : nodes) {
          List<ElementParameterType> elementParameter=node.getElementParameter();
          for (          ElementParameterType elementParam : elementParameter) {
            if (elementParam.getField() != null && elementParam.getField().equals(EParameterFieldType.MODULE_LIST.getName())) {
              String uniquename=coreSerivce.getParameterUNIQUENAME(node);
              ModuleNeeded toAdd=new ModuleNeeded(Messages.getString("String_Node_Str") + item.getProperty().getLabel(),elementParam.getValue(),Messages.getString("String_Node_Str") + uniquename + "String_Node_Str",true);
              importNeedsList.add(toAdd);
            }
          }
        }
      }
    }
  }
  return importNeedsList;
}
Program: 128119
Project: 128119
Buggy source:
@SuppressWarnings("String_Node_Str") public static <T extends DynaEnum<T>>T valueOf(Class<T> enumType,String name){
  return (T)elements.get(enumType).get(name.toUpperCase());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <T extends DynaEnum<T>>T valueOf(Class<T> enumType,String name){
  T t=(T)elements.get(enumType).get(name.toUpperCase());
  return t;
}
Program: 128120
Project: 128120
Buggy source:
@Override public String toString(){
switch (getType()) {
case REPOSITORY_ELEMENT:
    return getObject().toString();
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
  IRepositoryService service=(IRepositoryService)GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
return service.getRepositoryPath(this).toString();
default :
return getType() + "String_Node_Str" + getProperties(EProperties.LABEL);
}
}

Fixed version (ground truth):
@Override public String toString(){
switch (getType()) {
case REPOSITORY_ELEMENT:
    return getObject().toString();
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
  IRepositoryService service=(IRepositoryService)GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
return service.getRepositoryPath(this).toString() + "String_Node_Str" + getContentType();
default :
return getType().toString() + '-' + getProperties(EProperties.LABEL);
}
}
Program: 128121
Project: 128121
Buggy source:
/** 
 * Sets the icon.
 * @param icon the icon to set
 */
public void setIcon(IImage icon){
  this.icon=icon;
}

Fixed version (ground truth):
/** 
 * Sets the icon.
 * @param icon the icon to set
 */
@Override public void setIcon(IImage icon){
  this.icon=icon;
}
Program: 128122
Project: 128122
Buggy source:
/** 
 * Getter for label.
 * @return the label
 */
public String getLabel(){
  return this.label;
}

Fixed version (ground truth):
/** 
 * Getter for label.
 * @return the label
 */
@Override public String getLabel(){
  return this.label;
}
Program: 128123
Project: 128123
Buggy source:
/** 
 * Getter for icon.
 * @return the icon
 */
public IImage getIcon(){
  return this.icon;
}

Fixed version (ground truth):
/** 
 * Getter for icon.
 * @return the icon
 */
@Override public IImage getIcon(){
  return this.icon;
}
Program: 128124
Project: 128124
Buggy source:
/** 
 * DOC guanglong.du Comment method "updateFromRepositoryType".
 * @param itemType
 */
public static void updateFromRepositoryType(ERepositoryObjectType itemType){
  updatePalette(faState);
  setExtraEntryVisible(ERepositoryObjectType.JOBLET.equals(itemType));
}

Fixed version (ground truth):
/** 
 * DOC guanglong.du Comment method "updateFromRepositoryType".
 * @param itemType
 */
public static void updateFromRepositoryType(ERepositoryObjectType itemType){
  updatePalette(faState);
  setExtraEntryVisible(itemType.equals(ERepositoryObjectType.JOBLET));
}
Program: 128125
Project: 128125
Buggy source:
protected Item copyFromResource(Resource createResource,boolean changeLabelWithCopyPrefix) throws PersistenceException, BusinessException {
  Item newItem=(Item)EcoreUtil.getObjectByType(createResource.getContents(),PropertiesPackage.eINSTANCE.getItem());
  Property property=newItem.getProperty();
  property.setId(getNextId());
  property.setAuthor(getRepositoryContext().getUser());
  if (changeLabelWithCopyPrefix) {
    setPropNewName(property);
  }
  EcoreUtil.resolveAll(createResource);
  return newItem;
}

Fixed version (ground truth):
protected Item copyFromResource(Resource createResource,String newItemName) throws PersistenceException, BusinessException {
  Item newItem=(Item)EcoreUtil.getObjectByType(createResource.getContents(),PropertiesPackage.eINSTANCE.getItem());
  Property property=newItem.getProperty();
  property.setId(getNextId());
  property.setLabel(newItemName);
  property.setDisplayName(newItemName);
  property.setAuthor(getRepositoryContext().getUser());
  EcoreUtil.resolveAll(createResource);
  return newItem;
}
Program: 128126
Project: 128126
Buggy source:
public Item copy(Item item,IPath path,boolean changeLabelWithCopyPrefix) throws PersistenceException, BusinessException ;

Fixed version (ground truth):
public Item copy(Item originalItem,IPath path,String newItemName) throws PersistenceException, BusinessException ;
Program: 128127
Project: 128127
Buggy source:
@Override public Item copy(Item sourceItem,IPath targetPath,boolean changeLabelWithCopyPrefix) throws PersistenceException, BusinessException {
  if (sourceItem instanceof ProcessItem) {
    try {
      coreService.checkJob(sourceItem.getProperty().getLabel());
    }
 catch (    BusinessException e) {
      throw new PersistenceException(e);
    }
catch (    RuntimeException e) {
    }
  }
  Item targetItem=this.repositoryFactoryFromProvider.copy(sourceItem,targetPath,changeLabelWithCopyPrefix);
  return targetItem;
}

Fixed version (ground truth):
@Override public Item copy(Item sourceItem,IPath targetPath,String newItemName) throws PersistenceException, BusinessException {
  if (sourceItem instanceof ProcessItem) {
    try {
      coreService.checkJob(sourceItem.getProperty().getLabel());
    }
 catch (    BusinessException e) {
      throw new PersistenceException(e);
    }
catch (    RuntimeException e) {
    }
  }
  Item targetItem=this.repositoryFactoryFromProvider.copy(sourceItem,targetPath,newItemName);
  return targetItem;
}
Program: 128128
Project: 128128
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
  }
 catch (  CoreException e) {
    throw new InvocationTargetException(e);
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
  }
 catch (  CoreException e) {
    throw new InvocationTargetException(e);
  }
}
Program: 128129
Project: 128129
Buggy source:
private void synDuplicatedRoutine(RoutineItem item){
  ICodeGeneratorService codeGenService=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
  if (codeGenService != null) {
    codeGenService.createRoutineSynchronizer().renameRoutineClass((RoutineItem)item);
    try {
      codeGenService.createRoutineSynchronizer().syncRoutine((RoutineItem)item,true);
    }
 catch (    SystemException e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
private void synDuplicatedRoutine(RoutineItem item){
  ICodeGeneratorService codeGenService=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
  if (codeGenService != null) {
    codeGenService.createRoutineSynchronizer().renameRoutineClass(item);
    try {
      codeGenService.createRoutineSynchronizer().syncRoutine(item,true);
    }
 catch (    SystemException e) {
      ExceptionHandler.process(e);
    }
  }
}
Program: 128134
Project: 128134
Buggy source:
public abstract Item copy(Item item,IPath path,boolean changeLabelWithCopyPrefix) throws PersistenceException, BusinessException ;

Fixed version (ground truth):
public abstract Item copy(Item originalItem,IPath path,String newItemName) throws PersistenceException, BusinessException ;