nus-yam/ex-repair huggingface dataset:
Program: 75299
Project: 75299
Buggy source:
/** 
 * Create PDF render option.
 * @param servletPath
 * @param request
 * @param isDesigner
 * @return the PDF render option
 */
private PDFRenderOption createPDFRenderOption(String servletPath,HttpServletRequest request,boolean isDesigner){
  String baseURL=null;
  if (!isDesigner)   baseURL=ParameterAccessor.getBaseURL();
  if (baseURL == null)   baseURL="String_Node_Str";
  baseURL+=request.getContextPath();
  PDFRenderOption renderOption=new PDFRenderOption();
  if (servletPath != null && servletPath.length() > 0) {
    renderOption.setBaseURL(baseURL + servletPath);
  }
 else {
    renderOption.setBaseURL(baseURL + IBirtConstants.SERVLET_PATH_RUN);
  }
  renderOption.setSupportedImageFormats("String_Node_Str");
  renderOption.setOption(PDFRenderOption.FIT_TO_PAGE,new Boolean(ParameterAccessor.isFitToPage(request)));
  renderOption.setOption(PDFRenderOption.PAGEBREAK_PAGINATION_ONLY,new Boolean(ParameterAccessor.isPagebreakOnly(request)));
  return renderOption;
}

Fixed version (ground truth):
/** 
 * Create PDF render option.
 * @param servletPath
 * @param request
 * @param isDesigner
 * @return the PDF render option
 */
private PDFRenderOption createPDFRenderOption(String servletPath,HttpServletRequest request,boolean isDesigner){
  String baseURL=null;
  if (!isDesigner)   baseURL=ParameterAccessor.getBaseURL();
  if (baseURL == null) {
    if (ParameterAccessor.isOpenAsAttachment(request)) {
      baseURL=request.getScheme() + "String_Node_Str" + request.getServerName()+ "String_Node_Str"+ request.getServerPort();
    }
 else {
      baseURL="String_Node_Str";
    }
  }
  baseURL+=request.getContextPath();
  PDFRenderOption renderOption=new PDFRenderOption();
  if (servletPath != null && servletPath.length() > 0) {
    renderOption.setBaseURL(baseURL + servletPath);
  }
 else {
    renderOption.setBaseURL(baseURL + IBirtConstants.SERVLET_PATH_RUN);
  }
  renderOption.setSupportedImageFormats("String_Node_Str");
  renderOption.setOption(PDFRenderOption.FIT_TO_PAGE,new Boolean(ParameterAccessor.isFitToPage(request)));
  renderOption.setOption(PDFRenderOption.PAGEBREAK_PAGINATION_ONLY,new Boolean(ParameterAccessor.isPagebreakOnly(request)));
  return renderOption;
}
Program: 75302
Project: 75302
Buggy source:
/** 
 * Returns the coordinates of specified ticks. For the sake of performance, invokers need to ensure the index correct.
 * @param index tick index
 * @return
 */
public double getCoordinate(int index){
  if (index == size - 1) {
    return dEnd;
  }
  return dStart + index * dStep;
}

Fixed version (ground truth):
/** 
 * Returns the coordinates of specified ticks. For the sake of performance, invokers need to ensure the index correct.
 * @param index tick index
 * @return
 */
public double getCoordinate(int index){
  if (index == 0) {
    return dStart;
  }
 else   if (index == size - 1) {
    return dEnd;
  }
  return dStart + index * dStep - (isTickBetweenCategory ? 0 : dStep / 2);
}
Program: 75303
Project: 75303
Buggy source:
public Object clone(){
  return new AxisTickCoordinates(size,dStart,dEnd,dStep);
}

Fixed version (ground truth):
public Object clone(){
  return new AxisTickCoordinates(size,dStart,dEnd,dStep,isTickBetweenCategory);
}
Program: 75304
Project: 75304
Buggy source:
AxisTickCoordinates(int size,double dStart,double dEnd,double dStep){
  this.size=size;
  this.dStart=dStart;
  this.dEnd=dEnd;
  this.dStep=dStep;
}

Fixed version (ground truth):
AxisTickCoordinates(int size,double dStart,double dEnd,double dStep){
  this(size,dStart,dEnd,dStep,true);
}
Program: 75305
Project: 75305
Buggy source:
/** 
 * Returns the normalized tick coordinates. that means the start point is always zero, and the array lines forward. For the sake of performance, invokers need to ensure the index correct.
 * @param index tick index
 * @return
 */
public double getNormalizedCoordinate(int index){
  if (index == size - 1) {
    return dEnd - dStart;
  }
  return index * dStep;
}

Fixed version (ground truth):
/** 
 * Returns the normalized tick coordinates. that means the start point is always zero, and the array lines forward. For the sake of performance, invokers need to ensure the index correct.
 * @param index tick index
 * @return
 */
public double getNormalizedCoordinate(int index){
  return getCoordinate(index) - dStart;
}
Program: 75306
Project: 75306
Buggy source:
/** 
 * Resets the start and end coordinates.
 * @param dStart
 * @param dEnd
 */
void setEndPoints(double dStart,double dEnd){
  this.dStart=dStart;
  this.dEnd=dEnd;
  this.dStep=(dEnd - dStart) / size;
}

Fixed version (ground truth):
/** 
 * Resets the start and end coordinates.
 * @param dStart
 * @param dEnd
 */
void setEndPoints(double dStart,double dEnd){
  this.dStart=dStart;
  this.dEnd=dEnd;
  if (isTickBetweenCategory) {
    this.dStep=(dEnd - dStart) / size;
  }
 else {
    this.dStep=(dEnd - dStart) / (size - 1);
  }
}
Program: 75309
Project: 75309
Buggy source:
/** 
 */
public void test_regression_118178(){
  DesignEngine engine=new DesignEngine(new DesignConfig());
  SessionHandle session=engine.newSessionHandle(ULocale.ENGLISH);
  ReportDesignHandle designHandle=session.createDesign();
  ElementFactory factory=designHandle.getElementFactory();
  OdaDataSetHandle dataset=factory.newOdaDataSet("String_Node_Str",null);
  try {
    designHandle.getDataSets().add(dataset);
    fail();
  }
 catch (  Exception e) {
    assertTrue(e instanceof org.eclipse.birt.report.model.api.command.NameException);
  }
}

Fixed version (ground truth):
/** 
 */
