nus-yam/ex-repair huggingface dataset:
Program: 137057
Project: 137057
Buggy source:
/** 
 * DOC qiongli Comment method "initCsvReader".
 * @param csvReader
 * @param description
 */
private void initCsvReader(CSVReader csvReader,IProcessDescription description){
  String rowSep=description.getRowSeparator();
  if (!rowSep.equals(FileUtils.ROW_SEPARATOR_N) && !rowSep.equals(FileUtils.ROW_SEPARATOR_R)) {
    csvReader.setSeparator(ParameterUtil.trimParameter(rowSep).charAt(0));
  }
  csvReader.setSkipEmptyRecords(true);
  String textEnclosure=description.getTextEnclosure();
  if (!textEnclosure.equals("String_Node_Str") && textEnclosure.length() > 0) {
    csvReader.setQuoteChar(ParameterUtil.trimParameter(textEnclosure).charAt(0));
  }
 else {
    csvReader.setQuoteChar(FileUtils.QUOTECHAR_NOTVALID);
  }
  String escapeChar=description.getEscapeCharacter();
  if (escapeChar == null || escapeChar.equals(FileUtils.ESCAPECHAR1) || escapeChar.equals(FileUtils.ESCAPECHAR2)) {
    csvReader.setEscapeChar('\\');
  }
 else {
    csvReader.setEscapeChar(FileUtils.TEXT_QUAL);
  }
}

Fixed version (ground truth):
/** 
 * DOC qiongli Comment method "initCsvReader".
 * @param csvReader
 * @param description
 */
private void initCsvReader(CSVReader csvReader,IProcessDescription description){
  String rowSep=description.getRowSeparator();
  if (!rowSep.equals(FileUtils.ROW_SEPARATOR_N) && !rowSep.equals(FileUtils.ROW_SEPARATOR_R)) {
    csvReader.setSeparator(ParameterUtil.trimParameter(rowSep).charAt(0));
  }
  csvReader.setSkipEmptyRecords(true);
  String textEnclosure=description.getTextEnclosure();
  if (!textEnclosure.equals("String_Node_Str") && textEnclosure.length() > 0) {
    csvReader.setQuoteChar(ParameterUtil.trimParameter(textEnclosure).charAt(0));
  }
  String escapeChar=description.getEscapeCharacter();
  if (escapeChar == null || escapeChar.equals(FileUtils.ESCAPECHAR1) || escapeChar.equals(FileUtils.ESCAPECHAR2)) {
    csvReader.setEscapeChar('\\');
  }
 else {
    csvReader.setEscapeChar(FileUtils.TEXT_QUAL);
  }
}
Program: 137058
Project: 137058
Buggy source:
/** 
 * DOC yyin Comment method "createCSVReader".
 * @param csvFileToIndex
 * @return
 * @throws UnsupportedEncodingException
 * @throws FileNotFoundException
 * @throws IOException
 */
private CSVReader createCSVReader(String csvFileToIndex,char seperator) throws UnsupportedEncodingException, FileNotFoundException, IOException {
  CSVReader csvReader=new CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(csvFileToIndex.toString()),"String_Node_Str")),seperator);
  csvReader.setQuoteChar('"');
  csvReader.readNext();
  return csvReader;
}

Fixed version (ground truth):
/** 
 * DOC yyin Comment method "createCSVReader".
 * @param csvFileToIndex
 * @return
 * @throws UnsupportedEncodingException
 * @throws FileNotFoundException
 * @throws IOException
 */
private CSVReader createCSVReader(String csvFileToIndex,char seperator) throws UnsupportedEncodingException, FileNotFoundException, IOException {
  CSVReader csvReader=new CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(csvFileToIndex.toString()),"String_Node_Str")),seperator);
  csvReader.setQuoteChar('\"');
  csvReader.readNext();
  return csvReader;
}
Program: 137060
Project: 137060
Buggy source:
/** 
 * DOC qiongli Comment method "initializeCsvReader".
 * @param csvReader
 * @param connection
 */
public static void initializeCsvReader(DelimitedFileConnection delimitedFileconnection,CSVReader csvReader){
  String rowSep=JavaSqlFactory.getRowSeparatorValue(delimitedFileconnection);
  if (rowSep != null && !rowSep.equals(ROW_SEPARATOR_N) && !rowSep.equals(ROW_SEPARATOR_R)) {
    csvReader.setSeparator(ParameterUtil.trimParameter(rowSep).charAt(0));
  }
  csvReader.setSkipEmptyRecords(true);
  String textEnclosure=delimitedFileconnection.getTextEnclosure();
  if (textEnclosure != null && textEnclosure.length() > 0) {
    csvReader.setQuoteChar(ParameterUtil.trimParameter(textEnclosure).charAt(0));
  }
 else {
    csvReader.setQuoteChar(QUOTECHAR_NOTVALID);
  }
  String escapeChar=delimitedFileconnection.getEscapeChar();
  if (escapeChar == null || escapeChar.equals(ESCAPECHAR1) || escapeChar.equals(ESCAPECHAR2)) {
    csvReader.setEscapeChar(ESCAPE_CHAR);
  }
}

Fixed version (ground truth):
/** 
 * DOC qiongli Comment method "initializeCsvReader".
 * @param csvReader
 * @param connection
 */
public static void initializeCsvReader(DelimitedFileConnection delimitedFileconnection,CSVReader csvReader){
  String rowSep=JavaSqlFactory.getRowSeparatorValue(delimitedFileconnection);
  if (rowSep != null && !rowSep.equals(ROW_SEPARATOR_N) && !rowSep.equals(ROW_SEPARATOR_R)) {
    csvReader.setSeparator(ParameterUtil.trimParameter(rowSep).charAt(0));
  }
  csvReader.setSkipEmptyRecords(true);
  String textEnclosure=delimitedFileconnection.getTextEnclosure();
  if (textEnclosure != null && textEnclosure.length() > 0) {
    csvReader.setQuoteChar(ParameterUtil.trimParameter(textEnclosure).charAt(0));
  }
  String escapeChar=delimitedFileconnection.getEscapeChar();
  if (escapeChar == null || escapeChar.equals(ESCAPECHAR1) || escapeChar.equals(ESCAPECHAR2)) {
    csvReader.setEscapeChar(ESCAPE_CHAR);
  }
}
Program: 137061
Project: 137061
Buggy source:
private void useCsvReader(CSVReader csvReader,File file,DelimitedFileConnection dfCon,List<ModelElement> analysisElementList) throws Exception {
  FileUtils.initializeCsvReader(dfCon,csvReader);
  long currentRecord=0;
  int limitValue=JavaSqlFactory.getLimitValue(dfCon);
  int headValue=JavaSqlFactory.getHeadValue(dfCon);
  for (int i=0; i < headValue && csvReader.readNext(); i++) {
  }
  while (csvReader.readNext()) {
    currentRecord=csvReader.getCurrentRecord();
    if (!continueRun() || limitValue != -1 && currentRecord > limitValue - 1) {
      break;
    }
    if (dfCon.isFirstLineCaption() && currentRecord == 0) {
      continue;
    }
    String[] rowValues=csvReader.getValues();
    this.orgnizeObjectsToHandel(dfCon.getFilePath(),rowValues,currentRecord + 1,analysisElementList,dfCon.getFieldSeparatorValue());
  }
}

