nus-yam/ex-repair huggingface dataset:
Program: 138667
Project: 138667
Buggy source:
/** 
 * DOC scorreia Comment method "getSharedEmfUtil".
 * @return
 * @deprecated do not use directly EMFUtil.TODO rli use  {@link #saveAll()} method when needed.TODO rli create other methods in this class when needed.
 */
public static EMFUtil getSharedEmfUtil(){
  return getInstance().getEmfUtil();
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getSharedEmfUtil".
 * @return
 * @deprecated do not use directly EMFUtil.TODO rli use  {@link #saveAll()} method when needed.TODO rli create other methods in this class when needed.
 */
public static EMFUtil getSharedEmfUtil(){
  return getInstance().emfUtil;
}
Program: 138668
Project: 138668
Buggy source:
/** 
 * Method "saveResource" saves the resources of the resourceSet.
 * @return true when ok
 */
public boolean saveResource(Resource resource){
  return EMFUtil.saveResource(resource);
}

Fixed version (ground truth):
/** 
 * Method "saveResource" saves the resources of the resourceSet.
 * @return true when ok
 */
public boolean saveResource(Resource resource){
  try {
    resourceManager.saveResource(resource);
    return true;
  }
 catch (  PersistenceException e) {
    return false;
  }
}
Program: 138669
Project: 138669
Buggy source:
protected Collection<Analysis> searchAllAnalysis(IFolder folder){
  Collection<Analysis> analyses=new ArrayList<Analysis>();
  ResourceSet resoruceSet=new ResourceSetImpl();
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        analyses.addAll(searchAllAnalysis(folder.getFolder(resource.getName())));
        continue;
      }
      IFile file=(IFile)resource;
      if (file.getFileExtension().equals(FactoriesUtil.ANA)) {
        URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
        Resource eResource=resoruceSet.getResource(uri,true);
        analyses.add((Analysis)eResource.getContents().get(0));
      }
    }
  }
 catch (  Exception e) {
    log.error(e);
  }
  return analyses;
}

Fixed version (ground truth):
protected Collection<Analysis> searchAllAnalysis(IFolder folder){
  Collection<Analysis> analyses=new ArrayList<Analysis>();
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        analyses.addAll(searchAllAnalysis(folder.getFolder(resource.getName())));
        continue;
      }
      IFile file=(IFile)resource;
      if (file.getFileExtension().equals(FactoriesUtil.ANA)) {
        URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
        Resource eResource=EMFSharedResources.getInstance().getResource(uri,true);
        analyses.add((Analysis)eResource.getContents().get(0));
      }
    }
  }
 catch (  Exception e) {
    log.error(e);
  }
  return analyses;
}
Program: 138670
Project: 138670
Buggy source:
static void addDenpendencyElements(ModelElement[] children){
  for (int i=0; i < children.length; i++) {
    EList<Dependency> supplierDependencies=children[i].getSupplierDependency();
    ImpactNode impactNode;
    for (    Dependency dependency : supplierDependencies) {
      EList<ModelElement> clients=dependency.getClient();
      for (      ModelElement client : clients) {
        impactNode=new ImpactNode(client);
        int index=impactNodes.indexOf(impactNode);
        if (index == -1) {
          impactNode.addRequireModelElement(children[i]);
          impactNodes.add(impactNode);
        }
 else {
          ImpactNode existNode=impactNodes.get(index);
          existNode.addRequireModelElement(children[i]);
        }
      }
    }
  }
}

Fixed version (ground truth):
static void addDenpendencyElements(ModelElement[] children){
  for (int i=0; i < children.length; i++) {
    EList<Dependency> supplierDependencies=children[i].getSupplierDependency();
    ImpactNode impactNode;
    for (    Dependency dependency : supplierDependencies) {
      EList<ModelElement> clients=dependency.getClient();
      for (      ModelElement client : clients) {
        if (!client.eIsProxy()) {
          impactNode=new ImpactNode(client);
          int index=impactNodes.indexOf(impactNode);
          if (index == -1) {
            impactNode.addRequireModelElement(children[i]);
            impactNodes.add(impactNode);
          }
 else {
            ImpactNode existNode=impactNodes.get(index);
            existNode.addRequireModelElement(children[i]);
          }
        }
      }
    }
  }
}
Program: 138672
Project: 138672
Buggy source:
protected Collection<Analysis> searchAllAnalysis(IFolder folder){
  Collection<Analysis> analyses=new ArrayList<Analysis>();
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        analyses.addAll(searchAllAnalysis(folder.getFolder(resource.getName())));
        continue;
      }
      IFile file=(IFile)resource;
      if (null != file.getFileExtension() && file.getFileExtension().equals(FactoriesUtil.ANA)) {
        URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
        Resource eResource=EMFSharedResources.getInstance().getResource(uri,true);
        analyses.add((Analysis)eResource.getContents().get(0));
      }
    }
  }
 catch (  Exception e) {
    log.error(e);
  }
  return analyses;
}

Fixed version (ground truth):
protected Collection<Analysis> searchAllAnalysis(IFolder folder){
  Collection<Analysis> analyses=new ArrayList<Analysis>();
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        if (!resource.getName().startsWith("String_Node_Str")) {
          analyses.addAll(searchAllAnalysis(folder.getFolder(resource.getName())));
        }
        continue;
      }
      IFile file=(IFile)resource;
      if (null != file.getFileExtension() && file.getFileExtension().equals(FactoriesUtil.ANA)) {
        URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
        Resource eResource=EMFSharedResources.getInstance().getResource(uri,true);
        if (!eResource.getContents().isEmpty()) {
          analyses.add((Analysis)eResource.getContents().get(0));
        }
      }
    }
  }
 catch (  Exception e) {
    log.error(e);
  }
  return analyses;
}
Program: 138673
Project: 138673
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.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);
  }
}

