nus-yam/ex-repair huggingface dataset:
Program: 137818
Project: 137818
Buggy source:
/** 
 * DOC yyi Comment method "varifyImportFile".
 * @param importFile
 */
private static String createAndStorePattern(PatternParameters parameters,IFolder selectionFolder,ExpressionType type){
  Pattern pattern=createPattern(parameters.name,parameters.auther,parameters.description,parameters.purpose,parameters.status);
  for (  String key : parameters.regex.keySet()) {
    RegularExpression regularExpr=BooleanExpressionHelper.createRegularExpression(key,parameters.regex.get(key),type);
    pattern.getComponents().add(regularExpr);
  }
  boolean validStatus=PatternUtilities.isPatternValid(pattern);
  TaggedValueHelper.setValidStatus(validStatus,pattern);
  String fname=DqRepositoryViewService.createFilename(parameters.name,NewSourcePatternActionProvider.EXTENSION_PATTERN);
  try {
    String[] folderNames=parameters.relativePath.split("String_Node_Str");
    for (    String folderName : folderNames) {
      IFolder folder=selectionFolder.getFolder(folderName);
      if (!folder.exists()) {
        folder.create(false,true,null);
      }
      selectionFolder=folder;
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  IFile pfile=selectionFolder.getFile(fname);
  ElementWriterFactory.getInstance().createPatternWriter().create(pattern,selectionFolder);
  return ResourceManager.getPatternFolder().getLocationURI().relativize(selectionFolder.getLocationURI()).toString();
}

Fixed version (ground truth):
/** 
 * DOC yyi Comment method "varifyImportFile".
 * @param importFile
 */
private static String createAndStorePattern(PatternParameters parameters,IFolder selectionFolder,ExpressionType type){
  Pattern pattern=createPattern(parameters.name,parameters.auther,parameters.description,parameters.purpose,parameters.status);
  for (  String key : parameters.regex.keySet()) {
    RegularExpression regularExpr=BooleanExpressionHelper.createRegularExpression(key,parameters.regex.get(key),type);
    pattern.getComponents().add(regularExpr);
  }
  boolean validStatus=PatternUtilities.isPatternValid(pattern);
  TaggedValueHelper.setValidStatus(validStatus,pattern);
  String fname=DqRepositoryViewService.createFilename(parameters.name,NewSourcePatternActionProvider.EXTENSION_PATTERN);
  try {
    String relativePath=parameters.relativePath;
    if (EResourceConstant.PATTERN_REGEX.getName().equals(relativePath) || EResourceConstant.PATTERN_SQL.getName().equals(relativePath)) {
      relativePath=PluginConstant.EMPTY_STRING;
    }
    String[] folderNames=relativePath.split("String_Node_Str");
    for (    String folderName : folderNames) {
      IFolder folder=selectionFolder.getFolder(folderName);
      if (!folder.exists()) {
        folder.create(false,true,null);
      }
      selectionFolder=folder;
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  IFile pfile=selectionFolder.getFile(fname);
  ElementWriterFactory.getInstance().createPatternWriter().create(pattern,selectionFolder);
  return ResourceManager.getPatternFolder().getLocationURI().relativize(selectionFolder.getLocationURI()).toString();
}
Program: 137819
Project: 137819
Buggy source:
private static String trimQuote(String text){
  if (text.length() < 2)   return text;
  int beginLen=0;
  int endLen=text.length();
  if ('\"' == text.charAt(beginLen) && '\"' == text.charAt(endLen - 1)) {
    return text.substring(1,endLen - 1);
  }
  return text;
}

Fixed version (ground truth):
private static String trimQuote(String text){
  if (text.length() < 2) {
    return text;
  }
  int beginLen=0;
  int endLen=text.length();
  if ('\"' == text.charAt(beginLen) && '\"' == text.charAt(endLen - 1)) {
    return text.substring(1,endLen - 1);
  }
  return text;
}
Program: 137821
Project: 137821
Buggy source:
public String getDelimiter(){
  return DOT;
}

Fixed version (ground truth):
/** 
 * Getter for default SQL delimiter of the database. For the delimiter between catalog and schema, we should use   {@link #getCatalogDelimiter()} instead of this.
 * @return default SQL delimiter
 */
public String getDelimiter(){
  return DOT;
}
Program: 137822
Project: 137822
Buggy source:
public String toQualifiedName(String catalog,String schema,String table){
  StringBuffer qualName=new StringBuffer();
  if (catalog != null && catalog.trim().length() > 0) {
    qualName.append(this.handleContextModeOrAddQuotes(catalog));
    qualName.append(getDelimiter());
  }
  if (schema != null && schema.trim().length() > 0) {
    qualName.append(this.handleContextModeOrAddQuotes(schema));
    qualName.append(getSchemaDelimiter());
  }
  qualName.append(this.handleContextModeOrAddQuotes(table));
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",catalog,schema,table,qualName));
  }
  return qualName.toString();
}

Fixed version (ground truth):
public String toQualifiedName(String catalog,String schema,String table){
  StringBuffer qualName=new StringBuffer();
  if (catalog != null && catalog.trim().length() > 0) {
    qualName.append(this.handleContextModeOrAddQuotes(catalog));
    qualName.append(getCatalogDelimiter());
  }
  if (schema != null && schema.trim().length() > 0) {
    qualName.append(this.handleContextModeOrAddQuotes(schema));
    qualName.append(getDelimiter());
  }
  qualName.append(this.handleContextModeOrAddQuotes(table));
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",catalog,schema,table,qualName));
  }
  return qualName.toString();
}
Program: 137824
Project: 137824
Buggy source:
@Override public void treeExpanded(TreeEvent e){
  ExpandableComposite theSuitedComposite=getTheSuitedComposite(e);
  ScrolledForm form=masterPage.getForm();
  Composite comp=masterPage.getChartComposite();
  if (theSuitedComposite != null && !theSuitedComposite.isExpanded()) {
    theSuitedComposite.setExpanded(true);
  }
 else {
    propertyChangeSupport.firePropertyChange(PluginConstant.EXPAND_TREE,null,e.item);
  }
  comp.layout();
  form.reflow(true);
}

Fixed version (ground truth):
@Override public void treeExpanded(TreeEvent e){
  ExpandableComposite theSuitedComposite=getTheSuitedComposite(e);
  ScrolledForm form=masterPage.getForm();
  Composite comp=masterPage.getChartComposite();
  if (theSuitedComposite != null && !theSuitedComposite.isExpanded()) {
    theSuitedComposite.setExpanded(true);
  }
 else {
    propertyChangeSupport.firePropertyChange(PluginConstant.EXPAND_TREE,null,e.item);
  }
  if (comp != null) {
    comp.layout();
  }
  form.reflow(true);
}
Program: 137825
Project: 137825
Buggy source:
@Override public void treeCollapsed(TreeEvent e){
  ExpandableComposite theSuitedComposite=getTheSuitedComposite(e);
  ScrolledForm form=masterPage.getForm();
  Composite comp=masterPage.getChartComposite();
  if (theSuitedComposite != null && theSuitedComposite.isExpanded()) {
    getTheSuitedComposite(e).setExpanded(false);
  }
  comp.layout();
  form.reflow(true);
}

Fixed version (ground truth):
@Override public void treeCollapsed(TreeEvent e){
  ExpandableComposite theSuitedComposite=getTheSuitedComposite(e);
  ScrolledForm form=masterPage.getForm();
  Composite comp=masterPage.getChartComposite();
  if (theSuitedComposite != null && theSuitedComposite.isExpanded()) {
    getTheSuitedComposite(e).setExpanded(false);
  }
  if (comp != null) {
    comp.layout();
  }
  form.reflow(true);
}
Program: 137826
Project: 137826
Buggy source:
/** 
 * update Mean/Median indicators definition by uuid.
 */
@Override protected boolean doExecute() throws Exception {
  DefinitionHandler definitionHandler=DefinitionHandler.getInstance();
  boolean isMeanAdded=true;
  boolean isMedianUpdated=true;
  IndicatorDefinition meanDefinition=definitionHandler.getDefinitionById(MEAN_UUID);
  if (meanDefinition != null && !IndicatorDefinitionFileHelper.isExistSqlExprWithLanguage(meanDefinition,DB2)) {
    IndicatorDefinitionFileHelper.addSqlExpression(meanDefinition,DB2,"String_Node_Str");
    isMeanAdded=IndicatorDefinitionFileHelper.save(meanDefinition);
  }
  IndicatorDefinition medianDefinition=definitionHandler.getDefinitionById(MEDIAN_UUID);
  if (medianDefinition != null && IndicatorDefinitionFileHelper.removeSqlExpression(medianDefinition,DB2)) {
    IndicatorDefinitionFileHelper.removeSqlExpression(medianDefinition,SupportDBUrlType.ACCESS.getLanguage());
    List<TdExpression> remainExpLs=new ArrayList<TdExpression>();
    remainExpLs.addAll(medianDefinition.getSqlGenericExpression());
    medianDefinition.getSqlGenericExpression().clear();
    IndicatorDefinitionFileHelper.addSqlExpression(medianDefinition,DB2,"String_Node_Str");
    medianDefinition.getSqlGenericExpression().addAll(remainExpLs);
    isMedianUpdated=IndicatorDefinitionFileHelper.save(medianDefinition);
  }
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  if (!isMeanAdded || !isMedianUpdated) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * update Mean/Median indicators definition by uuid.
 */
@Override protected boolean doExecute() throws Exception {
  DefinitionHandler definitionHandler=DefinitionHandler.getInstance();
  boolean isMeanAdded=true;
  boolean isMedianUpdated=true;
  IndicatorDefinition meanDefinition=definitionHandler.getDefinitionById(MEAN_UUID);
  if (meanDefinition != null && !IndicatorDefinitionFileHelper.isExistSqlExprWithLanguage(meanDefinition,DB2)) {
    IndicatorDefinitionFileHelper.addSqlExpression(meanDefinition,DB2,"String_Node_Str");
    isMeanAdded=IndicatorDefinitionFileHelper.save(meanDefinition);
  }
  IndicatorDefinition medianDefinition=definitionHandler.getDefinitionById(MEDIAN_UUID);
  if (medianDefinition != null && IndicatorDefinitionFileHelper.removeSqlExpression(medianDefinition,DB2)) {
    List<TdExpression> remainExpLs=new ArrayList<TdExpression>();
    remainExpLs.addAll(medianDefinition.getSqlGenericExpression());
    medianDefinition.getSqlGenericExpression().clear();
    IndicatorDefinitionFileHelper.addSqlExpression(medianDefinition,DB2,"String_Node_Str");
    medianDefinition.getSqlGenericExpression().addAll(remainExpLs);
    isMedianUpdated=IndicatorDefinitionFileHelper.save(medianDefinition);
  }
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  if (!isMeanAdded || !isMedianUpdated) {
    return false;
  }
  return true;
}
Program: 137828
Project: 137828
Buggy source:
/** 
 * update Mean/Median indicators definition by uuid.
 */
@Override protected boolean doExecute() throws Exception {
  DefinitionHandler definitionHandler=DefinitionHandler.getInstance();
  boolean isMeanAdded=true;
  boolean isMedianUpdated=true;
  IndicatorDefinition meanDefinition=definitionHandler.getDefinitionById(MEAN_UUID);
  if (meanDefinition != null && !IndicatorDefinitionFileHelper.isExistSqlExprWithLanguage(meanDefinition,DB2)) {
    IndicatorDefinitionFileHelper.addSqlExpression(meanDefinition,DB2,"String_Node_Str");
    isMeanAdded=IndicatorDefinitionFileHelper.save(meanDefinition);
  }
  IndicatorDefinition medianDefinition=definitionHandler.getDefinitionById(MEDIAN_UUID);
  if (medianDefinition != null && IndicatorDefinitionFileHelper.removeSqlExpression(medianDefinition,DB2)) {
    IndicatorDefinitionFileHelper.removeSqlExpression(medianDefinition,SupportDBUrlType.ACCESS.getLanguage());
    List<TdExpression> remainExpLs=new ArrayList<TdExpression>();
    remainExpLs.addAll(medianDefinition.getSqlGenericExpression());
    medianDefinition.getSqlGenericExpression().clear();
    IndicatorDefinitionFileHelper.addSqlExpression(medianDefinition,DB2,"String_Node_Str");
    medianDefinition.getSqlGenericExpression().addAll(remainExpLs);
    isMedianUpdated=IndicatorDefinitionFileHelper.save(medianDefinition);
  }
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  if (!isMeanAdded || !isMedianUpdated) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * update Mean/Median indicators definition by uuid.
 */
@Override protected boolean doExecute() throws Exception {
  DefinitionHandler definitionHandler=DefinitionHandler.getInstance();
  boolean isMeanAdded=true;
  boolean isMedianUpdated=true;
  IndicatorDefinition meanDefinition=definitionHandler.getDefinitionById(MEAN_UUID);
  if (meanDefinition != null && !IndicatorDefinitionFileHelper.isExistSqlExprWithLanguage(meanDefinition,DB2)) {
    IndicatorDefinitionFileHelper.addSqlExpression(meanDefinition,DB2,"String_Node_Str");
    isMeanAdded=IndicatorDefinitionFileHelper.save(meanDefinition);
  }
  IndicatorDefinition medianDefinition=definitionHandler.getDefinitionById(MEDIAN_UUID);
  if (medianDefinition != null && IndicatorDefinitionFileHelper.removeSqlExpression(medianDefinition,DB2)) {
    List<TdExpression> remainExpLs=new ArrayList<TdExpression>();
    remainExpLs.addAll(medianDefinition.getSqlGenericExpression());
    medianDefinition.getSqlGenericExpression().clear();
    IndicatorDefinitionFileHelper.addSqlExpression(medianDefinition,DB2,"String_Node_Str");
    medianDefinition.getSqlGenericExpression().addAll(remainExpLs);
    isMedianUpdated=IndicatorDefinitionFileHelper.save(medianDefinition);
  }
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  if (!isMeanAdded || !isMedianUpdated) {
    return false;
  }
  return true;
}
Program: 137833
Project: 137833
Buggy source:
/** 
 * Test method for   {@link org.talend.dq.helper.ReportUtils#getReportListFile(org.eclipse.core.resources.IFile)}.
 */
@Test public void testGetReportListFile(){
  if (this.realProject != null) {
    String folderName1=ERepositoryObjectType.TDQ_DATA_PROFILING.getFolder();
    String folderName2=ERepositoryObjectType.TDQ_REPORT_ELEMENT.getFolder();
    String reportName="String_Node_Str" + StringUtilities.getRandomString(7);
    UnitTestBuildHelper.createRealFolder(this.realProject,folderName1);
    IFolder folder2=UnitTestBuildHelper.createRealFolder(this.realProject,folderName2);
    IFile iFile=UnitTestBuildHelper.createRealFile(folder2,reportName + "String_Node_Str");
    assertTrue(iFile.exists());
    assertTrue(WorkspaceUtils.ifileToFile(iFile).exists());
    try {
      File reportListFile=ReportUtils.getReportListFile(iFile);
      assertTrue(reportListFile.exists());
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
  }
 else {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.talend.dq.helper.ReportUtils#getReportListFile(org.eclipse.core.resources.IFile)}.
 */
@Test public void testGetReportListFile(){
  if (this.realProject != null) {
    String folderName1=ERepositoryObjectType.TDQ_DATA_PROFILING.getFolder();
    String folderName2=ERepositoryObjectType.TDQ_REPORT_ELEMENT.getFolder();
    String reportName="String_Node_Str" + StringUtilities.getRandomString(7);
    UnitTestBuildHelper.createRealFolder(this.realProject,folderName1);
    IFolder folder2=UnitTestBuildHelper.createRealFolder(this.realProject,folderName2);
    IFile iFile=UnitTestBuildHelper.createRealFile(folder2,reportName + "String_Node_Str");
    assertTrue(iFile.exists());
    assertTrue(WorkspaceUtils.ifileToFile(iFile).exists());
    File reportListFile=ReportUtils.getReportListFile(iFile);
    assertTrue(reportListFile.exists());
  }
 else {
    fail("String_Node_Str");
  }
}
Program: 137834
Project: 137834
Buggy source:
/** 
 * Test method for   {@link org.talend.dq.nodes.ReportSubFolderRepNode#setReport(orgomg.cwmx.analysis.informationreporting.Report)}.
 */
@Test public void testSetReport(){
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.dq.nodes.ReportSubFolderRepNode#setReport(orgomg.cwmx.analysis.informationreporting.Report)}.
 */
@Test public void testSetReport(){
}
Program: 137835
Project: 137835
Buggy source:
/** 
 * Test method for   {@link org.talend.dq.nodes.ReportSubFolderRepNode#setReportSubFolderType(org.talend.dq.nodes.ReportSubFolderRepNode.ReportSubFolderType)}.
 */
@Test public void testSetReportSubFolderType(){
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.dq.nodes.ReportSubFolderRepNode#setReportSubFolderType(org.talend.dq.nodes.ReportSubFolderRepNode.ReportSubFolderType)}.
 */
@Test public void testSetReportSubFolderType(){
}
Program: 137836
Project: 137836
Buggy source:
private void mockForGetChildren() throws Exception {
  IResource[] res=new IResource[3];
  for (int i=0; i < 3; i++) {
    IFile fe=mock(IFile.class);
    when(fe.getFullPath()).thenReturn(new Path("String_Node_Str"));
    res[i]=fe;
  }
  PowerMockito.mockStatic(ReportUtils.class);
  IFile repFile=mock(IFile.class);
  when(ReportUtils.getReportListFiles(repFile)).thenReturn(res);
  PowerMockito.mockStatic(ResourceFileMap.class);
  when(ResourceFileMap.findCorrespondingFile(report)).thenReturn(repFile);
  PowerMockito.mockStatic(ProjectManager.class);
  ProjectManager projManager=mock(ProjectManager.class);
  when(projManager.getProjectNode("String_Node_Str")).thenReturn(null);
  PowerMockito.mockStatic(CoreRuntimePlugin.class);
  CoreRuntimePlugin coreRunPlugin=mock(CoreRuntimePlugin.class);
  when(CoreRuntimePlugin.getInstance()).thenReturn(coreRunPlugin).thenReturn(coreRunPlugin).thenReturn(coreRunPlugin);
  when(ProjectManager.getInstance()).thenReturn(projManager).thenReturn(projManager).thenReturn(projManager);
}

Fixed version (ground truth):
private void mockForGetChildren() throws Exception {
  IResource[] res=new IResource[3];
  for (int i=0; i < 3; i++) {
    IFile fe=mock(IFile.class);
    when(fe.getFullPath()).thenReturn(new Path("String_Node_Str"));
    res[i]=fe;
  }
  PowerMockito.mockStatic(ReportUtils.class);
  IFile repFile=mock(IFile.class);
  when(ReportUtils.getReportGeneratedDocs(repFile)).thenReturn(res);
  PowerMockito.mockStatic(ResourceFileMap.class);
  when(ResourceFileMap.findCorrespondingFile(report)).thenReturn(repFile);
  PowerMockito.mockStatic(ProjectManager.class);
  ProjectManager projManager=mock(ProjectManager.class);
  when(projManager.getProjectNode("String_Node_Str")).thenReturn(null);
  PowerMockito.mockStatic(CoreRuntimePlugin.class);
  CoreRuntimePlugin coreRunPlugin=mock(CoreRuntimePlugin.class);
  when(CoreRuntimePlugin.getInstance()).thenReturn(coreRunPlugin).thenReturn(coreRunPlugin).thenReturn(coreRunPlugin);
  when(ProjectManager.getInstance()).thenReturn(projManager).thenReturn(projManager).thenReturn(projManager);
}
Program: 137837
Project: 137837
Buggy source:
/** 
 * Test method for   {@link org.talend.dq.nodes.ReportSubFolderRepNode#ReportSubFolderRepNode(org.talend.core.model.repository.IRepositoryViewObject,org.talend.repository.model.RepositoryNode,org.talend.repository.model.IRepositoryNode.ENodeType)}.
 */
@Test public void testReportSubFolderRepNode(){
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.dq.nodes.ReportSubFolderRepNode#ReportSubFolderRepNode(org.talend.core.model.repository.IRepositoryViewObject,org.talend.repository.model.RepositoryNode,org.talend.repository.model.IRepositoryNode.ENodeType)}.
 */
@Test public void testReportSubFolderRepNode(){
}
Program: 137838
Project: 137838
Buggy source:
public void openEditor(Item item){
  Class<?> clazz=null;
  IEditorInput editorInput=null;
  if (item instanceof ConnectionItem) {
    clazz=ConnectionEditor.class;
    editorInput=new ConnectionItemEditorInput(item);
  }
  if (editorInput != null && clazz != null) {
    CorePlugin.getDefault().closeEditorIfOpened(item);
    CorePlugin.getDefault().openEditor(editorInput,clazz.getName());
  }
}

Fixed version (ground truth):
public void openEditor(Item item){
  Class<?> clazz=null;
  IEditorInput editorInput=null;
  if (item instanceof ConnectionItem) {
    clazz=ConnectionEditor.class;
    editorInput=new ConnectionItemEditorInput(item);
  }
  if (editorInput != null && clazz != null) {
    boolean isOpenedThenClosed=CorePlugin.getDefault().itemIsOpening(item,true);
    if (isOpenedThenClosed || CoreRuntimePlugin.getInstance().isDataProfilePerspectiveSelected()) {
      CorePlugin.getDefault().openEditor(editorInput,clazz.getName());
    }
  }
}
Program: 137839
Project: 137839
Buggy source:
public void doSave(IProgressMonitor monitor){
  if (masterPage.isDirty()) {
    masterPage.doSave(monitor);
    setPartName(masterPage.getIntactElemenetName());
    ConnectionItem item=(ConnectionItem)((ConnectionItemEditorInput)this.getEditorInput()).getItem();
    if (item instanceof DatabaseConnectionItem) {
      String name=((DatabaseConnectionItem)item).getConnection().getName();
      CWMPlugin.getDefault().updateAliasInSQLExplorer(masterPage.getOldDataproviderName(),name);
      masterPage.setOldDataproviderName(name);
    }
  }
  setEditorObject(masterPage.getConnectionRepNode());
  super.doSave(monitor);
}

Fixed version (ground truth):
@Override public void doSave(IProgressMonitor monitor){
  if (masterPage.isDirty()) {
    masterPage.doSave(monitor);
    setPartName(masterPage.getIntactElemenetName());
    ConnectionItem item=(ConnectionItem)((ConnectionItemEditorInput)this.getEditorInput()).getItem();
    if (item instanceof DatabaseConnectionItem) {
      String name=((DatabaseConnectionItem)item).getConnection().getName();
      CWMPlugin.getDefault().updateConnetionAliasByName(item.getConnection(),masterPage.getOldDataproviderName());
      masterPage.setOldDataproviderName(name);
    }
  }
  setEditorObject(masterPage.getConnectionRepNode());
  super.doSave(monitor);
}
Program: 137840
Project: 137840
Buggy source:
protected void firePropertyChange(final int propertyId){
  super.firePropertyChange(propertyId);
}

Fixed version (ground truth):
@Override protected void firePropertyChange(final int propertyId){
  super.firePropertyChange(propertyId);
}
Program: 137841
Project: 137841
Buggy source:
protected void addPages(){
  masterPage=new ConnectionInfoPage(this,ID,DefaultMessagesImpl.getString("String_Node_Str"));
  try {
    addPage(masterPage);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
  setPartName(masterPage.getIntactElemenetName());
}

Fixed version (ground truth):
@Override protected void addPages(){
  masterPage=new ConnectionInfoPage(this,ID,DefaultMessagesImpl.getString("String_Node_Str"));
  try {
    addPage(masterPage);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
  setPartName(masterPage.getIntactElemenetName());
}
Program: 137842
Project: 137842
Buggy source:
protected void setInput(IEditorInput input){
  super.setInput(input);
}

Fixed version (ground truth):
@Override protected void setInput(IEditorInput input){
  super.setInput(input);
}
Program: 137843
Project: 137843
Buggy source:
private void saveConnectionInfo() throws DataprofilerCoreException {
  if (connection != null && connection.eIsProxy()) {
    connection=(Connection)EObjectHelper.resolveObject(connection);
  }
  ConnectionUtils.checkUsernameBeforeSaveConnection4Sqlite(connection);
  ReturnCode returnCode=ElementWriterFactory.getInstance().createDataProviderWriter().save(connection);
  if (returnCode.isOk()) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + connection.eResource().getURI().toFileString() + "String_Node_Str");
    }
  }
 else {
    throw new DataprofilerCoreException(DefaultMessagesImpl.getString("String_Node_Str",connection.eResource().getURI().toFileString(),returnCode.getMessage()));
  }
}

Fixed version (ground truth):
private void saveConnectionInfo() throws DataprofilerCoreException {
  if (connection != null && connection.eIsProxy()) {
    connection=(Connection)EObjectHelper.resolveObject(connection);
  }
  ConnectionUtils.checkUsernameBeforeSaveConnection4Sqlite(connection);
  ReturnCode returnCode=ElementWriterFactory.getInstance().createDataProviderWriter().save(connectionItem,true);
  if (returnCode.isOk()) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + connection.eResource().getURI().toFileString() + "String_Node_Str");
    }
  }
 else {
    throw new DataprofilerCoreException(DefaultMessagesImpl.getString("String_Node_Str",connection.eResource().getURI().toFileString(),returnCode.getMessage()));
  }
}
Program: 137844
Project: 137844
Buggy source:
@Override protected ModelElement getCurrentModelElement(FormEditor editor){
  IEditorInput editorInput=editor.getEditorInput();
  if (editorInput instanceof ConnectionItemEditorInput) {
    ConnectionItemEditorInput input=(ConnectionItemEditorInput)editorInput;
    connectionItem=input.getItem();
    connection=((ConnectionItem)input.getItem()).getConnection();
  }
 else   if (editorInput instanceof FileEditorInput) {
    Property proty=PropertyHelper.getProperty(((FileEditorInput)editorInput).getFile());
    Item item=proty.getItem();
    if (item instanceof ConnectionItem) {
      connectionItem=(ConnectionItem)item;
      connection=((ConnectionItem)item).getConnection();
    }
  }
  initConnectionRepNode(connection);
  return connection;
}

Fixed version (ground truth):
@Override protected ModelElement getCurrentModelElement(FormEditor editor){
  IEditorInput editorInput=editor.getEditorInput();
  if (editorInput instanceof ConnectionItemEditorInput) {
    ConnectionItemEditorInput input=(ConnectionItemEditorInput)editorInput;
    connectionItem=input.getItem();
    connection=((ConnectionItem)input.getItem()).getConnection();
  }
 else   if (editorInput instanceof FileEditorInput) {
    Property proty=PropertyHelper.getProperty(((FileEditorInput)editorInput).getFile());
    Item item=proty.getItem();
    if (item instanceof ConnectionItem) {
      connectionItem=item;
      connection=((ConnectionItem)item).getConnection();
    }
  }
  initConnectionRepNode(connection);
  return connection;
}
Program: 137849
Project: 137849
Buggy source:
/** 
 * physical delete related.
 * @param item
 */
public static ReturnCode deleteRelations(Item item){
  ReturnCode rc=new ReturnCode(Boolean.TRUE);
  if (item == null || item.getProperty() == null || item instanceof FolderItem) {
    rc.setOk(Boolean.FALSE);
    return rc;
  }
  IFile itemFile=PropertyHelper.getItemFile(item.getProperty());
  if (itemFile == null || itemFile.exists()) {
    rc.setOk(Boolean.FALSE);
    return rc;
  }
  if (item instanceof TDQReportItem) {
    return ReportUtils.deleteRepOutputFolder(itemFile);
  }
  return rc;
}

Fixed version (ground truth):
/** 
 * physical delete related.
 * @param item
 */
public static ReturnCode deleteRelations(Item item){
  ReturnCode rc=new ReturnCode(Boolean.TRUE);
  if (item == null || item.getProperty() == null || item instanceof FolderItem) {
    rc.setOk(Boolean.FALSE);
    return rc;
  }
  IFile itemFile=PropertyHelper.getItemFile(item.getProperty());
  if (itemFile == null || itemFile.exists()) {
    rc.setOk(Boolean.FALSE);
    return rc;
  }
  if (item instanceof TDQReportItem) {
    try {
      rc=ReportUtils.deleteRepOutputFolder(itemFile);
    }
 catch (    PersistenceException e) {
      log.error(e);
      rc.setMessage(e.getMessage());
      rc.setOk(false);
    }
    return rc;
  }
  return rc;
}
Program: 137850
Project: 137850
Buggy source:
/** 
 * delete the related output folder of reports.
 * @param repFiles
 */
public static void deleteRepOutputFolders(List<IFile> repFiles){
  for (  IFile repFile : repFiles) {
    deleteRepOutputFolder(repFile);
  }
}

Fixed version (ground truth):
/** 
 * delete the related output folder of reports.
 * @param repFiles
 */
public static void deleteRepOutputFolders(List<IFile> repFiles){
  for (  IFile repFile : repFiles) {
    try {
      deleteRepOutputFolder(repFile);
    }
 catch (    PersistenceException e) {
      log.error(e);
    }
  }
}
Program: 137851
Project: 137851
Buggy source:
/** 
 * delete the related output folder of report.
 * @param reportFile
 */
public static ReturnCode deleteRepOutputFolder(IFile reportFile){
  ReturnCode rc=new ReturnCode(Boolean.TRUE);
  IFolder currentRportFolder=ReportUtils.getOutputFolder(reportFile);
  if (currentRportFolder != null && currentRportFolder.exists()) {
    try {
      currentRportFolder.delete(true,new NullProgressMonitor());
    }
 catch (    CoreException e) {
      log.error(e,e);
      rc.setOk(Boolean.FALSE);
      rc.setMessage(e.getMessage());
    }
  }
 else {
    rc.setOk(Boolean.FALSE);
  }
  return rc;
}

Fixed version (ground truth):
/** 
 * delete the related output folder of report.
 * @param reportFile
 * @throws PersistenceException
 */
public static ReturnCode deleteRepOutputFolder(final IFile reportFile) throws PersistenceException {
  final ReturnCode rc=new ReturnCode(Boolean.TRUE);
  RepositoryWorkUnit repositoryWorkUnit=new RepositoryWorkUnit(ProjectManager.getInstance().getCurrentProject(),"String_Node_Str"){
    @Override protected void run() throws LoginException, PersistenceException {
      IFolder reportOutputFolder=ReportUtils.getOutputFolder(reportFile);
      if (reportOutputFolder != null && reportOutputFolder.exists()) {
        try {
          IContainer parent=reportOutputFolder.getParent();
          if (parent != null) {
            parent.refreshLocal(IResource.DEPTH_INFINITE,null);
          }
          File file=WorkspaceUtils.ifolderToFile(reportOutputFolder);
          if (file != null && file.exists()) {
            deleteFolder(file);
          }
          if (parent != null) {
            parent.refreshLocal(IResource.DEPTH_INFINITE,null);
          }
        }
 catch (        CoreException e) {
          log.warn(e);
        }
      }
 else {
        rc.setOk(Boolean.FALSE);
      }
    }
  }
;
  repositoryWorkUnit.setAvoidUnloadResources(true);
  ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(repositoryWorkUnit);
  repositoryWorkUnit.throwPersistenceExceptionIfAny();
  return rc;
}
Program: 137852
Project: 137852
Buggy source:
/** 
 * DOC xqliu Comment method "moveHiddenFolders".
 * @param srcFolder
 * @param tarFolder
 */
public static void moveHiddenFolders(File srcFolder,File tarFolder){
  if (srcFolder == null || tarFolder == null) {
    return;
  }
  File[] listFiles=srcFolder.listFiles();
  for (  File file : listFiles) {
    if (file.isDirectory()) {
      if (file.getName().startsWith("String_Node_Str")) {
        if (file.getName().equals("String_Node_Str")) {
          continue;
        }
        FilesUtils.copyDirectory(file,tarFolder);
      }
 else {
        moveHiddenFolders(file,getTargetFile(file,srcFolder,tarFolder));
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "moveHiddenFolders".
 * @param srcFolder
 * @param tarFolder
 */
public static void moveHiddenFolders(File srcFolder,File tarFolder){
  if (srcFolder == null || tarFolder == null) {
    return;
  }
  File[] listFiles=srcFolder.listFiles();
  if (listFiles != null) {
    for (    File file : listFiles) {
      if (file.isDirectory()) {
        if (file.getName().startsWith("String_Node_Str")) {
          if (file.getName().equals("String_Node_Str")) {
            continue;
          }
          FilesUtils.copyDirectoryWithoutSvnFolder(file,tarFolder);
        }
 else {
          moveHiddenFolders(file,getTargetFile(file,srcFolder,tarFolder));
        }
      }
    }
  }
}
Program: 137853
Project: 137853
Buggy source:
/** 
 * get the .report.list file for the report.
 * @param reportFile the IFile of report
 * @return
 * @throws IOException
 */
public static File getReportListFile(IFile reportFile) throws IOException {
  String reportFileName=reportFile.getName();
  String simpleName=getSimpleName(reportFileName);
  File file=new File(ReportHelper.getOutputFolderNameDefault((IFolder)reportFile.getParent(),simpleName) + File.separator + REPORT_LIST);
  if (!file.exists()) {
    File parentFile=file.getParentFile();
    if (parentFile != null) {
      if (!parentFile.exists()) {
        if (parentFile.mkdirs()) {
          file.createNewFile();
        }
      }
 else {
        file.createNewFile();
      }
    }
  }
  return file;
}

Fixed version (ground truth):
/** 
 * get the .report.list file for the report, if it doesn't exist, create it.
 * @param reportFile the IFile of report
 * @return
 */
public static File getReportListFile(IFile reportFile){
  File file=reportListFile(reportFile);
  if (!file.exists()) {
    try {
      createReportListFile(reportFile);
    }
 catch (    PersistenceException e) {
      log.error(e);
    }
  }
  return file;
}
Program: 137854
Project: 137854
Buggy source:
/** 
 * get the link files which link to the Report Generated Doc File.
 * @param file Report file
 * @return
 */
public static List<IFile> getRepDocLinkFiles(IFile file){
  List<IFile> linkFiles=new ArrayList<IFile>();
  if (file != null) {
    try {
      IResource[] reportListFiles=ReportUtils.getReportListFiles(file);
      for (      IResource res : reportListFiles) {
        IFile linkFile=ResourceManager.getRoot().getFile(res.getFullPath());
        if (linkFile.exists() && linkFile.isLinked()) {
          linkFiles.add(linkFile);
        }
      }
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return linkFiles;
}

Fixed version (ground truth):
/** 
 * get the link files which link to the Report Generated Doc File.
 * @param file Report file
 * @return
 */
public static List<IFile> getRepDocLinkFiles(IFile file){
  List<IFile> linkFiles=new ArrayList<IFile>();
  if (file != null) {
    try {
      IResource[] reportListFiles=ReportUtils.getReportGeneratedDocs(file);
      for (      IResource res : reportListFiles) {
        IFile linkFile=ResourceManager.getRoot().getFile(res.getFullPath());
        if (linkFile.exists() && linkFile.isLinked()) {
          linkFiles.add(linkFile);
        }
      }
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return linkFiles;
}
Program: 137855
Project: 137855
Buggy source:
/** 
 * DOC xqliu Comment method "getReportListParameters".
 * @param reportListFile
 * @return
 * @throws IOException
 */
private static List<ReportListParameters> getReportListParameters(File reportListFile) throws IOException {
  List<ReportListParameters> repList=new ArrayList<ReportListParameters>();
  if (reportListFile != null && reportListFile.exists()) {
    CsvReader reader=new CsvReader(new FileReader(reportListFile),CURRENT_SEPARATOR);
    reader.setEscapeMode(ESCAPE_MODE_BACKSLASH);
    reader.setTextQualifier(TEXT_QUAL);
    reader.setUseTextQualifier(USE_TEXT_QUAL);
    reader.readHeaders();
    while (reader.readRecord()) {
      repList.add(buildRepListParams(reader.get(ReportListEnum.Name.getLiteral()),reader.get(ReportListEnum.Path.getLiteral()),reader.get(ReportListEnum.CreateTime.getLiteral())));
    }
    reader.close();
  }
  return repList;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getReportListParameters".
 * @param reportListFile
 * @return
 * @throws IOException
 */
private static List<ReportListParameters> getReportListParameters(File reportListFile){
  List<ReportListParameters> repList=new ArrayList<ReportListParameters>();
  if (reportListFile != null && reportListFile.exists()) {
    try {
      CsvReader reader=new CsvReader(new FileReader(reportListFile),CURRENT_SEPARATOR);
      reader.setEscapeMode(ESCAPE_MODE_BACKSLASH);
      reader.setTextQualifier(TEXT_QUAL);
      reader.setUseTextQualifier(USE_TEXT_QUAL);
      reader.readHeaders();
      while (reader.readRecord()) {
        repList.add(buildRepListParams(reader.get(ReportListEnum.Name.getLiteral()),reader.get(ReportListEnum.Path.getLiteral()),reader.get(ReportListEnum.CreateTime.getLiteral())));
      }
      reader.close();
    }
 catch (    FileNotFoundException e) {
      log.error(e);
    }
catch (    IllegalArgumentException e) {
      log.error(e);
    }
catch (    IOException e) {
      log.error(e);
    }
  }
  return repList;
}
Program: 137856
Project: 137856
Buggy source:
/** 
 * get the report doc folder name from the report's preperty.
 * @param repProp
 * @return
 */
public static String getSimpleName(Property repProp){
  return repProp.getLabel() + "String_Node_Str" + repProp.getVersion();
}

Fixed version (ground truth):
/** 
 * remove the extension of full name to get the simple name of a report file.
 * @param reportFileName
 * @return
 */
public static String getSimpleName(String reportFileName){
  int indexOf=reportFileName.lastIndexOf(PluginConstant.DOT_STRING);
  String simpleName=PluginConstant.EMPTY_STRING;
  if (indexOf != -1) {
    simpleName=reportFileName.substring(0,indexOf);
  }
 else {
    simpleName=null;
  }
  return simpleName;
}
Program: 137857
Project: 137857
Buggy source:
/** 
 * DOC xqliu Comment method "saveReportListFile".
 * @param reportListFile
 * @param repList
 * @throws IOException
 */
private static void saveReportListFile(File reportListFile,List<ReportListParameters> repList) throws IOException {
  CsvWriter out=new CsvWriter(new FileOutputStream(reportListFile),CURRENT_SEPARATOR,Charset.defaultCharset());
  out.setEscapeMode(ESCAPE_MODE_BACKSLASH);
  out.setTextQualifier(TEXT_QUAL);
  out.setForceQualifier(USE_TEXT_QUAL);
  ReportListEnum[] values=ReportListEnum.values();
  String[] temp=new String[values.length];
  for (int i=0; i < repList.size() + 1; i++) {
    if (i == 0) {
      temp[0]=ReportListEnum.Name.getLiteral();
      temp[1]=ReportListEnum.Path.getLiteral();
      temp[2]=ReportListEnum.CreateTime.getLiteral();
    }
 else {
      temp[0]=repList.get(i - 1).name;
      temp[1]=repList.get(i - 1).path;
      temp[2]=repList.get(i - 1).createTime;
    }
    out.writeRecord(temp);
  }
  out.flush();
  out.close();
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "saveReportListFile".
 * @param reportListFile
 * @param repList
 * @throws IOException
 * @throws PersistenceException
 */
private static void saveReportListFile(final File reportListFile,final List<ReportListParameters> repList) throws PersistenceException {
  RepositoryWorkUnit repositoryWorkUnit=new RepositoryWorkUnit(ProjectManager.getInstance().getCurrentProject(),"String_Node_Str"){
    @Override protected void run() throws LoginException, PersistenceException {
      try {
        CsvWriter out=new CsvWriter(new FileOutputStream(reportListFile),CURRENT_SEPARATOR,Charset.defaultCharset());
        out.setEscapeMode(ESCAPE_MODE_BACKSLASH);
        out.setTextQualifier(TEXT_QUAL);
        out.setForceQualifier(USE_TEXT_QUAL);
        ReportListEnum[] values=ReportListEnum.values();
        String[] temp=new String[values.length];
        for (int i=0; i < repList.size() + 1; i++) {
          if (i == 0) {
            temp[0]=ReportListEnum.Name.getLiteral();
            temp[1]=ReportListEnum.Path.getLiteral();
            temp[2]=ReportListEnum.CreateTime.getLiteral();
          }
 else {
            temp[0]=repList.get(i - 1).name;
            temp[1]=repList.get(i - 1).path;
            temp[2]=repList.get(i - 1).createTime;
          }
          out.writeRecord(temp);
        }
        out.flush();
        out.close();
      }
 catch (      FileNotFoundException e) {
        log.error(e);
      }
catch (      IOException e) {
        log.error(e);
      }
    }
  }
;
  repositoryWorkUnit.setAvoidUnloadResources(true);
  ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(repositoryWorkUnit);
  repositoryWorkUnit.throwPersistenceExceptionIfAny();
}
Program: 137858
Project: 137858
Buggy source:
/** 
 */
public static void initRepListFile(IFile reportFile) throws Exception {
  String reportFileName=reportFile.getName();
  String simpleName=getSimpleName(reportFileName);
  if (simpleName == null) {
    return;
  }
  IFolder reportFileFolder=((IFolder)reportFile.getParent()).getFolder(PluginConstant.DOT_STRING + simpleName);
  if (reportFileFolder != null && reportFileFolder.exists()) {
    File repListFile=new File(ReportHelper.getOutputFolderNameDefault((IFolder)reportFile.getParent(),simpleName) + File.separator + REPORT_LIST);
    List<ReportListParameters> repList=new ArrayList<ReportListParameters>();
    IResource[] members=reportFileFolder.members();
    for (    IResource res : members) {
      if (res.getType() == IResource.FILE) {
        IFile repFile=(IFile)res;
        repList.add(buildRepListParams(repFile.getName(),repFile.getRawLocation().toOSString(),String.valueOf(repFile.getModificationStamp())));
      }
    }
    saveReportListFile(repListFile,repList);
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "initRepListFile".
 * @param reportFile
 * @throws Exception
 * @deprecated
 */
@Deprecated public static void initRepListFile(IFile reportFile) throws Exception {
  String reportFileName=reportFile.getName();
  String simpleName=getSimpleName(reportFileName);
  if (simpleName == null) {
    return;
  }
  IFolder reportFileFolder=((IFolder)reportFile.getParent()).getFolder(PluginConstant.DOT_STRING + simpleName);
  if (reportFileFolder != null && reportFileFolder.exists()) {
    File repListFile=new File(ReportHelper.getOutputFolderNameDefault((IFolder)reportFile.getParent(),simpleName) + File.separator + REPORT_LIST);
    List<ReportListParameters> repList=new ArrayList<ReportListParameters>();
    IResource[] members=reportFileFolder.members();
    for (    IResource res : members) {
      if (res.getType() == IResource.FILE) {
        IFile repFile=(IFile)res;
        repList.add(buildRepListParams(repFile.getName(),repFile.getRawLocation().toOSString(),String.valueOf(repFile.getModificationStamp())));
      }
    }
    saveReportListFile(repListFile,repList);
  }
}
Program: 137859
Project: 137859
Buggy source:
/** 
 * build RepositoryNode(Analysis) children according to IResource array.
 * @param analyses
 * @return
 */
private List<IRepositoryNode> buildChildrenAnalysis(List<Analysis> analyses){
  List<IRepositoryNode> nodes=new ArrayList<IRepositoryNode>();
  for (  Analysis analysis : analyses) {
    Property anaEleProperty=PropertyHelper.getProperty(analysis);
    IRepositoryViewObject viewObject=null;
    try {
      viewObject=ProxyRepositoryFactory.getInstance().getLastVersion(anaEleProperty.getId());
    }
 catch (    Exception e) {
      log.error(e);
    }
    if (null == viewObject) {
      continue;
    }
    ReportAnalysisRepNode node=new ReportAnalysisRepNode(viewObject,this,ENodeType.TDQ_REPOSITORY_ELEMENT);
    node.setReport(this.getReport());
    node.setAnalysis(analysis);
    node.setId(this.getReport().getName() + analysis.getName());
    nodes.add(node);
  }
  this.getReportSubFolderChildren().clear();
  if (nodes.size() > 0) {
    this.getReportSubFolderChildren().addAll(nodes);
  }
  return this.getReportSubFolderChildren();
}

Fixed version (ground truth):
/** 
 * build RepositoryNode(Analysis) children according to IResource array.
 * @param analyses
 * @return
 */
private List<IRepositoryNode> buildChildrenAnalysis(List<Analysis> analyses){
  List<IRepositoryNode> nodes=new ArrayList<IRepositoryNode>();
  for (  Analysis analysis : analyses) {
    Property anaEleProperty=PropertyHelper.getProperty(analysis);
    IRepositoryViewObject viewObject=null;
    if (anaEleProperty != null) {
      try {
        viewObject=ProxyRepositoryFactory.getInstance().getLastVersion(anaEleProperty.getId());
      }
 catch (      Exception e) {
        log.error(e);
      }
    }
 else {
      log.error("String_Node_Str" + analysis.getName() + "String_Node_Str");
    }
    if (null == viewObject) {
      continue;
    }
    ReportAnalysisRepNode node=new ReportAnalysisRepNode(viewObject,this,ENodeType.TDQ_REPOSITORY_ELEMENT);
    node.setReport(this.getReport());
    node.setAnalysis(analysis);
    node.setId(this.getReport().getName() + analysis.getName());
    nodes.add(node);
  }
  this.getReportSubFolderChildren().clear();
  if (nodes.size() > 0) {
    this.getReportSubFolderChildren().addAll(nodes);
  }
  return this.getReportSubFolderChildren();
}
Program: 137860
Project: 137860
Buggy source:
@Override public List<IRepositoryNode> getChildren(){
  if (this.getReport() != null) {
    try {
      if (ReportSubFolderType.ANALYSIS.equals(getReportSubFolderType())) {
        buildChildrenAnalysis(ReportHelper.getAnalyses(this.getReport()));
      }
 else       if (ReportSubFolderType.GENERATED_DOCS.equals(getReportSubFolderType())) {
        IResource[] repFiles=ReportUtils.getReportListFiles(ResourceFileMap.findCorrespondingFile(this.getReport()));
        buildChildrenReportFile(repFiles);
      }
    }
 catch (    Exception e) {
      log.warn(e,e);
    }
    return filterResultsIfAny(this.getReportSubFolderChildren());
  }
 else {
    return filterResultsIfAny(super.getChildren());
  }
}

Fixed version (ground truth):
@Override public List<IRepositoryNode> getChildren(){
  if (this.getReport() != null) {
    try {
      if (ReportSubFolderType.ANALYSIS.equals(getReportSubFolderType())) {
        buildChildrenAnalysis(ReportHelper.getAnalyses(this.getReport()));
      }
 else       if (ReportSubFolderType.GENERATED_DOCS.equals(getReportSubFolderType())) {
        IResource[] repFiles=ReportUtils.getReportGeneratedDocs(ResourceFileMap.findCorrespondingFile(this.getReport()));
        buildChildrenReportFile(repFiles);
      }
    }
 catch (    Exception e) {
      log.warn(e,e);
    }
    return filterResultsIfAny(this.getReportSubFolderChildren());
  }
 else {
    return filterResultsIfAny(super.getChildren());
  }
}
Program: 137861
Project: 137861
Buggy source:
public boolean isVirtualFolder(){
  return this.getReport() != null;
}

Fixed version (ground truth):
@Override public boolean isVirtualFolder(){
  return this.getReport() != null;
}
Program: 137862
Project: 137862
Buggy source:
public ReturnCode save(Item item,boolean careDependency){
  TDQReportItem repItem=(TDQReportItem)item;
  Report report=repItem.getReport();
  return careDependency ? saveWithDependencies(repItem,report) : saveWithoutDependencies(repItem,report);
}

Fixed version (ground truth):
@Override public ReturnCode save(Item item,boolean careDependency){
  TDQReportItem repItem=(TDQReportItem)item;
  Report report=repItem.getReport();
  return careDependency ? saveWithDependencies(repItem,report) : saveWithoutDependencies(repItem,report);
}
Program: 137867
Project: 137867
Buggy source:
/** 
 * DOC talend Comment method "checkEmptyError".
 * @param obj
 * @param index
 */
private void checkEmptyError(String[] values){
  if (hasEmptyRow) {
    return;
  }
  try {
    String[] headers=reader.getHeaders();
    for (int index=0; index < headers.length; index++) {
      String header=headers[index];
      String value=values[index];
      if (isNotEmpty(value)) {
        if (isRegEx(index)) {
          emptyError=false;
        }
 else         if (PatternToExcelEnum.Category.getLiteral().equalsIgnoreCase(header)) {
          emptyError=false;
        }
 else         if (PatternToExcelEnum.JavaClassName.getLiteral().equalsIgnoreCase(header)) {
          emptyError=false;
        }
 else         if (PatternToExcelEnum.JavaJarPath.getLiteral().equalsIgnoreCase(header)) {
          emptyError=false;
        }
      }
      if (isLastOne(index,headers.length)) {
        if (emptyError) {
          hasEmptyRow=true;
        }
      }
    }
  }
 catch (  IOException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
/** 
 * DOC talend Comment method "checkEmptyError".
 * @param obj
 * @param index
 */
private void checkEmptyError(String[] values){
  if (hasEmptyRow) {
    return;
  }
  try {
    String[] headers=reader.getHeaders();
    if (values.length < headers.length) {
      String errorRow="String_Node_Str";
      for (      String value : values) {
        errorRow+=value;
      }
      log.error("String_Node_Str" + errorRow);
      return;
    }
    for (int index=0; index < headers.length; index++) {
      String header=headers[index];
      String value=values[index];
      if (isNotEmpty(value)) {
        if (isRegEx(index)) {
          emptyError=false;
        }
 else         if (PatternToExcelEnum.Category.getLiteral().equalsIgnoreCase(header)) {
          emptyError=false;
        }
 else         if (PatternToExcelEnum.JavaClassName.getLiteral().equalsIgnoreCase(header)) {
          emptyError=false;
        }
 else         if (PatternToExcelEnum.JavaJarPath.getLiteral().equalsIgnoreCase(header)) {
          emptyError=false;
        }
      }
      if (isLastOne(index,headers.length)) {
        if (emptyError) {
          hasEmptyRow=true;
        }
      }
    }
  }
 catch (  IOException e) {
    log.error(e,e);
  }
}
Program: 137868
Project: 137868
Buggy source:
@Override public Map<String,List<String>> getRoutineAndJars(){
  return null;
}

Fixed version (ground truth):
@Override public Map<String,List<LibraryInfo>> getRoutineAndJars(){
  return null;
}