Fixed version (ground truth):
private void useCsvReader(CSVReader csvReader,File file,DelimitedFileConnection dfCon,List<ModelElement> analysisElementList) throws Exception {
  FileUtils.initializeCsvReader(dfCon,csvReader);
  long currentRecord=0;
  int limitValue=JavaSqlFactory.getLimitValue(dfCon);
  int headValue=JavaSqlFactory.getHeadValue(dfCon);
  for (int i=0; i < headValue && csvReader.readNext(); i++) {
  }
  while (csvReader.readNext()) {
    currentRecord++;
    if (!continueRun() || limitValue != -1 && currentRecord > limitValue) {
      break;
    }
    String[] rowValues=csvReader.getValues();
    this.orgnizeObjectsToHandel(dfCon.getFilePath(),rowValues,currentRecord,analysisElementList,dfCon.getFieldSeparatorValue());
  }
}
Program: 137062
Project: 137062
Buggy source:
private void useCsvReader(File file,DelimitedFileConnection dfCon,List<ModelElement> analysisElementList,List<MetadataColumn> columnElementList,EMap<Indicator,AnalyzedDataSet> indicToRowMap){
  int limitValue=JavaSqlFactory.getLimitValue(delimitedFileconnection);
  int headValue=JavaSqlFactory.getHeadValue(delimitedFileconnection);
  CSVReader csvReader=null;
  try {
    csvReader=FileUtils.createCsvReader(file,delimitedFileconnection);
    FileUtils.initializeCsvReader(delimitedFileconnection,csvReader);
    for (int i=0; i < headValue && csvReader.readNext(); i++) {
    }
    String[] rowValues=null;
    long currentRecord=0;
    while (csvReader.readNext()) {
      currentRecord=csvReader.getCurrentRecord();
      if (!continueRun() || limitValue != -1 && currentRecord > limitValue - 1) {
        break;
      }
      if (delimitedFileconnection.isFirstLineCaption() && currentRecord == 0) {
        continue;
      }
      rowValues=csvReader.getValues();
      handleByARow(rowValues,currentRecord + 1,analysisElementList,columnElementList,indicToRowMap);
    }
  }
 catch (  IOException e) {
    log.error(e,e);
  }
 finally {
    if (csvReader != null) {
      try {
        csvReader.close();
      }
 catch (      IOException e) {
        log.error(e,e);
      }
    }
  }
}

Fixed version (ground truth):
private void useCsvReader(File file,DelimitedFileConnection dfCon,List<ModelElement> analysisElementList,List<MetadataColumn> columnElementList,EMap<Indicator,AnalyzedDataSet> indicToRowMap){
  int limitValue=JavaSqlFactory.getLimitValue(delimitedFileconnection);
  int headValue=JavaSqlFactory.getHeadValue(delimitedFileconnection);
  CSVReader csvReader=null;
  try {
    csvReader=FileUtils.createCsvReader(file,delimitedFileconnection);
    FileUtils.initializeCsvReader(delimitedFileconnection,csvReader);
    for (int i=0; i < headValue && csvReader.readNext(); i++) {
    }
    String[] rowValues=null;
    long currentRecord=0;
    while (csvReader.readNext()) {
      currentRecord++;
      if (!continueRun() || limitValue != -1 && currentRecord > limitValue) {
        break;
      }
      rowValues=csvReader.getValues();
      handleByARow(rowValues,currentRecord,analysisElementList,columnElementList,indicToRowMap);
    }
  }
 catch (  IOException e) {
    log.error(e,e);
  }
 finally {
    if (csvReader != null) {
      try {
        csvReader.close();
      }
 catch (      IOException e) {
        log.error(e,e);
      }
    }
  }
}
Program: 137064
Project: 137064
Buggy source:
/** 
 * DOC qiongli Comment method "initCsvReader".
 * @param csvReader
 * @param description
 */
private void initCsvReader(CSVReader csvReader,IProcessDescription description){
  String rowSep=description.getRowSeparator();
  if (!rowSep.equals(FileUtils.ROW_SEPARATOR_N) && !rowSep.equals(FileUtils.ROW_SEPARATOR_R)) {
    csvReader.setSeparator(ParameterUtil.trimParameter(rowSep).charAt(0));
  }
  csvReader.setSkipEmptyRecords(true);
  String textEnclosure=description.getTextEnclosure();
  if (!textEnclosure.equals("String_Node_Str") && textEnclosure.length() > 0) {
    csvReader.setQuoteChar(ParameterUtil.trimParameter(textEnclosure).charAt(0));
  }
 else {
    csvReader.setQuoteChar(FileUtils.QUOTECHAR_NOTVALID);
  }
  String escapeChar=description.getEscapeCharacter();
  if (escapeChar == null || escapeChar.equals(FileUtils.ESCAPECHAR1) || escapeChar.equals(FileUtils.ESCAPECHAR2)) {
    csvReader.setEscapeChar('\\');
  }
 else {
    csvReader.setEscapeChar(FileUtils.TEXT_QUAL);
  }
}

Fixed version (ground truth):
/** 
 * DOC qiongli Comment method "initCsvReader".
 * @param csvReader
 * @param description
 */
private void initCsvReader(CSVReader csvReader,IProcessDescription description){
  String rowSep=description.getRowSeparator();
  if (!rowSep.equals(FileUtils.ROW_SEPARATOR_N) && !rowSep.equals(FileUtils.ROW_SEPARATOR_R)) {
    csvReader.setSeparator(ParameterUtil.trimParameter(rowSep).charAt(0));
  }
  csvReader.setSkipEmptyRecords(true);
  String textEnclosure=description.getTextEnclosure();
  if (!textEnclosure.equals("String_Node_Str") && textEnclosure.length() > 0) {
    csvReader.setQuoteChar(ParameterUtil.trimParameter(textEnclosure).charAt(0));
  }
  String escapeChar=description.getEscapeCharacter();
  if (escapeChar == null || escapeChar.equals(FileUtils.ESCAPECHAR1) || escapeChar.equals(FileUtils.ESCAPECHAR2)) {
    csvReader.setEscapeChar('\\');
  }
 else {
    csvReader.setEscapeChar(FileUtils.TEXT_QUAL);
  }
}
Program: 137065
Project: 137065
Buggy source:
/** 
 * DOC yyin Comment method "createCSVReader".
 * @param csvFileToIndex
 * @return
 * @throws UnsupportedEncodingException
 * @throws FileNotFoundException
 * @throws IOException
 */