public void test_regression_118178(){
  DesignEngine engine=new DesignEngine(new DesignConfig());
  SessionHandle session=engine.newSessionHandle(ULocale.ENGLISH);
  ReportDesignHandle designHandle=session.createDesign();
  ElementFactory factory=designHandle.getElementFactory();
  OdaDataSetHandle dataset=factory.newOdaDataSet("String_Node_Str",null);
  try {
    designHandle.getDataSets().add(dataset);
  }
 catch (  Exception e) {
    assertTrue(e instanceof org.eclipse.birt.report.model.api.command.NameException);
  }
}
Program: 75310
Project: 75310
Buggy source:
/** 
 * @throws DesignFileException
 * @throws SemanticException
 * @throws IOException
 */
public void test_regression_155943() throws DesignFileException, SemanticException, IOException {
  String report=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ INPUT;
  String libA=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ LIBRARY;
  openDesign(INPUT);
  ExtendedItemHandle chart=(ExtendedItemHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(chart);
  assertEquals("String_Node_Str",chart.getName());
  List elements=new ArrayList();
  elements.add(chart);
  GroupElementHandle group=new SimpleGroupElementHandle(designHandle,elements);
  assertEquals("String_Node_Str",chart.getProperty(ReportItemHandle.WIDTH_PROP).toString());
  assertFalse(group.hasLocalPropertiesForExtendedElements());
  chart.setProperty(ReportItemHandle.WIDTH_PROP,"String_Node_Str");
  assertFalse(group.hasLocalPropertiesForExtendedElements());
  group.clearLocalProperties();
  assertFalse(group.hasLocalPropertiesForExtendedElements());
}

Fixed version (ground truth):
/** 
 * @throws DesignFileException
 * @throws SemanticException
 * @throws IOException
 */
public void test_regression_155943() throws DesignFileException, SemanticException, IOException {
  String report=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ INPUT;
  String libA=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ LIBRARY;
  openDesign(INPUT);
  ExtendedItemHandle chart=(ExtendedItemHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(chart);
  assertEquals("String_Node_Str",chart.getName());
  List elements=new ArrayList();
  elements.add(chart);
  GroupElementHandle group=new SimpleGroupElementHandle(designHandle,elements);
  chart.setProperty(ReportItemHandle.WIDTH_PROP,"String_Node_Str");
  assertTrue(group.hasLocalPropertiesForExtendedElements());
  group.clearLocalProperties();
  elements.clear();
  assertFalse(group.hasLocalPropertiesForExtendedElements());
}
Program: 75311
Project: 75311
Buggy source:
private String applyIntrinsicFont(String fontName,int fontStyle,float fontSize,String text){
  setFont(fontName,fontStyle,fontSize);
  return ("String_Node_Str" + text + "String_Node_Str");
}

Fixed version (ground truth):
private String applyIntrinsicFont(String fontName,int fontStyle,float fontSize,String text){
  setFont(fontName,fontSize);
  return ("String_Node_Str" + text + "String_Node_Str");
}
Program: 75312
Project: 75312
Buggy source:
public void refreshFigure(){
  refreshBorder(getCrosstabHandleAdapter().getDesignElementHandle(),(BaseBorder)getFigure().getBorder());
  refreshBackground(getCrosstabHandleAdapter().getDesignElementHandle());
  refreshMargin();
}

Fixed version (ground truth):
public void refreshFigure(){
  refreshBorder(getCrosstabHandleAdapter().getDesignElementHandle(),(BaseBorder)getFigure().getBorder());
  refreshBackground(getCrosstabHandleAdapter().getDesignElementHandle());
  refreshMargin();
  ((TableLayout)getContentPane().getLayoutManager()).markDirty();
}
Program: 75313
Project: 75313
Buggy source:
protected void mergeDropCell(RowArea row){
  if (unresolvedRow == null) {
    return;
  }
  CellArea[] cells=new CellArea[columnNumber];
  Iterator iter=row.getChildren();
  while (iter.hasNext()) {
    CellArea cell=(CellArea)iter.next();
    int colStart=cell.getColumnID();
    int colEnd=colStart + cell.getColSpan();
    for (int i=colStart; i < colEnd; i++) {
      int index=colStart - start;
      if (index >= 0 && index < columnNumber) {
        cells[colStart - start]=cell;
      }
    }
  }
  for (int i=0; i < columnNumber; i++) {
    if (cells[i] == null) {
      ICellContent cellContent=null;
      CellArea ca=unresolvedRow.getCell(start + i);
      if (ca != null) {
        ICellContent cc=(ICellContent)ca.getContent();
        cellContent=new ClonedCellContent(cc,getRowSpan((IRowContent)row.getContent(),ca));
        int startColumn=cellContent.getColumn();
        int endColumn=cellContent.getColSpan() + startColumn;
        CellArea emptyCell=AreaFactory.createCellArea(cellContent);
        emptyCell.setRowSpan(ca.getRowSpan());
        resolveBorderConflict(emptyCell,false);
        emptyCell.setWidth(getCellWidth(startColumn,endColumn));
        emptyCell.setPosition(layoutInfo.getXPosition(i),0);
        emptyCell.setHeight(row.getHeight());
        row.addChild(emptyCell);
      }
    }
  }
}

Fixed version (ground truth):
protected void mergeDropCell(RowArea row){
  if (unresolvedRow == null) {
    return;
  }
  CellArea[] cells=new CellArea[columnNumber];
  Iterator iter=row.getChildren();
  while (iter.hasNext()) {
    CellArea cell=(CellArea)iter.next();
    int colStart=cell.getColumnID();
    int colEnd=colStart + cell.getColSpan();
    for (int i=colStart; i < colEnd; i++) {
      int index=colStart - start;
      if (index >= 0 && index < columnNumber) {
        cells[colStart - start]=cell;
      }
    }
  }
  for (int i=0; i < columnNumber; i++) {
    if (cells[i] == null) {
      ICellContent cellContent=null;
      CellArea ca=unresolvedRow.getCell(start + i);
      if (ca != null) {
        ICellContent cc=(ICellContent)ca.getContent();
        cellContent=new ClonedCellContent(cc,getRowSpan((IRowContent)row.getContent(),ca));
        int startColumn=cellContent.getColumn();
        int endColumn=cellContent.getColSpan() + startColumn;
        CellArea emptyCell=AreaFactory.createCellArea(cellContent);
        emptyCell.setRowSpan(cellContent.getRowSpan());
        resolveBorderConflict(emptyCell,false);
        emptyCell.setWidth(getCellWidth(startColumn,endColumn));
        emptyCell.setPosition(layoutInfo.getXPosition(i),0);
        emptyCell.setHeight(row.getHeight());
        row.addChild(emptyCell);
      }
    }
  }
}
Program: 75314
Project: 75314
Buggy source:
/** 
 * Set state of stacked CheckBox by type of series.
 */
private void setStackedBoxState(){
  if (btnStack == null) {
    return;
  }
  ChartDimension cd=getChart().getDimension();
  if ((cd == ChartDimension.TWO_DIMENSIONAL_LITERAL || cd == ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL)) {
    List seriesDefns=ChartUIUtil.getAllOrthogonalSeriesDefinitions(getChart());
    Series s=((SeriesDefinition)seriesDefns.get(0)).getDesignTimeSeries();
    if (s.getDisplayName().equals(seriesDefn.getDesignTimeSeries().getDisplayName())) {
      btnStack.setEnabled(true);
    }
 else {
      btnStack.setEnabled(false);
      cmbTypes.setEnabled(true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Set state of stacked CheckBox by type of series.
 */
private void setStackedBoxState(){
  if (btnStack == null) {
    return;
  }
  ChartDimension cd=getChart().getDimension();
  if ((cd == ChartDimension.TWO_DIMENSIONAL_LITERAL || cd == ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL)) {
    List seriesDefns=ChartUIUtil.getAllOrthogonalSeriesDefinitions(getChart());
    Series s=((SeriesDefinition)seriesDefns.get(0)).getDesignTimeSeries();
    if (s.getDisplayName().equals(seriesDefn.getDesignTimeSeries().getDisplayName())) {
      if (canStack && seriesDefn.getDesignTimeSeries().canBeStacked()) {
        btnStack.setEnabled(true);
      }
    }
 else {
      btnStack.setEnabled(false);
      cmbTypes.setEnabled(true);
    }
  }
}
Program: 75315
Project: 75315
Buggy source:
/** 
 * Gets position of css style sheet in all sheets. Compare two absolute path of file.
 * @param module module
 * @param csses list each item is <code>CssStyleSheet</code>
 * @param location absolute location
 * @return css style sheet.
 */
public static int getPositionOfCssStyleSheet(Module module,List csses,String location){
  if (location == null || csses == null)   return -1;
  URL url=module.findResource(location,IResourceLocator.CASCADING_STYLE_SHEET);
  if (url == null)   return -1;
  String fileLocation=url.getFile();
  for (int i=0; i < csses.size(); ++i) {
    CssStyleSheet css=(CssStyleSheet)csses.get(i);
    String tmpFileName=css.getFileName();
    url=module.findResource(tmpFileName,IResourceLocator.CASCADING_STYLE_SHEET);
    if (url == null)     continue;
    tmpFileName=url.getFile();
    if (fileLocation.equalsIgnoreCase(tmpFileName))     return i;
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Gets position of css style sheet in all sheets. Compare two absolute path of file.
 * @param module module
 * @param csses list each item is <code>CssStyleSheet</code>
 * @param location absolute location
 * @return css style sheet.
 */
public static int getPositionOfCssStyleSheet(Module module,List csses,String location){
  if (location == null || csses == null)   return -1;
  URL targetUrl=module.findResource(location,IResourceLocator.CASCADING_STYLE_SHEET);
  String fileLocation=location;
  if (targetUrl != null)   fileLocation=targetUrl.getFile();
  for (int i=0; i < csses.size(); ++i) {
    CssStyleSheet css=(CssStyleSheet)csses.get(i);
    String tmpFileName=css.getFileName();
    if (targetUrl != null) {
      URL url=module.findResource(tmpFileName,IResourceLocator.CASCADING_STYLE_SHEET);
      if (url != null)       tmpFileName=url.getFile();
    }
    if (fileLocation.equalsIgnoreCase(tmpFileName))     return i;
  }
  return -1;
}
Program: 75316
Project: 75316
Buggy source:
/** 
 * Check style sheet can be droped or not.
 * @param sheetHandle
 * @return <code>true</code> can be dropped.else return <code>false</code>
 */
public final boolean canDropCssStyleSheet(CssStyleSheetHandle sheetHandle){
  if (!element.canEdit(module)) {
    return false;
  }
  if (sheetHandle == null)   return false;
  String fileName=sheetHandle.getFileName();
  CssStyleSheet sheet=CssStyleSheetAdapter.getCssStyleSheetByLocation(module,((ICssStyleSheetOperation)element).getCsses(),fileName);
  ;
  if (sheet == null) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Check style sheet can be droped or not.
 * @param sheetHandle
 * @return <code>true</code> can be dropped.else return <code>false</code>
 */
public final boolean canDropCssStyleSheet(CssStyleSheetHandle sheetHandle){
  if (!element.canEdit(module)) {
    return false;
  }
  if (sheetHandle == null)   return false;
  String fileName=sheetHandle.getFileName();
  int position=CssStyleSheetAdapter.getPositionOfCssStyleSheet(module,((ICssStyleSheetOperation)element).getCsses(),fileName);
  ;
  if (position == -1) {
    return false;
  }
  return true;
}
Program: 75317
Project: 75317
Buggy source:
public void handleEvent(Event event){
  TreeItem item=(TreeItem)event.item;
  if (event.item.getData() instanceof CssStyleSheetHandle || event.item.getData() instanceof CssSharedStyleHandle) {
    Color gray=Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
    item.setForeground(gray);
  }
 else {
    Color black=Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
    item.setForeground(black);
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  TreeItem item=(TreeItem)event.item;
  if (event.item.getData() instanceof CssStyleSheetHandle || event.item.getData() instanceof CssSharedStyleHandle) {
    Color gray=Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
    if (!item.getForeground().equals(gray)) {
      item.setForeground(gray);
    }
  }
 else {
    Color black=Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
    if (!item.getForeground().equals(black)) {
      item.setForeground(black);
    }
  }
}
Program: 75321
Project: 75321
Buggy source:
public void run(){
  transStar(NAME);
  try {
    LevelViewDialog dialog=new LevelViewDialog(UIUtil.getDefaultShell());
    List showLevels=new ArrayList();
    List nullLevelHandle=new ArrayList();
    int viewCount=viewHandle.getLevelCount();
    for (int i=0; i < viewCount; i++) {
      LevelViewHandle levelHandle=viewHandle.getLevel(i);
      if (levelHandle.getCubeLevel() == null) {
        nullLevelHandle.add(new Integer(levelHandle.getIndex()));
      }
 else {
        showLevels.add(levelHandle.getCubeLevel());
      }
    }
    dialog.setInput(viewHandle.getCubeDimension(),showLevels);
    if (dialog.open() == Window.OK) {
      CrosstabReportItemHandle reportHandle=viewHandle.getCrosstab();
      List result=(List)dialog.getResult();
      processor(showLevels,result,nullLevelHandle);
      CrosstabAdaptUtil.processInvaildBindings(reportHandle);
    }
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}

Fixed version (ground truth):
public void run(){
  transStar(NAME);
  try {
    LevelViewDialog dialog=new LevelViewDialog(UIUtil.getDefaultShell());
    List showLevels=new ArrayList();
    List nullLevelHandle=new ArrayList();
    int viewCount=viewHandle.getLevelCount();
    for (int i=0; i < viewCount; i++) {
      LevelViewHandle levelHandle=viewHandle.getLevel(i);
      if (levelHandle.getCubeLevel() == null) {
        nullLevelHandle.add(new Integer(levelHandle.getIndex()));
      }
 else {
        showLevels.add(levelHandle.getCubeLevel());
      }
    }
    dialog.setInput(viewHandle.getCubeDimension(),showLevels);
    if (dialog.open() == Window.OK) {
      CrosstabReportItemHandle reportHandle=viewHandle.getCrosstab();
      List result=(List)dialog.getResult();
      boolean isLevelRemoved=processor(showLevels,result,nullLevelHandle);
      CrosstabAdaptUtil.processInvaildBindings(reportHandle,isLevelRemoved);
    }
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}
Program: 75322
Project: 75322
Buggy source:
private void processor(List ori,List newList,List nullLevelHandle) throws SemanticException {
  for (int i=nullLevelHandle.size() - 1; i >= 0; i--) {
    int index=((Integer)nullLevelHandle.get(i)).intValue();
    viewHandle.removeLevel(index);
  }
  for (int i=0; i < ori.size(); i++) {
    LevelHandle tempHandle=(LevelHandle)ori.get(i);
    if (!newList.contains(tempHandle)) {
      viewHandle.removeLevel(tempHandle.getQualifiedName());
    }
  }
  Collections.sort(newList,new LevelComparator());
  for (int i=0; i < newList.size(); i++) {
    LevelHandle tempHandle=(LevelHandle)newList.get(i);
    if (viewHandle.getLevel(tempHandle.getQualifiedName()) == null) {
      insertLevelHandle(tempHandle,i);
    }
  }
}

Fixed version (ground truth):
private boolean processor(List ori,List newList,List nullLevelHandle) throws SemanticException {
  boolean isLevelRemoved=false;
  for (int i=nullLevelHandle.size() - 1; i >= 0; i--) {
    int index=((Integer)nullLevelHandle.get(i)).intValue();
    viewHandle.removeLevel(index);
    isLevelRemoved=true;
  }
  for (int i=0; i < ori.size(); i++) {
    LevelHandle tempHandle=(LevelHandle)ori.get(i);
    if (!newList.contains(tempHandle)) {
      viewHandle.removeLevel(tempHandle.getQualifiedName());
      isLevelRemoved=true;
    }
  }
  Collections.sort(newList,new LevelComparator());
  for (int i=0; i < newList.size(); i++) {
    LevelHandle tempHandle=(LevelHandle)newList.get(i);
    if (viewHandle.getLevel(tempHandle.getQualifiedName()) == null) {
      insertLevelHandle(tempHandle,i);
    }
  }
  return isLevelRemoved;
}
Program: 75325
Project: 75325
Buggy source:
public void addAggregateOn(String levelName) throws DataException {
  if (this.aggregateOn.contains(levelName))   throw new DataException(ResourceConstants.TRY_TO_ADD_IDENTICAL_AGGR_GROUP,new Object[]{levelName,this.name});
  this.aggregateOn.add(levelName);
}

Fixed version (ground truth):
public void addAggregateOn(String levelName) throws DataException {
  if (!this.aggregateOn.contains(levelName)) {
    this.aggregateOn.add(levelName);
  }
}
Program: 75327
Project: 75327
Buggy source:
public CubeCursorImpl(CubeCursor cursor,Scriptable scope,ICubeQueryDefinition queryDefn) throws DataException {
  this.cursor=cursor;
  this.scope=scope;
  this.queryDefn=queryDefn;
  OlapQueryUtil.validateBinding(queryDefn,false);
  this.bindingMap=new HashMap();
  this.dataTypeMap=new HashMap();
  for (int i=0; i < this.queryDefn.getBindings().size(); i++) {
    IBinding binding=(IBinding)this.queryDefn.getBindings().get(i);
    if (binding.getAggrFunction() == null) {
      this.bindingMap.put(binding.getBindingName(),binding.getExpression());
      OLAPExpressionCompiler.compile(binding.getExpression());
    }
    dataTypeMap.put(binding.getBindingName(),Integer.valueOf(binding.getDataType()));
  }
  this.scope.put("String_Node_Str",this.scope,new JSCubeBindingObject(this));
}

Fixed version (ground truth):
public CubeCursorImpl(CubeCursor cursor,Scriptable scope,ICubeQueryDefinition queryDefn) throws DataException {
  this.cursor=cursor;
  this.scope=scope;
  this.queryDefn=queryDefn;
  OlapQueryUtil.validateBinding(queryDefn,false);
  this.bindingMap=new HashMap();
  this.dataTypeMap=new HashMap();
  for (int i=0; i < this.queryDefn.getBindings().size(); i++) {
    IBinding binding=(IBinding)this.queryDefn.getBindings().get(i);
    if (binding.getAggrFunction() == null) {
      this.bindingMap.put(binding.getBindingName(),binding.getExpression());
      OLAPExpressionCompiler.compile(binding.getExpression());
    }
    dataTypeMap.put(binding.getBindingName(),new Integer(binding.getDataType()));
  }
  this.scope.put("String_Node_Str",this.scope,new JSCubeBindingObject(this));
}
Program: 75328
Project: 75328
Buggy source:
public int canDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (transfer instanceof Object[]) {
  }
  if (transfer.equals(TEMPLATE) && target instanceof TableCellEditPart) {
    CellHandle cellHandle=(CellHandle)((TableCellEditPart)target).getModel();
    int slotId=cellHandle.getContainer().getContainerSlotHandle().getSlotID();
    if (slotId == TableHandle.HEADER_SLOT || slotId == TableHandle.FOOTER_SLOT || slotId == TableHandle.GROUP_SLOT) {
      return DNDService.LOGIC_TRUE;
    }
 else {
      return DNDService.LOGIC_FALSE;
    }
  }
  return DNDService.LOGIC_UNKNOW;
}

Fixed version (ground truth):
public int canDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (transfer instanceof Object[]) {
  }
  if (transfer.equals(TEMPLATE)) {
    if (target instanceof TableCellEditPart) {
      CellHandle cellHandle=(CellHandle)((TableCellEditPart)target).getModel();
      int slotId=cellHandle.getContainer().getContainerSlotHandle().getSlotID();
      if (slotId == TableHandle.HEADER_SLOT || slotId == TableHandle.FOOTER_SLOT || slotId == TableHandle.GROUP_SLOT) {
        return DNDService.LOGIC_TRUE;
      }
 else {
        return DNDService.LOGIC_FALSE;
      }
    }
 else     if (target instanceof ListBandEditPart) {
      ListBandProxy cellHandle=(ListBandProxy)((ListBandEditPart)target).getModel();
      int slotId=cellHandle.getSlotId();
      if (slotId == ListHandle.HEADER_SLOT || slotId == ListHandle.FOOTER_SLOT || slotId == ListHandle.GROUP_SLOT) {
        return DNDService.LOGIC_TRUE;
      }
 else {
        return DNDService.LOGIC_FALSE;
      }
    }
  }
  return DNDService.LOGIC_UNKNOW;
}
Program: 75329
Project: 75329
Buggy source:
public boolean performDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (transfer instanceof Object[]) {
  }
  if (transfer.equals(TEMPLATE) && target instanceof TableCellEditPart) {
    SessionHandleAdapter.getInstance().getCommandStack().startTrans(TRANS_NAME);
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(null);
    CellHandle cellHandle=(CellHandle)((TableCellEditPart)target).getModel();
    try {
      cellHandle.addElement(dataHandle,CellHandle.CONTENT_SLOT);
      DataColumnBindingDialog dialog=new DataColumnBindingDialog(true);
      dialog.setInput(dataHandle);
      dialog.setAggreate(true);
      if (dialog.open() == Window.OK) {
        dataHandle.setResultSetColumn(dialog.getBindingColumn().getName());
        SessionHandleAdapter.getInstance().getCommandStack().commit();
      }
 else {
        SessionHandleAdapter.getInstance().getCommandStack().rollback();
      }
    }
 catch (    Exception e) {
      SessionHandleAdapter.getInstance().getCommandStack().rollback();
      ExceptionHandler.handle(e);
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean performDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (transfer instanceof Object[]) {
  }
  SessionHandleAdapter.getInstance().getCommandStack().startTrans(TRANS_NAME);
  DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(null);
  try {
    if (target instanceof TableCellEditPart) {
      CellHandle cellHandle=(CellHandle)((TableCellEditPart)target).getModel();
      cellHandle.addElement(dataHandle,CellHandle.CONTENT_SLOT);
    }
 else     if (target instanceof ListBandEditPart) {
      ListBandProxy cellHandle=(ListBandProxy)((ListBandEditPart)target).getModel();
      cellHandle.getSlotHandle().add(dataHandle);
    }
    DataColumnBindingDialog dialog=new DataColumnBindingDialog(true);
    dialog.setInput(dataHandle);
    dialog.setAggreate(true);
    if (dialog.open() == Window.OK) {
      dataHandle.setResultSetColumn(dialog.getBindingColumn().getName());
      SessionHandleAdapter.getInstance().getCommandStack().commit();
    }
 else {
      SessionHandleAdapter.getInstance().getCommandStack().rollback();
    }
  }
 catch (  Exception e) {
    SessionHandleAdapter.getInstance().getCommandStack().rollback();
    ExceptionHandler.handle(e);
  }
  return true;
}
Program: 75330
Project: 75330
Buggy source:
public void startTable(ITableContent table){
  Rule rule=engine.getCurrentContainer().getRule();
  int width=rule.getWidth();
  TableInfo info=LayoutUtil.createTable(table,width);
  engine.addTable(info,table.getComputedStyle());
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  Rule rule=engine.getCurrentContainer().getRule();
  int width=rule.getWidth();
  TableInfo info=LayoutUtil.createTable(table,width);
  if (info == null) {
    return;
  }
  engine.addTable(info,table.getComputedStyle());
}
Program: 75331
Project: 75331
Buggy source:
public static TableInfo createTable(ITableContent table,int width){
  int colcount=table.getColumnCount();
  int[] index=new int[colcount];
  int know=0;
  List unmount=new ArrayList();
  for (int i=0; i < colcount; i++) {
    DimensionType value=table.getColumn(i).getWidth();
    if (value == null) {
      unmount.add(new Integer(i));
    }
 else {
      index[i]=ExcelUtil.covertDimensionType(value,width);
      know+=index[i];
    }
  }
  int left=width - know;
  if (left >= 0 && unmount.size() == 0) {
    return new DefaultTableInfo(index);
  }
 else   if (left <= 0 && unmount.size() > 0) {
    return new DefaultTableInfo(split(width,colcount));
  }
 else   if (left > 0 && unmount.size() > 0) {
    int[] size=split(left,unmount.size());
    Iterator iter=unmount.iterator();
    int i=0;
    while (iter.hasNext()) {
      int pos=((Integer)iter.next()).intValue();
      index[pos]=size[i];
      i++;
    }
    return new DefaultTableInfo(index);
  }
 else {
    System.out.println("String_Node_Str");
    return null;
  }
}

Fixed version (ground truth):
public static TableInfo createTable(ITableContent table,int width){
  int colcount=table.getColumnCount();
  int[] index=new int[colcount];
  int know=0;
  List unmount=new ArrayList();
  for (int i=0; i < colcount; i++) {
    DimensionType value=table.getColumn(i).getWidth();
    if (value == null) {
      unmount.add(new Integer(i));
    }
 else {
      index[i]=ExcelUtil.covertDimensionType(value,width);
      know+=index[i];
    }
  }
  int left=width - know;
  if (left >= 0 && unmount.size() == 0) {
    return new DefaultTableInfo(index);
  }
 else   if (left <= 0 && unmount.size() >= 0) {
    return new DefaultTableInfo(split(width,colcount));
  }
 else   if (left > 0 && unmount.size() > 0) {
    int[] size=split(left,unmount.size());
    Iterator iter=unmount.iterator();
    int i=0;
    while (iter.hasNext()) {
      int pos=((Integer)iter.next()).intValue();
      index[pos]=size[i];
      i++;
    }
    return new DefaultTableInfo(index);
  }
 else {
    System.out.println("String_Node_Str");
    return null;
  }
}
Program: 75332
Project: 75332
Buggy source:
/** 
 * Initialize the instance. The method includes heavyweight operations such as ResultIterator population.
 * @param dataEngine
 * @param appContext
 * @throws DataException
 */
private void initialize(DataEngineImpl dataEngine,Map appContext) throws DataException {
  int savedCacheOption=getDataSetCacheManager().suspendCache();
  try {
    ResultIterator left=(ResultIterator)this.leftQueryResults.getResultIterator();
    ResultIterator right=(ResultIterator)this.rightQueryResults.getResultIterator();
    getDataSetCacheManager().setCacheOption(savedCacheOption);
    getDataSetCacheManager().setCacheMode(DataSetCacheUtil.getCacheMode(appContext));
    this.left=left;
    this.right=right;
    this.joinType=dataSet.getJoinType();
    this.matcher=new JoinConditionMatcher(left.getOdiResult(),right.getOdiResult(),left.getScope(),right.getScope(),dataSet.getJoinConditions());
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * Initialize the instance. The method includes heavyweight operations such as ResultIterator population.
 * @param dataEngine
 * @param appContext
 * @throws DataException
 */
private void initialize(DataEngineImpl dataEngine,Map appContext){
  int savedCacheOption=getDataSetCacheManager().suspendCache();
  getDataSetCacheManager().setCacheOption(savedCacheOption);
  getDataSetCacheManager().setCacheMode(DataSetCacheUtil.getCacheMode(appContext));
  this.joinType=dataSet.getJoinType();
  this.matcher=new JoinConditionMatcher(left.getOdiResult(),right.getOdiResult(),left.getScope(),right.getScope(),dataSet.getJoinConditions());
}
Program: 75333
Project: 75333
Buggy source:
public CubeCursorImpl(CubeCursor cursor,Scriptable scope,ICubeQueryDefinition queryDefn) throws DataException {
  this.cursor=cursor;
  this.scope=scope;
  this.queryDefn=queryDefn;
  OlapQueryUtil.validateBinding(queryDefn,false);
  this.bindingMap=new HashMap();
  for (int i=0; i < this.queryDefn.getBindings().size(); i++) {
    IBinding binding=(IBinding)this.queryDefn.getBindings().get(i);
    if (binding.getAggrFunction() == null) {
      this.bindingMap.put(binding.getBindingName(),binding.getExpression());
      OLAPExpressionCompiler.compile(binding.getExpression());
    }
  }
  this.scope.put("String_Node_Str",this.scope,new JSCubeBindingObject(this));
}

Fixed version (ground truth):
public CubeCursorImpl(CubeCursor cursor,Scriptable scope,ICubeQueryDefinition queryDefn) throws DataException {
  this.cursor=cursor;
  this.scope=scope;
  this.queryDefn=queryDefn;
  OlapQueryUtil.validateBinding(queryDefn,false);
  this.bindingMap=new HashMap();
  this.dataTypeMap=new HashMap();
  for (int i=0; i < this.queryDefn.getBindings().size(); i++) {
    IBinding binding=(IBinding)this.queryDefn.getBindings().get(i);
    if (binding.getAggrFunction() == null) {
      this.bindingMap.put(binding.getBindingName(),binding.getExpression());
      OLAPExpressionCompiler.compile(binding.getExpression());
    }
    dataTypeMap.put(binding.getBindingName(),Integer.valueOf(binding.getDataType()));
  }
  this.scope.put("String_Node_Str",this.scope,new JSCubeBindingObject(this));
}
Program: 75334
Project: 75334
Buggy source:
public Object evaluate(Context context,Scriptable scope) throws DataException {
  Object temp=this.script.exec(context,scope);
  if (temp instanceof ScriptableObject) {
    return ((ScriptableObject)temp).getDefaultValue(null);
  }
  return temp;
}

Fixed version (ground truth):
public Object evaluate(Context context,Scriptable scope) throws DataException {
  Object temp=this.script.exec(context,scope);
  temp=JavascriptEvalUtil.convertJavascriptValue(temp);
  if (temp instanceof ScriptableObject) {
    return ((ScriptableObject)temp).getDefaultValue(null);
  }
  return temp;
}
Program: 75335
Project: 75335
Buggy source:
public Collection getColumnValueSet(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  ArrayList temp=new ArrayList();
  while (columnBindings.hasNext()) {
    temp.add(columnBindings.next());
  }
  if (referToAggregation(temp,boundColumnName))   return new ArrayList();
  IQueryResults queryResults=getGroupingQueryResults(dataSet,inputParamBindings,temp.iterator(),boundColumnName);
  IResultIterator resultIt=queryResults.getResultIterator();
  int maxRowCount=-1;
  if (requestInfo != null) {
    resultIt.moveTo(requestInfo.getStartRow());
    maxRowCount=requestInfo.getMaxRow();
  }
  ArrayList values=new ArrayList();
  while (resultIt.next() && maxRowCount != 0) {
    Object value=resultIt.getValue(boundColumnName);
    values.add(value);
    resultIt.skipToEnd(1);
    maxRowCount--;
  }
  resultIt.close();
  queryResults.close();
  return values;
}

Fixed version (ground truth):
public Collection getColumnValueSet(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  ArrayList temp=new ArrayList();
  while (columnBindings.hasNext()) {
    temp.add(columnBindings.next());
  }
  if (referToAggregation(temp,boundColumnName))   return new ArrayList();
  IQueryResults queryResults=getGroupingQueryResults(dataSet,inputParamBindings,temp.iterator(),boundColumnName);
  IResultIterator resultIt=queryResults.getResultIterator();
  int maxRowCount=-1;
  ArrayList values=new ArrayList();
  if (requestInfo != null) {
    if (requestInfo.getStartRow() >= 0) {
      resultIt.moveTo(requestInfo.getStartRow());
      Object value=resultIt.getValue(boundColumnName);
      values.add(value);
    }
    maxRowCount=requestInfo.getMaxRow();
  }
  while (resultIt.next() && maxRowCount != 0) {
    Object value=resultIt.getValue(boundColumnName);
    values.add(value);
    resultIt.skipToEnd(1);
    maxRowCount--;
  }
  resultIt.close();
  queryResults.close();
  return values;
}
Program: 75336
Project: 75336
Buggy source:
protected boolean existDropCells(){
  if (unresolvedRow != null) {
    for (int i=0; i < columnNumber; i++) {
      CellArea cell=unresolvedRow.getCell(start + i);
      if (cell != null && isDropCell(cell)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean existDropCells(){
  if (unresolvedRow != null) {
    for (int i=0; i < columnNumber; i++) {
      CellArea cell=unresolvedRow.getCell(start + i);
      if (cell != null && (isDropCell(cell) || cell.getRowSpan() > 1)) {
        return true;
      }
    }
  }
  return false;
}
Program: 75337
Project: 75337
Buggy source:
private boolean isEnable(){
  IEditorPart editor=UIUtil.getActiveEditor(true);
  if (editor != null) {
    IContentType[] contentTypes=Platform.getContentTypeManager().findContentTypesFor(editor.getEditorInput().getName());
    if (contentTypes[0] != null && (contentTypes[0].getId().equals("String_Node_Str") || contentTypes[0].getId().equals("String_Node_Str"))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isEnable(){
  IEditorPart editor=UIUtil.getActiveEditor(true);
  if (editor != null) {
    IContentType[] contentTypes=Platform.getContentTypeManager().findContentTypesFor(editor.getEditorInput().getName());
    if (contentTypes.length > 0 && contentTypes[0] != null && (contentTypes[0].getId().equals("String_Node_Str") || contentTypes[0].getId().equals("String_Node_Str"))) {
      return true;
    }
  }
  return false;
}
Program: 75338
Project: 75338
Buggy source:
private boolean isEnable(){
  IEditorPart editor=UIUtil.getActiveEditor(true);
  if (editor != null) {
    IContentType[] contentTypes=Platform.getContentTypeManager().findContentTypesFor(editor.getEditorInput().getName());
    if (contentTypes[0] != null && (contentTypes[0].getId().equals("String_Node_Str") || contentTypes[0].getId().equals("String_Node_Str"))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isEnable(){
  IEditorPart editor=UIUtil.getActiveEditor(true);
  if (editor != null) {
    IContentType[] contentTypes=Platform.getContentTypeManager().findContentTypesFor(editor.getEditorInput().getName());
    if (contentTypes.length > 0 && contentTypes[0] != null && (contentTypes[0].getId().equals("String_Node_Str") || contentTypes[0].getId().equals("String_Node_Str"))) {
      return true;
    }
  }
  return false;
}
Program: 75339
Project: 75339
Buggy source:
/** 
 * create a row in the table model
 * @param content row content
 */
public Row createRow(Object rowContent){
  if (!isRowHidden(rowContent)) {
    isRowHidden=false;
    ensureSize(rowCount + 1,realColCount);
    Row row=rows[rowCount];
    row.rowId=rowCount;
    row.content=rowContent;
    if (rowCount > 0) {
      Cell[] cells=row.cells;
      Cell[] lastCells=rows[rowCount - 1].cells;
      ;
      for (int cellId=0; cellId < realColCount; cellId++) {
        Cell lastCell=lastCells[cellId];
        if (lastCell.status == Cell.CELL_SPANED) {
          lastCell=lastCell.getCell();
        }
        if (lastCell.status == Cell.CELL_USED) {
          if (lastCell.rowSpan < 0 || lastCell.rowId + lastCell.rowSpan > rowCount) {
            cells[cellId]=Cell.createSpanCell(rowCount,cellId,lastCell);
          }
        }
      }
    }
    rowCount++;
    return row;
  }
  isRowHidden=true;
  if (rowCount > 0) {
    Cell[] lastCells=rows[rowCount - 1].cells;
    ;
    for (int cellId=0; cellId < realColCount; cellId++) {
      Cell lastCell=lastCells[cellId];
      if (lastCell.status == Cell.CELL_SPANED) {
        lastCell=lastCell.getCell();
      }
      if (lastCell.status == Cell.CELL_USED) {
        if (lastCell.rowId + lastCell.rowSpan >= rowCount + 1) {
          lastCell.rowSpan--;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * create a row in the table model
 * @param content row content
 */
public Row createRow(Object rowContent,boolean isHidden){
  if (!isHidden) {
    isRowHidden=false;
    ensureSize(rowCount + 1,realColCount);
    Row row=rows[rowCount];
    row.rowId=rowCount;
    row.content=rowContent;
    if (rowCount > 0) {
      Cell[] cells=row.cells;
      Cell[] lastCells=rows[rowCount - 1].cells;
      ;
      for (int cellId=0; cellId < realColCount; cellId++) {
        Cell lastCell=lastCells[cellId];
        if (lastCell.status == Cell.CELL_SPANED) {
          lastCell=lastCell.getCell();
        }
        if (lastCell.status == Cell.CELL_USED) {
          if (lastCell.rowSpan < 0 || lastCell.rowId + lastCell.rowSpan > rowCount) {
            cells[cellId]=Cell.createSpanCell(rowCount,cellId,lastCell);
          }
        }
      }
    }
    rowCount++;
    return row;
  }
  isRowHidden=true;
  if (rowCount > 0) {
    Cell[] lastCells=rows[rowCount - 1].cells;
    ;
    for (int cellId=0; cellId < realColCount; cellId++) {
      Cell lastCell=lastCells[cellId];
      if (lastCell.status == Cell.CELL_SPANED) {
        lastCell=lastCell.getCell();
      }
      if (lastCell.status == Cell.CELL_USED) {
        if (lastCell.rowId + lastCell.rowSpan >= rowCount + 1) {
          lastCell.rowSpan--;
        }
      }
    }
  }
  return null;
}
Program: 75340
Project: 75340
Buggy source:
public void run(){
  transStar(NAME);
  try {
    LevelViewDialog dialog=new LevelViewDialog(UIUtil.getDefaultShell());
    List showLevels=new ArrayList();
    List nullLevelHandle=new ArrayList();
    int viewCount=viewHandle.getLevelCount();
    for (int i=0; i < viewCount; i++) {
      LevelViewHandle levelHandle=viewHandle.getLevel(i);
      if (levelHandle.getCubeLevel() == null) {
        nullLevelHandle.add(new Integer(levelHandle.getIndex()));
      }
 else {
        showLevels.add(levelHandle.getCubeLevel());
      }
    }
    dialog.setInput(viewHandle.getCubeDimension(),showLevels);
    if (dialog.open() == Window.OK) {
      List result=(List)dialog.getResult();
      processor(showLevels,result,nullLevelHandle);
    }
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}

Fixed version (ground truth):
public void run(){
  transStar(NAME);
  try {
    LevelViewDialog dialog=new LevelViewDialog(UIUtil.getDefaultShell());
    List showLevels=new ArrayList();
    List nullLevelHandle=new ArrayList();
    int viewCount=viewHandle.getLevelCount();
    for (int i=0; i < viewCount; i++) {
      LevelViewHandle levelHandle=viewHandle.getLevel(i);
      if (levelHandle.getCubeLevel() == null) {
        nullLevelHandle.add(new Integer(levelHandle.getIndex()));
      }
 else {
        showLevels.add(levelHandle.getCubeLevel());
      }
    }
    dialog.setInput(viewHandle.getCubeDimension(),showLevels);
    if (dialog.open() == Window.OK) {
      CrosstabReportItemHandle reportHandle=viewHandle.getCrosstab();
      List result=(List)dialog.getResult();
      processor(showLevels,result,nullLevelHandle);
      CrosstabAdaptUtil.processInvaildBindings(reportHandle);
    }
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}
Program: 75341
Project: 75341
Buggy source:
public void run(){
  if (dimensionHandle == null) {
    return;
  }
  transStar(NAME);
  try {
    dimensionHandle.getCrosstab().removeDimension(dimensionHandle.getAxisType(),dimensionHandle.getIndex());
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}

Fixed version (ground truth):
public void run(){
  if (dimensionHandle == null) {
    return;
  }
  transStar(NAME);
  try {
    CrosstabReportItemHandle handle=dimensionHandle.getCrosstab();
    dimensionHandle.getCrosstab().removeDimension(dimensionHandle.getAxisType(),dimensionHandle.getIndex());
    CrosstabAdaptUtil.processInvaildBindings(handle);
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}
Program: 75342
Project: 75342
Buggy source:
public void run(){
  CrosstabReportItemHandle reportItem=getCrosstabReportItemHandle(getHandle());
  if (reportItem != null) {
    transStar(NAME);
    try {
      reportItem.removeMeasure(measureViewHandle.getIndex());
    }
 catch (    SemanticException e) {
      rollBack();
      ExceptionHandler.handle(e);
      return;
    }
    transEnd();
  }
}

Fixed version (ground truth):
public void run(){
  CrosstabReportItemHandle reportItem=getCrosstabReportItemHandle(getHandle());
  if (reportItem != null) {
    transStar(NAME);
    try {
      reportItem.removeMeasure(measureViewHandle.getIndex());
      CrosstabAdaptUtil.processInvaildBindings(reportItem);
    }
 catch (    SemanticException e) {
      rollBack();
      ExceptionHandler.handle(e);
      return;
    }
    transEnd();
  }
}
Program: 75343
Project: 75343
Buggy source:
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=childViewHandle.getCrosstab();
  try {
    reportHandle.pivotDimension(childViewHandle.getAxisType(),childViewHandle.getIndex(),getType(),findPosition());
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
  }
  transEnd();
}

Fixed version (ground truth):
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=childViewHandle.getCrosstab();
  try {
    reportHandle.pivotDimension(childViewHandle.getAxisType(),childViewHandle.getIndex(),getType(),findPosition());
    CrosstabAdaptUtil.processInvaildBindings(reportHandle);
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
  }
  transEnd();
}
Program: 75345
Project: 75345
Buggy source:
public DataExtractionTaskV1(IReportEngine engine,IReportRunnable runnable,IReportDocument reader) throws EngineException {
  super(engine,runnable);
  this.report=((ReportRunnable)runnable).getReportIR();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  Map appContext=executionContext.getAppContext();
  IDataEngine dataEngine=executionContext.getDataEngine();
  dataEngine.prepare(report,appContext);
}

Fixed version (ground truth):
public DataExtractionTaskV1(IReportEngine engine,IReportRunnable runnable,IReportDocument reader) throws EngineException {
  super(engine,runnable);
  this.report=((ReportRunnable)runnable).getReportIR();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  setParameterValues(reportDocReader.getParameterValues());
  setParameterDisplayTexts(reportDocReader.getParameterDisplayTexts());
  usingParameterValues();
  executionContext.registerGlobalBeans(reportDocReader.getGlobalVariables(null));
  Map appContext=executionContext.getAppContext();
  IDataEngine dataEngine=executionContext.getDataEngine();
  dataEngine.prepare(report,appContext);
}
Program: 75347
Project: 75347
Buggy source:
/** 
 * @throws Exception
 */
public void testBlankExpression() throws Exception {
  QueryDefinition queryDefn=newReportQuery();
  String[] name=new String[]{"String_Node_Str"};
  ScriptExpression[] se=new ScriptExpression[name.length];
  se[0]=new ScriptExpression(null);
  for (int i=0; i < name.length; i++)   queryDefn.addResultSetExpression(name[i],se[i]);
  try {
    IResultIterator ri=executeQuery(queryDefn);
    if (ri.next()) {
      ri.getValue(name[0]);
    }
    fail("String_Node_Str");
  }
 catch (  BirtException e) {
    assertTrue(e.getErrorCode() == ResourceConstants.INVALID_JS_EXPR);
  }
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
public void testBlankExpression() throws Exception {
  QueryDefinition queryDefn=newReportQuery();
  String[] name=new String[]{"String_Node_Str"};
  ScriptExpression[] se=new ScriptExpression[name.length];
  se[0]=new ScriptExpression(null);
  for (int i=0; i < name.length; i++)   queryDefn.addResultSetExpression(name[i],se[i]);
  try {
    IResultIterator ri=executeQuery(queryDefn);
    if (ri.next()) {
      ri.getValue(name[0]);
    }
    fail("String_Node_Str");
  }
 catch (  BirtException e) {
    assertTrue(e.getErrorCode() == ResourceConstants.INVALID_EXPR_HANDLE);
  }
}