nus-yam/ex-repair huggingface dataset:
Program: 138909
Project: 138909
Buggy source:
/** 
 * DOC scorreia Comment method "getQualifiedName".
 * @param tdDataProvider
 * @return
 */
private String getTableQualifiedName(Connection tdDataProvider){
  DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(tdDataProvider);
  Package catalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema(view);
  if (catalogOrSchema == null) {
    return view.getName();
  }
  String catalogName=null;
  String schemaName=null;
  if (catalogOrSchema != null && RelationalPackage.eINSTANCE.getSchema().equals(catalogOrSchema.eClass())) {
    schemaName=catalogOrSchema.getName();
    Catalog parentCatalog=CatalogHelper.getParentCatalog(catalogOrSchema);
    if (parentCatalog != null) {
      catalogName=parentCatalog.getName();
    }
  }
 else {
    catalogName=catalogOrSchema.getName();
  }
  if (dbmsLanguage.getDbmsName().equals(SupportDBUrlType.SYBASEDEFAULTURL.getLanguage())) {
    schemaName=ColumnSetHelper.getTableOwner(view);
  }
  return dbmsLanguage.toQualifiedName(catalogName,schemaName,view.getName());
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getQualifiedName".
 * @param tdDataProvider
 * @return
 */
private String getTableQualifiedName(Connection tdDataProvider){
  DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(tdDataProvider);
  Package catalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema(view);
  if (catalogOrSchema == null) {
    return view.getName();
  }
  String catalogName=null;
  String schemaName=null;
  if (catalogOrSchema != null && RelationalPackage.eINSTANCE.getSchema().equals(catalogOrSchema.eClass())) {
    schemaName=catalogOrSchema.getName();
    Catalog parentCatalog=CatalogHelper.getParentCatalog(catalogOrSchema);
    if (parentCatalog != null) {
      catalogName=parentCatalog.getName();
    }
  }
 else {
    catalogName=catalogOrSchema.getName();
  }
  if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
    schemaName=ColumnSetHelper.getTableOwner(view);
  }
  return dbmsLanguage.toQualifiedName(catalogName,schemaName,view.getName());
}
Program: 138910
Project: 138910
Buggy source:
/** 
 * DOC bZhou Comment method "getItemPath". This method is to get the entire path of a item. e.g. getItemPath() = Project/TypedPath/StatePath/xxxx.property.
 * @param property
 * @return
 */