private CSVReader createCSVReader(String csvFileToIndex,char seperator) throws UnsupportedEncodingException, FileNotFoundException, IOException {
  CSVReader csvReader=new CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(csvFileToIndex.toString()),"String_Node_Str")),seperator);
  csvReader.setQuoteChar('"');
  csvReader.readNext();
  return csvReader;
}

Fixed version (ground truth):
/** 
 * DOC yyin Comment method "createCSVReader".
 * @param csvFileToIndex
 * @return
 * @throws UnsupportedEncodingException
 * @throws FileNotFoundException
 * @throws IOException
 */
private CSVReader createCSVReader(String csvFileToIndex,char seperator) throws UnsupportedEncodingException, FileNotFoundException, IOException {
  CSVReader csvReader=new CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(csvFileToIndex.toString()),"String_Node_Str")),seperator);
  csvReader.setQuoteChar('\"');
  csvReader.readNext();
  return csvReader;
}
Program: 137066
Project: 137066
Buggy source:
/** 
 * Test method for  {@link org.talend.dataquality.record.linkage.ui.composite.utils.MatchRuleAnlaysisUtils#sortDataByColumn(org.talend.dataquality.record.linkage.ui.composite.table.SortState,java.util.List,java.util.List)}.
 */
public void testSortDataByColumn_StringAsDouble(){
  sortState.getNextSortDirection();
  sortState.setGrpSizeIndex(0);
  String[] array={"String_Node_Str"};
  String[] array2={"String_Node_Str"};
  String[] array4={"String_Node_Str"};
  String[] array3={"String_Node_Str"};
  sortData.add(array);
  sortData.add(array2);
  sortData.add(array4);
  sortData.add(array3);
  sqlDataType.setName("String_Node_Str");
  sqlDataType.setJavaDataType(Types.REAL);
  List<Object[]> sortResult=MatchRuleAnlaysisUtils.sortDataByColumn(sortState,sortData,columns);
  Assert.assertEquals(4,sortResult.size());
  Assert.assertEquals(((String)sortResult.get(0)[0]).compareTo(array[0]),0);
  Assert.assertEquals(((String)sortResult.get(1)[0]).compareTo(array4[0]),0);
  Assert.assertEquals(((String)sortResult.get(2)[0]).compareTo(array3[0]),0);
  sortState.setSelectedColumnIndex(0);
  sortState.getNextSortDirection();
  sortResult=MatchRuleAnlaysisUtils.sortDataByColumn(sortState,sortData,columns);
  Assert.assertEquals(((String)sortResult.get(0)[0]).compareTo(array2[0]),0);
  Assert.assertEquals(((String)sortResult.get(1)[0]).compareTo(array3[0]),0);
  Assert.assertEquals(((String)sortResult.get(2)[0]).compareTo(array4[0]),0);
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.dataquality.record.linkage.ui.composite.utils.MatchRuleAnlaysisUtils#sortDataByColumn(org.talend.dataquality.record.linkage.ui.composite.table.SortState,java.util.List,java.util.List)}.
 */
public void testSortDataByColumn_StringAsDouble(){
  sortState.getNextSortDirection();
  String[] array={"String_Node_Str"};
  String[] array2={"String_Node_Str"};
  String[] array4={"String_Node_Str"};
  String[] array3={"String_Node_Str"};
  sortData.add(array);
  sortData.add(array2);
  sortData.add(array4);
  sortData.add(array3);
  sqlDataType.setName("String_Node_Str");
  sqlDataType.setJavaDataType(Types.REAL);
  List<Object[]> sortResult=MatchRuleAnlaysisUtils.sortDataByColumn(sortState,sortData,columns);
  Assert.assertEquals(4,sortResult.size());
  Assert.assertEquals(((String)sortResult.get(0)[0]).compareTo(array[0]),0);
  Assert.assertEquals(((String)sortResult.get(1)[0]).compareTo(array4[0]),0);
  Assert.assertEquals(((String)sortResult.get(2)[0]).compareTo(array3[0]),0);
  sortState.setSelectedColumnIndex(0);
  sortState.getNextSortDirection();
  sortResult=MatchRuleAnlaysisUtils.sortDataByColumn(sortState,sortData,columns);
  Assert.assertEquals(((String)sortResult.get(0)[0]).compareTo(array2[0]),0);
  Assert.assertEquals(((String)sortResult.get(1)[0]).compareTo(array3[0]),0);
  Assert.assertEquals(((String)sortResult.get(2)[0]).compareTo(array4[0]),0);
}
Program: 137067
Project: 137067
Buggy source:
/** 
 * DOC yyin Comment method "setUp".
 * @throws java.lang.Exception
 */
protected void setUp() throws Exception {
  sortState=new SortState();
  sortState.setSelectedColumnIndex(0);
  sortState.setSelectedColumnName("String_Node_Str");
  sortData=new ArrayList<Object[]>();
  columns=new ArrayList<ModelElement>();
  tdColumn.setSqlDataType(sqlDataType);
  columns.add(tdColumn);
}

Fixed version (ground truth):
/** 
 * DOC yyin Comment method "setUp".
 * @throws java.lang.Exception
 */
@Override protected void setUp() throws Exception {
  sortState=new SortState(0);
  sortState.setSelectedColumnIndex(0);
  sortState.setSelectedColumnName("String_Node_Str");
  sortData=new ArrayList<Object[]>();
  columns=new ArrayList<ModelElement>();
  tdColumn.setSqlDataType(sqlDataType);
  columns.add(tdColumn);
}
Program: 137068
Project: 137068
Buggy source:
/** 
 * Test method for  {@link org.talend.dataquality.record.linkage.ui.composite.utils.MatchRuleAnlaysisUtils#sortDataByColumn(org.talend.dataquality.record.linkage.ui.composite.table.SortState,java.util.List,java.util.List)}.
 */
public void testSortDataByColumn_GroupSize(){
  sortState.getNextSortDirection();
  sortState.setGrpSizeIndex(0);
  String[] array={"String_Node_Str"};
  String[] array2={"String_Node_Str"};
  String[] array4={"String_Node_Str"};
  String[] array3={"String_Node_Str"};
  sortData.add(array);
  sortData.add(array2);
  sortData.add(array4);
  sortData.add(array3);
  sqlDataType.setName("String_Node_Str");
  sqlDataType.setJavaDataType(Types.VARCHAR);
  List<Object[]> sortResult=MatchRuleAnlaysisUtils.sortDataByColumn(sortState,sortData,columns);
  Assert.assertEquals(4,sortResult.size());
  Assert.assertEquals(((String)sortResult.get(0)[0]).compareTo(array[0]),0);
  Assert.assertEquals(((String)sortResult.get(1)[0]).compareTo(array4[0]),0);
  Assert.assertEquals(((String)sortResult.get(2)[0]).compareTo(array3[0]),0);
  sortState.setSelectedColumnIndex(0);
  sortState.getNextSortDirection();
  sortResult=MatchRuleAnlaysisUtils.sortDataByColumn(sortState,sortData,columns);
  Assert.assertEquals(((String)sortResult.get(0)[0]).compareTo(array2[0]),0);
  Assert.assertEquals(((String)sortResult.get(1)[0]).compareTo(array3[0]),0);
  Assert.assertEquals(((String)sortResult.get(2)[0]).compareTo(array4[0]),0);
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.dataquality.record.linkage.ui.composite.utils.MatchRuleAnlaysisUtils#sortDataByColumn(org.talend.dataquality.record.linkage.ui.composite.table.SortState,java.util.List,java.util.List)}.
 */
public void testSortDataByColumn_GroupSize(){
  sortState.getNextSortDirection();
  String[] array={"String_Node_Str"};
  String[] array2={"String_Node_Str"};
  String[] array4={"String_Node_Str"};
  String[] array3={"String_Node_Str"};
  sortData.add(array);
  sortData.add(array2);
  sortData.add(array4);
  sortData.add(array3);
  sqlDataType.setName("String_Node_Str");
  sqlDataType.setJavaDataType(Types.VARCHAR);
  List<Object[]> sortResult=MatchRuleAnlaysisUtils.sortDataByColumn(sortState,sortData,columns);
  Assert.assertEquals(4,sortResult.size());
  Assert.assertEquals(((String)sortResult.get(0)[0]).compareTo(array[0]),0);
  Assert.assertEquals(((String)sortResult.get(1)[0]).compareTo(array4[0]),0);
  Assert.assertEquals(((String)sortResult.get(2)[0]).compareTo(array3[0]),0);
  sortState.setSelectedColumnIndex(0);
  sortState.getNextSortDirection();
  sortResult=MatchRuleAnlaysisUtils.sortDataByColumn(sortState,sortData,columns);
  Assert.assertEquals(((String)sortResult.get(0)[0]).compareTo(array2[0]),0);
  Assert.assertEquals(((String)sortResult.get(1)[0]).compareTo(array3[0]),0);
  Assert.assertEquals(((String)sortResult.get(2)[0]).compareTo(array4[0]),0);
}
Program: 137069
Project: 137069
Buggy source:
/** 
 * DOC yyin Comment method "tearDown".
 * @throws java.lang.Exception
 */
protected void tearDown() throws Exception {
  sortData=null;
  columns=null;
}

Fixed version (ground truth):
/** 
 * DOC yyin Comment method "tearDown".
 * @throws java.lang.Exception
 */
@Override protected void tearDown() throws Exception {
  sortData=null;
  columns=null;
}
Program: 137070
Project: 137070
Buggy source:
public static <K,V>PageResult<Object[]> createPageByValue(DBValueMap<K,V> db,PageableController controller,SortProcessor processor,Map<Long,K> indexMap,long itemsSize,ColumnFilter filter){
  long totalSize=itemsSize;
  long pageSize=controller.getPageSize();
  long pageIndex=controller.getPageOffset();
  long fromIndex=pageIndex;
  long toIndex=pageIndex + pageSize;
  if (toIndex > totalSize) {
    toIndex=totalSize;
  }
  List<Object[]> content=((DBMap<K,V>)db).subValueList(fromIndex,toIndex,indexMap);
  if (filter != null) {
    content=filter.filterArray(content);
  }
  return new PageResult<Object[]>(content,content.size());
}

Fixed version (ground truth):
public static <K,V>PageResult<Object[]> createPageByValue(DBValueMap<K,V> db,PageableController controller,Map<Long,K> indexMap,long itemsSize,ColumnFilter filter){
  long totalSize=itemsSize;
  long pageSize=controller.getPageSize();
  long pageIndex=controller.getPageOffset();
  long fromIndex=pageIndex;
  long toIndex=pageIndex + pageSize;
  if (toIndex > totalSize) {
    toIndex=totalSize;
  }
  List<Object[]> content=((DBMap<K,V>)db).subValueList(fromIndex,toIndex,indexMap);
  if (filter != null) {
    content=filter.filterArray(content);
  }
  return new PageResult<Object[]>(content,content.size());
}
Program: 137071
Project: 137071
Buggy source:
public static <T>PageResult<Object[]> createPage(AbstractDB<T> db,PageableController controller,SortProcessor processor,Map<Long,T> indexMap,long itemsSize,DataValidation dataValidator){
  long totalSize=itemsSize;
  long pageSize=controller.getPageSize();
  long pageIndex=controller.getPageOffset();
  long fromIndex=pageIndex;
  long toIndex=pageIndex + pageSize;
  if (toIndex > totalSize) {
    toIndex=totalSize;
  }
  List<Object[]> content=db.subList(fromIndex,toIndex,indexMap,dataValidator);
  if (content.size() < pageSize) {
    totalSize=content.size();
  }
  return new PageResult<Object[]>(content,totalSize);
}

Fixed version (ground truth):
public static <T>PageResult<Object[]> createPage(AbstractDB<T> db,PageableController controller,Map<Long,T> indexMap,long itemsSize,ColumnFilter filter){
  long totalSize=itemsSize;
  long pageSize=controller.getPageSize();
  long pageIndex=controller.getPageOffset();
  long fromIndex=pageIndex;
  long toIndex=pageIndex + pageSize;
  if (toIndex > totalSize) {
    toIndex=totalSize;
  }
  List<Object[]> content=db.subList(fromIndex,toIndex,indexMap);
  if (filter != null) {
    content=filter.filterArray(content);
  }
  if (content.size() < totalSize) {
    totalSize=content.size();
  }
  return new PageResult<Object[]>(content,totalSize);
}
Program: 137072
Project: 137072
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public PageResult<Object[]> loadPage(PageableController controller){
  if (dataValidator == null) {
    if (DBValueMap.class.isInstance(db)) {
      return MapDBPageListHelper.createPageByValue((DBValueMap)db,controller,indexMap,itemsSize,columnFilter);
    }
    return MapDBPageListHelper.createPage(db,controller,indexMap,itemsSize,columnFilter);
  }
 else {
    return MapDBPageListHelper.createPage(db,controller,indexMap,itemsSize,dataValidator);
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public PageResult<Object[]> loadPage(PageableController controller){
  if (dataValidator == null) {
    if (DBValueMap.class.isInstance(db)) {
      return MapDBPageListHelper.createPageByValue((DBValueMap)db,controller,indexMap,itemsSize,columnFilter);
    }
 else {
      return MapDBPageListHelper.createPage(db,controller,indexMap,itemsSize,columnFilter);
    }
  }
 else {
    return MapDBPageListHelper.createPage(db,controller,indexMap,itemsSize,dataValidator);
  }
}
Program: 137075
Project: 137075
Buggy source:
/** 
 * DataSet is used to be the input on the export wizard. unchecked is for the type of mapDB else will have a warning
 * @param controller
 * @return
 */
@SuppressWarnings("String_Node_Str") public Object getDataSetForMapDB(int pageSize){
  List<String> columnElementList=filterAdaptColumnHeader();
  columnHeader=new String[columnElementList.size()];
  int headerIndex=0;
  for (  String columnElement : columnElementList) {
    columnHeader[headerIndex++]=columnElement;
  }
  AbstractDB<?> mapDB=getMapDB();
  AnalysisType analysisType=analysis.getParameters().getAnalysisType();
  if (AnalysisType.COLUMN_SET == analysisType) {
    Long size=getCurrentIndicatorResultSize();
    if (ColumnSetDBMap.class.isInstance(mapDB)) {
      return SqlExplorerUtils.getDefault().createMapDBColumnSetDataSet(columnHeader,(ColumnSetDBMap)mapDB,size,currIndicator,pageSize);
    }
  }
  if (DBSet.class.isInstance(mapDB)) {
    return SqlExplorerUtils.getDefault().createMapDBSetDataSet(columnHeader,(DBSet<Object>)mapDB,pageSize);
  }
 else {
    ColumnFilter columnFilter=getColumnFilter();
    Long itemSize=getItemSize(mapDB);
    return SqlExplorerUtils.getDefault().createMapDBDataSet(columnHeader,(DBMap<Object,List<Object>>)mapDB,pageSize,columnFilter,itemSize);
  }
}

Fixed version (ground truth):
/** 
 * DataSet is used to be the input on the export wizard. unchecked is for the type of mapDB else will have a warning
 * @param controller
 * @return
 */
@SuppressWarnings("String_Node_Str") public Object getDataSetForMapDB(int pageSize){
  List<String> columnElementList=filterAdaptColumnHeader();
  columnHeader=new String[columnElementList.size()];
  int headerIndex=0;
  for (  String columnElement : columnElementList) {
    columnHeader[headerIndex++]=columnElement;
  }
  AbstractDB<?> mapDB=DrillDownUtils.getMapDB(dataEntity,analysis);
  AnalysisType analysisType=analysis.getParameters().getAnalysisType();
  if (AnalysisType.COLUMN_SET == analysisType) {
    Long size=getCurrentIndicatorResultSize();
    if (ColumnSetDBMap.class.isInstance(mapDB)) {
      return SqlExplorerUtils.getDefault().createMapDBColumnSetDataSet(columnHeader,(ColumnSetDBMap)mapDB,size,currIndicator,pageSize);
    }
  }
  if (DBSet.class.isInstance(mapDB)) {
    return SqlExplorerUtils.getDefault().createMapDBSetDataSet(columnHeader,(DBSet<Object>)mapDB,pageSize);
  }
 else {
    ColumnFilter columnFilter=getColumnFilter();
    Long itemSize=getItemSize(mapDB);
    return SqlExplorerUtils.getDefault().createMapDBDataSet(columnHeader,(DBMap<Object,List<Object>>)mapDB,pageSize,columnFilter,itemSize);
  }
}
Program: 137079
Project: 137079
Buggy source:
/** 
 * Test method for  {@link org.talend.dataquality.matching.date.pattern.DatePatternRetriever#handle(java.lang.String)}.
 * @throws URISyntaxException
 * @throws IOException
 */
@Test public void testHandle() throws IOException, URISyntaxException {
  String expr="String_Node_Str";
  DatePatternRetriever dtr=new DatePatternRetriever();
  dtr.handle(expr);
  assertEquals(dtr.getModelMatchers().size(),0);
  ModelMatcher mm=new ModelMatcher("String_Node_Str","String_Node_Str");
  assertEquals(0,mm.getScore());
  dtr.getModelMatchers().add(mm);
  assertEquals(dtr.getModelMatchers().size(),1);
  dtr.handle(expr);
  assertEquals(1,mm.getScore());
  DatePatternRetriever patt=new DatePatternRetriever();
  File file=ResourceUtil.getFileFromResource(getClass(),"String_Node_Str");
  File filedates=ResourceUtil.getFileFromResource(getClass(),"String_Node_Str");
  patt.initModel2Regex(file);
  parseFile(filedates,patt);
  final int[] EXPECTED_SCORE={1,4,3,1,2,1,1,40,1};
  for (int i=0, j=0; i < patt.getModelMatchers().size(); i++) {
    ModelMatcher patternMatcher=patt.getModelMatchers().get(i);
    if (patternMatcher.getScore() > 0) {
      assertEquals(EXPECTED_SCORE[j],patternMatcher.getScore());
      j++;
    }
  }
  if (logger.isInfoEnabled()) {
    patt.showResults();
  }
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.dataquality.matching.date.pattern.DatePatternRetriever#handle(java.lang.String)}.
 * @throws URISyntaxException
 * @throws IOException
 */
@Test public void testHandle() throws IOException, URISyntaxException {
  String expr="String_Node_Str";
  DatePatternRetriever dtr=new DatePatternRetriever();
  dtr.handle(expr);
  assertEquals(dtr.getModelMatchers().size(),0);
  ModelMatcher mm=new ModelMatcher("String_Node_Str","String_Node_Str");
  assertEquals(0,mm.getScore());
  dtr.getModelMatchers().add(mm);
  assertEquals(dtr.getModelMatchers().size(),1);
  dtr.handle(expr);
  assertEquals(1,mm.getScore());
  DatePatternRetriever patt=new DatePatternRetriever();
  File file=ResourceUtil.getFileFromResource(getClass(),"String_Node_Str");
  File filedates=ResourceUtil.getFileFromResource(getClass(),"String_Node_Str");
  patt.initModel2Regex(file);
  parseFile(filedates,patt);
  final int[] EXPECTED_SCORE={1,4,1,2,1,1,40,1};
  for (int i=0, j=0; i < patt.getModelMatchers().size(); i++) {
    ModelMatcher patternMatcher=patt.getModelMatchers().get(i);
    if (patternMatcher.getScore() > 0) {
      assertEquals(EXPECTED_SCORE[j],patternMatcher.getScore());
      j++;
    }
  }
  if (logger.isInfoEnabled()) {
    patt.showResults();
  }
}
Program: 137080
Project: 137080
Buggy source:
@Override protected void initHeaders(){
  headers.add(MatchAnalysisConstant.BLOCKING_KEY_NAME);
  headers.add(MatchAnalysisConstant.PRECOLUMN);
  headers.add(MatchAnalysisConstant.PRE_ALGO);
  headers.add(MatchAnalysisConstant.PRE_VALUE);
  headers.add(MatchAnalysisConstant.KEY_ALGO);
  headers.add(MatchAnalysisConstant.KEY_VALUE);
  headers.add(MatchAnalysisConstant.POST_ALGO);
  headers.add(MatchAnalysisConstant.POST_VALUE);
}

Fixed version (ground truth):
@Override protected void initHeaders(){
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.BLOCKING_KEY_NAME));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.PRECOLUMN));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.PRE_ALGO));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.PRE_VALUE));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.KEY_ALGO));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.KEY_VALUE));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.POST_ALGO));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.POST_VALUE));
}
Program: 137081
Project: 137081
Buggy source:
@Override protected void initHeaders(){
  headers.add(MatchAnalysisConstant.DATA_TYPE);
  headers.add(MatchAnalysisConstant.FUNCTION);
  headers.add(MatchAnalysisConstant.PARAMETER);
}

