nus-yam/ex-repair huggingface dataset:
Program: 139157
Project: 139157
Buggy source:
private void unload(IResource res){
  if (res instanceof IFile) {
    IFile resFile=(IFile)res;
    ResourceFileMap fileMap=ModelElementFileFactory.getResourceFileMap(resFile);
    String uriStr=fileMap.getFileResource(resFile).getURI().toString();
    fileMap.remove(resFile);
    EMFSharedResources.getInstance().unloadResource(uriStr);
  }
}

Fixed version (ground truth):
private void unload(IResource res){
  if (res instanceof IFile) {
    IFile resFile=(IFile)res;
    ResourceFileMap fileMap=ModelElementFileFactory.getResourceFileMap(resFile);
    if (fileMap != null) {
      String uriStr=fileMap.getFileResource(resFile).getURI().toString();
      fileMap.remove(resFile);
      EMFSharedResources.getInstance().unloadResource(uriStr);
    }
  }
}
Program: 139158
Project: 139158
Buggy source:
@Override public boolean performFinish(){
  IFile[] files=exportPage.getElements();
  IImexWriter writer=ExportWriterFactory.create(type);
  try {
    for (    IFile file : files) {
      writer.initPath(new ItemRecord(file),exportPage.getFilePath());
      writer.write();
    }
    writer.finish();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  File[] files=exportPage.getElements();
  IImexWriter writer=ExportWriterFactory.create(type);
  try {
    for (    File file : files) {
      writer.initPath(new ItemRecord(file),exportPage.getFilePath());
      writer.write();
    }
    writer.finish(null);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return true;
}
Program: 139159
Project: 139159
Buggy source:
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public IFile[] getElements(){
  Object[] checkedElements=repositoryTree.getCheckedElements();
  List<IFile> files=new ArrayList<IFile>();
  if (checkedElements != null) {
    for (    Object obj : checkedElements) {
      if (obj instanceof File) {
        File file=(File)obj;
        IFile file2iFile=file2IFile(file);
        if (file2iFile != null) {
          files.add(file2iFile);
        }
      }
    }
  }
  return files.toArray(new IFile[files.size()]);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public File[] getElements(){
  Object[] checkedElements=repositoryTree.getCheckedElements();
  List<File> files=new ArrayList<File>();
  if (checkedElements != null) {
    for (    Object obj : checkedElements) {
      if (obj instanceof File) {
        files.add((File)obj);
      }
    }
  }
  return files.toArray(new File[files.size()]);
}
Program: 139160
Project: 139160
Buggy source:
/** 
 * DOC bZhou Comment method "isTOPFile".
 * @param file
 * @return
 */
private boolean isValidDirectory(File file){
  String absolutePath=file.getAbsolutePath();
  boolean tdqProject=false;
  File[] listFiles=file.listFiles();
  if (listFiles != null) {
    for (    File afile : listFiles) {
      if (StringUtils.equals(afile.getName(),"String_Node_Str")) {
        tdqProject=true;
        break;
      }
    }
  }
  return absolutePath.indexOf(EResourceConstant.DATA_PROFILING.getName()) > 0 || absolutePath.indexOf(EResourceConstant.LIBRARIES.getName()) > 0 || absolutePath.indexOf(EResourceConstant.METADATA.getName()) > 0 || StringUtils.equals(file.getName(),ReponsitoryContextBridge.PROJECT_DEFAULT_NAME) || tdqProject;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isTOPFile".
 * @param file
 * @return
 */
private boolean isValidDirectory(File file){
  String absolutePath=file.getAbsolutePath();
  boolean tdqProject=false;
  File[] listFiles=file.listFiles();
  if (listFiles != null) {
    for (    File afile : listFiles) {
      if (StringUtils.equals(afile.getName(),"String_Node_Str")) {
        tdqProject=true;
        break;
      }
    }
  }
  return (absolutePath.indexOf(EResourceConstant.DATA_PROFILING.getName()) > 0 || absolutePath.indexOf(EResourceConstant.LIBRARIES.getName()) > 0 || absolutePath.indexOf(EResourceConstant.METADATA.getName()) > 0 || StringUtils.equals(file.getName(),ReponsitoryContextBridge.PROJECT_DEFAULT_NAME) || tdqProject) && !file.getName().startsWith("String_Node_Str");
}
Program: 139161
Project: 139161
Buggy source:
public ImportWizard(){
  this.importPage=new ImportWizardPage();
  setWindowTitle("String_Node_Str");
}

Fixed version (ground truth):
public ImportWizard(EImexType type){
  setWindowTitle("String_Node_Str");
  this.writer=ImportWriterFactory.create(type);
  this.importPage=new ImportWizardPage(writer);
}
Program: 139162
Project: 139162
Buggy source:
@Override public boolean performFinish(){
  File[] files=importPage.getElements();
  IImexWriter writer=ImportWriterFactory.create(type);
  try {
    for (    File file : files) {
      writer.initPath(new ItemRecord(file),null);
      writer.write();
    }
    writer.finish();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  File[] files=importPage.getElements();
  final ItemRecord[] records=new ItemRecord[files.length];
  for (int i=0; i < files.length; i++) {
    records[i]=new ItemRecord(files[i]);
  }
  ItemRecord[] invalidRecords=writer.populate(records);
  importPage.updateErrorList(invalidRecords);
  if (invalidRecords.length > 0) {
    return false;
  }
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.initPath(record,null);
            writer.write();
          }
 else {
            for (            String error : record.getErrors()) {
              log.error(error);
            }
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}
Program: 139164
Project: 139164
Buggy source:
/** 
 * return the String size limit for the given ecore attribute. This looks for an annotation url : htttp://talend.org/UiConstraints and search for the key string.max.size
 * @param tag the tag value to get the size limit from.
 * @param defaultValue the default value returned if limit not found in feature
 * @return the string limit found or the default valueADDED sgandon 16/03/2010 bug 11760
 */
public static int getStringMaxSize(String tag,int defaultValue){
  Assert.isNotNull(tag);
  int result=defaultValue;
  EAnnotation guiAnnotation=CorePackage.Literals.MODEL_ELEMENT__TAGGED_VALUE.getEAnnotation(EmfHelper.UI_CONSTRAINTS_ANNOTATION_URL);
  if (guiAnnotation != null) {
    String docuValue=guiAnnotation.getDetails().get(EmfHelper.STRING_MAX_SIZE_ANNOTATION_KEY + "String_Node_Str" + tag);
    try {
      result=Integer.parseInt(docuValue);
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + tag,e);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * return the String size limit for the given ecore attribute. This looks for an annotation url : htttp://talend.org/UiConstraints and search for the key string.max.size
 * @param tag the tag value to get the size limit from.
 * @param defaultValue the default value returned if limit not found in feature
 * @return the string limit found or the default value ADDED sgandon 16/03/2010 bug 11760
 */
public static int getStringMaxSize(String tag,int defaultValue){
  Assert.isNotNull(tag);
  int result=defaultValue;
  EAnnotation guiAnnotation=CorePackage.Literals.MODEL_ELEMENT__TAGGED_VALUE.getEAnnotation(EmfHelper.UI_CONSTRAINTS_ANNOTATION_URL);
  if (guiAnnotation != null) {
    String docuValue=guiAnnotation.getDetails().get(EmfHelper.STRING_MAX_SIZE_ANNOTATION_KEY + "String_Node_Str" + tag);
    try {
      result=Integer.parseInt(docuValue);
    }
 catch (    Exception e) {
      log.warn("String_Node_Str" + tag,e);
    }
  }
  return result;
}
Program: 139166
Project: 139166
Buggy source:
public void widgetSelected(SelectionEvent e){
  int column=cursor.getColumn();
  if (column == TABLE_COLUMN_INDEX) {
    cursor.setMenu(menu2);
    menu2.setVisible(true);
  }
 else {
    cursor.setMenu(null);
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  TableItem tableItem=cursor.getRow();
  runTableAnalysis(tableItem.getText(0));
}
Program: 139167
Project: 139167
Buggy source:
/** 
 * DOC bZhou Comment method "getIndicatorPercentValue".
 * @param indicator, never null
 * @return null in case of error
 */
public static String getIndicatorPercentValue(Indicator indicator){
  try {
    double userCount=NumberFormat.getInstance().parse(getIndicatorValue(indicator)).doubleValue();
    double count=Double.valueOf(indicator.getCount());
    return computePercent(userCount,count);
  }
 catch (  NumberFormatException e) {
    log.warn("String_Node_Str" + indicator.getName(),e);
    return null;
  }
catch (  ParseException e) {
    log.warn("String_Node_Str" + indicator.getName(),e);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getIndicatorPercentValue".
 * @param indicator, never null
 * @return null in case of error
 */
public static String getIndicatorPercentValue(Indicator indicator){
  try {
    String indicatorValue=getIndicatorValue(indicator);
    if (indicatorValue != null) {
      double userCount=NumberFormat.getInstance().parse(indicatorValue).doubleValue();
      double count=Double.valueOf(indicator.getCount());
      return computePercent(userCount,count);
    }
  }
 catch (  NumberFormatException e) {
    log.warn("String_Node_Str" + indicator.getName(),e);
  }
catch (  ParseException e) {
    log.warn("String_Node_Str" + indicator.getName(),e);
  }
  return null;
}
Program: 139168
Project: 139168
Buggy source:
public void clear(){
  this.registedResourceMap.clear();
}

Fixed version (ground truth):
public void clear(){
  registedResourceMap.clear();
}
Program: 139169
Project: 139169
Buggy source:
/** 
 * DOC rli Comment method "createResource".
 * @param file
 * @return
 */
public Resource getFileResource(IFile file){
  Resource res=registedResourceMap.get(file);
  if (res != null) {
    return res;
  }
  URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
  Resource rs=EMFSharedResources.getInstance().getResource(uri,true);
  this.registedResourceMap.put(file,rs);
  return rs;
}

Fixed version (ground truth):
/** 
 * DOC rli Comment method "createResource".
 * @param file
 * @return
 */
public Resource getFileResource(IFile file){
  Resource res;
  if (exist(file)) {
    res=registedResourceMap.get(file);
  }
 else {
    URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
    res=EMFSharedResources.getInstance().getResource(uri,true);
    register(file,res);
  }
  return res;
}
Program: 139170
Project: 139170
Buggy source:
public void remove(IFile file){
  this.registedResourceMap.remove(file);
}

Fixed version (ground truth):
public void remove(IFile file){
  registedResourceMap.remove(file);
}
Program: 139171
Project: 139171
Buggy source:
public void deleteResource(){
  DriverManager driverManager=SQLExplorerPlugin.getDefault().getDriverModel();
  final IResource[] resources=selectedFiles;
  if (!checkDeleteContent(resources)) {
    return;
  }
  List<Map<String,String>> driverList=driverPreferCustInfo();
  for (  Map<String,String> driverInfoMap : driverList) {
    String connectionURI=driverInfoMap.get("String_Node_Str");
    for (    ModelElement tdDataProvider : modelElementList) {
      if (tdDataProvider.eResource().getURI().toString().trim().equals(connectionURI.trim())) {
        String customDriverId=driverInfoMap.get("String_Node_Str");
        if (driverManager.getDriver(customDriverId) != null) {
          driverManager.removeDriver(driverManager.getDriver(customDriverId));
        }
      }
    }
  }
  delRelatedResource(isDeleteContent,resources);
  EObjectHelper.removeDependencys(resources);
  for (  IResource res : resources) {
    try {
      if (res.isLinked()) {
        File file=new File(res.getRawLocation().toOSString());
        if (file.exists()) {
          file.delete();
        }
      }
      res.delete(true,new NullProgressMonitor());
      res.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      log.error(e,e);
    }
  }
  CorePlugin.getDefault().refreshDQView();
}

Fixed version (ground truth):
public void deleteResource(){
  DriverManager driverManager=SQLExplorerPlugin.getDefault().getDriverModel();
  final IResource[] resources=selectedFiles;
  if (!checkDeleteContent(resources)) {
    return;
  }
  List<Map<String,String>> driverList=driverPreferCustInfo();
  for (  Map<String,String> driverInfoMap : driverList) {
    String connectionURI=driverInfoMap.get("String_Node_Str");
    for (    ModelElement tdDataProvider : modelElementList) {
      if (tdDataProvider.eResource().getURI().toString().trim().equals(connectionURI.trim())) {
        String customDriverId=driverInfoMap.get("String_Node_Str");
        if (driverManager.getDriver(customDriverId) != null) {
          driverManager.removeDriver(driverManager.getDriver(customDriverId));
        }
      }
    }
  }
  delRelatedResource(isDeleteContent,resources);
  EObjectHelper.removeDependencys(resources);
  for (  IResource res : resources) {
    unload(res);
    delete(res);
  }
  CorePlugin.getDefault().refreshDQView();
}
Program: 139172
Project: 139172
Buggy source:
public void finish() throws IOException {
  CorePlugin.getDefault().refreshWorkSpace();
  CorePlugin.getDefault().refreshDQView();
}

Fixed version (ground truth):
public void finish() throws IOException {
  IFile defintionFile=ResourceManager.getLibrariesFolder().getFile("String_Node_Str");
  if (!defintionFile.exists()) {
    DefinitionHandler.getInstance();
  }
  CorePlugin.getDefault().refreshWorkSpace();
  CorePlugin.getDefault().refreshDQView();
}
Program: 139173
Project: 139173
Buggy source:
/** 
 * DOC xqliu Comment method "initTempExpressionList". ADD xqliu 2010-03-23 feature 11201
 */
private void initTempExpressionList(IndicatorDefinition definition){
  if (tempExpressionList == null) {
    tempExpressionList=new ArrayList<Expression>();
  }
 else {
    tempExpressionList.clear();
  }
  if (definition != null) {
    EList<Expression> expressions=definition.getSqlGenericExpression();
    for (    Expression exp : expressions) {
      Expression newExp=BooleanExpressionHelper.createExpression(exp.getLanguage(),exp.getBody());
      newExp.setVersion(exp.getVersion());
      tempExpressionList.add(newExp);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "initTempExpressionList". ADD xqliu 2010-03-23 feature 11201
 */
private void initTempExpressionList(IndicatorDefinition definition){
  if (tempExpressionList == null) {
    tempExpressionList=new ArrayList<Expression>();
  }
 else {
    tempExpressionList.clear();
  }
  if (definition != null) {
    EList<Expression> expressions=definition.getSqlGenericExpression();
    for (    Expression exp : expressions) {
      tempExpressionList.add(cloneExpression(exp));
    }
  }
}
Program: 139174
Project: 139174
Buggy source:
public void modifyText(ModifyEvent e){
  Text dbVersionText=(Text)e.getSource();
  Expression expression=tempExpressionMap.get(combo);
  expression.setVersion(dbVersionText.getText().trim());
  setDirty(true);
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  setDirty(true);
  Text dbVersionText=null;
  if (e.getSource() != null && e.getSource() instanceof Text) {
    dbVersionText=(Text)e.getSource();
  }
  Expression expression=tempExpressionMap.get(this.combo);
  if (expression != null && dbVersionText != null) {
    expression.setVersion(dbVersionText.getText().trim());
  }
}
Program: 139176
Project: 139176
Buggy source:
@Override protected void initialize(){
  String[] indicatorThreshold=IndicatorHelper.getIndicatorThreshold(parameters);
  if (indicatorThreshold != null) {
    lowerText.setText(indicatorThreshold[0] == null ? "String_Node_Str" : indicatorThreshold[0]);
    higherText.setText(indicatorThreshold[1] == null ? "String_Node_Str" : indicatorThreshold[1]);
  }
  String[] indicatorPersentThreshold=IndicatorHelper.getIndicatorThresholdInPercent(parameters);
  if (indicatorPersentThreshold != null && isContainRowCount) {
    if (StringUtils.isNotEmpty(indicatorPersentThreshold[0])) {
      Double min=StringFormatUtil.parseDouble(indicatorPersentThreshold[0]);
      pLowerText.setText(String.valueOf(min * 100));
    }
    if (StringUtils.isNotEmpty(indicatorPersentThreshold[1])) {
      Double max=StringFormatUtil.parseDouble(indicatorPersentThreshold[1]);
      pHigherText.setText(String.valueOf(max * 100));
    }
  }
}

Fixed version (ground truth):
@Override protected void initialize(){
  String[] indicatorThreshold=IndicatorHelper.getIndicatorThreshold(parameters);
  if (indicatorThreshold != null) {
    lowerText.setText(indicatorThreshold[0] == null ? "String_Node_Str" : indicatorThreshold[0]);
    higherText.setText(indicatorThreshold[1] == null ? "String_Node_Str" : indicatorThreshold[1]);
  }
  String[] indicatorPersentThreshold=IndicatorHelper.getIndicatorThresholdInPercent(parameters);
  if (indicatorPersentThreshold != null && isContainRowCount) {
    if (StringUtils.isNotEmpty(indicatorPersentThreshold[0])) {
      Double min=StringFormatUtil.parseDouble(indicatorPersentThreshold[0]);
      min=min > 1 ? min : min * 100;
      pLowerText.setText(String.valueOf(min));
    }
    if (StringUtils.isNotEmpty(indicatorPersentThreshold[1])) {
      Double max=StringFormatUtil.parseDouble(indicatorPersentThreshold[1]);
      max=max > 1 ? max : max * 100;
      pHigherText.setText(String.valueOf(max));
    }
  }
}
Program: 139177
Project: 139177
Buggy source:
/** 
 * DOC bZhou Comment method "updateProperty".
 * @param elementResource
 * @param propertyResource
 */
private void updateProperty(final Resource elementResource,Resource propertyResource){
  EList<EObject> contents=propertyResource.getContents();
  Property property=(Property)EcoreUtil.getObjectByType(contents,PropertiesPackage.eINSTANCE.getProperty());
  if (property != null) {
    URI elementURI=elementResource.getURI();
    IPath path=new Path(elementURI.toPlatformString(true));
    IPath rootPath=PropertyHelper.getItemWorkspaceBasePath(property);
    if (rootPath != null) {
      path=path.makeRelativeTo(rootPath);
      path=path.removeLastSegments(1);
      property.getItem().getState().setPath(path.toString());
    }
  }
  URI desUri=elementResource.getURI().trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  EMFSharedResources.getInstance().saveToUri(propertyResource,desUri.trimSegments(1));
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "updateProperty".
 * @param elementResource
 * @param propertyResource
 */
private void updateProperty(final Resource elementResource,Resource propertyResource){
  EList<EObject> contents=propertyResource.getContents();
  Property property=(Property)EcoreUtil.getObjectByType(contents,PropertiesPackage.eINSTANCE.getProperty());
  if (property != null) {
    URI elementURI=elementResource.getURI();
    IPath newPath=new Path(elementURI.toPlatformString(true));
    IPath rootPath=PropertyHelper.getItemWorkspaceBasePath(property);
    if (rootPath != null) {
      newPath=newPath.makeRelativeTo(rootPath);
      newPath=newPath.removeLastSegments(1);
      String oldPath=property.getItem().getState().getPath();
      if (!StringUtils.equals(oldPath,newPath.toString())) {
        property.getItem().getState().setPath(newPath.toString());
        URI desUri=elementResource.getURI().trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
        EMFSharedResources.getInstance().saveToUri(propertyResource,desUri.trimSegments(1));
      }
    }
  }
}
Program: 139178
Project: 139178
Buggy source:
public void finish() throws IOException {
  CorePlugin.getDefault().refreshWorkSpace();
}

Fixed version (ground truth):
public void finish() throws IOException {
  CorePlugin.getDefault().refreshWorkSpace();
  CorePlugin.getDefault().refreshDQView();
}
Program: 139179
Project: 139179
Buggy source:
/** 
 * DOC bZhou Comment method "getItemWorkspaceBasePath".
 * @param property
 * @return
 */
public static IPath getItemWorkspaceBasePath(Property property){
  IPath itemBasePath=getItemTypedPath(property);
  return ResourceManager.getRootProject().getFolder(itemBasePath).getFullPath();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getItemWorkspaceBasePath".
 * @param property
 * @return
 */
public static IPath getItemWorkspaceBasePath(Property property){
  IPath itemBasePath=getItemTypedPath(property);
  return itemBasePath != null ? ResourceManager.getRootProject().getFolder(itemBasePath).getFullPath() : null;
}
Program: 139180
Project: 139180
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 {
      TypedReturnCode<TdProviderConnection> tdPc=DataProviderHelper.getTdProviderConnection(dataProvider);
      TdProviderConnection providerConnection=tdPc.getObject();
      Alias alias=new Alias(dataProvider.getName());
      String clearTextUser=DataProviderHelper.getUser(providerConnection);
      String user="String_Node_Str".equals(clearTextUser) ? "String_Node_Str" : clearTextUser;
      String password=DataProviderHelper.getClearTextPassword(providerConnection);
      String url=providerConnection.getConnectionString();
      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(providerConnection.getDriverClassName()));
      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){
  SQLExplorerPlugin sqlPlugin=SQLExplorerPlugin.getDefault();
  AliasManager aliasManager=sqlPlugin.getAliasManager();
  for (  DataProvider dataProvider : dataproviders) {
    try {
      TypedReturnCode<TdProviderConnection> tdPc=DataProviderHelper.getTdProviderConnection(dataProvider);
      TdProviderConnection providerConnection=tdPc.getObject();
      Alias alias=new Alias(dataProvider.getName());
      String clearTextUser=DataProviderHelper.getUser(providerConnection);
      String user="String_Node_Str".equals(clearTextUser) ? "String_Node_Str" : clearTextUser;
      String password=DataProviderHelper.getClearTextPassword(providerConnection);
      String url=providerConnection.getConnectionString();
      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(providerConnection.getDriverClassName()));
      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();
}
Program: 139181
Project: 139181
Buggy source:
/** 
 * DOC bZhou Comment method "updateProperty".
 * @param elementResource
 * @param propertyResource
 */
private void updateProperty(final Resource elementResource,Resource propertyResource){
  EList<EObject> contents=propertyResource.getContents();
  Property property=(Property)EcoreUtil.getObjectByType(contents,PropertiesPackage.eINSTANCE.getProperty());
  if (property != null) {
    URI elementURI=elementResource.getURI();
    IPath path=new Path(elementURI.toPlatformString(true));
    path=path.makeRelativeTo(PropertyHelper.getItemWorkspaceBasePath(property));
    path=path.removeLastSegments(1);
    property.getItem().getState().setPath(path.toString());
  }
  URI desUri=elementResource.getURI().trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  EMFSharedResources.getInstance().saveToUri(propertyResource,desUri.trimSegments(1));
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "updateProperty".
 * @param elementResource
 * @param propertyResource
 */
private void updateProperty(final Resource elementResource,Resource propertyResource){
  EList<EObject> contents=propertyResource.getContents();
  Property property=(Property)EcoreUtil.getObjectByType(contents,PropertiesPackage.eINSTANCE.getProperty());
  if (property != null) {
    URI elementURI=elementResource.getURI();
    IPath path=new Path(elementURI.toPlatformString(true));
    IPath rootPath=PropertyHelper.getItemWorkspaceBasePath(property);
    if (rootPath != null) {
      path=path.makeRelativeTo(rootPath);
      path=path.removeLastSegments(1);
      property.getItem().getState().setPath(path.toString());
    }
  }
  URI desUri=elementResource.getURI().trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  EMFSharedResources.getInstance().saveToUri(propertyResource,desUri.trimSegments(1));
}
Program: 139182
Project: 139182
Buggy source:
@Override protected void addDependencies(ModelElement element){
  Analysis analysis=(Analysis)element;
  List<IndicatorDefinition> userDefinedIndicators=AnalysisHelper.getUserDefinedIndicators(analysis);
  for (  IndicatorDefinition udi : userDefinedIndicators) {
    TypedReturnCode<Dependency> dependencyReturn=DependenciesHandler.getInstance().setDependencyOn(analysis,udi);
    if (dependencyReturn.isOk()) {
      EMFUtil.saveSingleResource(udi.eResource());
    }
  }
  List<Pattern> patterns=AnalysisHelper.getPatterns(analysis);
  for (  Pattern pattern : patterns) {
    TypedReturnCode<Dependency> dependencyReturn=DependenciesHandler.getInstance().setDependencyOn(analysis,pattern);
    if (dependencyReturn.isOk()) {
      EMFUtil.saveSingleResource(pattern.eResource());
    }
  }
}

Fixed version (ground truth):
@Override protected void addDependencies(ModelElement element){
  Analysis analysis=(Analysis)element;
  List<IndicatorDefinition> udis=AnalysisHelper.getUserDefinedIndicators(analysis);
  for (  IndicatorDefinition udi : udis) {
    InternalEObject iudi=(InternalEObject)udi;
    if (!iudi.eIsProxy()) {
      DependenciesHandler.getInstance().setDependencyOn(analysis,udi);
    }
  }
  List<Pattern> patterns=AnalysisHelper.getPatterns(analysis);
  for (  Pattern pattern : patterns) {
    InternalEObject iptn=(InternalEObject)pattern;
    if (!iptn.eIsProxy()) {
      DependenciesHandler.getInstance().setDependencyOn(analysis,pattern);
    }
  }
}
Program: 139184
Project: 139184
Buggy source:
private void setConnectionState(final AbstractAnalysisMetadataPage masterPage,final TdDataProvider tdProvider){
  final IFile prvFile=PrvResourceFileHelper.getInstance().findCorrespondingFile(tdProvider);
  String prvFileName=prvFile.getName();
  Object value=masterPage.getConnCombo().getData(prvFileName);
  Integer index=0;
  if (value != null && value instanceof Integer) {
    index=(Integer)value;
  }
  masterPage.getConnCombo().select(index);
  if (selectionListener == null) {
    selectionListener=new SelectionListener(){
      private int prevSelect=masterPage.getConnCombo().getSelectionIndex();
      private TdDataProvider dataProvider=tdProvider;
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dataProvider=callChangeConnectionAction(masterPage,prevSelect,dataProvider);
        prevSelect=masterPage.getConnCombo().getSelectionIndex();
      }
    }
;
    masterPage.getConnCombo().addSelectionListener(selectionListener);
  }
}

Fixed version (ground truth):
private void setConnectionState(final AbstractAnalysisMetadataPage masterPage,final DataManager dataManager){
  final IFile prvFile=PrvResourceFileHelper.getInstance().findCorrespondingFile(dataManager);
  if (prvFile != null && prvFile.exists()) {
    String prvFileName=prvFile.getName();
    Object value=masterPage.getConnCombo().getData(prvFileName);
    Integer index=0;
    if (value != null && value instanceof Integer) {
      index=(Integer)value;
    }
    masterPage.getConnCombo().select(index);
    if (selectionListener == null) {
      selectionListener=new SelectionListener(){
        private int prevSelect=masterPage.getConnCombo().getSelectionIndex();
        private TdDataProvider dataProvider=(TdDataProvider)dataManager;
        public void widgetDefaultSelected(        SelectionEvent e){
        }
        public void widgetSelected(        SelectionEvent e){
          dataProvider=callChangeConnectionAction(masterPage,prevSelect,dataProvider);
          prevSelect=masterPage.getConnCombo().getSelectionIndex();
        }
      }
;
      masterPage.getConnCombo().addSelectionListener(selectionListener);
    }
  }
 else {
    masterPage.getConnCombo().setText("String_Node_Str");
  }
}
Program: 139185
Project: 139185
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  File[] dependencies=computeDependencies(getElements());
  if (dependBTN.getSelection()) {
    for (    File file : dependencies) {
      repositoryTree.setChecked(file,true);
    }
  }
 else {
    for (    File file : dependencies) {
      repositoryTree.setChecked(file,false);
    }
  }
  repositoryTree.setExpandedElements(repositoryTree.getCheckedElements());
  repositoryTree.refresh();
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  File sfile=(File)item.getData();
  IFile sIFile=file2IFile(sfile);
  if (sIFile != null) {
    File[] dependencies=computeDependencies(sIFile);
    for (    File file : dependencies) {
      repositoryTree.setChecked(file,item.getChecked());
    }
    repositoryTree.refresh();
  }
}
Program: 139186
Project: 139186
Buggy source:
/** 
 * DOC bZhou Comment method "createOptionComposite".
 * @param top
 */
private void createOptionComposite(Composite top){
  Group optionGroup=new Group(top,SWT.NONE);
  optionGroup.setLayout(new RowLayout());
  optionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  optionGroup.setText("String_Node_Str");
  dependBTN=new Button(optionGroup,SWT.CHECK);
  dependBTN.setText("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "createOptionComposite".
 * @param top
 */
private void createOptionComposite(Composite top){
  Group optionGroup=new Group(top,SWT.NONE);
  optionGroup.setLayout(new RowLayout());
  optionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  optionGroup.setText("String_Node_Str");
}
Program: 139187
Project: 139187
Buggy source:
/** 
 * DOC bZhou Comment method "computeDependencies".
 * @param elements
 * @return
 */
protected File[] computeDependencies(IFile[] elements){
  List<ModelElement> dependencyElements=new ArrayList<ModelElement>();
  List<File> dependencyFiles=new ArrayList<File>();
  ModelElement[] modelElements=ModelElementFileFactory.getModelElements(elements);
  for (  ModelElement melement : modelElements) {
    ModelElementHelper.iterateClientDependencies(melement,dependencyElements);
  }
  for (  ModelElement element : dependencyElements) {
    ResourceFileMap fileMap=ModelElementFileFactory.getResourceFileMap(element);
    IFile file=fileMap.findCorrespondingFile(element);
    if (file != null && file.exists()) {
      dependencyFiles.add(file.getLocation().toFile());
    }
  }
  return dependencyFiles.toArray(new File[dependencyFiles.size()]);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "computeDependencies".
 * @param elements
 * @return
 */
protected File[] computeDependencies(IFile... elements){
  List<ModelElement> dependencyElements=new ArrayList<ModelElement>();
  List<File> dependencyFiles=new ArrayList<File>();
  ModelElement[] modelElements=ModelElementFileFactory.getModelElements(elements);
  for (  ModelElement melement : modelElements) {
    ModelElementHelper.iterateClientDependencies(melement,dependencyElements);
  }
  for (  ModelElement element : dependencyElements) {
    ResourceFileMap fileMap=ModelElementFileFactory.getResourceFileMap(element);
    IFile file=fileMap.findCorrespondingFile(element);
    if (file != null && file.exists()) {
      dependencyFiles.add(file.getLocation().toFile());
    }
  }
  return dependencyFiles.toArray(new File[dependencyFiles.size()]);
}
Program: 139188
Project: 139188
Buggy source:
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public IFile[] getElements(){
  Object[] checkedElements=repositoryTree.getCheckedElements();
  List<IFile> files=new ArrayList<IFile>();
  if (checkedElements != null) {
    for (    Object obj : checkedElements) {
      if (obj instanceof File) {
        File file=(File)obj;
        if (file.isFile()) {
          IPath path=new Path(file.getAbsolutePath());
          path=path.makeRelativeTo(ResourceManager.getRootProject().getLocation());
          files.add(ResourceManager.getRootProject().getFile(path));
        }
      }
    }
  }
  return files.toArray(new IFile[files.size()]);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public IFile[] getElements(){
  Object[] checkedElements=repositoryTree.getCheckedElements();
  List<IFile> files=new ArrayList<IFile>();
  if (checkedElements != null) {
    for (    Object obj : checkedElements) {
      if (obj instanceof File) {
        File file=(File)obj;
        IFile file2iFile=file2IFile(file);
        if (file2iFile != null) {
          files.add(file2iFile);
        }
      }
    }
  }
  return files.toArray(new IFile[files.size()]);
}
Program: 139190
Project: 139190
Buggy source:
public void createControl(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout());
  top.setLayoutData(new GridData(GridData.FILL_BOTH));
  createSelectComposite(top);
  createOptionComposite(top);
  createRepositoryTree(top);
  addListeners();
  initControlState();
  setControl(top);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout());
  top.setLayoutData(new GridData(GridData.FILL_BOTH));
  createSelectComposite(top);
  createRepositoryTree(top);
  addListeners();
  initControlState();
  setControl(top);
}
Program: 139191
Project: 139191
Buggy source:
public Object[] getChildren(Object parentElement){
  List<File> objects=new ArrayList<File>();
  if (parentElement instanceof File) {
    File[] files=((File)parentElement).listFiles();
    if (files != null) {
      for (      File file : files) {
        if (isValidFile(file) && isTOPFile(file)) {
          objects.add(file);
        }
      }
    }
  }
  return objects.toArray();
}

Fixed version (ground truth):
public Object[] getChildren(Object parentElement){
  List<File> objects=new ArrayList<File>();
  if (parentElement instanceof File) {
    File[] files=((File)parentElement).listFiles();
    if (files != null) {
      for (      File file : files) {
        if (file.isDirectory() && isValidDirectory(file)) {
          objects.add(file);
        }
        if (file.isFile() && isValidFile(file)) {
          objects.add(file);
        }
      }
    }
  }
  return objects.toArray();
}
Program: 139192
Project: 139192
Buggy source:
/** 
 * DOC bZhou Comment method "isValidFile".
 * @param file
 * @return
 */
private boolean isValidFile(File file){
  IPath path=new Path(file.getName());
  return !StringUtils.equals(path.getFileExtension(),FactoriesUtil.PROPERTIES_EXTENSION) && !file.getName().startsWith("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isValidFile".
 * @param file
 * @return
 */
private boolean isValidFile(File file){
  IPath path=new Path(file.getAbsolutePath());
  IPath propPath=path.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  File propFile=propPath.toFile();
  return propFile.exists() && !StringUtils.equals(path.getFileExtension(),FactoriesUtil.PROPERTIES_EXTENSION);
}
Program: 139194
Project: 139194
Buggy source:
private Resource getResourceFromFile(){
  EMFUtil util=new EMFUtil();
  Resource definitionsFile=null;
  URI uri=URI.createPlatformResourceURI(WORKSPACE_PATH + FILENAME,false);
  try {
    definitionsFile=util.getResourceSet().getResource(uri,true);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + uri);
    }
  }
 catch (  RuntimeException e) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + e.getMessage(),e);
    }
  }
  if (definitionsFile == null) {
    needCopy=true;
    uri=URI.createPlatformPluginURI(PLUGIN_PATH,false);
    try {
      definitionsFile=util.getResourceSet().getResource(uri,true);
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + uri);
      }
    }
 catch (    RuntimeException e) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + e.getMessage(),e);
      }
    }
  }
  if (definitionsFile == null) {
    definitionsFile=util.getResourceSet().getResource(URI.createFileURI("String_Node_Str" + File.separator + PLUGIN_PATH),true);
  }
  if (definitionsFile == null) {
    log.error("String_Node_Str" + PLUGIN_PATH + "String_Node_Str"+ uri);
    return null;
  }
  return definitionsFile;
}

Fixed version (ground truth):
private Resource getResourceFromFile(){
  EMFUtil util=new EMFUtil();
  Resource definitionsFile=null;
  IPath definitionPath=ResourceManager.getLibrariesFolder().getFullPath().append(FILENAME);
  URI uri=URI.createPlatformResourceURI(definitionPath.toString(),false);
  try {
    definitionsFile=util.getResourceSet().getResource(uri,true);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + uri);
    }
  }
 catch (  RuntimeException e) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + e.getMessage(),e);
    }
  }
  if (definitionsFile == null) {
    needCopy=true;
    uri=URI.createPlatformPluginURI(PLUGIN_PATH,false);
    try {
      definitionsFile=util.getResourceSet().getResource(uri,true);
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + uri);
      }
    }
 catch (    RuntimeException e) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + e.getMessage(),e);
      }
    }
  }
  if (definitionsFile == null) {
    definitionsFile=util.getResourceSet().getResource(URI.createFileURI("String_Node_Str" + File.separator + PLUGIN_PATH),true);
  }
  if (definitionsFile == null) {
    log.error("String_Node_Str" + PLUGIN_PATH + "String_Node_Str"+ uri);
    return null;
  }
  return definitionsFile;
}
Program: 139195
Project: 139195
Buggy source:
/** 
 * DOC scorreia Comment method "initSoftwareDeploymentResource".
 * @return
 */
