nus-yam/ex-repair huggingface dataset:
Program: 74823
Project: 74823
Buggy source:
/** 
 * @param sash
 * @param parent
 * @param left
 * @param right
 */
private void addDragListerner(final Sash sash,final Composite parent,final Control left,final Control right){
  sash.addListener(SWT.Selection,new Listener(){
    public void handleEvent(    Event event){
      if (event.detail == SWT.DRAG) {
        return;
      }
      Sash sash=(Sash)event.widget;
      int shift=event.x - sash.getBounds().x;
      GridData data=(GridData)left.getLayoutData();
      int newWidthHint=data.widthHint + shift;
      if (newWidthHint < 20) {
        return;
      }
      Point computedSize=parent.computeSize(SWT.DEFAULT,SWT.DEFAULT);
      Point currentSize=parent.getSize();
      boolean customSize=!computedSize.equals(currentSize);
      widthHints[0]=data.widthHint=newWidthHint;
      data=(GridData)right.getLayoutData();
      newWidthHint=data.widthHint - shift;
      widthHints[1]=data.widthHint=newWidthHint;
      parent.layout(true);
      computedSize=parent.computeSize(SWT.DEFAULT,SWT.DEFAULT);
      if (customSize) {
        computedSize.x=Math.max(computedSize.x,currentSize.x);
      }
      computedSize.y=Math.max(computedSize.y,currentSize.y);
      if (computedSize.equals(currentSize)) {
        return;
      }
      parent.setSize(computedSize.x,computedSize.y);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param sash
 * @param parent
 * @param left
 * @param right
 */
private void addDragListerner(final Sash sash,final Composite parent,final Control left,final Control right){
  sash.addListener(SWT.Selection,new Listener(){
    public void handleEvent(    Event event){
      if (event.detail == SWT.DRAG) {
        return;
      }
      Sash sash=(Sash)event.widget;
      int shift=event.x - sash.getBounds().x;
      GridData data=(GridData)left.getLayoutData();
      int newWidthHint=data.widthHint + shift;
      if (newWidthHint < 100) {
        newWidthHint=100;
        shift=100 - data.widthHint;
      }
      widthHints[0]=data.widthHint=newWidthHint;
      data=(GridData)right.getLayoutData();
      newWidthHint=data.widthHint - shift;
      widthHints[1]=data.widthHint=newWidthHint;
      parent.layout();
    }
  }
);
}
Program: 74824
Project: 74824
Buggy source:
protected IReportLayoutEngine createReportLayoutEngine(String pagination,IRenderOption options){
  IReportLayoutEngine layoutEngine=LayoutEngineFactory.createLayoutEngine(pagination);
  if (options != null) {
    Object fitToPage=renderOptions.getOption(IPDFRenderOption.FIT_TO_PAGE);
    if (fitToPage != null) {
      layoutEngine.setOption(IPDFRenderOption.FIT_TO_PAGE,fitToPage);
    }
    Object pagebreakOnly=renderOptions.getOption(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY);
    if (pagebreakOnly != null) {
      layoutEngine.setOption(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY,pagebreakOnly);
    }
    Object outputDisplayNone=renderOptions.getOption(IPDFRenderOption.OUTPUT_DISPLAY_NONE);
    if (outputDisplayNone != null) {
      layoutEngine.setOption(IPDFRenderOption.OUTPUT_DISPLAY_NONE,outputDisplayNone);
    }
  }
  return layoutEngine;
}

Fixed version (ground truth):
protected IReportLayoutEngine createReportLayoutEngine(String pagination,IRenderOption options){
  IReportLayoutEngine layoutEngine=LayoutEngineFactory.createLayoutEngine(pagination);
  if (options != null) {
    Object fitToPage=renderOptions.getOption(IPDFRenderOption.FIT_TO_PAGE);
    if (fitToPage != null) {
      layoutEngine.setOption(IPDFRenderOption.FIT_TO_PAGE,fitToPage);
    }
    Object pagebreakOnly=renderOptions.getOption(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY);
    if (pagebreakOnly != null) {
      layoutEngine.setOption(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY,pagebreakOnly);
    }
    Object outputDisplayNone=renderOptions.getOption(IPDFRenderOption.OUTPUT_DISPLAY_NONE);
    if (outputDisplayNone != null) {
      layoutEngine.setOption(IPDFRenderOption.OUTPUT_DISPLAY_NONE,outputDisplayNone);
    }
  }
  layoutEngine.setOption(TASK_TYPE,new Integer(taskType));
  return layoutEngine;
}
Program: 74825
Project: 74825
Buggy source:
protected void start(boolean isFirst){
  MasterPageDesign pageDesign=getMasterPage(report);
  pageContent=ReportExecutorUtil.executeMasterPage(reportExecutor,context.getPageNumber(),pageDesign);
  if (emitter != null) {
    context.getPageBufferManager().startContainer(pageContent,isFirst,emitter,true);
  }
}

Fixed version (ground truth):
protected void start(boolean isFirst){
  MasterPageDesign pageDesign=getMasterPage(report);
  pageContent=ReportExecutorUtil.executeMasterPage(reportExecutor,context.getPageNumber(),pageDesign);
  if (pageContent != null && context.needLayoutPageContent()) {
    layoutPageContent(pageContent);
  }
  if (emitter != null) {
    context.getPageBufferManager().startContainer(pageContent,isFirst,emitter,true);
  }
}
Program: 74826
Project: 74826
Buggy source:
protected void setupLayoutOptions(){
  Object outputDisplayNone=options.get(IPDFRenderOption.OUTPUT_DISPLAY_NONE);
  if (outputDisplayNone instanceof Boolean) {
    if (((Boolean)outputDisplayNone).booleanValue()) {
      context.setOutputDisplayNone(true);
    }
  }
}

Fixed version (ground truth):
protected void setupLayoutOptions(){
  Object outputDisplayNone=options.get(IPDFRenderOption.OUTPUT_DISPLAY_NONE);
  if (outputDisplayNone instanceof Boolean) {
    if (((Boolean)outputDisplayNone).booleanValue()) {
      context.setOutputDisplayNone(true);
    }
  }
  Object taskType=options.get(EngineTask.TASK_TYPE);
  if (taskType instanceof Integer) {
    int type=((Integer)taskType).intValue();
    if (type == IEngineTask.TASK_RUN) {
      context.setLayoutPageContent(false);
    }
  }
}
Program: 74827
Project: 74827
Buggy source:
public void build(){
  IReportExecutor executor=executionContext.getExecutor();
  engine=LayoutEngineFactory.createLayoutEngine(ExtensionManager.PAGE_BREAK_PAGINATION);
  engine.setPageHandler(layoutPageHandler);
  IReportContent report=executor.execute();
  outputEmitters.start(report);
  engine.layout(executor,report,outputEmitters,true);
  outputEmitters.end(report);
  engine=null;
}

Fixed version (ground truth):
public void build(){
  IReportExecutor executor=executionContext.getExecutor();
  engine=LayoutEngineFactory.createLayoutEngine(ExtensionManager.PAGE_BREAK_PAGINATION);
  engine.setOption(EngineTask.TASK_TYPE,new Integer(IEngineTask.TASK_RUN));
  engine.setPageHandler(layoutPageHandler);
  IReportContent report=executor.execute();
  outputEmitters.start(report);
  engine.layout(executor,report,outputEmitters,true);
  outputEmitters.end(report);
  engine=null;
}
Program: 74828
Project: 74828
Buggy source:
public static String getPattern(Object data,String val){
  if (val != null && data instanceof Date) {
    if (val.indexOf("String_Node_Str") >= 0) {
      return "String_Node_Str";
    }
 else     if (val.startsWith("String_Node_Str")) {
      return "String_Node_Str";
    }
 else     if (!val.startsWith("String_Node_Str") && val.indexOf("String_Node_Str") >= 0) {
      return "String_Node_Str";
    }
    return new DateFormatter(val).getPattern();
  }
 else   if (val == null && data instanceof Time) {
    return "String_Node_Str";
  }
 else   if (val == null && data instanceof java.sql.Date) {
    return "String_Node_Str";
  }
 else   if (val == null && data instanceof java.util.Date) {
    return "String_Node_Str";
  }
 else   if (val != null && data instanceof Number) {
    return new NumberFormatter(val).getPattern();
  }
 else   if (val != null && data instanceof String) {
    return new StringFormatter(val).getPattern();
  }
  return null;
}

Fixed version (ground truth):
public static String getPattern(Object data,String val){
  if (val != null && data instanceof Date) {
    if (val.indexOf("String_Node_Str") >= 0) {
      return "String_Node_Str";
    }
 else     if (val.startsWith("String_Node_Str")) {
      return "String_Node_Str";
    }
 else     if (!val.startsWith("String_Node_Str") && val.indexOf("String_Node_Str") >= 0) {
      return "String_Node_Str";
    }
    return new DateFormatter(val).getPattern();
  }
 else   if (val == null && data instanceof Time) {
    return "String_Node_Str";
  }
 else   if (val == null && data instanceof java.sql.Date) {
    return "String_Node_Str";
  }
 else   if (val == null && data instanceof java.util.Date) {
    return "String_Node_Str";
  }
 else   if (val != null && data instanceof Number) {
    if (val.indexOf("String_Node_Str") >= 0) {
      return "String_Node_Str";
    }
    return new NumberFormatter(val).getPattern();
  }
 else   if (val != null && data instanceof String) {
    return new StringFormatter(val).getPattern();
  }
  return null;
}
Program: 74829
Project: 74829
Buggy source:
private static IDiskArray getDiskArrayFromAggregationResultSet(IAggregationResultSet base) throws IOException {
  IDiskArray diskArray=new BufferedStructureArray(AggregationResultRow.getCreator(),4096);
  for (int j=0; j < base.length(); j++) {
    base.seek(j);
    IAggregationResultRow temp=base.getCurrentRow();
    diskArray.add(temp);
  }
  base.seek(0);
  return diskArray;
}

Fixed version (ground truth):
private static IDiskArray getDiskArrayFromAggregationResultSet(IAggregationResultSet base) throws IOException {
  IDiskArray diskArray=new BufferedStructureArray(AggregationResultRow.getCreator(),4096);
  for (int j=0; j < base.length(); j++) {
    base.seek(j);
    IAggregationResultRow temp=base.getCurrentRow();
    diskArray.add(temp);
  }
  if (base.length() > 0) {
    base.seek(0);
  }
  return diskArray;
}
Program: 74832
Project: 74832
Buggy source:
/** 
 * @throws DataException
 */
private void populateDataSet() throws DataException {
  int originalMaxRows=this.populator.getQuery().getMaxRows();
  boolean changeMaxRows=filterByRow == null ? false : filterByRow.getFilterList(FilterByRow.QUERY_FILTER).size() + filterByRow.getFilterList(FilterByRow.GROUP_FILTER).size() > 0;
  if (changeMaxRows)   this.populator.getQuery().setMaxRows(0);
  List aggCCList=prepareComputedColumns(TransformationConstants.DATA_SET_MODEL);
  populateAggrCCs(this.getAggrComputedColumns(aggCCList,true));
  removeAvailableComputedColumns();
  doDataSetFilter(changeMaxRows);
  populateComputedColumns(this.getAggrComputedColumns(aggCCList,false));
  this.populator.getQuery().setMaxRows(originalMaxRows);
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
private void populateDataSet() throws DataException {
  int originalMaxRows=this.populator.getQuery().getMaxRows();
  boolean changeMaxRows=filterByRow == null ? false : filterByRow.getFilterList(FilterByRow.QUERY_FILTER).size() + filterByRow.getFilterList(FilterByRow.GROUP_FILTER).size() > 0;
  if (changeMaxRows)   this.populator.getQuery().setMaxRows(0);
  List aggCCList=prepareComputedColumns(TransformationConstants.DATA_SET_MODEL);
  doDataSetFilter(changeMaxRows);
  populateAggrCCs(this.getAggrComputedColumns(aggCCList,true));
  removeAvailableComputedColumns();
  populateComputedColumns(this.getAggrComputedColumns(aggCCList,false));
  this.populator.getQuery().setMaxRows(originalMaxRows);
}
Program: 74833
Project: 74833
Buggy source:
/** 
 * populate all available value in selectValueList
 */
private void populateList(){
  try {
    getOkButton().setEnabled(false);
    selectValueList.removeAll();
    viewerValueList.clear();
    if (modelValueList != null) {
      Iterator iter=modelValueList.iterator();
      while (iter.hasNext()) {
        Object candiateValue=iter.next();
        if (candiateValue != null) {
          String displayCandiateValue;
          if (candiateValue instanceof Date && !(candiateValue instanceof java.sql.Date || candiateValue instanceof java.sql.Time)) {
            DateFormatter formatter=new DateFormatter(ULocale.US);
            formatter.applyPattern("String_Node_Str");
            displayCandiateValue=formatter.format((Date)candiateValue);
          }
 else           displayCandiateValue=DataTypeUtil.toString(candiateValue);
          viewerValueList.add(displayCandiateValue);
          selectValueList.add(displayCandiateValue);
        }
      }
    }
 else {
      selectValueList.removeAll();
      modelValueList.clear();
      viewerValueList.clear();
      ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    }
    if (selectValueList.getItemCount() > 0) {
      selectValueList.select(0);
      getOkButton().setEnabled(true);
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
/** 
 * populate all available value in selectValueList
 */
private void populateList(){
  try {
    getOkButton().setEnabled(false);
    selectValueList.removeAll();
    viewerValueList.clear();
    if (modelValueList != null) {
      Iterator iter=modelValueList.iterator();
      while (iter.hasNext()) {
        Object candiateValue=iter.next();
        if (candiateValue != null) {
          Object displayCandiateValue;
          if (candiateValue instanceof Date && !(candiateValue instanceof java.sql.Date || candiateValue instanceof java.sql.Time)) {
            DateFormatter formatter=new DateFormatter(ULocale.US);
            formatter.applyPattern("String_Node_Str");
            displayCandiateValue=formatter.format((Date)candiateValue);
          }
 else           displayCandiateValue=candiateValue;
          viewerValueList.add(displayCandiateValue.toString());
          selectValueList.add(displayCandiateValue.toString());
        }
      }
    }
 else {
      selectValueList.removeAll();
      modelValueList.clear();
      viewerValueList.clear();
      ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    }
    if (selectValueList.getItemCount() > 0) {
      selectValueList.select(0);
      getOkButton().setEnabled(true);
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
}
Program: 74834
Project: 74834
Buggy source:
public Object getData(int col,int row){
  int start=((Integer)colrow.get(new Integer(col))).intValue();
  if (row < start) {
    logger.log(Level.WARNING,"String_Node_Str");
    return null;
  }
 else {
    List data=(List)columns.get(col);
    if (data.size() > (row - start)) {
      return data.get(row - start);
    }
 else {
      return null;
    }
  }
}

Fixed version (ground truth):
public Object getData(int col,int row){
  int start=((Integer)colrow.get(new Integer(col))).intValue();
  if (row < start) {
    return null;
  }
 else {
    List data=(List)columns.get(col);
    if (data.size() > (row - start)) {
      return data.get(row - start);
    }
 else {
      return null;
    }
  }
}
Program: 74835
Project: 74835
Buggy source:
public PDFBlockStackingLM(PDFLayoutEngineContext context,PDFStackingLM parent,IContent content,IReportItemExecutor executor){
  super(context,parent,content,executor);
  pageBreakAvoid=pageBreakInsideAvoid() || pageBreakAfterAvoid();
}

Fixed version (ground truth):
public PDFBlockStackingLM(PDFLayoutEngineContext context,PDFStackingLM parent,IContent content,IReportItemExecutor executor){
  super(context,parent,content,executor);
}
Program: 74836
Project: 74836
Buggy source:
public void autoPageBreak(){
  if (!isRootEmpty()) {
    return;
  }
 else   if (!keepWithCache.isEmpty()) {
    clearCache();
    if (!isRootEmpty()) {
      closeLayout();
      submitRoot();
      return;
    }
  }
  if (child != null) {
    child.autoPageBreak();
    closeLayout();
    submitRoot();
  }
}

Fixed version (ground truth):
public void autoPageBreak(){
  if (!isRootEmpty()) {
    closeLayout();
    submitRoot();
    return;
  }
 else   if (!keepWithCache.isEmpty()) {
    clearCache();
    if (!isRootEmpty()) {
      closeLayout();
      submitRoot();
      return;
    }
  }
  if (child != null) {
    child.autoPageBreak();
    closeLayout();
    submitRoot();
  }
}
Program: 74837
Project: 74837
Buggy source:
protected boolean isRootEmpty(){
  if (pageBreakInsideAvoid()) {
    if (this.isRowFinished()) {
      return false;
    }
    if (!context.isAutoPageBreak()) {
      return false;
    }
    return true;
  }
 else {
    Iterator iter=root.getChildren();
    while (iter.hasNext()) {
      CellArea cell=(CellArea)iter.next();
      if (cell.getChildrenCount() > 0) {
        return false;
      }
    }
    if (this.isRowFinished()) {
      return false;
    }
    return true;
  }
}

Fixed version (ground truth):
protected boolean isRootEmpty(){
  if (root != null) {
    Iterator iter=root.getChildren();
    while (iter.hasNext()) {
      CellArea cell=(CellArea)iter.next();
      if (cell.getChildrenCount() > 0) {
        return false;
      }
    }
    if (isRowFinished() && root.getChildrenCount() > 0) {
      return false;
    }
  }
  return true;
}
Program: 74838
Project: 74838
Buggy source:
public PDFStackingLM(PDFLayoutEngineContext context,PDFStackingLM parent,IContent content,IReportItemExecutor executor){
  super(context,parent,content,executor);
}

Fixed version (ground truth):
public PDFStackingLM(PDFLayoutEngineContext context,PDFStackingLM parent,IContent content,IReportItemExecutor executor){
  super(context,parent,content,executor);
  pageBreakAvoid=pageBreakInsideAvoid() || pageBreakAfterAvoid();
}
Program: 74839
Project: 74839
Buggy source:
protected boolean layoutChildren(){
  initialize();
  boolean hasNextPage=false;
  hasNextPage=traverseChildren();
  if (!hasNextPage) {
    isLast=true;
    clearCache();
  }
 else   if (!context.isAutoPageBreak()) {
    clearCache();
  }
  if (!isRootEmpty()) {
    closeLayout();
    hasNextPage=!submitRoot() || hasNextPage;
  }
  return hasNextPage;
}

Fixed version (ground truth):
protected boolean layoutChildren(){
  initialize();
  boolean hasNextPage=false;
  hasNextPage=traverseChildren();
  if (!hasNextPage) {
    isLast=true;
    clearCache();
  }
 else   if (!context.isAutoPageBreak()) {
    clearCache();
  }
  if (!isRootEmpty() && !(isPageBreakAvoidInside() && context.isAutoPageBreak() && hasNextPage)) {
    closeLayout();
    hasNextPage=!submitRoot() || hasNextPage;
  }
  return hasNextPage;
}
Program: 74840
Project: 74840
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  IStructuredSelection selection=(IStructuredSelection)event.getSelection();
  if (selection.isEmpty()) {
    return;
  }
  Viewer target=null;
  if (event.getSource() == categoryTable) {
    target=subCategoryTable;
  }
 else   if (event.getSource() == subCategoryTable) {
    target=functionTable;
  }
  if (target != null) {
    target.setInput(selection.getFirstElement());
  }
  if (event.getSource() == functionTable) {
    Table table=functionTable.getTable();
    if (table.getSelectionCount() == 1) {
      String message=table.getSelection()[0].getText();
      message=message.replaceAll("String_Node_Str","String_Node_Str");
      messageLine.setText(message);
    }
 else {
      messageLine.setText("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  IStructuredSelection selection=(IStructuredSelection)event.getSelection();
  Viewer target=null;
  if (event.getSource() == categoryTable) {
    target=subCategoryTable;
  }
 else   if (event.getSource() == subCategoryTable) {
    target=functionTable;
  }
  if (target != null) {
    target.setInput(selection == null ? null : selection.getFirstElement());
  }
  if (event.getSource() == functionTable) {
    Table table=functionTable.getTable();
    if (table.getSelectionCount() == 1) {
      String message=table.getSelection()[0].getText();
      message=message.replaceAll("String_Node_Str","String_Node_Str");
      messageLine.setText(message);
    }
 else {
      messageLine.setText("String_Node_Str");
    }
  }
}
Program: 74841
Project: 74841
Buggy source:
protected boolean traverseChildren(){
  if (isFirst && groupLevel >= 0 && type == IBandContent.BAND_GROUP_FOOTER) {
    tbl.updateUnresolvedCell(groupLevel,false);
  }
  isFirst=false;
  boolean childBreak=super.traverseChildren();
  if (!childBreak && groupLevel >= 0 && type == IBandContent.BAND_GROUP_FOOTER) {
    tbl.updateUnresolvedCell(groupLevel,true);
  }
  return childBreak;
}

Fixed version (ground truth):
protected boolean traverseChildren(){
  if (isFirst && groupLevel >= 0 && type == IBandContent.BAND_GROUP_FOOTER) {
    int height=0;
    height=tbl.updateUnresolvedCell(groupLevel,false);
    if (0 != height) {
      ((PDFTableGroupLM)parent).updateHeight(height);
    }
  }
  isFirst=false;
  boolean childBreak=super.traverseChildren();
  if (!childBreak && groupLevel >= 0 && type == IBandContent.BAND_GROUP_FOOTER) {
    int height=0;
    height=tbl.updateUnresolvedCell(groupLevel,true);
    if (0 != height) {
      ((PDFTableGroupLM)parent).updateHeight(height);
    }
  }
  return childBreak;
}
Program: 74842
Project: 74842
Buggy source:
protected boolean traverseChildren(){
  boolean childBreak=super.traverseChildren();
  if (!childBreak) {
    tableLM.endGroup((IGroupContent)content);
  }
  return childBreak;
}

Fixed version (ground truth):
protected boolean traverseChildren(){
  boolean childBreak=super.traverseChildren();
  if (!childBreak) {
    int heightAdjustment=tableLM.endGroup((IGroupContent)content);
    currentBP+=heightAdjustment;
  }
  return childBreak;
}
Program: 74843
Project: 74843
Buggy source:
protected void closeLayout(){
  regionLayout=null;
  if (root == null) {
    return;
  }
  int borderHeight=0;
  if (layout != null) {
    layout.resolveAll();
    borderHeight=layout.resolveBottomBorder();
    layout.remove((TableArea)root);
  }
  if (isLast) {
    root.setHeight(getCurrentBP() + getOffsetY() + borderHeight);
  }
 else {
    root.setHeight(getCurrentBP() + getOffsetY());
  }
}

Fixed version (ground truth):
protected void closeLayout(){
  regionLayout=null;
  if (root == null) {
    return;
  }
  int borderHeight=0;
  if (layout != null) {
    int height=layout.resolveAll();
    if (0 != height) {
      currentBP=currentBP + height;
    }
    borderHeight=layout.resolveBottomBorder();
    layout.remove((TableArea)root);
  }
  if (isLast) {
    root.setHeight(getCurrentBP() + getOffsetY() + borderHeight);
  }
 else {
    root.setHeight(getCurrentBP() + getOffsetY());
  }
}
Program: 74844
Project: 74844
Buggy source:
public void endGroup(IGroupContent groupContent){
  int groupLevel=groupContent.getGroupLevel();
  updateUnresolvedCell(groupLevel,false);
  updateUnresolvedCell(groupLevel,true);
  assert(!groupStack.isEmpty());
  groupStack.pop();
}

Fixed version (ground truth):
public int endGroup(IGroupContent groupContent){
  int groupLevel=groupContent.getGroupLevel();
  int height=0;
  height=updateUnresolvedCell(groupLevel,false);
  height+=updateUnresolvedCell(groupLevel,true);
  assert(!groupStack.isEmpty());
  groupStack.pop();
  return height;
}
Program: 74845
Project: 74845
Buggy source:
public void updateUnresolvedCell(int groupLevel,boolean dropAll){
  String dropType=dropAll ? "String_Node_Str" : "String_Node_Str";
  int dropValue=this.createDropID(groupLevel,dropType);
  if (layout != null) {
    layout.resolveDropCells(dropValue);
  }
}

Fixed version (ground truth):
public int updateUnresolvedCell(int groupLevel,boolean dropAll){
  String dropType=dropAll ? "String_Node_Str" : "String_Node_Str";
  int dropValue=this.createDropID(groupLevel,dropType);
  if (layout != null) {
    return layout.resolveDropCells(dropValue);
  }
  return 0;
}
Program: 74848
Project: 74848
Buggy source:
/** 
 * @throws DataException
 */
public void test_IN() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_IN,new String[]{"String_Node_Str","String_Node_Str"});
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_IN,new String[]{"String_Node_Str","String_Node_Str"});
  assertResult(result,false);
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
public void test_IN() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_IN,new String[]{"String_Node_Str","String_Node_Str"});
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_IN,new String[]{"String_Node_Str","String_Node_Str"});
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_IN,new String[]{null});
  assertResult(result,false);
}
Program: 74849
Project: 74849
Buggy source:
/** 
 * @param resultObj
 * @return
 * @throws DataException
 */
private static boolean in(Object target,Object[] resultObj) throws DataException {
  for (int i=0; i < resultObj.length; i++) {
    if (compare(target,resultObj[i]) == 0)     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param resultObj
 * @return
 * @throws DataException
 */
private static boolean in(Object target,Object[] resultObj) throws DataException {
  if (resultObj == null)   return false;
  for (int i=0; i < resultObj.length; i++) {
    if (compare(target,resultObj[i]) == 0)     return true;
  }
  return false;
}
Program: 74850
Project: 74850
Buggy source:
/** 
 * Handles a Rhino script evaluation result, converting Javascript object into equivalent Java objects if necessary.
 * @param inputObj Object returned by rhino engine.
 * @return If inputObj is a native Javascript object, its equivalent Java object is returned; otherwise inputObj is returned
 */
public static Object convertJavascriptValue(Object inputObj){
  if (inputObj instanceof Undefined) {
    return null;
  }
  if (inputObj instanceof IdScriptableObject) {
    String jsClass=((Scriptable)inputObj).getClassName();
    if ("String_Node_Str".equals(jsClass)) {
      return new Date((long)Context.toNumber(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return new Boolean(Context.toBoolean(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return new Double(Context.toNumber(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return inputObj.toString();
    }
  }
 else   if (inputObj instanceof Wrapper) {
    return ((Wrapper)inputObj).unwrap();
  }
  return inputObj;
}

Fixed version (ground truth):
/** 
 * Handles a Rhino script evaluation result, converting Javascript object into equivalent Java objects if necessary.
 * @param inputObj Object returned by rhino engine.
 * @return If inputObj is a native Javascript object, its equivalent Java object is returned; otherwise inputObj is returned
 */
public static Object convertJavascriptValue(Object inputObj){
  if (inputObj instanceof Undefined) {
    return null;
  }
  if (inputObj instanceof IdScriptableObject) {
    String jsClass=((Scriptable)inputObj).getClassName();
    if ("String_Node_Str".equals(jsClass)) {
      return new Date((long)Context.toNumber(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return new Boolean(Context.toBoolean(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return new Double(Context.toNumber(inputObj));
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      return inputObj.toString();
    }
 else     if ("String_Node_Str".equals(jsClass)) {
      Object[] obj=new Object[(int)((NativeArray)inputObj).getLength()];
      for (int i=0; i < obj.length; i++) {
        obj[i]=convertJavascriptValue(((NativeArray)inputObj).get(i,null));
      }
      return obj;
    }
  }
 else   if (inputObj instanceof Wrapper) {
    return ((Wrapper)inputObj).unwrap();
  }
  return inputObj;
}
Program: 74851
Project: 74851
Buggy source:
/** 
 * @param resultObj
 * @return
 * @throws DataException
 */
private static boolean in(Object[] resultObj) throws DataException {
  Object target=resultObj[0];
  for (int i=1; i < resultObj.length; i++) {
    if (compare(target,resultObj[i]) == 0)     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param resultObj
 * @return
 * @throws DataException
 */
private static boolean in(Object target,Object[] resultObj) throws DataException {
  for (int i=0; i < resultObj.length; i++) {
    if (compare(target,resultObj[i]) == 0)     return true;
  }
  return false;
}
Program: 74853
Project: 74853
Buggy source:
/** 
 * remove overwrited adapters.
 */
public void reset(){
  if (!isReset && this.overwriteList != null) {
    for (Iterator iterator=this.iterator(); iterator.hasNext(); ) {
      ElementAdapter adapter=(ElementAdapter)iterator.next();
      if (this.overwriteList.contains(adapter.getId())) {
        if (super.remove(adapter))         System.out.println(adapter.getId() + "String_Node_Str");
      }
    }
    this.isReset=true;
  }
}

Fixed version (ground truth):
/** 
 * remove overwrited adapters.
 */
public void reset(){
  if (!isReset && this.overwriteList != null) {
    for (Iterator iterator=this.iterator(); iterator.hasNext(); ) {
      ElementAdapter adapter=(ElementAdapter)iterator.next();
      if (this.overwriteList.contains(adapter.getId())) {
        iterator.remove();
        ElementAdapterManager.logger.log(Level.INFO,adapter.getId() + "String_Node_Str");
      }
    }
    this.isReset=true;
  }
}
Program: 74854
Project: 74854
Buggy source:
public Data createData(Object txt,StyleEntry entry){
  if (txt instanceof IDataContent) {
    IDataContent dataContent=(IDataContent)txt;
    Object value=dataContent.getValue();
    if (ExcelUtil.getType(value).equals(Data.NUMBER)) {
      String format=ExcelUtil.getPattern(value,entry.getProperty(StyleConstant.NUMBER_FORMAT_PROP));
      entry.setProperty(StyleConstant.NUMBER_FORMAT_PROP,format);
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.NUMBER);
      Data data=new Data(value,entry,Data.NUMBER);
      return data;
    }
 else     if (ExcelUtil.getType(value).equals(Data.DATE)) {
      String format=ExcelUtil.getPattern(value,entry.getProperty(StyleConstant.DATE_FORMAT_PROP));
      entry.setProperty(StyleConstant.DATE_FORMAT_PROP,format);
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.DATE);
      Data data=new Data(value,entry,Data.DATE);
      return data;
    }
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.STRING);
    return new Data(dataContent.getText().trim(),entry,Data.STRING);
  }
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.STRING);
  return new Data(txt,entry,Data.STRING);
}

Fixed version (ground truth):
public Data createData(Object txt,StyleEntry entry){
  if (txt instanceof IDataContent) {
    IDataContent dataContent=(IDataContent)txt;
    Object value=dataContent.getValue();
    String text=dataContent.getText();
    if (((DataItemDesign)dataContent.getGenerateBy()).getMap() != null && ((DataItemDesign)dataContent.getGenerateBy()).getMap().getRuleCount() > 0) {
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.STRING);
      return new Data(text.trim(),entry,Data.STRING);
    }
 else     if (ExcelUtil.getType(value).equals(Data.NUMBER)) {
      String format=ExcelUtil.getPattern(value,entry.getProperty(StyleConstant.NUMBER_FORMAT_PROP));
      entry.setProperty(StyleConstant.NUMBER_FORMAT_PROP,format);
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.NUMBER);
      return new Data(value,entry,Data.NUMBER);
    }
 else     if (ExcelUtil.getType(value).equals(Data.DATE)) {
      String format=ExcelUtil.getPattern(value,entry.getProperty(StyleConstant.DATE_FORMAT_PROP));
      entry.setProperty(StyleConstant.DATE_FORMAT_PROP,format);
      entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.DATE);
      return new Data(value,entry,Data.DATE);
    }
    entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.STRING);
    return new Data(text.trim(),entry,Data.STRING);
  }
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.STRING);
  return new Data(txt,entry,Data.STRING);
}
Program: 74855
Project: 74855
Buggy source:
/** 
 * Clear time portion of a date value
 * @param d
 */
private void cleanTimePortion(Calendar d){
  d.set(Calendar.HOUR_OF_DAY,0);
  d.set(Calendar.MINUTE,0);
  d.set(Calendar.SECOND,1);
  d.set(Calendar.MILLISECOND,0);
}

Fixed version (ground truth):
/** 
 * Clear time portion of a date value
 * @param d
 */
private void cleanTimePortion(Calendar d){
  d.set(Calendar.HOUR_OF_DAY,0);
  d.set(Calendar.MINUTE,0);
  d.set(Calendar.SECOND,0);
  d.set(Calendar.MILLISECOND,0);
}
Program: 74856
Project: 74856
Buggy source:
public Data(final Object txt,final StyleEntry s){
  this.txt=txt;
  this.style=s;
  id=ID++;
}

Fixed version (ground truth):
public Data(final Object txt,final StyleEntry s,final String datatype){
  this.txt=txt;
  this.style=s;
  this.datatype=datatype;
  id=ID++;
}
Program: 74857
Project: 74857
Buggy source:
public void writeText(Object d){
  writer.openTag("String_Node_Str");
  if (d instanceof Data) {
    if (((Data)d).getDatatype().equals(Data.NUMBER)) {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
 else     if (((Data)d).getDatatype().equals(Data.DATE)) {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
 else {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
    writer.text(((Data)d).txt.toString());
  }
 else {
    writer.attribute("String_Node_Str","String_Node_Str");
    writer.text(d.toString());
  }
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void writeText(Data d){
  writer.openTag("String_Node_Str");
  if (d.getDatatype().equals(Data.NUMBER)) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else   if (d.getDatatype().equals(Data.DATE)) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  writer.text(d.getText());
  writer.closeTag("String_Node_Str");
}
Program: 74858
Project: 74858
Buggy source:
public void writeDefaultCell(String content){
  writer.openTag("String_Node_Str");
  writeText(content);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void writeDefaultCell(Data d){
  writer.openTag("String_Node_Str");
  if (d.getStyleId() != 0) {
    writer.attribute("String_Node_Str",d.getStyleId());
  }
  writeText(d);
  writer.closeTag("String_Node_Str");
}
Program: 74859
Project: 74859
Buggy source:
public void writeDataFormat(StyleEntry style){
  if (style.getDatatype() == Data.DATE && style.getProperty(StyleConstant.DATE_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.DATE_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
  if (style.getDatatype() == Data.STRING && style.getProperty(StyleConstant.STRING_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.STRING_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
  if (style.getDatatype() == Data.NUMBER && style.getProperty(StyleConstant.NUMBER_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.NUMBER_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
}

Fixed version (ground truth):
public void writeDataFormat(StyleEntry style){
  if (style.getProperty(StyleConstant.DATA_TYPE_PROP) == Data.DATE && style.getProperty(StyleConstant.DATE_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.DATE_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
  if (style.getProperty(StyleConstant.DATA_TYPE_PROP) == Data.NUMBER && style.getProperty(StyleConstant.NUMBER_FORMAT_PROP) != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",style.getProperty(StyleConstant.NUMBER_FORMAT_PROP));
    writer.closeTag("String_Node_Str");
  }
}
Program: 74861
Project: 74861
Buggy source:
/** 
 * @param dataMap layout data
 * @return a StyleEngine instance
 */
public StyleEngine(ExcelLayoutEngine engine){
  this.engine=engine;
}

Fixed version (ground truth):
/** 
 * @param dataMap layout data
 * @return a StyleEngine instance
 */
public StyleEngine(ExcelLayoutEngine engine){
  this.engine=engine;
  style2id.put(getDefaultEntry(DEFAULT_DATE_STYLE),new Integer(DEFAULT_DATE_STYLE));
}
Program: 74862
Project: 74862
Buggy source:
/** 
 * @param selectValueExpression
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
public static List getSelectValueList(String expression,DataSetHandle dataSetHandle) throws BirtException {
  List selectValueList=new ArrayList();
  if (expression != null && expression.trim().length() > 0) {
    QueryDefinition query=new QueryDefinition();
    query.setDataSetName(dataSetHandle.getQualifiedName());
    PropertyHandle handle=dataSetHandle.getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
    if (handle != null) {
      Iterator paramIter=handle.iterator();
      while (paramIter.hasNext()) {
        DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
        if (paramDefn.isInput()) {
          String defaultValue=null;
          if (paramDefn instanceof OdaDataSetParameterHandle && ((OdaDataSetParameterHandle)paramDefn).getParamName() != null)           defaultValue=ExpressionUtil.createJSParameterExpression(((OdaDataSetParameterHandle)paramDefn).getParamName());
 else           defaultValue=paramDefn.getDefaultValue();
          if (defaultValue != null) {
            InputParameterBinding binding=new InputParameterBinding(paramDefn.getName(),new ScriptExpression(defaultValue));
            query.addInputParamBinding(binding);
          }
        }
      }
    }
    IBaseExpression bindingExprGroup=new ScriptExpression(ExpressionUtility.getReplacedColRefExpr(expression));
    GroupDefinition groupDefn=new GroupDefinition(BINDING_GROUP_NAME);
    groupDefn.setKeyExpression(BINDING_GROUP_EXPRESSION);
    query.addBinding(new Binding(BINDING_ROW_NAME,bindingExprGroup));
    query.addGroup(groupDefn);
    query.setUsesDetails(false);
    DataRequestSession session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,dataSetHandle == null ? null : dataSetHandle.getModuleHandle()));
    if (dataSetHandle != null) {
      if (dataSetHandle.getDataSource() != null)       session.defineDataSource(session.getModelAdaptor().adaptDataSource(dataSetHandle.getDataSource()));
      session.defineDataSet(session.getModelAdaptor().adaptDataSet(dataSetHandle));
    }
    IPreparedQuery preparedQuery=session.prepare(query);
    IQueryResults results=preparedQuery.execute(null);
    if (results != null) {
      IResultIterator iter=null;
      iter=results.getResultIterator();
      if (iter != null) {
        while (iter.next()) {
          Object candiateValue=iter.getValue(BINDING_ROW_NAME);
          if (candiateValue != null) {
            selectValueList.add(candiateValue);
          }
          iter.skipToEnd(1);
        }
      }
      results.close();
    }
  }
  return selectValueList;
}

Fixed version (ground truth):
/** 
 * @param selectValueExpression
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
public static List getSelectValueList(String expression,DataSetHandle dataSetHandle) throws BirtException {
  return getSelectValueList(expression,dataSetHandle,true);
}
Program: 74863
Project: 74863
Buggy source:
/** 
 * TODO: enhance me, this is only a temp logic Set temporary computed columns to DataSourceQuery where cache is used
 */
protected void prepareCacheQuery(IQuery odiQuery){
  if (odiQuery instanceof org.eclipse.birt.data.engine.executor.dscache.DataSourceQuery && temporaryComputedColumns != null && temporaryComputedColumns.size() > 0) {
    ((org.eclipse.birt.data.engine.executor.dscache.DataSourceQuery)odiQuery).setTempComputedColumn(this.temporaryComputedColumns);
  }
}

Fixed version (ground truth):
/** 
 * TODO: enhance me, this is only a temp logic Set temporary computed columns to DataSourceQuery where cache is used
 */
protected void prepareCacheQuery(IQuery odiQuery){
  if (temporaryComputedColumns != null && temporaryComputedColumns.size() > 0) {
    if (odiQuery instanceof org.eclipse.birt.data.engine.executor.dscache.DataSourceQuery) {
      ((org.eclipse.birt.data.engine.executor.dscache.DataSourceQuery)odiQuery).setTempComputedColumn(this.temporaryComputedColumns);
    }
 else     if (odiQuery instanceof org.eclipse.birt.data.engine.executor.dscache.CandidateQuery) {
      ((org.eclipse.birt.data.engine.executor.dscache.CandidateQuery)odiQuery).setTempComputedColumn(this.temporaryComputedColumns);
    }
  }
}
Program: 74864
Project: 74864
Buggy source:
/** 
 * @param obj
 * @param operator
 * @param ops
 * @return
 */
private static boolean needFormat(Object obj,int operator,ExprTextAndValue[] ops){
  if (operator < IConditionalExpression.OP_EQ || (operator > IConditionalExpression.OP_NOT_BETWEEN && operator < IConditionalExpression.OP_IN) || obj == null || ops.length == 0)   return false;
 else   if ((operator == IConditionalExpression.OP_BETWEEN || operator == IConditionalExpression.OP_NOT_BETWEEN) && ops.length < 2)   return false;
  return true;
}

Fixed version (ground truth):
/** 
 * @param obj
 * @param operator
 * @param ops
 * @return
 */
private static boolean needFormat(Object obj,int operator,ExprTextAndValue[] ops){
  if (operator < IConditionalExpression.OP_EQ || (operator > IConditionalExpression.OP_NOT_BETWEEN && operator < IConditionalExpression.OP_IN) || obj == null || ops.length == 0 || ops[0].value == null)   return false;
 else   if ((operator == IConditionalExpression.OP_BETWEEN || operator == IConditionalExpression.OP_NOT_BETWEEN) && ops.length < 2)   return false;
  return true;
}
Program: 74865
Project: 74865
Buggy source:
/** 
 * @param result
 * @param key
 * @throws EngineException 
 */
private void addConditionalExprBindings(TotalExprBinding result,IConditionalExpression key,List bindings,String groupName) throws EngineException {
  try {
    IConditionalExpression ce=key;
    if (hasAggregationInFilter(key)) {
      result.addNewExpression(ce);
      return;
    }
    if (groupName != null)     ce.setGroupName(groupName);
    String bindingName=TOTAL_PREFIX + totalColumnSuffix;
    totalColumnSuffix++;
    Binding columnBinding=new Binding(bindingName,ce);
    if (groupName != null) {
      columnBinding.addAggregateOn(groupName);
    }
    List allColumnBindings=new ArrayList();
    allColumnBindings.add(columnBinding);
    result.addColumnBindings(allColumnBindings);
    result.addNewExpression(org.eclipse.birt.core.data.ExpressionUtil.createJSRowExpression(bindingName));
  }
 catch (  DataException e) {
    throw new EngineException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param result
 * @param key
 * @throws EngineException 
 */
private void addConditionalExprBindings(TotalExprBinding result,IConditionalExpression key,List bindings,String groupName) throws EngineException {
  try {
    IConditionalExpression ce=key;
    if (!hasAggregationInFilter(key)) {
      result.addNewExpression(ce);
      return;
    }
    if (groupName != null)     ce.setGroupName(groupName);
    String bindingName=TOTAL_PREFIX + totalColumnSuffix;
    totalColumnSuffix++;
    Binding columnBinding=new Binding(bindingName,ce);
    if (groupName != null) {
      columnBinding.addAggregateOn(groupName);
    }
    List allColumnBindings=new ArrayList();
    allColumnBindings.add(columnBinding);
    result.addColumnBindings(allColumnBindings);
    result.addNewExpression(org.eclipse.birt.core.data.ExpressionUtil.createJSRowExpression(bindingName));
  }
 catch (  DataException e) {
    throw new EngineException(e.getLocalizedMessage());
  }
}
Program: 74866
Project: 74866
Buggy source:
/** 
 * Do the first pass. In the first pass we maintain a value list and a row id list that will host all top/bottom N values/rowIds so that in pass 2 we can use them to filter rows out.
 * @param value
 * @return
 * @throws DataException
 */
private boolean doFirstPass(Object value) throws DataException {
  firstPassRowNumberCounter++;
  if (valueList == null) {
    valueList=new BasicCachedArray(N);
    rowIdList=new BasicCachedArray(N);
  }
  populateValueListAndRowIdList(value,N);
  return true;
}

Fixed version (ground truth):
/** 
 * Do the first pass. In the first pass we maintain a value list and a row id list that will host all top/bottom N values/rowIds so that in pass 2 we can use them to filter rows out.
 * @param value
 * @return
 * @throws DataException
 */
private boolean doFirstPass(Object value) throws DataException {
  firstPassRowNumberCounter++;
  if (valueList == null) {
    valueList=new BasicCachedArray(N);
    rowIdList=new BasicCachedArray(N);
  }
  if (value != null) {
    populateValueListAndRowIdList(value,N);
  }
  return true;
}
Program: 74867
Project: 74867
Buggy source:
/** 
 * @param resultObj
 * @return
 * @throws DataException
 */
private static boolean in(Object[] resultObj) throws DataException {
  Object target=resultObj[0];
  for (int i=1; i < resultObj.length; i++) {
    if (resultObj[i] instanceof Object[]) {
      Object[] flatternObj=(Object[])resultObj[i];
      if (in(flatternObj))       return true;
    }
    if (compare(target,resultObj[i]) == 0)     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param target
 * @param resultObj
 * @return
 * @throws DataException
 */
private static boolean in(Object target,Object[] resultObj) throws DataException {
  for (int i=0; i < resultObj.length; i++) {
    if (resultObj[i] instanceof Object[]) {
      Object[] flatternObj=(Object[])resultObj[i];
      if (in(target,flatternObj))       return true;
    }
 else     if (compare(target,resultObj[i]) == 0)     return true;
  }
  return false;
}
Program: 74868
Project: 74868
Buggy source:
/** 
 * Returns the separator String
 * @param request
 * @return
 */
public static char getSep(HttpServletRequest request){
  String sepKey=getParameter(request,PARAM_SEP);
  if (sepKey == null)   return DEFAULT_SEP;
  String key="String_Node_Str" + sepKey;
  String sep=getInitProp(key);
  if (sep.length() <= 0)   return DEFAULT_SEP;
  return sep.charAt(0);
}

Fixed version (ground truth):
/** 
 * Returns the separator String
 * @param request
 * @return
 */
public static char getSep(HttpServletRequest request){
  String sepKey=getParameter(request,PARAM_SEP);
  if (sepKey == null)   return DEFAULT_SEP;
  String key="String_Node_Str" + sepKey;
  String sep=getInitProp(key);
  if (sep == null || sep.length() <= 0)   return DEFAULT_SEP;
  return sep.charAt(0);
}