Fixed version (ground truth):
@Override protected void initHeaders(){
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.DATA_TYPE));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.FUNCTION));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.PARAMETER));
}
Program: 137082
Project: 137082
Buggy source:
@Override protected void initHeaders(){
  headers.add(MatchAnalysisConstant.MATCH_KEY_NAME);
  if (isShowInputColumn) {
    headers.add(MatchAnalysisConstant.INPUT_COLUMN);
  }
  headers.add(MatchAnalysisConstant.MATCHING_TYPE);
  headers.add(MatchAnalysisConstant.CUSTOM_MATCHER);
  headers.add(MatchAnalysisConstant.THRESHOLD);
  headers.add(MatchAnalysisConstant.CONFIDENCE_WEIGHT);
  headers.add(MatchAnalysisConstant.HANDLE_NULL);
  headers.add(MatchAnalysisConstant.FUNCTION);
  headers.add(MatchAnalysisConstant.PARAMETER);
}

Fixed version (ground truth):
@Override protected void initHeaders(){
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.MATCH_KEY_NAME));
  if (isShowInputColumn) {
    headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.INPUT_COLUMN));
  }
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.MATCHING_TYPE));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.CUSTOM_MATCHER));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.THRESHOLD));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.CONFIDENCE_WEIGHT));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.HANDLE_NULL));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.FUNCTION));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.PARAMETER));
}
Program: 137083
Project: 137083
Buggy source:
/** 
 * DOC zshen Comment method "initHeaders".
 */