private Resource initSoftwareDeploymentResource(){
  URI sUri=URI.createPlatformResourceURI("String_Node_Str" + ReponsitoryContextBridge.getProjectName() + "String_Node_Str"+ SoftwaredeploymentPackage.eNAME,false);
  Resource resource=resourceSet.getResource(sUri,false);
  if (resource == null) {
    resource=resourceSet.createResource(sUri);
  }
  return resource;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "initSoftwareDeploymentResource".
 * @return
 */
private Resource initSoftwareDeploymentResource(){
  String softwareFile="String_Node_Str" + SoftwaredeploymentPackage.eNAME;
  String softwarePath=ResourceManager.getLibrariesFolder().getFullPath().append(softwareFile).toString();
  URI sUri=URI.createPlatformResourceURI(softwarePath,false);
  Resource resource=resourceSet.getResource(sUri,false);
  if (resource == null) {
    resource=resourceSet.createResource(sUri);
  }
  return resource;
}
Program: 139198
Project: 139198
Buggy source:
public void recomputeIndicators(){
  correlationAnalysisHandler=new ColumnCorrelationAnalysisHandler();
  correlationAnalysisHandler.setAnalysis((Analysis)this.currentModelElement);
  stringDataFilter=correlationAnalysisHandler.getStringDataFilter();
  analyzedColumns=correlationAnalysisHandler.getAnalyzedColumns();
  CountAvgNullIndicator currentCountAvgNullIndicator;
  if (correlationAnalysisHandler.getIndicator() == null) {
    ColumnsetFactory columnsetFactory=ColumnsetFactory.eINSTANCE;
    currentCountAvgNullIndicator=columnsetFactory.createCountAvgNullIndicator();
    columnSetMultiIndicator=currentCountAvgNullIndicator;
  }
 else {
    columnSetMultiIndicator=(ColumnSetMultiValueIndicator)correlationAnalysisHandler.getIndicator();
  }
  for (  ModelElement element : analyzedColumns) {
    TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
    if (tdColumn == null) {
      continue;
    }
    DataminingType dataminingType=correlationAnalysisHandler.getDatamingType(tdColumn);
    MetadataHelper.setDataminingType(dataminingType == null ? DataminingType.NOMINAL : dataminingType,tdColumn);
  }
}

Fixed version (ground truth):
public void recomputeIndicators(){
  correlationAnalysisHandler=new ColumnCorrelationAnalysisHandler();
  correlationAnalysisHandler.setAnalysis((Analysis)this.currentModelElement);
  stringDataFilter=correlationAnalysisHandler.getStringDataFilter();
  analyzedColumns=correlationAnalysisHandler.getAnalyzedColumns();
  CountAvgNullIndicator currentCountAvgNullIndicator;
  if (correlationAnalysisHandler.getIndicator() == null) {
    ColumnsetFactory columnsetFactory=ColumnsetFactory.eINSTANCE;
    currentCountAvgNullIndicator=columnsetFactory.createCountAvgNullIndicator();
    currentCountAvgNullIndicator.setRowCountIndicator(IndicatorsFactory.eINSTANCE.createRowCountIndicator());
    currentCountAvgNullIndicator.setDistinctCountIndicator(IndicatorsFactory.eINSTANCE.createDistinctCountIndicator());
    currentCountAvgNullIndicator.setDuplicateCountIndicator(IndicatorsFactory.eINSTANCE.createDuplicateCountIndicator());
    currentCountAvgNullIndicator.setUniqueCountIndicator(IndicatorsFactory.eINSTANCE.createUniqueCountIndicator());
    columnSetMultiIndicator=currentCountAvgNullIndicator;
  }
 else {
    columnSetMultiIndicator=(ColumnSetMultiValueIndicator)correlationAnalysisHandler.getIndicator();
  }
  initializeIndicator(columnSetMultiIndicator);
  for (  ModelElement element : analyzedColumns) {
    TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
    if (tdColumn == null) {
      continue;
    }
    DataminingType dataminingType=correlationAnalysisHandler.getDatamingType(tdColumn);
    MetadataHelper.setDataminingType(dataminingType == null ? DataminingType.NOMINAL : dataminingType,tdColumn);
  }
}
Program: 139199
Project: 139199
Buggy source:
public void recomputeIndicators(){
  columnSetAnalysisHandler=new ColumnSetAnalysisHandler();
  columnSetAnalysisHandler.setAnalysis((Analysis)this.currentModelElement);
  stringDataFilter=columnSetAnalysisHandler.getStringDataFilter();
  analyzedColumns=columnSetAnalysisHandler.getAnalyzedColumns();
  SimpleStatIndicator ssIndicator;
  if (columnSetAnalysisHandler.getIndicator() == null) {
    ColumnsetFactory columnsetFactory=ColumnsetFactory.eINSTANCE;
    ssIndicator=columnsetFactory.createSimpleStatIndicator();
    simpleStatIndicator=ssIndicator;
  }
 else {
    simpleStatIndicator=(SimpleStatIndicator)columnSetAnalysisHandler.getIndicator();
  }
  for (  ModelElement element : analyzedColumns) {
    TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
    if (tdColumn == null) {
      continue;
    }
    MetadataHelper.setDataminingType(DataminingType.NOMINAL,tdColumn);
  }
}

Fixed version (ground truth):
public void recomputeIndicators(){
  columnSetAnalysisHandler=new ColumnSetAnalysisHandler();
  columnSetAnalysisHandler.setAnalysis((Analysis)this.currentModelElement);
  stringDataFilter=columnSetAnalysisHandler.getStringDataFilter();
  analyzedColumns=columnSetAnalysisHandler.getAnalyzedColumns();
  if (columnSetAnalysisHandler.getIndicator() == null) {
    ColumnsetFactory columnsetFactory=ColumnsetFactory.eINSTANCE;
    simpleStatIndicator=columnsetFactory.createSimpleStatIndicator();
    simpleStatIndicator.setRowCountIndicator(IndicatorsFactory.eINSTANCE.createRowCountIndicator());
    simpleStatIndicator.setDistinctCountIndicator(IndicatorsFactory.eINSTANCE.createDistinctCountIndicator());
    simpleStatIndicator.setDuplicateCountIndicator(IndicatorsFactory.eINSTANCE.createDuplicateCountIndicator());
    simpleStatIndicator.setUniqueCountIndicator(IndicatorsFactory.eINSTANCE.createUniqueCountIndicator());
  }
 else {
    simpleStatIndicator=(SimpleStatIndicator)columnSetAnalysisHandler.getIndicator();
  }
  initializeIndicator(simpleStatIndicator);
  for (  ModelElement element : analyzedColumns) {
    TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
    if (tdColumn == null) {
      continue;
    }
    MetadataHelper.setDataminingType(DataminingType.NOMINAL,tdColumn);
  }
}
Program: 139201
Project: 139201
Buggy source:
/** 
 * DOC bZhou Comment method "getElementPath".
 * @param property
 * @return
 */
public static IPath getElementPath(Property property){
  TDQItem item=(TDQItem)property.getItem();
  IPath proPath=getItemWorkspaceBasePath(item);
  proPath=proPath.append(item.getState().getPath());
  proPath=proPath.append(item.getFilename());
  return proPath;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getElementPath".
 * @param property
 * @return
 */
public static IPath getElementPath(Property property){
  TDQItem item=(TDQItem)property.getItem();
  IPath proPath=getItemWorkspaceBasePath(property);
  proPath=proPath.append(item.getState().getPath());
  proPath=proPath.append(item.getFilename());
  return proPath;
}
Program: 139202
Project: 139202
Buggy source:
/** 
 * DOC bZhou Comment method "getItemWorkspaceBasePath".
 * @param fileExtension
 * @return
 */
public static IPath getItemWorkspaceBasePath(String fileExtension){
  IPath itemBasePath=getItemBasePath(fileExtension);
  return ResourceManager.getRootProject().getFolder(itemBasePath).getFullPath();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getItemWorkspaceBasePath".
 * @param property
 * @return
 */
public static IPath getItemWorkspaceBasePath(Property property){
  IPath itemBasePath=getItemTypedPath(property);
  return ResourceManager.getRootProject().getFolder(itemBasePath).getFullPath();
}