public static IPath getItemPath(Property property){
  TDQItem item=(TDQItem)property.getItem();
  return ResourceManager.getRootProject().getFullPath().append(getItemTypedPath(property)).append(getItemStatePath(property)).append(item.getFilename());
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getItemPath". This method is to get the entire path of a item. e.g. getItemPath() = Project/TypedPath/StatePath/xxxx.property.
 * @param property
 * @return
 */
public static IPath getItemPath(Property property){
  Item item=property.getItem();
  if (item instanceof TDQItem) {
    TDQItem tdqItem=(TDQItem)item;
    return ResourceManager.getRootProject().getFullPath().append(getItemTypedPath(property)).append(getItemStatePath(property)).append(tdqItem.getFilename());
  }
 else {
    IPath itemFilePath=new Path(property.eResource().getURI().lastSegment()).removeFileExtension().addFileExtension(FactoriesUtil.ITEM_EXTENSION);
    return ResourceManager.getRootProject().getFullPath().append(getItemTypedPath(property)).append(getItemStatePath(property)).append(itemFilePath);
  }
}
Program: 138911
Project: 138911
Buggy source:
@Override public void run(){
  boolean isFilesDeleted=deleteFolderAndFiles();
  if (!isFilesDeleted) {
    return;
  }
  try {
    folder.delete(true,null);
    CorePlugin.getDefault().refreshDQView();
    ProxyRepositoryManager.getInstance().save();
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  boolean isFilesDeleted=deleteFolderAndFiles();
  if (!isFilesDeleted) {
    return;
  }
  try {
    if (isDeleteForever) {
      delsubFolderForever(folder);
      if (LogicalDeleteFileHandle.isStartWithDelFolder(folder.getFullPath().toOSString())) {
        LogicalDeleteFileHandle.replaceInFile(LogicalDeleteFileHandle.folderType + folder.getFullPath().toOSString(),PluginConstant.EMPTY_STRING);
        folder.delete(true,null);
      }
    }
 else {
      LogicalDeleteFileHandle.saveElement(LogicalDeleteFileHandle.folderType,folder.getFullPath().toOSString());
    }
    CorePlugin.getDefault().refreshDQView();
    ProxyRepositoryManager.getInstance().save();
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
}
Program: 138912
Project: 138912
Buggy source:
/** 
 * DOC bZhou Comment method "createDuplicateHandle".
 * @param property
 * @return
 */
public static IDuplicateHandle createDuplicateHandle(Property property){
  IDuplicateHandle handle=null;
  EResourceConstant typedConstant=EResourceConstant.getTypedConstant(property.getItem());
switch (typedConstant) {
case DB_CONNECTIONS:
    handle=new ConnectionHandle(property);
  break;
case MDM_CONNECTIONS:
handle=new XMLDataProviderHandle(property);
break;
case JRXML_TEMPLATE:
handle=new JrxmlHandle(property);
break;
case ANALYSIS:
handle=new AnalysisHandle(property);
break;
case REPORTS:
handle=new ReportHandle(property);
break;
case PATTERNS:
case RULES:
handle=new EMFResourceHandle(property);
break;
case INDICATORS:
handle=new UDIHandle(property);
break;
default :
handle=new SimpleHandle(property);
break;
}
return handle;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "createDuplicateHandle".
 * @param property
 * @return
 */
public static IDuplicateHandle createDuplicateHandle(Property property){
  IDuplicateHandle handle=null;
  EResourceConstant typedConstant=EResourceConstant.getTypedConstant(property.getItem());
  if (typedConstant == null) {
    handle=new SimpleHandle(property);
  }
 else {
switch (typedConstant) {
case DB_CONNECTIONS:
      handle=new ConnectionHandle(property);
    break;
case MDM_CONNECTIONS:
  handle=new XMLDataProviderHandle(property);
break;
case JRXML_TEMPLATE:
handle=new JrxmlHandle(property);
break;
case ANALYSIS:
handle=new AnalysisHandle(property);
break;
case REPORTS:
handle=new ReportHandle(property);
break;
case PATTERNS:
case RULES:
handle=new EMFResourceHandle(property);
break;
case INDICATORS:
handle=new UDIHandle(property);
break;
default :
break;
}
}
return handle;
}
Program: 138913
Project: 138913
Buggy source:
/** 
 * DOC bZhou DuplicateEMFResourceAction constructor comment.
 */
EMFResourceHandle(Property propety){
  this.property=propety;
  IPath itemPath=PropertyHelper.getItemPath(propety);
  this.file=ResourceManager.getRoot().getFile(itemPath);
  this.modelElement=ModelElementFileFactory.getModelElement(file);
}

Fixed version (ground truth):
/** 
 * DOC bZhou DuplicateEMFResourceAction constructor comment.
 */
EMFResourceHandle(Property property){
  this.property=property;
  IPath itemPath=PropertyHelper.getItemPath(property);
  this.file=ResourceManager.getRoot().getFile(itemPath);
  this.modelElement=ModelElementFileFactory.getModelElement(file);
}
Program: 138914
Project: 138914
Buggy source:
@Override public List<ModelElement> getDependencies(){
  List<ModelElement> elementList=new ArrayList<ModelElement>();
  Collection<TdReport> allReports=RepResourceFileHelper.getInstance().getAllReports();
  for (  TdReport report : allReports) {
    for (    AnalysisMap anaMap : report.getAnalysisMap()) {
      if (StringUtils.equals(file.getLocation().toOSString(),anaMap.getJrxmlSource())) {
        elementList.add(report);
      }
    }
  }
  return elementList;
}

Fixed version (ground truth):
public List<ModelElement> getDependencies(){
  List<ModelElement> elementList=new ArrayList<ModelElement>();
  Collection<TdReport> allReports=RepResourceFileHelper.getInstance().getAllReports();
  for (  TdReport report : allReports) {
    for (    AnalysisMap anaMap : report.getAnalysisMap()) {
      if (StringUtils.equals(file.getLocation().toOSString(),anaMap.getJrxmlSource())) {
        elementList.add(report);
      }
    }
  }
  return elementList;
}
Program: 138915
Project: 138915
Buggy source:
/** 
 * DOC bZhou Comment method "createProperty".
 * @param targetFile
 */
public void createProperty(File targetFile){
  URI uri=URI.createFileURI(targetFile.getAbsolutePath());
  URI propertiesURI=uri.trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  Resource propertyResource=EMFSharedResources.getInstance().createResource(propertiesURI);
  Property property=PropertiesFactory.eINSTANCE.createProperty();
  property.setId(EcoreUtil.generateUUID());
  property.setLabel(StringUtilities.tokenize(targetFile.getName(),"String_Node_Str").get(0));
  property.setCreationDate(new Date());
  property.setVersion("String_Node_Str");
  TDQJrxmlItem item=org.talend.dataquality.properties.PropertiesFactory.eINSTANCE.createTDQJrxmlItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  itemState.setDeleted(false);
  IPath propPath=new Path(propertiesURI.toPlatformString(true)).removeLastSegments(1);
  IPath typedPath=ResourceManager.getRootProject().getFullPath().append(PropertyHelper.getItemTypedPath(property));
  IPath itemPath=propPath.makeRelativeTo(typedPath);
  itemState.setPath(itemPath.toString());
  item.setState(itemState);
  item.setFilename(targetFile.getName());
  item.setProperty(property);
  property.setItem(item);
  propertyResource.getContents().add(property);
  propertyResource.getContents().add(property.getItem());
  propertyResource.getContents().add(property.getItem().getState());
  EMFSharedResources.getInstance().saveResource(propertyResource);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "createProperty".
 * @param targetFile
 */
public void createProperty(File targetFile){
  URI uri=URI.createFileURI(targetFile.getAbsolutePath());
  URI propertiesURI=uri.trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  Resource propertyResource=EMFSharedResources.getInstance().createResource(propertiesURI);
  Property property=PropertiesFactory.eINSTANCE.createProperty();
  property.setId(EcoreUtil.generateUUID());
  property.setLabel(StringUtilities.tokenize(targetFile.getName(),"String_Node_Str").get(0));
  property.setCreationDate(new Date());
  property.setVersion("String_Node_Str");
  TDQJrxmlItem item=org.talend.dataquality.properties.PropertiesFactory.eINSTANCE.createTDQJrxmlItem();
  item.setFilename(targetFile.getName());
  item.setProperty(property);
  property.setItem(item);
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  itemState.setDeleted(false);
  IPath propPath=new Path(targetFile.getAbsolutePath()).removeLastSegments(1);
  IPath typedPath=ResourceManager.getRootProject().getFolder(PropertyHelper.getItemTypedPath(property)).getLocation();
  IPath itemPath=propPath.makeRelativeTo(typedPath);
  itemState.setPath(itemPath.toString());
  item.setState(itemState);
  propertyResource.getContents().add(property);
  propertyResource.getContents().add(property.getItem());
  propertyResource.getContents().add(property.getItem().getState());
  EMFSharedResources.getInstance().saveResource(propertyResource);
}
Program: 138916
Project: 138916
Buggy source:
/** 
 * DOC bZhou JrxmlHandle constructor comment.
 * @param file
 */
JrxmlHandle(IFile file){
  super(file);
}

Fixed version (ground truth):
/** 
 * DOC bZhou JrxmlHandle constructor comment.
 * @param file
 */
JrxmlHandle(IFile file){
  this.file=file;
}
Program: 138917
Project: 138917
Buggy source:
@Override public IFile duplicate(){
  IFile duplicateFile=super.duplicate();
  createProperty(duplicateFile.getLocation().toFile());
  return duplicateFile;
}

Fixed version (ground truth):
public IFile duplicate(){
  IFile newFile=SimpleHandle.getNewFile(file);
  try {
    file.copy(newFile.getFullPath(),true,null);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  createProperty(newFile.getLocation().toFile());
  return newFile;
}
Program: 138918
Project: 138918
Buggy source:
@Override public boolean delete() throws Exception {
  IPath filePath=file.getFullPath();
  filePath=filePath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  IFile propFile=ResourceManager.getRoot().getFile(filePath);
  if (propFile.exists()) {
    propFile.delete(true,null);
  }
  return super.delete();
}

Fixed version (ground truth):
public boolean delete() throws Exception {
  if (isPhysicalDelete()) {
    LogicalDeleteFileHandle.deleteElement(file);
    IPath filePath=file.getFullPath();
    filePath=filePath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
    IFile propFile=ResourceManager.getRoot().getFile(filePath);
    if (propFile.exists()) {
      propFile.delete(true,null);
    }
    if (file.exists() && isPhysicalDelete()) {
      file.delete(true,null);
    }
  }
 else {
    LogicalDeleteFileHandle.deleteLogical(file);
  }
  return true;
}
Program: 138919
Project: 138919
Buggy source:
/** 
 * DOC bZhou Comment method "getNewFile".
 * @param file
 * @return
 */
private IFile getNewFile(IFile file){
  IFile newFile=null;
  int idx=1;
  while (true) {
    final String newFilename="String_Node_Str" + idx + "String_Node_Str"+ file.getName();
    newFile=((IFolder)file.getParent()).getFile(newFilename);
    if (!newFile.exists()) {
      break;
    }
    idx++;
  }
  return newFile;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getNewFile".
 * @param file
 * @return
 */
public static IFile getNewFile(IFile file){
  IFile newFile=null;
  int idx=1;
  while (true) {
    final String newFilename="String_Node_Str" + idx + "String_Node_Str"+ file.getName();
    newFile=((IFolder)file.getParent()).getFile(newFilename);
    if (!newFile.exists()) {
      break;
    }
    idx++;
  }
  return newFile;
}
Program: 138922
Project: 138922
Buggy source:
/** 
 * DOC zshen Comment method "isSybase".
 * @param connection
 * @return decide to whether is sybase connection
 * @throws SQLException
 */
public static boolean isSybase(java.sql.Connection connection) throws SQLException {
  DatabaseMetaData connectionMetadata=getConnectionMetadata(connection);
  if (connectionMetadata.getDriverName() != null && connectionMetadata.getDatabaseProductName() != null) {
    for (    String keyString : SupportDBUrlType.SYBASEDEFAULTURL.getLanguage().split("String_Node_Str")) {
      if (keyString.trim().equals(connectionMetadata.getDatabaseProductName().trim())) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "isSybase".
 * @param connection
 * @return decide to whether is sybase connection
 * @throws SQLException
 */
public static boolean isSybase(java.sql.Connection connection) throws SQLException {
  DatabaseMetaData connectionMetadata=getConnectionMetadata(connection);
  if (connectionMetadata.getDriverName() != null && connectionMetadata.getDatabaseProductName() != null) {
    for (    String keyString : getSybaseDBProductsName()) {
      if (keyString.equals(connectionMetadata.getDatabaseProductName().trim())) {
        return true;
      }
    }
  }
  return false;
}
Program: 138925
Project: 138925
Buggy source:
@Override public void run(){
  IFile[] selectedFiles;
  if (isDeleteForever) {
    SelectedResources selectedResources=new SelectedResources();
    selectedFiles=selectedResources.getSelectedResourcesArrayForDelForever();
  }
 else {
    selectedFiles=getSelectedResourcesArray();
  }
  for (  IFile file : selectedFiles) {
    IDeletionHandle handle=ActionHandleFactory.createDeletionHandle(file);
    List<ModelElement> dependencies=handle.getDependencies();
    if (dependencies != null && !dependencies.isEmpty()) {
      showDependenciesDialog(file,dependencies);
      return;
    }
  }
  try {
    for (    IFile file : selectedFiles) {
      IDeletionHandle handle=ActionHandleFactory.createDeletionHandle(file);
      if (isDeleteForever && !showConfirmDialog()) {
        return;
      }
      runStatus=handle.delete(isDeleteForever);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  ProxyRepositoryManager.getInstance().save();
  CorePlugin.getDefault().refreshDQView();
  CorePlugin.getDefault().refreshWorkSpace();
}

Fixed version (ground truth):
@Override public void run(){
  IFile[] selectedFiles;
  if (isDeleteForever) {
    SelectedResources selectedResources=new SelectedResources();
    selectedFiles=selectedResources.getSelectedResourcesArrayForDelForever();
  }
 else {
    selectedFiles=getSelectedResourcesArray();
  }
  for (  IFile file : selectedFiles) {
    IDeletionHandle handle=ActionHandleFactory.createDeletionHandle(file);
    List<ModelElement> dependencies=handle.getDependencies();
    if (dependencies != null && !dependencies.isEmpty()) {
      showDependenciesDialog(file,dependencies);
      return;
    }
  }
  try {
    for (    IFile file : selectedFiles) {
      IDeletionHandle handle=ActionHandleFactory.createDeletionHandle(file);
      if (isDeleteForever && !showConfirmDialog()) {
        return;
      }
      CorePlugin.getDefault().closeEditorIfOpened(file);
      runStatus=handle.delete(isDeleteForever);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  ProxyRepositoryManager.getInstance().save();
  CorePlugin.getDefault().refreshDQView();
  CorePlugin.getDefault().refreshWorkSpace();
}
Program: 138926
Project: 138926
Buggy source:
/** 
 * DOC bZhou Comment method "createDeletionHandle".
 * @param file
 * @return
 */
public static IDeletionHandle createDeletionHandle(IFile file){
  IDeletionHandle handle=null;
  String fileExtension=file.getFileExtension();
  if (FactoriesUtil.isEmfFile(fileExtension)) {
    if (FactoriesUtil.isProvFile(fileExtension)) {
      ModelElement modelElement=ModelElementFileFactory.getModelElement(file);
      EResourceConstant typedConstant=EResourceConstant.getTypedConstant(modelElement);
      if (typedConstant == EResourceConstant.MDM_CONNECTIONS) {
        handle=new XMLDataProviderHandle(file);
      }
    }
 else {
      handle=new EMFResourceHandle(file);
    }
  }
 else   if (FactoriesUtil.isJrxmlFile(fileExtension)) {
    handle=new JrxmlHandle(file);
  }
 else {
    handle=new SimpleHandle(file);
  }
  return handle;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "createDeletionHandle".
 * @param file
 * @return
 */
public static IDeletionHandle createDeletionHandle(IFile file){
  IDeletionHandle handle=null;
  String fileExtension=file.getFileExtension();
  if (FactoriesUtil.isEmfFile(fileExtension)) {
    handle=new EMFResourceHandle(file);
    if (FactoriesUtil.isProvFile(fileExtension)) {
      ModelElement modelElement=ModelElementFileFactory.getModelElement(file);
      EResourceConstant typedConstant=EResourceConstant.getTypedConstant(modelElement);
      if (typedConstant == EResourceConstant.MDM_CONNECTIONS) {
        handle=new XMLDataProviderHandle(file);
      }
    }
  }
 else   if (FactoriesUtil.isJrxmlFile(fileExtension)) {
    handle=new JrxmlHandle(file);
  }
 else {
    handle=new SimpleHandle(file);
  }
  return handle;
}
Program: 138927
Project: 138927
Buggy source:
@Override public boolean hasChildren(Object element){
  if (element instanceof IEcosCategory) {
    return true;
  }
  if (element instanceof RecycleBin) {
    return getRecycleBinChildren().size() > 0 ? true : false;
  }
 else   if (element instanceof DQRecycleBinNode) {
    DQRecycleBinNode rbn=(DQRecycleBinNode)element;
    Object obj=rbn.getObject();
    if (obj instanceof IFolder) {
      try {
        if (((IFolder)obj).members().length > 0)         return true;
      }
 catch (      CoreException e) {
        log.error(e);
      }
    }
    return false;
  }
  return super.hasChildren(element);
}

Fixed version (ground truth):
@Override public boolean hasChildren(Object element){
  if (element instanceof IEcosCategory) {
    return true;
  }
  if (element instanceof IFolder) {
    List<Object> obsLs=Arrays.asList(super.getChildren(element));
    if (obsLs.size() == 1) {
      Object obj=(Object)obsLs.get(0);
      if (obj instanceof IFolder && ((IFolder)obj).getName().equals(PluginConstant.SVN_SUFFIX))       return false;
    }
  }
 else   if (element instanceof RecycleBin) {
    return getRecycleBinChildren().size() > 0 ? true : false;
  }
 else   if (element instanceof DQRecycleBinNode) {
    DQRecycleBinNode rbn=(DQRecycleBinNode)element;
    Object obj=rbn.getObject();
    if (obj instanceof IFolder) {
      try {
        if (((IFolder)obj).members().length > 0)         return true;
      }
 catch (      CoreException e) {
        log.error(e);
      }
    }
    return false;
  }
  return super.hasChildren(element);
}
Program: 138929
Project: 138929
Buggy source:
/** 
 * @param path
 * @param element
 * @throws Exceptio Save logical delete path to TXT file
 */
public static void saveElement(String type,String path){
  try {
    File f=new Path(filePath).toFile();
    if (!f.exists()) {
      f=new File(filePath);
      f.createNewFile();
    }
    FileWriter fw=new FileWriter(f.getPath(),true);
    PrintWriter out=new PrintWriter(fw);
    out.println(type + path);
    fw.close();
    out.close();
    String[] es={type.replaceAll("String_Node_Str",PluginConstant.EMPTY_STRING),path};
    delLs.add(es);
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
}

Fixed version (ground truth):
/** 
 * Save logical delete path to TXT file.
 * @param type
 * @param path
 */
public static void saveElement(String type,String path){
  try {
    File f=new Path(filePath).toFile();
    if (!f.exists()) {
      f=new File(filePath);
      f.createNewFile();
    }
    FileWriter fw=new FileWriter(f.getPath(),true);
    PrintWriter out=new PrintWriter(fw);
    out.println(type + path);
    fw.close();
    out.close();
    String[] es={type.replaceAll("String_Node_Str",PluginConstant.EMPTY_STRING),path};
    delLs.add(es);
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
}
Program: 138930
Project: 138930
Buggy source:
/** 
 * @return the delLs Get the Logical delete elements
 */
public static List<String[]> getDelLs(){
  if (delLs == null)   delLs=readFileByLine();
  return delLs;
}

Fixed version (ground truth):
/** 
 * Get the Logical delete elements.
 * @return
 */
public static List<String[]> getDelLs(){
  if (delLs == null)   delLs=readFileByLine();
  return delLs;
}
Program: 138931
Project: 138931
Buggy source:
/** 
 * DOC Replace a path String to "" in logicalDelete.txt.
 * @param regex
 * @param fileName
 * @param replacement
 * @throws IOExceptio
 */
public static void replaceInFile(String oldString,String newString){
  InputStream in=null;
  InputStreamReader inRead=null;
  try {
    in=new FileInputStream(filePath);
    StringBuffer buffer=new StringBuffer();
    inRead=new InputStreamReader(in);
    BufferedReader buf=new BufferedReader(inRead);
    String line;
    String newLine;
    while ((line=buf.readLine()) != null) {
      if (!line.equals(oldString)) {
        newLine=line;
      }
 else {
        newLine=line.replace(oldString,newString);
        for (int i=0; i < delLs.size(); i++) {
          String[] es=(String[])delLs.get(i);
          if ((es[0] + "String_Node_Str" + es[1]).equals(oldString)) {
            delLs.remove(es);
            break;
          }
        }
      }
      if (!newLine.equals(PluginConstant.EMPTY_STRING)) {
        buffer.append(newLine).append("String_Node_Str");
      }
    }
    OutputStream os=new FileOutputStream(filePath);
    os.write(buffer.toString().getBytes());
    os.close();
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
 finally {
    try {
      in.close();
      inRead.close();
    }
 catch (    IOException e) {
      log.error(e,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Replace a path String to "" in logicalDelete.txt.
 * @param regex
 * @param fileName
 * @param replacement
 * @throws IOExceptio
 */
public static void replaceInFile(String oldString,String newString){
  InputStream in=null;
  InputStreamReader inRead=null;
  try {
    in=new FileInputStream(filePath);
    StringBuffer buffer=new StringBuffer();
    inRead=new InputStreamReader(in);
    BufferedReader buf=new BufferedReader(inRead);
    String line;
    String newLine;
    while ((line=buf.readLine()) != null) {
      if (!line.equals(oldString)) {
        newLine=line;
      }
 else {
        newLine=line.replace(oldString,newString);
        for (int i=0; i < delLs.size(); i++) {
          String[] es=(String[])delLs.get(i);
          if ((es[0] + "String_Node_Str" + es[1]).equals(oldString)) {
            delLs.remove(es);
            break;
          }
        }
      }
      if (!newLine.equals(PluginConstant.EMPTY_STRING)) {
        buffer.append(newLine).append("String_Node_Str");
      }
    }
    OutputStream os=new FileOutputStream(filePath);
    os.write(buffer.toString().getBytes());
    os.close();
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
 finally {
    try {
      in.close();
      inRead.close();
    }
 catch (    IOException e) {
      log.error(e,e);
    }
  }
}
Program: 138932
Project: 138932
Buggy source:
/** 
 * @param ifile
 * @throws IOException Remove the path of file's parents(until to the top) in the TXT file.
 */
public static void removeAllParent(IFile ifile) throws IOException {
  IFolder parent=(IFolder)ifile.getParent();
  while (!ResourceService.isReadOnlyFolder(parent)) {
    replaceInFile(folderType + parent.getFullPath().toOSString(),PluginConstant.EMPTY_STRING);
    parent=(IFolder)parent.getParent();
  }
}

Fixed version (ground truth):
/** 
 * Remove the path of file's parents(until to the top) in the TXT file.
 * @param ifile
 * @throws IOException
 */
public static void removeAllParent(IFile ifile) throws IOException {
  IFolder parent=(IFolder)ifile.getParent();
  while (!ResourceService.isReadOnlyFolder(parent)) {
    replaceInFile(folderType + parent.getFullPath().toOSString(),PluginConstant.EMPTY_STRING);
    parent=(IFolder)parent.getParent();
  }
}
Program: 138934
Project: 138934
Buggy source:
/** 
 * @param ifile
 * @throws Exception Logical delete file.set the property of isDelete to 'true'.save the file fullPath to the TXTfile
 */
public static ReturnCode deleteLogical(IFile ifile) throws Exception {
  ReturnCode rc=new ReturnCode();
  List<ModelElement> dependencyClients=EObjectHelper.getDependencyClients(ifile);
  if (!dependencyClients.isEmpty()) {
    rc.setOk(false);
    rc.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
  }
 else {
    IFile propFile=ResourcesPlugin.getWorkspace().getRoot().getFile(ifile.getFullPath().removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION));
    if (propFile.exists()) {
      Property property=PropertyHelper.getProperty(propFile);
      ItemState itemState=property.getItem().getState();
      if (!itemState.isDeleted()) {
        itemState.setDeleted(true);
        Resource propertyResource=property.eResource();
        rc.setOk(EMFSharedResources.getInstance().saveResource(propertyResource));
        saveElement(LogicalDeleteFileHandle.fileType,ifile.getFullPath().toOSString());
      }
    }
    ProxyRepositoryManager.getInstance().save();
    ifile.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    rc.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
  }
  return rc;
}

Fixed version (ground truth):
/** 
 * Logical delete file.set the property of isDelete to 'true'.save the file fullPath to the TXT.
 * @param ifile
 * @return
 * @throws Exception
 */
public static ReturnCode deleteLogical(IFile ifile) throws Exception {
  ReturnCode rc=new ReturnCode();
  List<ModelElement> dependencyClients=EObjectHelper.getDependencyClients(ifile);
  if (!dependencyClients.isEmpty()) {
    rc.setOk(false);
    rc.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
  }
 else {
    IFile propFile=ResourcesPlugin.getWorkspace().getRoot().getFile(ifile.getFullPath().removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION));
    if (propFile.exists()) {
      Property property=PropertyHelper.getProperty(propFile);
      ItemState itemState=property.getItem().getState();
      if (!itemState.isDeleted()) {
        itemState.setDeleted(true);
        Resource propertyResource=property.eResource();
        rc.setOk(EMFSharedResources.getInstance().saveResource(propertyResource));
        saveElement(LogicalDeleteFileHandle.fileType,ifile.getFullPath().toOSString());
      }
    }
    ProxyRepositoryManager.getInstance().save();
    ifile.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    rc.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
  }
  return rc;
}
Program: 138935
Project: 138935
Buggy source:
/** 
 * @param filePath
 * @return
 * @throws Exception Read all logical delete elements from the TXT file
 */
public static List<String[]> readFileByLine(){
  List<String[]> list=new ArrayList<String[]>();
  FileReader fr=null;
  BufferedReader br=null;
  try {
    createTxtFile();
    fr=new FileReader(filePath);
    br=new BufferedReader(fr);
    String line=null;
    String[] es=null;
    while ((line=br.readLine()) != null) {
      es=StringUtils.split(line,':');
      if (es.length < 2) {
        continue;
      }
      list.add(es);
    }
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
 finally {
    try {
      fr.close();
      if (br != null) {
        br.close();
      }
    }
 catch (    IOException e) {
      log.error(e,e);
    }
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Read all logical delete elements from the TXT file.
 * @return
 */
public static List<String[]> readFileByLine(){
  List<String[]> list=new ArrayList<String[]>();
  FileReader fr=null;
  BufferedReader br=null;
  try {
    createTxtFile();
    fr=new FileReader(filePath);
    br=new BufferedReader(fr);
    String line=null;
    String[] es=null;
    while ((line=br.readLine()) != null) {
      es=StringUtils.split(line,':');
      if (es.length < 2) {
        continue;
      }
      list.add(es);
    }
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
 finally {
    try {
      fr.close();
      if (br != null) {
        br.close();
      }
    }
 catch (    IOException e) {
      log.error(e,e);
    }
  }
  return list;
}
Program: 138936
Project: 138936
Buggy source:
/** 
 * @param fullPath
 * @param folderPath
 * @param hashSe Make sure the same subFoleder only appear oncet
 */
private static void addToSet(String fullPath,String folderPath,HashSet<String> hashSet){
  String subFolderName=fullPath.replace(folderPath,"String_Node_Str");
  String[] temp=StringUtils.split(subFolderName,'\\');
  if (temp != null && temp.length > 0) {
    subFolderName=temp[0];
    hashSet.add(folderPath + "String_Node_Str" + subFolderName);
  }
}

Fixed version (ground truth):
/** 
 * Make sure the same subFoleder only appear once.
 * @param fullPath
 * @param folderPath
 * @param hashSet
 */
private static void addToSet(String fullPath,String folderPath,HashSet<String> hashSet) throws CoreException {
  String subFolderName=fullPath.replace(folderPath,PluginConstant.EMPTY_STRING);
  String[] temp=StringUtils.split(subFolderName,'\\');
  if (temp != null && temp.length > 0) {
    subFolderName=temp[0];
    hashSet.add(folderPath + slashStr + subFolderName);
    if (isStartWithDelFolder(folderPath)) {
      IPath iPath=new Path(folderPath);
      IFolder rootFolder=ResourcesPlugin.getWorkspace().getRoot().getFolder(iPath);
      for (      IResource res : rootFolder.members()) {
        if (res.getType() == IResource.FOLDER && ((IFolder)res).members().length == 0) {
          hashSet.add(folderPath + slashStr + ((IFolder)res).getName());
        }
      }
    }
  }
}
Program: 138938
Project: 138938
Buggy source:
public static List<Pattern> getPatterns(Analysis analysis){
  List<Pattern> rets=new ArrayList<Pattern>();
  EList<Indicator> indicators=analysis.getResults().getIndicators();
  for (  Indicator indicator : indicators) {
    if (indicator instanceof PatternMatchingIndicator) {
      IndicatorParameters parameters=((PatternMatchingIndicator)indicator).getParameters();
      if (null != parameters && null != parameters.getDataValidDomain()) {
        rets.addAll(parameters.getDataValidDomain().getPatterns());
      }
    }
  }
  return rets;
}

Fixed version (ground truth):
public static List<Pattern> getPatterns(Analysis analysis){
  List<Pattern> rets=new ArrayList<Pattern>();
  EList<Indicator> indicators=analysis.getResults().getIndicators();
  for (  Indicator indicator : indicators) {
    if (indicator instanceof PatternMatchingIndicator) {
      IndicatorParameters parameters=((PatternMatchingIndicator)indicator).getParameters();
      if (null != parameters && null != parameters.getDataValidDomain()) {
        rets.addAll(parameters.getDataValidDomain().getPatterns());
      }
    }
    if (indicator instanceof AllMatchIndicator) {
      EList<RegexpMatchingIndicator> list=((AllMatchIndicator)indicator).getCompositeRegexMatchingIndicators();
      for (      RegexpMatchingIndicator pattern : list) {
        IndicatorParameters parameters=pattern.getParameters();
        if (null != parameters && null != parameters.getDataValidDomain()) {
          rets.addAll(parameters.getDataValidDomain().getPatterns());
        }
      }
    }
  }
  return rets;
}
Program: 138941
Project: 138941
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public double getAverageLength(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public double getAverageLength(){
  if (getCount() == null) {
    return 0.0;
  }
  if (BigInteger.ZERO.equals(getCount())) {
    return 0.0;
  }
  Double totalLength=getSumLength();
  if (totalLength == null) {
    return 0.0;
  }
  return totalLength.doubleValue() / getCount().doubleValue();
}
Program: 138942
Project: 138942
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public double getAverageLength(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public double getAverageLength(){
  if (getCount() == null) {
    return 0.0;
  }
  if (BigInteger.ZERO.equals(getCount())) {
    return 0.0;
  }
  Double totalLength=getSumLength();
  if (totalLength == null) {
    return 0.0;
  }
  return totalLength.doubleValue() / getCount().doubleValue();
}
Program: 138943
Project: 138943
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public double getAverageLength(){
  if (getCount() == null) {
    return 0.0;
  }
  if (BigInteger.ZERO.equals(getCount())) {
    return 0.0;
  }
  Double totalLength=getSumLength();
  if (totalLength == null) {
    return 0.0;
  }
  return totalLength.doubleValue() / getCount().doubleValue();
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public double getAverageLength(){
  if (getCount() == null) {
    return 0.0;
  }
  if (BigInteger.ZERO.equals(getCount())) {
    return 0.0;
  }
  Double totalLength=getSumLength();
  if (totalLength == null) {
    return 0.0;
  }
  return totalLength.doubleValue() / (getCount().doubleValue() - blankCount.doubleValue());
}
Program: 138944
Project: 138944
Buggy source:
@Override public boolean reset(){
  this.sumLength=SUM_LENGTH_EDEFAULT;
  return super.reset();
}

Fixed version (ground truth):
@Override public boolean reset(){
  this.sumLength=SUM_LENGTH_EDEFAULT;
  this.blankCount=BLANK_COUNT_EDEFAULT;
  return super.reset();
}
Program: 138947
Project: 138947
Buggy source:
/** 
 * DataProviderBuilder constructor.
 * @param conn the connection
 * @param driver the JDBC driver
 * @param databaseUrl the database connection string (must not be null)
 * @param driverProperties the properties passed to the driver (could be null)
 * @throws SQLException
 */
public DataProviderBuilder(Connection databaseConn,java.sql.Connection conn,Driver driver,String databaseUrl) throws SQLException {
  super(conn);
  dataProvider=databaseConn;
  String identifierQuote=ConnectionUtils.getConnectionMetadata(conn).getIdentifierQuoteString();
  ConnectionHelper.setIdentifierQuoteString(identifierQuote == null ? "String_Node_Str" : identifierQuote,dataProvider);
}

Fixed version (ground truth):
/** 
 * DataProviderBuilder constructor.
 * @param conn the connection
 * @param driver the JDBC driver
 * @param databaseUrl the database connection string (must not be null)
 * @param driverProperties the properties passed to the driver (could be null)
 * @throws SQLException
 */
public DataProviderBuilder(DatabaseConnection databaseConn,Connection conn,Driver driver,String databaseUrl) throws SQLException {
  super(conn);
  dataProvider=databaseConn;
  String identifierQuote=ConnectionUtils.getConnectionMetadata(conn).getIdentifierQuoteString();
  ConnectionHelper.setIdentifierQuoteString(identifierQuote == null ? "String_Node_Str" : identifierQuote,dataProvider);
}
Program: 138948
Project: 138948
Buggy source:
/** 
 * DOC scorreia Comment method "getPrimaryKeys".
 * @param catalogName
 * @param schemaPattern
 * @param table
 * @throws SQLException
 */
public List<PrimaryKey> getPrimaryKeys(String catalogName,String schemaPattern,String tableName) throws SQLException {
  List<PrimaryKey> pks=new ArrayList<PrimaryKey>();
  ResultSet primaryKeys=null;
  try {
    primaryKeys=ConnectionUtils.getConnectionMetadata(connection).getPrimaryKeys(catalogName,schemaPattern,tableName);
    try {
      while (primaryKeys.next()) {
        PrimaryKey pk=createPrimaryKey(primaryKeys);
        pks.add(pk);
      }
    }
 catch (    SQLException e) {
      throw e;
    }
 finally {
      if (primaryKeys != null) {
        primaryKeys.close();
      }
    }
  }
 catch (  Exception e1) {
    log.warn("String_Node_Str",e1);
  }
  return pks;
}

Fixed version (ground truth):
/** 
 * Method "getPrimaryKeys".
 * @param catalogName the catalog name (can be null)
 * @param schemaPattern the schema name (can be null)
 * @param tableName the name of a table
 * @return the primary keys found given the parameters. According the CWM documentation, there is only one primarykey per table (primary key may be composed by several columns).
 * @throws SQLException
 */
public List<PrimaryKey> getPrimaryKeys(String catalogName,String schemaPattern,String tableName) throws SQLException {
}
Program: 138949
Project: 138949
Buggy source:
/** 
 * Method "getDataProvider" should be called after   {@link #retrieveDriverInformations()}. Note that the ProviderConnection is already linked to the data provider when calling this method.
 * @return the data provider or null.
 */
public Connection getDataProvider(){
  return this.databaseConnection;
}

Fixed version (ground truth):
/** 
 * Method "getDataProvider" should be called after   {@link #retrieveDriverInformations()}. Note that the ProviderConnection is already linked to the data provider when calling this method.
 * @return the data provider or null.
 */
public DatabaseConnection getDataProvider(){
  return this.databaseConnection;
}
Program: 138950
Project: 138950
Buggy source:
/** 
 * Method "getDataProvider".
 * @param driver the driver for the database connection
 * @param databaseUrl the database url
 * @param driverProperties the properties given to the driver
 * @return the data provider with a null name. Its name has to be set elsewhere.
 * @throws SQLException
 */
public static DatabaseConnection getDataProvider(Driver driver,String databaseUrl,Properties driverProperties) throws SQLException {
  DatabaseConnection provider=DataProviderHelper.createDatabaseConnection(null);
  DriverPropertyInfo[] driverProps=null;
  if (!databaseUrl.toLowerCase().startsWith("String_Node_Str")) {
    driverProps=driver.getPropertyInfo(databaseUrl,driverProperties);
  }
  if (driverProps != null) {
    for (int i=0; i < driverProps.length; i++) {
      DriverPropertyInfo prop=driverProps[i];
      if (TaggedValueHelper.PASSWORD.equals(prop.name)) {
        continue;
      }
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + prop.description);
        log.debug(prop.name + "String_Node_Str" + prop.value);
      }
      if (log.isDebugEnabled()) {
        if (prop.choices != null) {
          for (int j=0; j < prop.choices.length; j++) {
            log.debug("String_Node_Str" + j + "String_Node_Str"+ prop.choices[j]);
          }
        }
      }
    }
  }
  return provider;
}

Fixed version (ground truth):
/** 
 * Method "getDataProvider".
 * @param driver the driver for the database connection
 * @param databaseUrl the database url
 * @param driverProperties the properties given to the driver
 * @return the data provider with a null name. Its name has to be set elsewhere.
 * @throws SQLException
 */
public static DatabaseConnection getDataProvider(Driver driver,String databaseUrl,Properties driverProperties) throws SQLException {
  DatabaseConnection provider=DataProviderHelper.createDatabaseConnection(null);
  DriverPropertyInfo[] driverProps=null;
  if (!databaseUrl.toLowerCase().startsWith("String_Node_Str")) {
    driverProps=driver.getPropertyInfo(databaseUrl,driverProperties);
  }
  if (driverProps != null) {
    for (int i=0; i < driverProps.length; i++) {
      DriverPropertyInfo prop=driverProps[i];
      if (TaggedValueHelper.PASSWORD.equals(prop.name)) {
        String password=prop.value != null ? prop.value : "String_Node_Str";
        ConnectionHelper.setPassword(provider,password);
        continue;
      }
      if (TaggedValueHelper.USER.equals(prop.name)) {
        String user=prop.value != null ? prop.value : "String_Node_Str";
        ConnectionHelper.setUsername(provider,user);
      }
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + prop.description);
        log.debug(prop.name + "String_Node_Str" + prop.value);
      }
      if (log.isDebugEnabled()) {
        if (prop.choices != null) {
          for (int j=0; j < prop.choices.length; j++) {
            log.debug("String_Node_Str" + j + "String_Node_Str"+ prop.choices[j]);
          }
        }
      }
    }
  }
  return provider;
}
Program: 138951
Project: 138951
Buggy source:
public static QueryColumnSet getQueryColumnSet(ResultSetMetaData metaData) throws SQLException {
  QueryColumnSet columnSet=ColumnSetHelper.createQueryColumnSet();
  int columnCount=metaData.getColumnCount();
  for (int i=1; i <= columnCount; i++) {
    String columnName=metaData.getColumnName(i);
    TdColumn column=ColumnHelper.createColumn(columnName);
    ColumnSetHelper.addColumn(column,columnSet);
  }
  return columnSet;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getQueryColumnSet".
 * @param metaData
 * @return
 * @throws SQLException
 * @Deprecated not used. Please check the code before using it!!
 */
public static QueryColumnSet getQueryColumnSet(ResultSetMetaData metaData) throws SQLException {
  QueryColumnSet columnSet=ColumnSetHelper.createQueryColumnSet();
  int columnCount=metaData.getColumnCount();
  for (int i=1; i <= columnCount; i++) {
    String columnName=metaData.getColumnName(i);
    TdColumn column=ColumnHelper.createColumn(columnName);
    ColumnSetHelper.addColumn(column,columnSet);
  }
  return columnSet;
}
Program: 138952
Project: 138952
Buggy source:
public static DatabaseConnection fillConnectionInfo(Connection prov,String dbUrl,String driverClassName,Properties props,java.sql.Connection connection) throws SQLException {
  return null;
}

Fixed version (ground truth):
public static DatabaseConnection fillConnectionInfo(DatabaseConnection prov,String dbUrl,String driverClassName,Properties props,java.sql.Connection connection) throws SQLException {
  prov.setDriverClass(driverClassName);
  prov.setURL(dbUrl);
  try {
    prov.setReadOnly(connection.isReadOnly());
  }
 catch (  Exception e) {
    log.warn(e,e);
  }
  Enumeration<?> propertyNames=props.propertyNames();
  while (propertyNames.hasMoreElements()) {
    String key=propertyNames.nextElement().toString();
    String property=props.getProperty(key);
    if (property == null) {
    }
    if (TaggedValueHelper.PASSWORD.equals(key)) {
      prov.setPassword(property);
    }
 else     if (TaggedValueHelper.USER.equals(key)) {
      prov.setUsername(property);
    }
  }
  return prov;
}
Program: 138953
Project: 138953
Buggy source:
/** 
 * DOC bZhou Comment method "addConnetionAliasToSQLPlugin".
 * @param dataproviders
 */
public void addConnetionAliasToSQLPlugin(DataProvider... dataproviders){
  SQLExplorerPlugin sqlPlugin=SQLExplorerPlugin.getDefault();
  AliasManager aliasManager=sqlPlugin.getAliasManager();
  for (  DataProvider dataProvider : dataproviders) {
    try {
      Connection connection=SwitchHelpers.CONNECTION_SWITCH.doSwitch(dataProvider);
      if (connection != null) {
        Alias alias=new Alias(dataProvider.getName());
        String clearTextUser=ConnectionHelper.getUsername(connection);
        String user="String_Node_Str".equals(clearTextUser) ? "String_Node_Str" : clearTextUser;
        String password=ConnectionHelper.getPassword(connection);
        String url=ConnectionHelper.getURL(connection);
        User previousUser=new User(user,password);
        alias.setDefaultUser(previousUser);
        alias.setAutoLogon(false);
        alias.setConnectAtStartup(true);
        alias.setUrl(url);
        ManagedDriver manDr=sqlPlugin.getDriverModel().getDriver(EDriverName.getId(ConnectionHelper.getDriverClass(connection)));
        if (manDr != null) {
          alias.setDriver(manDr);
        }
        if (!aliasManager.contains(alias)) {
          aliasManager.addAlias(alias);
        }
      }
    }
 catch (    ExplorerException e) {
      log.error(e,e);
    }
  }
  try {
    aliasManager.saveAliases();
  }
 catch (  ExplorerException e) {
    log.error(e,e);
  }
  aliasManager.modelChanged();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "addConnetionAliasToSQLPlugin".
 * @param dataproviders
 */
public void addConnetionAliasToSQLPlugin(DataProvider... dataproviders){
}
Program: 138954
Project: 138954
Buggy source:
private void retrieveProjectName(ItemRecord anyRecord){
  Property property=anyRecord.getProperty();
  if (projectName == null && property != null) {
    InternalEObject author=(InternalEObject)property.getAuthor();
    if (author != null && !author.eIsProxy()) {
      Resource projResource=author.eResource();
      if (projResource != null) {
        IPath projectPath=new Path(projResource.getURI().toFileString());
        Object projOBJ=EObjectHelper.retrieveEObject(projectPath,PropertiesPackage.eINSTANCE.getProject());
        if (projOBJ != null) {
          Project project=(Project)projOBJ;
          projectName=project.getTechnicalLabel();
        }
      }
    }
 else {
      projectName=ReponsitoryContextBridge.PROJECT_DEFAULT_NAME;
    }
  }
}

Fixed version (ground truth):
private void retrieveProjectName(ItemRecord anyRecord){
  Property property=anyRecord.getProperty();
  if (property != null) {
    InternalEObject author=(InternalEObject)property.getAuthor();
    if (author != null && !author.eIsProxy()) {
      Resource projResource=author.eResource();
      if (projResource != null) {
        IPath projectPath=new Path(projResource.getURI().toFileString());
        Object projOBJ=EObjectHelper.retrieveEObject(projectPath,PropertiesPackage.eINSTANCE.getProject());
        if (projOBJ != null) {
          Project project=(Project)projOBJ;
          projectName=project.getTechnicalLabel();
        }
      }
    }
 else {
      projectName=ReponsitoryContextBridge.PROJECT_DEFAULT_NAME;
    }
  }
}
Program: 138956
Project: 138956
Buggy source:
@Override public String toQualifiedName(String catalog,String schema,String table){
  if (schema == null) {
    schema=quote("String_Node_Str");
  }
  return super.toQualifiedName(catalog,schema,table);
}

Fixed version (ground truth):
@Override public String toQualifiedName(String catalog,String schema,String table){
  return super.toQualifiedName(catalog,schema,table);
}