@Override protected void initHeaders(){
  headers.add(MatchAnalysisConstant.MATCH_KEY_NAME);
  headers.add(MatchAnalysisConstant.INPUT_COLUMN);
  headers.add(MatchAnalysisConstant.MATCHING_TYPE);
  headers.add(MatchAnalysisConstant.CUSTOM_MATCHER);
  headers.add(MatchAnalysisConstant.CONFIDENCE_WEIGHT);
  headers.add(MatchAnalysisConstant.HANDLE_NULL);
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "initHeaders".
 */
@Override protected void initHeaders(){
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.MATCH_KEY_NAME));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.INPUT_COLUMN));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.MATCHING_TYPE));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.CUSTOM_MATCHER));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.CONFIDENCE_WEIGHT));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.HANDLE_NULL));
}
Program: 137084
Project: 137084
Buggy source:
@Override protected void initHeaders(){
  headers.add(MatchAnalysisConstant.SURVIVORSHIP_KEY_NAME);
  headers.add(MatchAnalysisConstant.COLUMN);
  headers.add(MatchAnalysisConstant.FUNCTION);
  headers.add(MatchAnalysisConstant.ALLOW_MANUAL_RESOLUTION);
}

Fixed version (ground truth):
@Override protected void initHeaders(){
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.SURVIVORSHIP_KEY_NAME));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.COLUMN));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.FUNCTION));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.ALLOW_MANUAL_RESOLUTION));
}
Program: 137085
Project: 137085
Buggy source:
@Override protected void initHeaders(){
  headers.add(MatchAnalysisConstant.BLOCKING_KEY_NAME);
  headers.add(MatchAnalysisConstant.PRE_ALGO);
  headers.add(MatchAnalysisConstant.PRE_VALUE);
  headers.add(MatchAnalysisConstant.KEY_ALGO);
  headers.add(MatchAnalysisConstant.KEY_VALUE);
  headers.add(MatchAnalysisConstant.POST_ALGO);
  headers.add(MatchAnalysisConstant.POST_VALUE);
}