Fixed version (ground truth):
public void write(ItemRecord[] records,IProgressMonitor monitor){
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  final ItemRecord[] fRecords=records;
  final IProgressMonitor fMonitor=monitor;
  RepositoryWorkUnit<Object> workUnit=new RepositoryWorkUnit<Object>("String_Node_Str"){
    @Override protected void run(){
      try {
        for (        ItemRecord record : fRecords) {
          if (fMonitor.isCanceled()) {
            break;
          }
          Map<IPath,IPath> toImportMap=mapping(record);
          fMonitor.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);
            }
          }
          fMonitor.worked(1);
        }
        finish(fRecords,fMonitor);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
    }
  }
;
  workUnit.setAvoidUnloadResources(Boolean.TRUE);
  ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
}
Program: 138674
Project: 138674
Buggy source:
public DQRespositoryView(){
  super();
  final DQStructureManager manager=DQStructureManager.getInstance();
  if (manager.isNeedCreateStructure()) {
    ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(new RepositoryWorkUnit("String_Node_Str"){
      @Override protected void run(){
        manager.createDQStructure();
      }
    }
);
  }
  if (manager.isNeedMigration()) {
    try {
      MigrationTaskManager.doMigrationTask(MigrationTaskManager.findWorksapceTasks());
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
}

Fixed version (ground truth):
public DQRespositoryView(){
  super();
  final DQStructureManager manager=DQStructureManager.getInstance();
  if (manager.isNeedCreateStructure()) {
    ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(new RepositoryWorkUnit<Object>("String_Node_Str"){
      @Override protected void run(){
        manager.createDQStructure();
      }
    }
);
  }
  if (manager.isNeedMigration()) {
    try {
      MigrationTaskManager.doMigrationTask(MigrationTaskManager.findWorksapceTasks());
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
}
Program: 138676
Project: 138676
Buggy source:
/** 
 * DOC yyi 2009-09-23 Feature 9059
 * @param composite
 */
protected void updateDetailList(){
  if (!"String_Node_Str".equals(comboCategory.getText())) {
    IndicatorCategory ic=UDIHelper.getUDICategory(definition);
    String purposeText="String_Node_Str";
    String descriptionText="String_Node_Str";
    for (    TaggedValue value : ic.getTaggedValue()) {
      if ("String_Node_Str".equals(value.getTag())) {
        purposeText=DefaultMessagesImpl.getString("String_Node_Str") + value.getValue();
      }
 else       if (DefaultMessagesImpl.getString("String_Node_Str").equals(value.getTag())) {
        descriptionText=DefaultMessagesImpl.getString("String_Node_Str") + value.getValue();
      }
    }
    labelDetail.setText(purposeText + System.getProperty("String_Node_Str") + System.getProperty("String_Node_Str")+ descriptionText);
  }
}

Fixed version (ground truth):
/** 
 * DOC yyi 2009-09-23 Feature 9059
 * @param composite
 */
protected void updateDetailList(){
  if (!"String_Node_Str".equals(comboCategory.getText())) {
    IndicatorCategory ic=UDIHelper.getUDICategory(definition);
    String purposeText="String_Node_Str";
    String descriptionText="String_Node_Str";
    for (    TaggedValue value : ic.getTaggedValue()) {
      if ("String_Node_Str".equals(value.getTag())) {
        purposeText=DefaultMessagesImpl.getString("String_Node_Str") + value.getValue();
      }
 else       if ("String_Node_Str".equals(value.getTag())) {
        descriptionText=DefaultMessagesImpl.getString("String_Node_Str") + value.getValue();
      }
    }
    labelDetail.setText(purposeText + System.getProperty("String_Node_Str") + System.getProperty("String_Node_Str")+ descriptionText);
  }
}
Program: 138677
Project: 138677
Buggy source:
/** 
 * DOC yyi 2009-09-23 Feature 9059
 * @param composite
 */
private void createDetailList(Composite composite){
  Composite compoDetail=new Composite(composite,SWT.NONE);
  compoDetail.setLayout(new GridLayout(1,false));
  GridData data=new GridData(SWT.FILL,SWT.FILL,true,true);
  data.heightHint=60;
  data.widthHint=300;
  compoDetail.setLayoutData(data);
  labelDetail=new Label(compoDetail,SWT.WRAP);
  labelDetail.setLayoutData(data);
}

Fixed version (ground truth):
/** 
 * DOC yyi 2009-09-23 Feature 9059
 * @param composite
 */
private void createDetailList(Composite composite){
  Composite compoDetail=new Composite(composite,SWT.NONE);
  compoDetail.setLayout(new GridLayout(1,false));
  GridData data=new GridData(SWT.FILL,SWT.FILL,true,true);
  data.heightHint=150;
  data.widthHint=300;
  compoDetail.setLayoutData(data);
  labelDetail=new Label(compoDetail,SWT.WRAP);
  labelDetail.setLayoutData(data);
}
Program: 138679
Project: 138679
Buggy source:
@SuppressWarnings("String_Node_Str") public static List<Status> getTechnicalStatus(){
  org.talend.core.model.properties.Project loadProject=null;
  try {
    loadProject=loadProject();
  }
 catch (  Exception e) {
    log.error(e,e);
    return null;
  }
  if (loadProject == null) {
    return null;
  }
  return copyList(loadProject.getTechnicalStatus());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static List<Status> getTechnicalStatus(){
  Project project=ReponsitoryContextBridge.getProject();
  if (project != null) {
    return copyList(project.getTechnicalStatus());
  }
 else {
    return new ArrayList<Status>();
  }
}
Program: 138680
Project: 138680
Buggy source:
protected Collection<Analysis> searchAllAnalysis(IFolder folder){
  Collection<Analysis> analyses=new ArrayList<Analysis>();
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        analyses.addAll(searchAllAnalysis(folder.getFolder(resource.getName())));
        continue;
      }
      IFile file=(IFile)resource;
      if (file.getFileExtension().equals(FactoriesUtil.ANA)) {
        URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
        Resource eResource=EMFSharedResources.getInstance().getResource(uri,true);
        analyses.add((Analysis)eResource.getContents().get(0));
      }
    }
  }
 catch (  Exception e) {
    log.error(e);
  }
  return analyses;
}

Fixed version (ground truth):
protected Collection<Analysis> searchAllAnalysis(IFolder folder){
  Collection<Analysis> analyses=new ArrayList<Analysis>();
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        analyses.addAll(searchAllAnalysis(folder.getFolder(resource.getName())));
        continue;
      }
      IFile file=(IFile)resource;
      if (null != file.getFileExtension() && file.getFileExtension().equals(FactoriesUtil.ANA)) {
        URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
        Resource eResource=EMFSharedResources.getInstance().getResource(uri,true);
        analyses.add((Analysis)eResource.getContents().get(0));
      }
    }
  }
 catch (  Exception e) {
    log.error(e);
  }
  return analyses;
}
Program: 138682
Project: 138682
Buggy source:
public boolean addIndicator(NamedColumnSet set,Indicator... indicators){
  if (!analysis.getContext().getAnalysedElements().contains(set)) {
    analysis.getContext().getAnalysedElements().add(set);
  }
  for (  Indicator indicator : indicators) {
    analysis.getResults().getIndicators().add(indicator);
    initializeIndicator(indicator,set);
  }
  DataManager connection=analysis.getContext().getConnection();
  if (connection == null) {
    log.error("String_Node_Str");
    connection=ConnectionHelper.getTdDataProvider(PackageHelper.getCatalogOrSchema(set));
    analysis.getContext().setConnection(connection);
  }
  TypedReturnCode<Dependency> rc=DependenciesHandler.getInstance().setDependencyOn(analysis,connection);
  if (rc.isOk()) {
    Resource resource=connection.eResource();
    if (resource != null) {
      this.modifiedResources.add(resource);
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean addIndicator(NamedColumnSet set,Indicator... indicators){
  if (!analysis.getContext().getAnalysedElements().contains(set)) {
    analysis.getContext().getAnalysedElements().add(set);
  }
  for (  Indicator indicator : indicators) {
    analysis.getResults().getIndicators().add(indicator);
    initializeIndicator(indicator,set);
  }
  DataManager connection=analysis.getContext().getConnection();
  if (connection == null) {
    log.error("String_Node_Str");
    connection=ConnectionHelper.getTdDataProvider(PackageHelper.getParentPackage((MetadataTable)set));
    analysis.getContext().setConnection(connection);
  }
  TypedReturnCode<Dependency> rc=DependenciesHandler.getInstance().setDependencyOn(analysis,connection);
  if (rc.isOk()) {
    Resource resource=connection.eResource();
    if (resource != null) {
      this.modifiedResources.add(resource);
    }
  }
  return true;
}
Program: 138684
Project: 138684
Buggy source:
public Paint getDrawPaint(Edge e){
{
    return defaultFunc.getDrawPaint(e);
  }
}

Fixed version (ground truth):
public Paint getDrawPaint(Edge e){
  return defaultFunc.getDrawPaint(e);
}
Program: 138685
Project: 138685
Buggy source:
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
public static DatabaseConnection fillDbConnectionInformation(DatabaseConnection dbConn){
  if (DatabaseConstant.XML_EXIST_DRIVER_NAME.equals(dbConn.getDriverClass())) {
    IXMLDBConnection xmlDBConnection=new EXistXMLDBConnection(dbConn.getDriverClass(),dbConn.getURL());
    ConnectionHelper.addXMLDocuments(xmlDBConnection.createConnection(),dbConn);
  }
 else {
    try {
      boolean noStructureExists=ConnectionHelper.getAllCatalogs(dbConn).isEmpty() && ConnectionHelper.getAllSchemas(dbConn).isEmpty();
      if (noStructureExists) {
        dbConn=(DatabaseConnection)TalendCwmFactory.createDataProvider(createDBConnect(dbConn,false));
      }
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
catch (    TalendException e) {
      e.printStackTrace();
    }
  }
  return dbConn;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
public static DatabaseConnection fillDbConnectionInformation(DatabaseConnection dbConn){
  if (DatabaseConstant.XML_EXIST_DRIVER_NAME.equals(dbConn.getDriverClass())) {
    IXMLDBConnection xmlDBConnection=new EXistXMLDBConnection(dbConn.getDriverClass(),dbConn.getURL());
    ConnectionHelper.addXMLDocuments(xmlDBConnection.createConnection(dbConn));
  }
 else {
    try {
      boolean noStructureExists=ConnectionHelper.getAllCatalogs(dbConn).isEmpty() && ConnectionHelper.getAllSchemas(dbConn).isEmpty();
      if (noStructureExists) {
        dbConn=(DatabaseConnection)TalendCwmFactory.createDataProvider(createDBConnect(dbConn,false));
      }
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
catch (    TalendException e) {
      e.printStackTrace();
    }
  }
  return dbConn;
}
Program: 138686
Project: 138686
Buggy source:
/** 
 * DOC xqliu Comment method "fillMdmConnectionInformation".
 * @param mdmConn
 * @return
 */
public static MDMConnection fillMdmConnectionInformation(MDMConnection mdmConn){
  Properties properties=new Properties();
  properties.put(TaggedValueHelper.USER,mdmConn.getUsername());
  properties.put(TaggedValueHelper.PASSWORD,mdmConn.getPassword());
  properties.put(TaggedValueHelper.UNIVERSE,mdmConn.getUniverse() == null ? "String_Node_Str" : mdmConn.getUniverse());
  MdmWebserviceConnection mdmWsConn=new MdmWebserviceConnection(mdmConn.getPathname(),properties);
  ConnectionHelper.addXMLDocuments(mdmWsConn.createConnection(),mdmConn);
  return mdmConn;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "fillMdmConnectionInformation".
 * @param mdmConn
 * @return
 */
public static MDMConnection fillMdmConnectionInformation(MDMConnection mdmConn){
  Properties properties=new Properties();
  properties.put(TaggedValueHelper.USER,mdmConn.getUsername());
  properties.put(TaggedValueHelper.PASSWORD,mdmConn.getPassword());
  properties.put(TaggedValueHelper.UNIVERSE,mdmConn.getUniverse() == null ? "String_Node_Str" : mdmConn.getUniverse());
  MdmWebserviceConnection mdmWsConn=new MdmWebserviceConnection(mdmConn.getPathname(),properties);
  ConnectionHelper.addXMLDocuments(mdmWsConn.createConnection(mdmConn));
  return mdmConn;
}
Program: 138687
Project: 138687
Buggy source:
private void adaptToCWMDocument(List<TdXmlSchema> xmlDocCollection,Collection col,String resName,String providerTechName) throws XMLDBException, CoreException {
  XMLResource resXSD=(XMLResource)col.getResource(StringUtils.removeEnd(resName,XML_SUFIX) + XSD_SUFIX);
  if (resXSD == null) {
    log.error("String_Node_Str" + resName + "String_Node_Str");
    return;
  }
  IFolder xsdFolder=ResourceManager.getConnectionFolder().getFolder(XSD_SUFIX);
  if (!xsdFolder.exists()) {
    xsdFolder.create(true,true,new NullProgressMonitor());
  }
  xsdFolder=xsdFolder.getFolder(providerTechName);
  if (!xsdFolder.exists()) {
    xsdFolder.create(true,true,new NullProgressMonitor());
  }
  IFile file=xsdFolder.getFile(StringUtils.removeEnd(resName,XML_SUFIX) + XSD_SUFIX);
  file.create(new ByteArrayInputStream(resXSD.getContent().toString().getBytes()),true,new NullProgressMonitor());
  TdXmlSchema tdXmlDoc=XmlFactory.eINSTANCE.createTdXmlSchema();
  tdXmlDoc.setName(StringUtils.removeEnd(resName,XML_SUFIX));
  tdXmlDoc.setXsdFilePath(XSD_SUFIX + File.separator + xsdFolder.getName()+ File.separator+ file.getName());
  xmlDocCollection.add(tdXmlDoc);
}

Fixed version (ground truth):
private void adaptToCWMDocument(List<TdXmlSchema> xmlDocCollection,Collection col,String resName,String providerTechName,Connection dataProvider) throws XMLDBException, CoreException {
  XMLResource resXSD=(XMLResource)col.getResource(StringUtils.removeEnd(resName,XML_SUFIX) + XSD_SUFIX);
  if (resXSD == null) {
    log.error("String_Node_Str" + resName + "String_Node_Str");
    return;
  }
  IFolder xsdFolder=ResourceManager.getConnectionFolder().getFolder(XSD_SUFIX);
  if (!xsdFolder.exists()) {
    xsdFolder.create(true,true,new NullProgressMonitor());
  }
  xsdFolder=xsdFolder.getFolder(providerTechName);
  if (!xsdFolder.exists()) {
    xsdFolder.create(true,true,new NullProgressMonitor());
  }
  IFile file=xsdFolder.getFile(StringUtils.removeEnd(resName,XML_SUFIX) + XSD_SUFIX);
  file.create(new ByteArrayInputStream(resXSD.getContent().toString().getBytes()),true,new NullProgressMonitor());
  TdXmlSchema tdXmlDoc=XmlFactory.eINSTANCE.createTdXmlSchema();
  tdXmlDoc.setName(StringUtils.removeEnd(resName,XML_SUFIX));
  tdXmlDoc.setXsdFilePath(XSD_SUFIX + File.separator + xsdFolder.getName()+ File.separator+ file.getName());
  tdXmlDoc.getDataManager().add(dataProvider);
  xmlDocCollection.add(tdXmlDoc);
}
Program: 138688
Project: 138688
Buggy source:
public java.util.Collection<TdXmlSchema> createConnection(){
  Collection col=null;
  List<TdXmlSchema> tempXmlDocs=null;
  try {
    Class<?> cl=Class.forName(driverClassName);
    Database database=(Database)cl.newInstance();
    DatabaseManager.registerDatabase(database);
    col=DatabaseManager.getCollection(connectionURI);
    col.setProperty(OutputKeys.INDENT,"String_Node_Str");
    tempXmlDocs=new ArrayList<TdXmlSchema>();
    String techXSDFolderName=DqRepositoryViewService.createTechnicalName(XSD_SUFIX + DateFormatUtils.format(new Date(),"String_Node_Str"));
    for (int idx=0; idx < col.getResourceCount(); idx++) {
      String resName=col.listResources()[idx];
      if (resName.endsWith(XML_SUFIX)) {
        adaptToCWMDocument(tempXmlDocs,col,resName,techXSDFolderName);
      }
    }
  }
 catch (  Exception e) {
    log.error(e);
    return null;
  }
  this.xmlDocs=tempXmlDocs;
  return tempXmlDocs;
}

Fixed version (ground truth):
public java.util.Collection<TdXmlSchema> createConnection(Connection dataProvider){
  Collection col=null;
  List<TdXmlSchema> tempXmlDocs=null;
  try {
    Class<?> cl=Class.forName(driverClassName);
    Database database=(Database)cl.newInstance();
    DatabaseManager.registerDatabase(database);
    col=DatabaseManager.getCollection(connectionURI);
    col.setProperty(OutputKeys.INDENT,"String_Node_Str");
    tempXmlDocs=new ArrayList<TdXmlSchema>();
    String techXSDFolderName=DqRepositoryViewService.createTechnicalName(XSD_SUFIX + DateFormatUtils.format(new Date(),"String_Node_Str"));
    for (int idx=0; idx < col.getResourceCount(); idx++) {
      String resName=col.listResources()[idx];
      if (resName.endsWith(XML_SUFIX)) {
        adaptToCWMDocument(tempXmlDocs,col,resName,techXSDFolderName,dataProvider);
      }
    }
  }
 catch (  Exception e) {
    log.error(e);
    return null;
  }
  this.xmlDocs=tempXmlDocs;
  return tempXmlDocs;
}
Program: 138689
Project: 138689
Buggy source:
public Collection<TdXmlSchema> createConnection();

Fixed version (ground truth):
public Collection<TdXmlSchema> createConnection(Connection dataProvider);
Program: 138690
Project: 138690
Buggy source:
public Collection<TdXmlSchema> createConnection(){
  List<TdXmlSchema> xmlDocs=new ArrayList<TdXmlSchema>();
  try {
    XtentisBindingStub stub=getXtentisBindingStub();
    WSDataModelPK[] pks=stub.getDataModelPKs(new WSRegexDataModelPKs("String_Node_Str"));
    String techXSDFolderName=getTechXSDFolderName();
    for (    WSDataModelPK pk : pks) {
      String filterName=props.getProperty(TaggedValueHelper.DATA_FILTER);
      if (filterName == null || filterName.equals("String_Node_Str") || Arrays.asList(filterName.split("String_Node_Str")).contains((pk.getPk()))) {
        adaptToCWMDocument(xmlDocs,stub,pk.getPk(),techXSDFolderName);
      }
    }
  }
 catch (  Exception e) {
    log.error(e);
    return null;
  }
  return xmlDocs;
}

Fixed version (ground truth):
public Collection<TdXmlSchema> createConnection(Connection dataProvider){
  List<TdXmlSchema> xmlDocs=new ArrayList<TdXmlSchema>();
  try {
    XtentisBindingStub stub=getXtentisBindingStub();
    WSDataModelPK[] pks=stub.getDataModelPKs(new WSRegexDataModelPKs("String_Node_Str"));
    String techXSDFolderName=getTechXSDFolderName();
    for (    WSDataModelPK pk : pks) {
      String filterName=props.getProperty(TaggedValueHelper.DATA_FILTER);
      if (filterName == null || filterName.equals("String_Node_Str") || Arrays.asList(filterName.split("String_Node_Str")).contains((pk.getPk()))) {
        adaptToCWMDocument(xmlDocs,stub,pk.getPk(),techXSDFolderName,dataProvider);
      }
    }
  }
 catch (  Exception e) {
    log.error(e);
    return null;
  }
  return xmlDocs;
}
Program: 138691
Project: 138691
Buggy source:
/** 
 * DOC xqliu Comment method "adaptToCWMDocument".
 * @param xmlDocCollection
 * @param stub
 * @param resName
 * @param providerTechName
 * @throws RemoteException
 * @throws CoreException
 */
private void adaptToCWMDocument(List<TdXmlSchema> xmlDocCollection,XtentisPort stub,String resName,String providerTechName) throws RemoteException, CoreException {
  String resXSD=null;
  try {
    resXSD=stub.getDataModel(new WSGetDataModel(new WSDataModelPK(resName))).getXsdSchema();
  }
 catch (  Exception e1) {
    log.warn(e1,e1);
  }
  if (resXSD == null || "String_Node_Str".equals(resXSD.trim())) {
    log.warn("String_Node_Str" + resName + "String_Node_Str");
    return;
  }
  IFolder xsdFolder=ResourceManager.getMDMConnectionFolder().getFolder(XSD_SUFIX);
  if (!xsdFolder.exists()) {
    xsdFolder.create(true,true,new NullProgressMonitor());
  }
  xsdFolder=xsdFolder.getFolder(providerTechName);
  if (!xsdFolder.exists()) {
    xsdFolder.create(true,true,new NullProgressMonitor());
  }
  IFile file=xsdFolder.getFile(resName + XSD_SUFIX);
  try {
    file.create(new ByteArrayInputStream(resXSD.getBytes("String_Node_Str")),true,new NullProgressMonitor());
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  TdXmlSchema tdXmlDoc=XmlFactory.eINSTANCE.createTdXmlSchema();
  tdXmlDoc.setName(resName);
  tdXmlDoc.setXsdFilePath(XSD_SUFIX + File.separator + xsdFolder.getName()+ File.separator+ file.getName());
  xmlDocCollection.add(tdXmlDoc);
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "adaptToCWMDocument".
 * @param xmlDocCollection
 * @param stub
 * @param resName
 * @param providerTechName
 * @param dataProvider
 * @throws RemoteException
 * @throws CoreException
 */
private void adaptToCWMDocument(List<TdXmlSchema> xmlDocCollection,XtentisPort stub,String resName,String providerTechName,Connection dataProvider) throws RemoteException, CoreException {
  String resXSD=null;
  try {
    resXSD=stub.getDataModel(new WSGetDataModel(new WSDataModelPK(resName))).getXsdSchema();
  }
 catch (  Exception e1) {
    log.warn(e1,e1);
  }
  if (resXSD == null || "String_Node_Str".equals(resXSD.trim())) {
    log.warn("String_Node_Str" + resName + "String_Node_Str");
    return;
  }
  IFolder xsdFolder=ResourceManager.getMDMConnectionFolder().getFolder(XSD_SUFIX);
  if (!xsdFolder.exists()) {
    xsdFolder.create(true,true,new NullProgressMonitor());
  }
  xsdFolder=xsdFolder.getFolder(providerTechName);
  if (!xsdFolder.exists()) {
    xsdFolder.create(true,true,new NullProgressMonitor());
  }
  IFile file=xsdFolder.getFile(resName + XSD_SUFIX);
  try {
    file.create(new ByteArrayInputStream(resXSD.getBytes("String_Node_Str")),true,new NullProgressMonitor());
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  TdXmlSchema tdXmlDoc=XmlFactory.eINSTANCE.createTdXmlSchema();
  tdXmlDoc.setName(resName);
  tdXmlDoc.setXsdFilePath(XSD_SUFIX + File.separator + xsdFolder.getName()+ File.separator+ file.getName());
  tdXmlDoc.getDataManager().add(dataProvider);
  xmlDocCollection.add(tdXmlDoc);
}
Program: 138692
Project: 138692
Buggy source:
/** 
 * Instantiate a data provider from xml documents. DOC mzhao Comment method "getTdDataProvider".
 * @param parameter
 * @return
 */
public static DatabaseConnection createEXistTdDataProvider(DBConnectionParameter parameter){
  IXMLDBConnection xmlDBConnection=new EXistXMLDBConnection(parameter.getDriverClassName(),parameter.getJdbcUrl());
  ReturnCode rt=xmlDBConnection.checkDatabaseConnection();
  if (rt.isOk()) {
    DatabaseConnection dataProvider=ConnectionHelper.createDatabaseConnection(parameter.getName());
    xmlDBConnection.setSofewareSystem(dataProvider,parameter);
    xmlDBConnection.setProviderConnection(dataProvider,parameter);
    ConnectionHelper.addXMLDocuments(xmlDBConnection.createConnection(),dataProvider);
    return dataProvider;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Instantiate a data provider from xml documents. DOC mzhao Comment method "getTdDataProvider".
 * @param parameter
 * @return
 */
public static DatabaseConnection createEXistTdDataProvider(DBConnectionParameter parameter){
  IXMLDBConnection xmlDBConnection=new EXistXMLDBConnection(parameter.getDriverClassName(),parameter.getJdbcUrl());
  ReturnCode rt=xmlDBConnection.checkDatabaseConnection();
  if (rt.isOk()) {
    DatabaseConnection dataProvider=ConnectionHelper.createDatabaseConnection(parameter.getName());
    xmlDBConnection.setSofewareSystem(dataProvider,parameter);
    xmlDBConnection.setProviderConnection(dataProvider,parameter);
    ConnectionHelper.addXMLDocuments(xmlDBConnection.createConnection(dataProvider));
    return dataProvider;
  }
  return null;
}
Program: 138693
Project: 138693
Buggy source:
/** 
 * Instantiate a data provider from mdm service. DOC xqliu feature 10238.
 * @param parameter
 * @return
 */
public static MDMConnection createMdmTdDataProvider(DBConnectionParameter parameter){
  MdmWebserviceConnection mdmConnection=new MdmWebserviceConnection(parameter.getJdbcUrl(),parameter.getParameters());
  ReturnCode rt=mdmConnection.checkDatabaseConnection();
  if (rt.isOk()) {
    MDMConnection dataProvider=ConnectionHelper.createMDMConnection(parameter.getName());
    mdmConnection.setSofewareSystem(dataProvider,parameter);
    mdmConnection.setProviderConnection(dataProvider,parameter);
    ConnectionHelper.addXMLDocuments(mdmConnection.createConnection(),dataProvider);
    dataProvider.setUsername(mdmConnection.getUserName());
    dataProvider.setPassword(mdmConnection.getUserPass());
    dataProvider.setLabel(parameter.getName());
    return dataProvider;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Instantiate a data provider from mdm service. DOC xqliu feature 10238.
 * @param parameter
 * @return
 */
public static MDMConnection createMdmTdDataProvider(DBConnectionParameter parameter){
  MdmWebserviceConnection mdmConnection=new MdmWebserviceConnection(parameter.getJdbcUrl(),parameter.getParameters());
  ReturnCode rt=mdmConnection.checkDatabaseConnection();
  if (rt.isOk()) {
    MDMConnection dataProvider=ConnectionHelper.createMDMConnection(parameter.getName());
    mdmConnection.setSofewareSystem(dataProvider,parameter);
    mdmConnection.setProviderConnection(dataProvider,parameter);
    ConnectionHelper.addXMLDocuments(mdmConnection.createConnection(dataProvider));
    dataProvider.setUsername(mdmConnection.getUserName());
    dataProvider.setPassword(mdmConnection.getUserPass());
    dataProvider.setLabel(parameter.getName());
    return dataProvider;
  }
  return null;
}
Program: 138694
Project: 138694
Buggy source:
public static List<ModelElement> getDependencyClients(ModelElement modelElement){
  if (modelElement == null) {
    return new ArrayList<ModelElement>();
  }
  EList<Dependency> clientDependencys=modelElement.getSupplierDependency();
  List<ModelElement> supplierList=new ArrayList<ModelElement>();
  for (  Dependency dependency : clientDependencys) {
    EList<ModelElement> client=dependency.getClient();
    if (client != null) {
      supplierList.addAll(client);
    }
  }
  return supplierList;
}

Fixed version (ground truth):
public static List<ModelElement> getDependencyClients(ModelElement modelElement){
  if (modelElement == null) {
    return new ArrayList<ModelElement>();
  }
  EList<Dependency> clientDependencys=modelElement.getSupplierDependency();
  List<ModelElement> supplierList=new ArrayList<ModelElement>();
  for (  Dependency dependency : clientDependencys) {
    EList<ModelElement> clients=dependency.getClient();
    if (clients != null) {
      for (      ModelElement client : clients) {
        if (!client.eIsProxy()) {
          supplierList.add(client);
        }
      }
    }
  }
  return supplierList;
}
Program: 138695
Project: 138695
Buggy source:
/** 
 * DOC bZhou Comment method "populateElement".
 */
private void populateElement(){
  List<ItemRecord> allRecordList=ItemRecord.getAllItemRecords();
  ItemRecord[] invalidRecords=writer.populate(allRecordList.toArray(new ItemRecord[allRecordList.size()]),!overwriteBTN.getSelection());
  updateErrorList(invalidRecords);
  if (invalidRecords.length > 0) {
    removeInvalidRecords(invalidRecords);
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "populateElement".
 */
private void populateElement(){
  ItemRecord[] invalidRecords=writer.populate(getElements(),!overwriteBTN.getSelection());
  updateErrorList(invalidRecords);
  if (invalidRecords.length > 0) {
    removeInvalidRecords(invalidRecords);
  }
}
Program: 138696
Project: 138696
Buggy source:
/** 
 * DOC bZhou Comment method "writeSysFile".
 * @param file
 * @throws IOException
 * @throws CoreException
 */
private void writeSysFile(IFile file) throws IOException, CoreException {
  if (file.exists()) {
    write(file.getLocation(),file.getFullPath());
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "writeSysFile".
 * @param file
 * @throws IOException
 * @throws CoreException
 */
private void writeSysFile(IFile file) throws IOException, CoreException {
  if (file.exists()) {
    write(file.getLocation(),file.getFullPath().makeRelative());
  }
}
Program: 138697
Project: 138697
Buggy source:
@Override public void write(IPath resPath,IPath desPath) throws IOException, CoreException {
  File file=getBasePath().toFile();
  if (!file.exists()) {
    file.createNewFile();
  }
  String lastSegment=getBasePath().removeFileExtension().lastSegment();
  IPath newDestPath=new Path(lastSegment).append(desPath);
  tempMap.put(resPath.toFile(),newDestPath.toOSString());
}

Fixed version (ground truth):
@Override public void write(IPath resPath,IPath desPath) throws IOException, CoreException {
  File file=getBasePath().toFile();
  if (!file.exists()) {
    file.createNewFile();
  }
  tempMap.put(resPath.toFile(),desPath.toOSString());
}
Program: 138698
Project: 138698
Buggy source:
@Override public void run(){
  SelectedResources selectedResources=new SelectedResources();
  Property[] selectedProps=selectedResources.getSelectedArrayForDelForever();
  try {
    for (    Property property : selectedProps) {
      Item item=property.getItem();
      if (item instanceof ConnectionItem) {
        property.getItem().getState().setDeleted(false);
        ProxyRepositoryFactory.getInstance().save(property);
      }
 else {
        property.getItem().getState().setDeleted(false);
        Resource propertyResource=property.eResource();
        if (!EMFSharedResources.getInstance().saveResource(propertyResource))         return;
      }
      LogicalDeleteFileHandle.refreshDelPropertys(0,property);
      if (property.getItem() instanceof ConnectionItem) {
        SQLExplorerPlugin.getDefault().getAliasManager().modelChanged();
      }
    }
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
  ProxyRepositoryManager.getInstance().save();
  CorePlugin.getDefault().refreshDQView();
  CorePlugin.getDefault().refreshWorkSpace();
}

Fixed version (ground truth):
@Override public void run(){
  SelectedResources selectedResources=new SelectedResources();
  Property[] selectedProps=selectedResources.getSelectedArrayForDelForever();
  try {
    for (    Property property : selectedProps) {
      Item item=property.getItem();
      if (item instanceof ConnectionItem) {
        if (property.eIsProxy()) {
          property=(Property)EObjectHelper.resolveObject(property);
        }
        property.getItem().getState().setDeleted(false);
        ProxyRepositoryFactory.getInstance().save(property);
      }
 else {
        property.getItem().getState().setDeleted(false);
        Resource propertyResource=property.eResource();
        if (!EMFSharedResources.getInstance().saveResource(propertyResource))         return;
      }
      LogicalDeleteFileHandle.refreshDelPropertys(0,property);
      if (property.getItem() instanceof ConnectionItem) {
        SQLExplorerPlugin.getDefault().getAliasManager().modelChanged();
      }
    }
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
  ProxyRepositoryManager.getInstance().save();
  CorePlugin.getDefault().refreshDQView();
  CorePlugin.getDefault().refreshWorkSpace();
}
Program: 138700
Project: 138700
Buggy source:
/** 
 * DOC bZhou Comment method "delete".
 * @param ifile
 * @throws Exception
 */
public ReturnCode delete(IFile ifile) throws Exception {
  ReturnCode rc=new ReturnCode();
  Resource resource=getFileResource(ifile);
  List<ModelElement> dependencyClients=EObjectHelper.getDependencyClients(ifile);
  if (!dependencyClients.isEmpty()) {
    rc.setOk(false);
    rc.setMessage("String_Node_Str");
  }
 else {
    EObjectHelper.removeDependencys(ifile);
    deleteRelated(ifile);
    String uriStr=resource.getURI().toString();
    remove(ifile);
    EMFSharedResources.getInstance().unloadResource(uriStr);
    if (ifile.isLinked()) {
      File file=new File(ifile.getRawLocation().toOSString());
      if (file.exists()) {
        file.delete();
      }
    }
    ifile.delete(true,new NullProgressMonitor());
    IFile propFile=ResourcesPlugin.getWorkspace().getRoot().getFile(ifile.getFullPath().removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION));
    resource=getFileResource(propFile);
    remove(propFile);
    EMFSharedResources.getInstance().unloadResource(resource.getURI().toString());
    if (propFile.exists()) {
      propFile.delete(true,new NullProgressMonitor());
    }
    ProxyRepositoryManager.getInstance().save();
    ifile.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    rc.setMessage("String_Node_Str");
  }
  return rc;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "delete".
 * @param ifile
 * @throws Exception
 */
public ReturnCode delete(IFile ifile) throws Exception {
  ReturnCode rc=new ReturnCode();
  Resource resource=getFileResource(ifile);
  List<ModelElement> dependencyClients=EObjectHelper.getDependencyClients(ifile);
  if (!dependencyClients.isEmpty()) {
    rc.setOk(false);
    rc.setMessage("String_Node_Str" + dependencyClients.get(0).getName() + "String_Node_Str");
  }
 else {
    EObjectHelper.removeDependencys(ifile);
    deleteRelated(ifile);
    String uriStr=resource.getURI().toString();
    remove(ifile);
    EMFSharedResources.getInstance().unloadResource(uriStr);
    if (ifile.isLinked()) {
      File file=new File(ifile.getRawLocation().toOSString());
      if (file.exists()) {
        file.delete();
      }
    }
    ifile.delete(true,new NullProgressMonitor());
    IFile propFile=ResourcesPlugin.getWorkspace().getRoot().getFile(ifile.getFullPath().removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION));
    resource=getFileResource(propFile);
    remove(propFile);
    EMFSharedResources.getInstance().unloadResource(resource.getURI().toString());
    if (propFile.exists()) {
      propFile.delete(true,new NullProgressMonitor());
    }
    ProxyRepositoryManager.getInstance().save();
    ifile.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    rc.setMessage("String_Node_Str");
  }
  return rc;
}
Program: 138701
Project: 138701
Buggy source:
private void initializeDefinitions(){
  this.indicatorCategories=loadDefinitionsFromFile().getCategories();
  indicatorDefinitions.addAll(IndicatorResourceFileHelper.getInstance().getAllIndicators(ResourceManager.getLibrariesFolder().getFolder(EResourceConstant.INDICATORS.getName()).getFolder(EResourceConstant.SYSTEM_INDICATORS.getName())));
  indicatorDefinitions.addAll(IndicatorResourceFileHelper.getInstance().getAllIndicators(ResourceManager.getLibrariesFolder().getFolder(EResourceConstant.INDICATORS.getName()).getFolder(EResourceConstant.USER_DEFINED_INDICATORS.getName())));
}

Fixed version (ground truth):
private void initializeDefinitions(){
  this.indicatorDefinitions.clear();
  this.indicatorCategories=loadDefinitionsFromFile().getCategories();
  indicatorDefinitions.addAll(IndicatorResourceFileHelper.getInstance().getAllIndicators(ResourceManager.getIndicatorFolder()));
}
Program: 138702
Project: 138702
Buggy source:
/** 
 * Method "getIndicatorsDefinitions".
 * @return the singleton analysis categories (or throws an exception if a problem occured)
 */
public List<IndicatorDefinition> getIndicatorsDefinitions(){
  if (indicatorDefinitions == null) {
    initializeDefinitions();
  }
  if (indicatorDefinitions == null) {
    throw new RuntimeException(Messages.getString("String_Node_Str"));
  }
  return indicatorDefinitions;
}

Fixed version (ground truth):
/** 
 * Method "getIndicatorsDefinitions".
 * @return the singleton analysis categories (or throws an exception if a problem occured)
 */
public List<IndicatorDefinition> getIndicatorsDefinitions(){
  if (indicatorDefinitions == null || indicatorDefinitions.isEmpty()) {
    initializeDefinitions();
  }
  if (indicatorDefinitions == null) {
    throw new RuntimeException(Messages.getString("String_Node_Str"));
  }
  return indicatorDefinitions;
}
Program: 138703
Project: 138703
Buggy source:
@Override protected boolean doExecute() throws Exception {
  if (!ResourceManager.getSystemIndicatorFolder().exists()) {
    DQStructureManager manager=DQStructureManager.getInstance();
    IFolder systemIndicatorFoler=manager.createNewFolder(ResourceManager.getIndicatorFolder(),EResourceConstant.SYSTEM_INDICATORS);
    manager.copyFilesToFolder(CorePlugin.getDefault(),DQStructureManager.SYSTEM_INDICATOR_PATH,true,systemIndicatorFoler,null);
  }
  Collection<Analysis> analyses=searchAllAnalysis(ResourceManager.getAnalysisFolder());
  AnalysisWriter analysisWriter=ElementWriterFactory.getInstance().createAnalysisWrite();
  for (  Analysis ana : analyses) {
    for (    Indicator ind : ana.getResults().getIndicators()) {
      updateIndDefinition(ind);
      if (ind instanceof CompositeIndicator) {
        for (        Indicator indLeave : IndicatorHelper.getIndicatorLeaves(ind)) {
          updateIndDefinition(indLeave);
        }
      }
    }
    analysisWriter.save(ana);
  }
  ResourceManager.getLibrariesFolder().getFile(DefinitionHandler.FILENAME).delete(true,new NullProgressMonitor());
  DefinitionHandler.getInstance().copyDefinitionsIntoFolder(ResourceManager.getLibrariesFolder());
  return true;
}

Fixed version (ground truth):
@Override protected boolean doExecute() throws Exception {
  DQStructureManager manager=DQStructureManager.getInstance();
  IFolder systemIndicatorFolder=ResourceManager.getSystemIndicatorFolder();
  if (!systemIndicatorFolder.exists()) {
    systemIndicatorFolder=manager.createNewFolder(ResourceManager.getIndicatorFolder(),EResourceConstant.SYSTEM_INDICATORS);
  }
  manager.copyFilesToFolder(CorePlugin.getDefault(),DQStructureManager.SYSTEM_INDICATOR_PATH,true,systemIndicatorFolder,null);
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  Collection<Analysis> analyses=searchAllAnalysis(ResourceManager.getAnalysisFolder());
  AnalysisWriter analysisWriter=ElementWriterFactory.getInstance().createAnalysisWrite();
  for (  Analysis ana : analyses) {
    for (    Indicator ind : ana.getResults().getIndicators()) {
      updateIndDefinition(ind);
      if (ind instanceof CompositeIndicator) {
        for (        Indicator indLeave : IndicatorHelper.getIndicatorLeaves(ind)) {
          updateIndDefinition(indLeave);
        }
      }
    }
    analysisWriter.save(ana);
  }
  ResourceManager.getLibrariesFolder().getFile(DefinitionHandler.FILENAME).delete(true,new NullProgressMonitor());
  DefinitionHandler.getInstance().copyDefinitionsIntoFolder(ResourceManager.getLibrariesFolder());
  return true;
}
Program: 138704
Project: 138704
Buggy source:
public void modifyText(ModifyEvent e){
  setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
  urlText.setText(getConnectionURL());
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  connectionParam.setaDDParameter(parameterText.getText());
  setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
  urlText.setText(getConnectionURL());
}
Program: 138706
Project: 138706
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);
    }
  }
  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) {
    record.getErrors().clear();
    checkDependency(record);
    if (checkExisted) {
      checkExisted(record);
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}
Program: 138707
Project: 138707
Buggy source:
public ItemRecord(File file){
  this.file=file;
  try {
    if (file != null && file.isFile()) {
      init();
    }
  }
 catch (  Exception e) {
    addError("String_Node_Str" + getName() + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
public ItemRecord(File file){
  this.file=file;
  if (resourceSet == null) {
    resourceSet=new ResourceSetImpl();
  }
  if (allItemRecords == null) {
    allItemRecords=new ArrayList<ItemRecord>();
  }
  if (file != null && file.isFile()) {
    allItemRecords.add(this);
    initialize();
  }
}