nus-yam/ex-repair huggingface dataset:
Program: 138874
Project: 138874
Buggy source:
/** 
 * DOC bZhou Comment method "getSelectedProperties".
 * @return
 */
private List<Property> getSelectedProperties(){
  List<Property> propList=new ArrayList<Property>();
  DQRespositoryView findView=CorePlugin.getDefault().getRepositoryView();
  TreeSelection treeSelection=(TreeSelection)findView.getCommonViewer().getSelection();
  Iterator iterator=treeSelection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    Property property=null;
    if (obj instanceof IFile) {
      property=PropertyHelper.getProperty((IFile)obj);
    }
 else     if (obj instanceof IRepositoryViewObject) {
      property=((IRepositoryViewObject)obj).getProperty();
    }
 else     if (obj instanceof DQRecycleBinNode) {
      DQRecycleBinNode node=(DQRecycleBinNode)obj;
      node.getObject();
    }
    propList.add(property);
  }
  return propList;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getSelectedProperties".
 * @return
 */
private List<Property> getSelectedProperties(){
  List<Property> propList=new ArrayList<Property>();
  DQRespositoryView findView=CorePlugin.getDefault().getRepositoryView();
  TreeSelection treeSelection=(TreeSelection)findView.getCommonViewer().getSelection();
  Iterator iterator=treeSelection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    Property property=null;
    if (obj instanceof IFile) {
      property=PropertyHelper.getProperty((IFile)obj);
    }
 else     if (obj instanceof IFolder) {
      IFolder folder=(IFolder)obj;
      propList.addAll(getAllSubFileProperties(folder));
    }
 else     if (obj instanceof IRepositoryViewObject) {
      property=((IRepositoryViewObject)obj).getProperty();
    }
 else     if (obj instanceof DQRecycleBinNode) {
      DQRecycleBinNode node=(DQRecycleBinNode)obj;
      node.getObject();
    }
    if (property != null) {
      propList.add(property);
    }
  }
  return propList;
}
Program: 138875
Project: 138875
Buggy source:
@Override public void run(){
  List<Property> propList=getSelectedProperties();
  List<IDeletionHandle> handleList=new ArrayList<IDeletionHandle>();
  for (  Property property : propList) {
    IDeletionHandle handle=ActionHandleFactory.createDeletionHandle(property);
    List<ModelElement> dependencies=handle.getDependencies();
    if (dependencies != null && !dependencies.isEmpty()) {
      MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
      return;
    }
 else {
      handleList.add(handle);
    }
  }
  try {
    for (    IDeletionHandle handle : handleList) {
      if (!showConfirmDialog()) {
        return;
      }
      CorePlugin.getDefault().closeEditorIfOpened(handle.getProperty());
      runStatus=handle.delete();
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  ProxyRepositoryManager.getInstance().save();
  CorePlugin.getDefault().refreshDQView();
  CorePlugin.getDefault().refreshWorkSpace();
}

Fixed version (ground truth):
@Override public void run(){
  List<Property> propList=getSelectedProperties();
  List<IDeletionHandle> handleList=new ArrayList<IDeletionHandle>();
  for (  Property property : propList) {
    IDeletionHandle handle=ActionHandleFactory.createDeletionHandle(property);
    List<ModelElement> dependencies=handle.getDependencies();
    if (dependencies != null && !dependencies.isEmpty()) {
      IFile itemFile=PropertyHelper.getItemFile(property);
      showDependenciesDialog(itemFile,dependencies);
      return;
    }
 else {
      handleList.add(handle);
    }
  }
  try {
    for (    IDeletionHandle handle : handleList) {
      if (!showConfirmDialog()) {
        return;
      }
      CorePlugin.getDefault().closeEditorIfOpened(handle.getProperty());
      runStatus=handle.delete();
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  ProxyRepositoryManager.getInstance().save();
  CorePlugin.getDefault().refreshDQView();
  CorePlugin.getDefault().refreshWorkSpace();
}
Program: 138876
Project: 138876
Buggy source:
public List<String> readWorkspaceTasksDone(){
  return null;
}

Fixed version (ground truth):
public List<String> readWorkspaceTasksDone(){
  return new ArrayList<String>();
}
Program: 138877
Project: 138877
Buggy source:
/** 
 * Adds a submenu to the given menu with the name "New Component".
 */
public void fillContextMenu(IMenuManager menu){
  Object obj=((TreeSelection)this.getContext().getSelection()).getFirstElement();
  if (obj instanceof IResource) {
    IResource resource=(IResource)obj;
    if (!ResourceService.isReadOnlyFolder(resource)) {
      menu.add(new DeleteObjectsAction());
    }
  }
 else   if (obj instanceof DQRecycleBinNode) {
    menu.add(new DeleteObjectsAction());
  }
}

Fixed version (ground truth):
/** 
 * Adds a submenu to the given menu with the name "New Component".
 */
public void fillContextMenu(IMenuManager menu){
  Object obj=((TreeSelection)this.getContext().getSelection()).getFirstElement();
  if (obj instanceof IResource) {
    IResource resource=(IResource)obj;
    if (!ResourceService.isReadOnlyFolder(resource)) {
      menu.add(new DeleteObjectsAction());
    }
  }
 else {
    menu.add(new DeleteObjectsAction());
  }
}
Program: 138878
Project: 138878
Buggy source:
/** 
 * this check that the folder entered in the target export location exist otherwhise set an erro message and disable export.
 */
protected void checkForErrors(){
  errors=new ArrayList<String>();
  errors.addAll(writer.check());
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    Map<File,ModelElement> dependencyMap=record.getDependencyMap();
    for (    File depFile : dependencyMap.keySet()) {
      if (!repositoryTree.getChecked(ItemRecord.findRecord(depFile))) {
        ModelElement element=dependencyMap.get(depFile);
        String fileName=element != null ? element.getName() : depFile.getName();
        errors.add("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ fileName);
      }
    }
  }
  if (!errors.isEmpty()) {
    setErrorMessage(errors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}

Fixed version (ground truth):
/** 
 * this check that the folder entered in the target export location exist otherwhise set an erro message and disable export.
 */
protected void checkForErrors(){
  errors=new ArrayList<String>();
  errors.addAll(writer.check());
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    Map<File,ModelElement> dependencyMap=record.getDependencyMap();
    for (    File depFile : dependencyMap.keySet()) {
      if (!repositoryTree.getChecked(ItemRecord.findRecord(depFile))) {
        ModelElement element=dependencyMap.get(depFile);
        String fileName=element != null ? element.getName() : depFile.getName();
        errors.add("String_Node_Str" + record.getName() + "String_Node_Str"+ fileName);
      }
    }
  }
  if (!errors.isEmpty()) {
    setErrorMessage(errors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}
Program: 138879
Project: 138879
Buggy source:
@Override public String getText(Object element){
  if (element instanceof ItemRecord) {
    ItemRecord recored=(ItemRecord)element;
    File file=recored.getFile();
    String fileExtension=new Path(file.getName()).getFileExtension();
    if (file.isFile() && FactoriesUtil.isEmfFile(fileExtension)) {
      EMFUtil emfUtil=new EMFUtil();
      URI uri=URI.createFileURI(file.getAbsolutePath());
      Resource resource=emfUtil.getResourceSet().getResource(uri,true);
      EList<EObject> contents=resource.getContents();
      if (contents != null && !contents.isEmpty()) {
        EObject eObject=contents.get(0);
        if (eObject instanceof ModelElement) {
          return ((ModelElement)eObject).getName();
        }
      }
    }
    return file.getName();
  }
  return super.getText(element);
}

Fixed version (ground truth):
@Override public String getText(Object element){
  if (element instanceof ItemRecord) {
    ItemRecord recored=(ItemRecord)element;
    return recored.getName();
  }
  return super.getText(element);
}
Program: 138881
Project: 138881
Buggy source:
/** 
 * check that directory exist and issue an error message if not. <br> check that the folder is a data quality repository or issue an error.<br> check that anything is check in the tree or issue an error.<br>
 */
private void checkforErrors(){
  List<String> dErrors=new ArrayList<String>();
  if (repositoryTree.getTree().getItems().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  if (repositoryTree.getCheckedElements().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  dErrors.addAll(writer.check());
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    for (    File depFile : record.getDependencyMap().keySet()) {
      ModelElement element=record.getDependencyMap().get(depFile);
      ItemRecord findRecord=ItemRecord.findRecord(depFile);
      if (findRecord == null || !repositoryTree.getChecked(findRecord)) {
        dErrors.add("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ element.getName());
      }
    }
  }
  if (!dErrors.isEmpty()) {
    setErrorMessage(dErrors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}

Fixed version (ground truth):
/** 
 * check that directory exist and issue an error message if not. <br> check that the folder is a data quality repository or issue an error.<br> check that anything is check in the tree or issue an error.<br>
 */
private void checkforErrors(){
  List<String> dErrors=new ArrayList<String>();
  if (repositoryTree.getTree().getItems().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  if (repositoryTree.getCheckedElements().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  dErrors.addAll(writer.check());
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    for (    File depFile : record.getDependencyMap().keySet()) {
      ModelElement element=record.getDependencyMap().get(depFile);
      ItemRecord findRecord=ItemRecord.findRecord(depFile);
      if (findRecord == null || !repositoryTree.getChecked(findRecord)) {
        dErrors.add("String_Node_Str" + record.getName() + "String_Node_Str"+ element.getName());
      }
    }
  }
  if (!dErrors.isEmpty()) {
    setErrorMessage(dErrors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}
Program: 138882
Project: 138882
Buggy source:
public Map<IPath,IPath> mapping(ItemRecord record){
  Map<IPath,IPath> toExportMap=new HashMap<IPath,IPath>();
  IPath itemResPath=new Path(record.getFile().getAbsolutePath());
  IPath itemDesPath=record.getFullPath();
  IPath propResPath=record.getPropertyPath();
  if (itemDesPath == null) {
    System.out.println("String_Node_Str");
  }
 else {
  }
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  toExportMap.put(itemResPath,itemDesPath);
  toExportMap.put(propResPath,propDesPath);
  return toExportMap;
}

Fixed version (ground truth):
public Map<IPath,IPath> mapping(ItemRecord record){
  Map<IPath,IPath> toExportMap=new HashMap<IPath,IPath>();
  IPath itemResPath=new Path(record.getFile().getAbsolutePath());
  IPath itemDesPath=record.getFullPath();
  IPath propResPath=record.getPropertyPath();
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  toExportMap.put(itemResPath,itemDesPath);
  toExportMap.put(propResPath,propDesPath);
  return toExportMap;
}
Program: 138883
Project: 138883
Buggy source:
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    checkDependency(record);
    if (checkExisted) {
      checkExisted(record);
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  if (basePath != null) {
    versionFile=DqFileUtils.getFile(basePath.toFile(),VERSION_FILE_NAME);
    definitionFile=DqFileUtils.getFile(basePath.toFile(),DEFINITION_FILE_NAME);
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}

Fixed version (ground truth):
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    checkDependency(record);
    if (checkExisted) {
      checkExisted(record);
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}
Program: 138884
Project: 138884
Buggy source:
public ItemRecord computeInput(IPath path){
  setBasePath(path);
  return new ItemRecord(path.toFile());
}

Fixed version (ground truth):
public ItemRecord computeInput(IPath path){
  setBasePath(path);
  if (path != null) {
    versionFile=DqFileUtils.getFile(path.toFile(),VERSION_FILE_NAME);
    definitionFile=DqFileUtils.getFile(path.toFile(),DEFINITION_FILE_NAME);
  }
  if (versionFile != null && versionFile.exists()) {
    ProductVersion version=WorkspaceVersionHelper.getVesion(new Path(versionFile.getAbsolutePath()));
    migrationTasks=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version);
  }
  return new ItemRecord(path.toFile());
}
Program: 138885
Project: 138885
Buggy source:
/** 
 * DOC bZhou Comment method "checkExisted".
 * @param record
 */
private void checkExisted(ItemRecord record){
  Property property=record.getProperty();
  if (property != null) {
    IPath itemPath=PropertyHelper.getItemPath(property);
    IFile itemFile=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath);
    try {
      itemFile.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
    }
    ModelElement element=record.getElement();
    String aString=element != null ? element.getName() : property.getLabel();
    if (itemFile.exists()) {
      record.addError("String_Node_Str" + aString + "String_Node_Str"+ itemFile.getFullPath().toString());
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "checkExisted".
 * @param record
 */
private void checkExisted(ItemRecord record){
  Property property=record.getProperty();
  if (property != null) {
    IPath itemPath=PropertyHelper.getItemPath(property);
    IFile itemFile=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath);
    try {
      itemFile.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
    }
    String aString=record.getName();
    if (itemFile.exists()) {
      record.addError("String_Node_Str" + aString + "String_Node_Str"+ itemFile.getFullPath().toString());
    }
  }
}
Program: 138886
Project: 138886
Buggy source:
public void migration(IProgressMonitor monitor){
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  if (versionFile != null && versionFile.exists()) {
    ProductVersion version=WorkspaceVersionHelper.getVesion(new Path(versionFile.getAbsolutePath()));
    final List<IMigrationTask> migrationTasks=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version);
    MigrationTaskManager.doMigrationTask(migrationTasks,monitor);
  }
}

Fixed version (ground truth):
public void migration(IProgressMonitor monitor){
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  MigrationTaskManager.doMigrationTask(migrationTasks,monitor);
}
Program: 138887
Project: 138887
Buggy source:
/** 
 * DOC bZhou Comment method "checkDependency".
 * @param record
 */
private void checkDependency(ItemRecord record){
  for (  ModelElement melement : record.getDependencyMap().values()) {
    if (melement.eIsProxy()) {
      InternalEObject inObject=(InternalEObject)melement;
      record.addError("String_Node_Str" + record.getElement().getName() + "String_Node_Str"+ inObject.eProxyURI().toFileString());
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "checkDependency".
 * @param record
 */
private void checkDependency(ItemRecord record){
  for (  ModelElement melement : record.getDependencyMap().values()) {
    if (melement.eIsProxy()) {
      InternalEObject inObject=(InternalEObject)melement;
      record.addError("String_Node_Str" + record.getName() + "String_Node_Str"+ inObject.eProxyURI().toFileString());
    }
  }
}
Program: 138888
Project: 138888
Buggy source:
public void write(ItemRecord[] records,IProgressMonitor monitor){
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      Map<IPath,IPath> toImportMap=mapping(record);
      monitor.subTask("String_Node_Str" + record.getElementName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        for (        IPath resPath : toImportMap.keySet()) {
          IPath desPath=toImportMap.get(resPath);
          write(resPath,desPath);
        }
      }
 else {
        for (        String error : record.getErrors()) {
          log.error(error);
        }
      }
      monitor.worked(1);
    }
    finish(records,monitor);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
public void write(ItemRecord[] records,IProgressMonitor monitor){
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      Map<IPath,IPath> toImportMap=mapping(record);
      monitor.subTask("String_Node_Str" + record.getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        for (        IPath resPath : toImportMap.keySet()) {
          IPath desPath=toImportMap.get(resPath);
          write(resPath,desPath);
        }
      }
 else {
        for (        String error : record.getErrors()) {
          log.error(error);
        }
      }
      monitor.worked(1);
    }
    finish(records,monitor);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}
Program: 138889
Project: 138889
Buggy source:
/** 
 * DOC bZhou Comment method "init".
 */
private void init(){
  if (resourceSet == null) {
    resourceSet=new ResourceSetImpl();
  }
  if (allItemRecords == null) {
    allItemRecords=new ArrayList<ItemRecord>();
  }
  allItemRecords.add(this);
  if (element == null && !isJRXml()) {
    URI fileURI=URI.createFileURI(file.getAbsolutePath());
    Resource resource=resourceSet.getResource(fileURI,true);
    EList<EObject> contents=resource.getContents();
    if (contents != null && !contents.isEmpty()) {
      EObject object=contents.get(0);
      if (object instanceof ModelElement) {
        element=(ModelElement)object;
      }
    }
  }
  if (property == null) {
    property=(Property)EObjectHelper.retrieveEObject(getPropertyPath(),PropertiesPackage.eINSTANCE.getProperty());
  }
  computeDependencies();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "init".
 */
private void init(){
  if (resourceSet == null) {
    resourceSet=new ResourceSetImpl();
  }
  if (allItemRecords == null) {
    allItemRecords=new ArrayList<ItemRecord>();
  }
  allItemRecords.add(this);
  if (property == null) {
    property=(Property)EObjectHelper.retrieveEObject(getPropertyPath(),PropertiesPackage.eINSTANCE.getProperty());
  }
  if (element == null && !isJRXml()) {
    try {
      URI fileURI=URI.createFileURI(file.getAbsolutePath());
      Resource resource=resourceSet.getResource(fileURI,true);
      EList<EObject> contents=resource.getContents();
      if (contents != null && !contents.isEmpty()) {
        EObject object=contents.get(0);
        if (object instanceof ModelElement) {
          element=(ModelElement)object;
        }
      }
    }
 catch (    Exception e) {
      Log.warn("String_Node_Str" + getName());
    }
  }
  computeDependencies();
}
Program: 138890
Project: 138890
Buggy source:
/** 
 * DOC bZhou Comment method "computeDependencies".
 */
private void computeDependencies(){
  if (isJRXml()) {
    Collection<TdReport> allReports=RepResourceFileHelper.getInstance().getAllReports();
    for (    TdReport report : allReports) {
      for (      AnalysisMap anaMap : report.getAnalysisMap()) {
        if (StringUtils.equals(file.getAbsolutePath(),anaMap.getJrxmlSource())) {
          dependencyMap.put(file,report);
        }
      }
    }
  }
 else {
    List<ModelElement> dependencyElements=new ArrayList<ModelElement>();
    ModelElementHelper.iterateClientDependencies(element,dependencyElements);
    for (    ModelElement dElement : dependencyElements) {
      if (!dElement.eIsProxy()) {
        URI dURI=dElement.eResource().getURI();
        Resource dResource=resourceSet.getResource(dURI,false);
        if (dResource != null) {
          File depFile=new File(dResource.getURI().toFileString());
          dependencyMap.put(depFile,dElement);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "computeDependencies".
 */
private void computeDependencies(){
  if (isJRXml()) {
    Collection<TdReport> allReports=RepResourceFileHelper.getInstance().getAllReports();
    for (    TdReport report : allReports) {
      for (      AnalysisMap anaMap : report.getAnalysisMap()) {
        if (StringUtils.equals(file.getAbsolutePath(),anaMap.getJrxmlSource())) {
          dependencyMap.put(file,report);
        }
      }
    }
  }
 else   if (element != null) {
    List<ModelElement> dependencyElements=new ArrayList<ModelElement>();
    ModelElementHelper.iterateClientDependencies(element,dependencyElements);
    for (    ModelElement dElement : dependencyElements) {
      EcoreUtil.resolveAll(dElement);
      if (!dElement.eIsProxy()) {
        URI dURI=dElement.eResource().getURI();
        Resource dResource=resourceSet.getResource(dURI,false);
        if (dResource != null) {
          File depFile=new File(dResource.getURI().toFileString());
          dependencyMap.put(depFile,dElement);
        }
      }
    }
  }
}
Program: 138891
Project: 138891
Buggy source:
/** 
 * DOC zshen Comment method "initProxyRepository".
 */
private void initProxyRepository(){
  Project project=null;
  ProxyRepositoryFactory proxyRepository=ProxyRepositoryFactory.getInstance();
  proxyRepository.setRepositoryFactoryFromProvider(LocalRepositoryFactory.getInstance());
  try {
    proxyRepository.checkAvailability();
    proxyRepository.initialize();
    XmiResourceManager xmiResourceManager=new XmiResourceManager();
    IProject rootProject=ResourceManager.getRootProject();
    if (rootProject.exists()) {
      project=new Project(xmiResourceManager.loadProject(rootProject));
    }
 else {
      User user=PropertiesFactoryImpl.eINSTANCE.createUser();
      user.setLogin("String_Node_Str");
      user.setPassword("String_Node_Str".getBytes());
      String projectName=ResourceManager.getRootProjectName();
      String projectDesc=ResourcesPlugin.getWorkspace().newProjectDescription(projectName).getComment();
      Project projectInfor=ProjectHelper.createProject(projectName,projectDesc,ECodeLanguage.JAVA.getCaseName(),user);
      checkFileName(projectInfor.getLabel(),RepositoryConstants.PROJECT_PATTERN);
      project=proxyRepository.getRepositoryFactoryFromProvider().createProject(projectInfor);
    }
    initRepositoryContext(project);
  }
 catch (  PersistenceException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "initProxyRepository".
 */
private void initProxyRepository(){
  Project project=null;
  ProxyRepositoryFactory proxyRepository=ProxyRepositoryFactory.getInstance();
  proxyRepository.setRepositoryFactoryFromProvider(LocalRepositoryFactory.getInstance());
  try {
    proxyRepository.checkAvailability();
    proxyRepository.initialize();
    XmiResourceManager xmiResourceManager=new XmiResourceManager();
    IProject rootProject=ResourceManager.getRootProject();
    if (rootProject.exists()) {
      project=new Project(xmiResourceManager.loadProject(rootProject));
    }
 else {
      User user=PropertiesFactoryImpl.eINSTANCE.createUser();
      user.setLogin("String_Node_Str");
      user.setPassword("String_Node_Str".getBytes());
      String projectName=ResourceManager.getRootProjectName();
      String projectDesc=ResourcesPlugin.getWorkspace().newProjectDescription(projectName).getComment();
      Project projectInfor=ProjectHelper.createProject(projectName,projectDesc,ECodeLanguage.JAVA.getName(),user);
      checkFileName(projectInfor.getLabel(),RepositoryConstants.PROJECT_PATTERN);
      project=proxyRepository.getRepositoryFactoryFromProvider().createProject(projectInfor);
    }
    initRepositoryContext(project);
  }
 catch (  PersistenceException e) {
    e.printStackTrace();
  }
}
Program: 138892
Project: 138892
Buggy source:
/** 
 * DOC zshen Comment method "initProxyRepository".
 */
private void initProxyRepository(){
  Project project=null;
  ProxyRepositoryFactory proxyRepository=ProxyRepositoryFactory.getInstance();
  proxyRepository.setRepositoryFactoryFromProvider(LocalRepositoryFactory.getInstance());
  try {
    proxyRepository.checkAvailability();
    proxyRepository.initialize();
    XmiResourceManager xmiResourceManager=new XmiResourceManager();
    IProject rootProject=ResourceManager.getRootProject();
    if (rootProject.exists()) {
      project=new Project(xmiResourceManager.loadProject(rootProject));
    }
 else {
      User user=PropertiesFactoryImpl.eINSTANCE.createUser();
      user.setLogin("String_Node_Str");
      user.setPassword("String_Node_Str".getBytes());
      String projectName=ResourceManager.getRootProjectName();
      project=proxyRepository.createProject(projectName,ResourcesPlugin.getWorkspace().newProjectDescription(projectName).getComment(),ECodeLanguage.JAVA,user);
    }
    initRepositoryContext(project);
  }
 catch (  PersistenceException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "initProxyRepository".
 */
private void initProxyRepository(){
  Project project=null;
  ProxyRepositoryFactory proxyRepository=ProxyRepositoryFactory.getInstance();
  proxyRepository.setRepositoryFactoryFromProvider(LocalRepositoryFactory.getInstance());
  try {
    proxyRepository.checkAvailability();
    proxyRepository.initialize();
    XmiResourceManager xmiResourceManager=new XmiResourceManager();
    IProject rootProject=ResourceManager.getRootProject();
    if (rootProject.exists()) {
      project=new Project(xmiResourceManager.loadProject(rootProject));
    }
 else {
      User user=PropertiesFactoryImpl.eINSTANCE.createUser();
      user.setLogin("String_Node_Str");
      user.setPassword("String_Node_Str".getBytes());
      String projectName=ResourceManager.getRootProjectName();
      Project projectInfor=new Project(projectName);
      projectInfor.setDescription(ResourcesPlugin.getWorkspace().newProjectDescription(projectName).getComment());
      projectInfor.setLanguage(ECodeLanguage.JAVA);
      projectInfor.setAuthor(user);
      project=proxyRepository.createProject(projectInfor);
    }
    initRepositoryContext(project);
  }
 catch (  PersistenceException e) {
    e.printStackTrace();
  }
}
Program: 138893
Project: 138893
Buggy source:
/** 
 * yyi 2010-08-25 for 14851, Sybase DB has several names with different productions and versions. For example the Sybase IQ with version 12.6 is called 'Sybase' getting by JDBC but the version 15+ it is changed to 'Sybase IQ'. it is user by org.talend.cwm.db.connection.ConnectionUtils.isSybase
 * @return All Sybase DB products name,"Adaptive Server Enterprise","Sybase Adaptive Server IQ","Sybase IQ","Sybase"
 */
public static String[] getSybaseDBProductsName(){
  if (null == sybaseDBProductsNames) {
    sybaseDBProductsNames=new ArrayList<String>();
    for (    String name : SupportDBUrlType.SYBASEDEFAULTURL.getLanguage().split("String_Node_Str")) {
      sybaseDBProductsNames.add(name.trim());
    }
    sybaseDBProductsNames.add("String_Node_Str");
    sybaseDBProductsNames.add("String_Node_Str");
  }
  return sybaseDBProductsNames.toArray(new String[sybaseDBProductsNames.size()]);
}

Fixed version (ground truth):
/** 
 * yyi 2010-08-25 for 14851, Sybase DB has several names with different productions and versions. For example the Sybase IQ with version 12.6 is called 'Sybase' getting by JDBC but the version 15+ it is changed to 'Sybase IQ'. it is user by org.talend.cwm.db.connection.ConnectionUtils.isSybase
 * @return All Sybase DB products name,"Adaptive Server Enterprise","Sybase Adaptive Server IQ","Sybase IQ","Sybase"
 */
public static String[] getSybaseDBProductsName(){
  if (null == sybaseDBProductsNames) {
    sybaseDBProductsNames=new ArrayList<String>();
    for (    String name : SupportDBUrlType.SYBASEDEFAULTURL.getLanguage().split("String_Node_Str")) {
      sybaseDBProductsNames.add(name.trim());
    }
    sybaseDBProductsNames.add("String_Node_Str");
    sybaseDBProductsNames.add("String_Node_Str");
    sybaseDBProductsNames.add("String_Node_Str");
  }
  return sybaseDBProductsNames.toArray(new String[sybaseDBProductsNames.size()]);
}
Program: 138895
Project: 138895
Buggy source:
private String getTableNameFromColumn(TdColumn column){
  ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(column);
  if (columnSetOwner == null) {
    log.error("String_Node_Str" + column.getName() + "String_Node_Str");
  }
 else {
    Package pack=ColumnSetHelper.getParentCatalogOrSchema(columnSetOwner);
    if (SwitchHelpers.SCHEMA_SWITCH.doSwitch(pack) != null) {
      schemaName=pack.getName();
      Package catalog=ColumnSetHelper.getParentCatalogOrSchema(pack);
      if (catalog != null && SwitchHelpers.CATALOG_SWITCH.doSwitch(catalog) != null) {
        catalogName=catalog.getName();
      }
    }
    if (SwitchHelpers.CATALOG_SWITCH.doSwitch(pack) != null) {
      catalogName=pack.getName();
    }
    if (dbms().getDbmsName().equals(SupportDBUrlType.SYBASEDEFAULTURL.getLanguage())) {
      schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
    }
    return dbms().toQualifiedName(catalogName,schemaName,columnSetOwner.getName());
  }
  return null;
}

Fixed version (ground truth):
private String getTableNameFromColumn(TdColumn column){
  ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(column);
  if (columnSetOwner == null) {
    log.error("String_Node_Str" + column.getName() + "String_Node_Str");
  }
 else {
    Package pack=ColumnSetHelper.getParentCatalogOrSchema(columnSetOwner);
    if (SwitchHelpers.SCHEMA_SWITCH.doSwitch(pack) != null) {
      schemaName=pack.getName();
      Package catalog=ColumnSetHelper.getParentCatalogOrSchema(pack);
      if (catalog != null && SwitchHelpers.CATALOG_SWITCH.doSwitch(catalog) != null) {
        catalogName=catalog.getName();
      }
    }
    if (SwitchHelpers.CATALOG_SWITCH.doSwitch(pack) != null) {
      catalogName=pack.getName();
    }
    if (ConnectionUtils.isSybaseeDBProducts(dbms().getDbmsName())) {
      schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
    }
    return dbms().toQualifiedName(catalogName,schemaName,columnSetOwner.getName());
  }
  return null;
}
Program: 138896
Project: 138896
Buggy source:
/** 
 * DOC scorreia Comment method "getTableName".
 * @param analyzedColumns
 * @return the quoted table name
 */
private String getTableName(final EList<TdColumn> analyzedColumns){
  ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(analyzedColumns.get(0));
  String tableName=columnSetOwner.getName();
  Package pack=ColumnSetHelper.getParentCatalogOrSchema(columnSetOwner);
  if (pack instanceof Schema && ColumnSetHelper.getParentCatalogOrSchema(pack) instanceof Catalog) {
    pack=ColumnSetHelper.getParentCatalogOrSchema(pack);
  }
  if (pack == null) {
    log.error("String_Node_Str" + tableName);
  }
 else {
    this.catalogOrSchema=pack.getName();
  }
  String schemaName=getQuotedSchemaName(columnSetOwner);
  String catalogName=getQuotedCatalogName(columnSetOwner);
  if (catalogName == null && schemaName != null) {
    final Schema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
    final Catalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
    catalogName=parentCatalog != null ? parentCatalog.getName() : null;
  }
  if (dbms().getDbmsName().equals(SupportDBUrlType.SYBASEDEFAULTURL.getLanguage())) {
    schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
  }
  return dbms().toQualifiedName(catalogName,schemaName,tableName);
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getTableName".
 * @param analyzedColumns
 * @return the quoted table name
 */
private String getTableName(final EList<TdColumn> analyzedColumns){
  ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(analyzedColumns.get(0));
  String tableName=columnSetOwner.getName();
  Package pack=ColumnSetHelper.getParentCatalogOrSchema(columnSetOwner);
  if (pack instanceof Schema && ColumnSetHelper.getParentCatalogOrSchema(pack) instanceof Catalog) {
    pack=ColumnSetHelper.getParentCatalogOrSchema(pack);
  }
  if (pack == null) {
    log.error("String_Node_Str" + tableName);
  }
 else {
    this.catalogOrSchema=pack.getName();
  }
  String schemaName=getQuotedSchemaName(columnSetOwner);
  String catalogName=getQuotedCatalogName(columnSetOwner);
  if (catalogName == null && schemaName != null) {
    final Schema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
    final Catalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
    catalogName=parentCatalog != null ? parentCatalog.getName() : null;
  }
  if (ConnectionUtils.isSybaseeDBProducts(dbms().getDbmsName())) {
    schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
  }
  return dbms().toQualifiedName(catalogName,schemaName,tableName);
}
Program: 138897
Project: 138897
Buggy source:
/** 
 * DOC scorreia Comment method "getTableName".
 * @param columnSetA
 * @return
 */
private String getTableName(EList<TdColumn> columnSetA){
  String tableName=null;
  for (  TdColumn column : columnSetA) {
    if (belongToSameSchemata((TdColumn)column)) {
      ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(column);
      if (columnSetOwner == null) {
        log.error("String_Node_Str" + column.getName() + "String_Node_Str");
        continue;
      }
 else {
        String schemaName=getQuotedSchemaName(columnSetOwner);
        String table=getQuotedTableName(column);
        String catalogName=getQuotedCatalogName(columnSetOwner);
        if (catalogName == null && schemaName != null) {
          final Schema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
          final Catalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
          catalogName=parentCatalog != null ? parentCatalog.getName() : null;
        }
        if (dbms().getDbmsName().equals(SupportDBUrlType.SYBASEDEFAULTURL.getLanguage())) {
          schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
        }
        tableName=dbms().toQualifiedName(catalogName,schemaName,table);
        this.catalogOrSchema=getCatalogOrSchemaName(column);
        break;
      }
    }
 else {
      log.error(this.errorMessage);
    }
  }
  return quote(tableName);
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getTableName".
 * @param columnSetA
 * @return
 */
private String getTableName(EList<TdColumn> columnSetA){
  String tableName=null;
  for (  TdColumn column : columnSetA) {
    if (belongToSameSchemata((TdColumn)column)) {
      ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(column);
      if (columnSetOwner == null) {
        log.error("String_Node_Str" + column.getName() + "String_Node_Str");
        continue;
      }
 else {
        String schemaName=getQuotedSchemaName(columnSetOwner);
        String table=getQuotedTableName(column);
        String catalogName=getQuotedCatalogName(columnSetOwner);
        if (catalogName == null && schemaName != null) {
          final Schema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
          final Catalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
          catalogName=parentCatalog != null ? parentCatalog.getName() : null;
        }
        if (ConnectionUtils.isSybaseeDBProducts(dbms().getDbmsName())) {
          schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
        }
        tableName=dbms().toQualifiedName(catalogName,schemaName,table);
        this.catalogOrSchema=getCatalogOrSchemaName(column);
        break;
      }
    }
 else {
      log.error(this.errorMessage);
    }
  }
  return quote(tableName);
}
Program: 138898
Project: 138898
Buggy source:
/** 
 * Method "getAnalyzedTable".
 * @param indicator
 * @return the table name (within quotes)
 */
private String getAnalyzedTable(Indicator indicator){
  String analyzedTableName=null;
  ColumnSet columnSetOwner=(ColumnSet)indicator.getAnalyzedElement();
  if (columnSetOwner == null) {
    log.error("String_Node_Str" + indicator.getName());
  }
 else {
    String schemaName=getQuotedSchemaName(columnSetOwner);
    String table=quote(columnSetOwner.getName());
    String catalogName=getQuotedCatalogName(columnSetOwner);
    if (catalogName == null && schemaName != null) {
      final Schema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
      final Catalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
      catalogName=parentCatalog != null ? parentCatalog.getName() : null;
    }
    if (dbms().getDbmsName().equals(SupportDBUrlType.SYBASEDEFAULTURL.getLanguage())) {
      schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
    }
    analyzedTableName=dbms().toQualifiedName(catalogName,schemaName,table);
  }
  return analyzedTableName;
}

Fixed version (ground truth):
/** 
 * Method "getAnalyzedTable".
 * @param indicator
 * @return the table name (within quotes)
 */
private String getAnalyzedTable(Indicator indicator){
  String analyzedTableName=null;
  ColumnSet columnSetOwner=(ColumnSet)indicator.getAnalyzedElement();
  if (columnSetOwner == null) {
    log.error("String_Node_Str" + indicator.getName());
  }
 else {
    String schemaName=getQuotedSchemaName(columnSetOwner);
    String table=quote(columnSetOwner.getName());
    String catalogName=getQuotedCatalogName(columnSetOwner);
    if (catalogName == null && schemaName != null) {
      final Schema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
      final Catalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
      catalogName=parentCatalog != null ? parentCatalog.getName() : null;
    }
    if (ConnectionUtils.isSybaseeDBProducts(dbms().getDbmsName())) {
      schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
    }
    analyzedTableName=dbms().toQualifiedName(catalogName,schemaName,table);
  }
  return analyzedTableName;
}
Program: 138901
Project: 138901
Buggy source:
/** 
 * DOC bZhou Comment method "getFullyQualifiedTableName".
 * @param set
 * @return
 */
protected String getFullyQualifiedTableName(ColumnSet set){
  Schema parentSchema=SchemaHelper.getParentSchema(set);
  Catalog parentCatalog=CatalogHelper.getParentCatalog(set);
  if (parentSchema != null) {
    parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
  }
  String schemaName=parentSchema == null ? null : parentSchema.getName();
  String catalogName=parentCatalog == null ? null : parentCatalog.getName();
  if (dbmsLanguage.getDbmsName().equals(SupportDBUrlType.SYBASEDEFAULTURL.getLanguage())) {
    schemaName=ColumnSetHelper.getTableOwner(set);
  }
  return dbmsLanguage.toQualifiedName(catalogName,schemaName,set.getName());
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getFullyQualifiedTableName".
 * @param set
 * @return
 */
protected String getFullyQualifiedTableName(ColumnSet set){
  Schema parentSchema=SchemaHelper.getParentSchema(set);
  Catalog parentCatalog=CatalogHelper.getParentCatalog(set);
  if (parentSchema != null) {
    parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
  }
  String schemaName=parentSchema == null ? null : parentSchema.getName();
  String catalogName=parentCatalog == null ? null : parentCatalog.getName();
  if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
    schemaName=ColumnSetHelper.getTableOwner(set);
  }
  return dbmsLanguage.toQualifiedName(catalogName,schemaName,set.getName());
}
Program: 138902
Project: 138902
Buggy source:
/** 
 * Method "getInstantiatedClause".
 * @return the where clause from the instantiated query
 */
protected String getInstantiatedClause(){
  TdColumn column=(TdColumn)indicator.getAnalyzedElement();
  int javaType=column.getJavaType();
  Object value=null;
  if (Java2SqlType.isNumbericInSQL(javaType) && dbmsLanguage instanceof DB2DbmsLanguage) {
    value=entity.getKey();
  }
 else {
    value="String_Node_Str" + entity.getKey() + "String_Node_Str";
  }
  String clause=entity.isLabelNull() ? columnName + dbmsLanguage.isNull() : columnName + dbmsLanguage.equal() + value;
  return clause;
}

Fixed version (ground truth):
/** 
 * Method "getInstantiatedClause".
 * @return the where clause from the instantiated query
 */
protected String getInstantiatedClause(){
  TdColumn column=(TdColumn)indicator.getAnalyzedElement();
  int javaType=column.getJavaType();
  Object value=null;
  if (Java2SqlType.isNumbericInSQL(javaType) && dbmsLanguage instanceof DB2DbmsLanguage) {
    value=entity.getKey();
  }
 else   if (Java2SqlType.isNumbericInSQL(javaType) && dbmsLanguage instanceof SybaseASEDbmsLanguage) {
    value=entity.getKey();
  }
 else {
    value="String_Node_Str" + entity.getKey() + "String_Node_Str";
  }
  String clause=entity.isLabelNull() ? columnName + dbmsLanguage.isNull() : columnName + dbmsLanguage.equal() + value;
  return clause;
}
Program: 138903
Project: 138903
Buggy source:
protected String extract(DateGrain dateGrain,String colName){
  return "String_Node_Str" + dateGrain + from()+ colName+ "String_Node_Str";
}

Fixed version (ground truth):
protected String extract(DateGrain dateGrain,String colName){
  if (ConnectionUtils.isSybaseeDBProducts(getDbmsName())) {
    return "String_Node_Str" + dateGrain + "String_Node_Str"+ colName+ "String_Node_Str";
  }
  return "String_Node_Str" + dateGrain + from()+ colName+ "String_Node_Str";
}
Program: 138905
Project: 138905
Buggy source:
private static boolean isSybase(String dbms){
  String[] sybaseVertions=DbmsLanguage.SYBASE.split("String_Node_Str");
  for (  String sybaseVerion : sybaseVertions) {
    if (compareDbmsLanguage(dbms,sybaseVerion.trim())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private static boolean isSybase(String dbms){
  return ConnectionUtils.isSybaseeDBProducts(dbms);
}
Program: 138906
Project: 138906
Buggy source:
/** 
 * DOC zqin Comment method "getQualifiedName".
 * @param tdDataProvider
 * @return
 */
public static String getColumnSetQualifiedName(Connection tdDataProvider,ColumnSet columnset){
  DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(tdDataProvider);
  Package catalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema(columnset);
  if (catalogOrSchema == null) {
    return columnset.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(columnset);
  }
  return dbmsLanguage.toQualifiedName(catalogName,schemaName,columnset.getName());
}

Fixed version (ground truth):
/** 
 * DOC zqin Comment method "getQualifiedName".
 * @param tdDataProvider
 * @return
 */
public static String getColumnSetQualifiedName(Connection tdDataProvider,ColumnSet columnset){
  DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(tdDataProvider);
  Package catalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema(columnset);
  if (catalogOrSchema == null) {
    return columnset.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(columnset);
  }
  return dbmsLanguage.toQualifiedName(catalogName,schemaName,columnset.getName());
}
Program: 138907
Project: 138907
Buggy source:
/** 
 * DOC scorreia Comment method "queryOnTable".
 * @param catalog
 * @param schema
 * @param schemaIndic
 * @param tablesSet
 * @param tableCube
 * @param ok
 * @throws SQLException
 */
protected void evalAllCounts(String catalog,String schema,NamedColumnSet t,SchemaIndicator schemaIndic,boolean isTable,ReturnCode ok) throws SQLException {
  String quCatalog=catalog == null ? null : dbms().quote(catalog);
  String quSchema=schema == null ? null : dbms().quote(schema);
  final String table=t.getName();
  String quTable=dbms().quote(table);
  if (isTable) {
    long rowCount=getRowCounts(quCatalog,quSchema,quTable);
    schemaIndic.setTableRowCount(schemaIndic.getTableRowCount() + rowCount);
    if (dbmsLanguage.getDbmsName().equals(SupportDBUrlType.SYBASEDEFAULTURL.getLanguage())) {
      schema=ColumnSetHelper.getTableOwner(t);
    }
    int pkCount=getPKCount(catalog,schema,table);
    schemaIndic.setKeyCount(schemaIndic.getKeyCount() + pkCount);
    int idxCount=getIndexCount(catalog,schema,table);
    schemaIndic.setIndexCount(schemaIndic.getIndexCount() + idxCount);
    createTableIndicator(t,schemaIndic,rowCount,pkCount,idxCount);
  }
 else {
    long rowCount=getRowCounts(quCatalog,quSchema,quTable);
    schemaIndic.setViewRowCount(schemaIndic.getViewRowCount() + rowCount);
    createViewIndicator(t,schemaIndic,rowCount);
  }
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "queryOnTable".
 * @param catalog
 * @param schema
 * @param schemaIndic
 * @param tablesSet
 * @param tableCube
 * @param ok
 * @throws SQLException
 */
protected void evalAllCounts(String catalog,String schema,NamedColumnSet t,SchemaIndicator schemaIndic,boolean isTable,ReturnCode ok) throws SQLException {
  String quCatalog=catalog == null ? null : dbms().quote(catalog);
  String quSchema=schema == null ? null : dbms().quote(schema);
  final String table=t.getName();
  String quTable=dbms().quote(table);
  if (isTable) {
    long rowCount=getRowCounts(quCatalog,quSchema,quTable);
    schemaIndic.setTableRowCount(schemaIndic.getTableRowCount() + rowCount);
    if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
      schema=ColumnSetHelper.getTableOwner(t);
    }
    int pkCount=getPKCount(catalog,schema,table);
    schemaIndic.setKeyCount(schemaIndic.getKeyCount() + pkCount);
    int idxCount=getIndexCount(catalog,schema,table);
    schemaIndic.setIndexCount(schemaIndic.getIndexCount() + idxCount);
    createTableIndicator(t,schemaIndic,rowCount,pkCount,idxCount);
  }
 else {
    if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
      schema=ColumnSetHelper.getTableOwner(t);
    }
    long rowCount=getRowCounts(quCatalog,schema,quTable);
    schemaIndic.setViewRowCount(schemaIndic.getViewRowCount() + rowCount);
    createViewIndicator(t,schemaIndic,rowCount);
  }
}
Program: 138908
Project: 138908
Buggy source:
protected ReturnCode closeConnection(){
  if (connection != null) {
    return ConnectionUtils.closeConnection(connection);
  }
  return new ReturnCode(Messages.getString("String_Node_Str"),false);
}

Fixed version (ground truth):
protected ReturnCode closeConnection(){
  if (connection != null) {
    try {
      return connection.isClosed() ? new ReturnCode(true) : ConnectionUtils.closeConnection(connection);
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
  }
  return new ReturnCode(Messages.getString("String_Node_Str"),false);
}