Fixed version (ground truth):
@Override protected void initHeaders(){
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.BLOCKING_KEY_NAME));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.PRE_ALGO));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.PRE_VALUE));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.KEY_ALGO));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.KEY_VALUE));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.POST_ALGO));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.POST_VALUE));
}
Program: 137086
Project: 137086
Buggy source:
@Override protected void initHeaders(){
  headers.add(MatchAnalysisConstant.MATCH_KEY_NAME);
  headers.add(MatchAnalysisConstant.MATCHING_TYPE);
  headers.add(MatchAnalysisConstant.CUSTOM_MATCHER);
  if (isAddColumn()) {
    headers.add(MatchAnalysisConstant.THRESHOLD);
  }
  headers.add(MatchAnalysisConstant.CONFIDENCE_WEIGHT);
  headers.add(MatchAnalysisConstant.HANDLE_NULL);
}

Fixed version (ground truth):
@Override protected void initHeaders(){
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.MATCH_KEY_NAME));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.MATCHING_TYPE));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.CUSTOM_MATCHER));
  if (isAddColumn()) {
    headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.THRESHOLD));
  }
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.CONFIDENCE_WEIGHT));
  headers.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.HANDLE_NULL));
}
Program: 137088
Project: 137088
Buggy source:
/** 
 * DOC zhao Comment method "initHeaders".
 */
private void initHeaders(){
  tableHeaders.add(MatchAnalysisConstant.LABEL);
  tableHeaders.add(MatchAnalysisConstant.COUNT);
  tableHeaders.add(MatchAnalysisConstant.PERCENTAGE);
}

Fixed version (ground truth):
/** 
 * DOC zhao Comment method "initHeaders".
 */
private void initHeaders(){
  tableHeaders.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.LABEL));
  tableHeaders.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.COUNT));
  tableHeaders.add(MatchAnalysisConstant.PERCENTAGE);
}
Program: 137089
Project: 137089
Buggy source:
/** 
 * DOC zhao Comment method "initHeaders".
 */
private void initHeaders(){
  tableHeaders.add(MatchAnalysisConstant.GROUP_SIZE);
  tableHeaders.add(MatchAnalysisConstant.GROUP_COUNT);
  tableHeaders.add(MatchAnalysisConstant.RECORD_COUNT);
  tableHeaders.add(MatchAnalysisConstant.RECORDS_PERCENTAGE);
}

Fixed version (ground truth):
/** 
 * DOC zhao Comment method "initHeaders".
 */
private void initHeaders(){
  tableHeaders.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.GROUP_SIZE));
  tableHeaders.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.GROUP_COUNT));
  tableHeaders.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.RECORD_COUNT));
  tableHeaders.add(DefaultMessagesImpl.getString(MatchAnalysisConstant.RECORDS_PERCENTAGE));
}
Program: 137091
Project: 137091
Buggy source:
@Override public void handle(Object object,String[] rowValues){
  super.handle(object);
  if (duplicateMap.containsKey(object)) {
    duplicateMap.get(object).add(rowValues);
  }
 else {
    List<Object[]> temp=new ArrayList<Object[]>();
    temp.add(rowValues);
    duplicateMap.put(object,temp);
  }
}

Fixed version (ground truth):
@Override public void handle(Object object,String[] rowValues){
  super.handle(object);
  List<Object[]> duplicateValueList=null;
  if (duplicateMap.containsKey(object)) {
    duplicateValueList=duplicateMap.get(object);
  }
 else {
    duplicateValueList=new ArrayList<Object[]>();
  }
  duplicateValueList.add(rowValues);
  duplicateMap.put(object,duplicateValueList);
}
Program: 137092
Project: 137092
Buggy source:
@Override public boolean handle(Object data){
  if (isUsedMapDBMode()) {
    if (data == null) {
      List<Object> valueList=soundexFreqMap.get(data);
      if (valueList == null) {
        valueList=new ArrayList<Object>();
        valueList.add(data);
        valueList.add(null);
        valueList.add(0);
        valueList.add(1);
      }
 else {
        Long duplicateCount=Long.valueOf(valueList.get(3).toString()) + 1;
        valueList.set(3,duplicateCount);
      }
      soundexFreqMap.put(data,valueList);
    }
 else {
      String soundexValue=soundex.soundex(data.toString());
      List<Object> valueList=soundexFreqMap.get(soundexValue);
      if (valueList == null) {
        valueList=new ArrayList<Object>();
        valueList.add(data);
        valueList.add(soundexValue);
        valueList.add(1);
        valueList.add(0);
        soundexFreqMap.put(soundexValue,valueList);
      }
 else       if (!getMapForFreq().containsKey(data)) {
        Long distinctCount=Long.valueOf(valueList.get(2).toString()) + 1;
        valueList.set(2,distinctCount);
        if (valueList.get(0).toString().compareTo(data.toString()) < 0) {
          valueList.set(0,data);
        }
      }
 else {
        Long duplicateCount=Long.valueOf(valueList.get(3).toString()) + 1;
        valueList.set(3,duplicateCount);
      }
    }
  }
  boolean returnValue=super.handle(data);
  this.mustStoreRow=false;
  return returnValue;
}

Fixed version (ground truth):
@Override public boolean handle(Object data){
  if (isUsedMapDBMode()) {
    if (data == null) {
      List<Object> valueList=soundexFreqMap.get(data);
      if (valueList == null) {
        valueList=new ArrayList<Object>();
        valueList.add(data);
        valueList.add(null);
        valueList.add(0);
        valueList.add(1);
      }
 else {
        Long duplicateCount=Long.valueOf(valueList.get(3).toString()) + 1;
        valueList.set(3,duplicateCount);
      }
      soundexFreqMap.put(data,valueList);
    }
 else {
      String soundexValue=soundex.soundex(data.toString());
      List<Object> valueList=soundexFreqMap.get(soundexValue);
      if (valueList == null) {
        valueList=new ArrayList<Object>();
        valueList.add(data);
        valueList.add(soundexValue);
        valueList.add(1);
        valueList.add(0);
      }
 else       if (!getMapForFreq().containsKey(data)) {
        Long distinctCount=Long.valueOf(valueList.get(2).toString()) + 1;
        valueList.set(2,distinctCount);
        if (valueList.get(0).toString().compareTo(data.toString()) < 0) {
          valueList.set(0,data);
        }
      }
 else {
        Long duplicateCount=Long.valueOf(valueList.get(3).toString()) + 1;
        valueList.set(3,duplicateCount);
      }
      soundexFreqMap.put(soundexValue,valueList);
    }
  }
  boolean returnValue=super.handle(data);
  this.mustStoreRow=false;
  return returnValue;
}
Program: 137093
Project: 137093
Buggy source:
@Override public void dispose(){
  super.dispose();
  if (this.treeViewer != null) {
    this.treeViewer.removePropertyChangeListener(this);
  }
  if (dataFilterComp != null) {
    this.dataFilterComp.removePropertyChangeListener(this);
  }
  if (this.getCurrentModelElementIndicators() != null) {
    for (    ModelElementIndicator modelIndi : this.getCurrentModelElementIndicators()) {
      for (      Indicator indicator : modelIndi.getIndicators()) {
        indicator.closeMapDB();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void dispose(){
  super.dispose();
  if (this.treeViewer != null) {
    this.treeViewer.removePropertyChangeListener(this);
  }
  if (dataFilterComp != null) {
    this.dataFilterComp.removePropertyChangeListener(this);
  }
  MapDBManager.getInstance().closeDB(getAnalysis());
}
Program: 137094
Project: 137094
Buggy source:
@Override public void dispose(){
  if (bg != null) {
    bg.dispose();
  }
  if (this.simpleStaticIndicator != null) {
    this.simpleStaticIndicator.closeMapDB();
  }
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (bg != null) {
    bg.dispose();
  }
  MapDBManager.getInstance().closeDB(masterPage.getAnalysis());
  super.dispose();
}
Program: 137095
Project: 137095
Buggy source:
/** 
 * DOC talend Comment method "initValueByGroupMap".
 * @return
 */
private ColumnSetDBMap initValueForDBMap(String dbName){
  if (isUsedMapDBMode()) {
    return new ColumnSetDBMap(ResourceManager.getMapDBFilePath(this),ResourceHelper.getUUID(this),dbName);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC talend Comment method "initValueByGroupMap".
 * @return
 */
private ColumnSetDBMap initValueForDBMap(String dbName){
  if (isUsedMapDBMode()) {
    return new ColumnSetDBMap(ResourceManager.getMapDBFilePath(),ResourceManager.getMapDBFileName(this),ResourceManager.getMapDBCatalogName(this,dbName));
  }
  return null;
}
Program: 137096
Project: 137096
Buggy source:
/** 
 * Create a new DBSet
 * @return
 */
private Set<Object> initValueForDBSet(String dbName){
  if (isUsedMapDBMode()) {
    return new DBSet<Object>(ResourceManager.getMapDBFilePath(this),ResourceHelper.getUUID(this),dbName);
  }
 else {
    return new HashSet<Object>();
  }
}

Fixed version (ground truth):
/** 
 * Create a new DBSet
 * @return
 */
private Set<Object> initValueForDBSet(String dbName){
  if (isUsedMapDBMode()) {
    return new DBSet<Object>(ResourceManager.getMapDBFilePath(),ResourceManager.getMapDBFileName(this),ResourceManager.getMapDBCatalogName(this,dbName));
  }
 else {
    return new HashSet<Object>();
  }
}
Program: 137097
Project: 137097
Buggy source:
/** 
 * Create a new DBMap
 * @return
 */
private Map<Object,List<Object[]>> initValueForDBMap(String dbName){
  if (isUsedMapDBMode()) {
    return new DBValueListMap<Object>(ResourceManager.getMapDBFilePath(this),ResourceHelper.getUUID(this),dbName);
  }
 else {
    return new HashMap<Object,List<Object[]>>();
  }
}

Fixed version (ground truth):
/** 
 * Create a new DBMap
 * @return
 */
private Map<Object,List<Object[]>> initValueForDBMap(String dbName){
  if (isUsedMapDBMode()) {
    return new DBValueListMap<Object>(ResourceManager.getMapDBFilePath(),ResourceManager.getMapDBFileName(this),ResourceManager.getMapDBCatalogName(this,dbName));
  }
 else {
    return new HashMap<Object,List<Object[]>>();
  }
}
Program: 137098
Project: 137098
Buggy source:
/** 
 * Create a new DBSet
 * @return
 */
private Set<Object> initValueForDBSet(String dbName){
  if (isUsedMapDBMode()) {
    return new DBSet<Object>(ResourceManager.getMapDBFilePath(this),ResourceHelper.getUUID(this),dbName);
  }
 else {
    return new HashSet<Object>();
  }
}

Fixed version (ground truth):
/** 
 * Create a new DBSet
 * @return
 */
private Set<Object> initValueForDBSet(String dbName){
  if (isUsedMapDBMode()) {
    return new DBSet<Object>(ResourceManager.getMapDBFilePath(),ResourceManager.getMapDBFileName(this),ResourceManager.getMapDBCatalogName(this,dbName));
  }
 else {
    return new HashSet<Object>();
  }
}
Program: 137099
Project: 137099
Buggy source:
/** 
 * init the ValueByGroupMap.
 * @return
 */
private Map<Object,Long> initValueForDBMap(String dbName){
  if (isUsedMapDBMode()) {
    return new DBMap<Object,Long>(ResourceManager.getMapDBFilePath(this),ResourceHelper.getUUID(this),dbName);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * init the ValueByGroupMap.
 * @return
 */
private Map<Object,Long> initValueForDBMap(String dbName){
  if (isUsedMapDBMode()) {
    return new DBMap<Object,Long>(ResourceManager.getMapDBFilePath(),ResourceManager.getMapDBFileName(this),ResourceManager.getMapDBCatalogName(this,dbName));
  }
  return null;
}
Program: 137100
Project: 137100
Buggy source:
/** 
 * clear DrillDown Maps.
 * @param valueToFreqForMapDB2
 */
@SuppressWarnings("String_Node_Str") protected void clearDrillDownMaps(){
  AbstractDB<?> mapDB=getMapDB(StandardDBName.drillDown.name());
  if (mapDB != null) {
    mapDB.clearDB();
  }
}

Fixed version (ground truth):
/** 
 * clear DrillDown Maps.
 * @param valueToFreqForMapDB2
 */
@SuppressWarnings("String_Node_Str") protected void clearDrillDownMaps(){
  AbstractDB<?> mapDB=getMapDB(StandardDBName.drillDown.name());
  if (mapDB != null) {
    mapDB.clearDB(ResourceManager.getMapDBCatalogName(this));
  }
}
Program: 137101
Project: 137101
Buggy source:
/** 
 * Check whether drill down action is allow
 * @return true is allowed else false
 */
@Override public boolean checkAllowDrillDown(){
  Analysis analysis=AnalysisHelper.getAnalysis(this);
  if (analysis != null) {
    return analysis.getParameters().isStoreData();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check whether drill down action is allow
 * @return true is allowed else false
 */
@Override public boolean checkAllowDrillDown(){
  Analysis analysis=AnalysisHelper.getAnalysis(this);
  boolean isStoreData=false;
  if (analysis != null) {
    isStoreData=analysis.getParameters().isStoreData();
  }
  boolean isJavaEngine=AnalysisHelper.isJavaExecutionEngine(analysis);
  return isStoreData && isJavaEngine;
}
Program: 137102
Project: 137102
Buggy source:
@Override public File getMapDBFile(){
  return MapDBManager.createPath(ResourceManager.getMapDBFilePath(this),ResourceHelper.getUUID(this));
}

Fixed version (ground truth):
@Override public File getMapDBFile(){
  return MapDBManager.createPath(ResourceManager.getMapDBFilePath(),ResourceManager.getMapDBFileName(this));
}
Program: 137103
Project: 137103
Buggy source:
/** 
 * Create a new DBMap
 * @return
 */
private DBMap<Object,List<Object>> initValueForDBMap(String dbName){
  return new DBMap<Object,List<Object>>(ResourceManager.getMapDBFilePath(this),ResourceHelper.getUUID(this),dbName);
}

Fixed version (ground truth):
/** 
 * Create a new DBMap
 * @return
 */
private DBMap<Object,List<Object>> initValueForDBMap(String dbName){
  return new DBMap<Object,List<Object>>(ResourceManager.getMapDBFilePath(),ResourceManager.getMapDBFileName(this),ResourceManager.getMapDBCatalogName(this,dbName));
}
Program: 137104
Project: 137104
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
@Override public boolean finalizeComputation(){
  if (isUsedMapDBMode()) {
    closeMapDB();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
@Override public boolean finalizeComputation(){
  return true;
}