nus-yam/ex-repair huggingface dataset:
Program: 71029
Project: 71029
Buggy source:
protected void setupPageBreak(PolicyNode node){
  ReportItemDesign item=node.design;
  String styleClass=item.getStyleName();
  if (styleClass != null) {
    IStyle style=report.findStyle(styleClass);
    CSSValue masterPage=style.getProperty(IStyle.STYLE_MASTER_PAGE);
    CSSValue pageBreakBefore=style.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    CSSValue pageBreakAfter=style.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
    if (masterPage != null || (pageBreakBefore != null) && !pageBreakBefore.equals(IStyle.AUTO_VALUE)) {
      node.breakBefore=true;
      node.execute=true;
    }
    if (pageBreakAfter != null && !pageBreakAfter.equals(IStyle.AUTO_VALUE)) {
      node.breakAfter=true;
      node.execute=true;
    }
  }
  if (item.getJavaClass() != null || item.getOnCreate() != null || item.getOnPageBreak() != null) {
    node.breakBefore=true;
    node.breakAfter=true;
    node.execute=true;
  }
  if (node.breakBefore || node.breakAfter) {
    Iterator iter=rows.iterator();
    while (iter.hasNext()) {
      PolicyNode row=(PolicyNode)iter.next();
      row.executeAll=true;
    }
    return;
  }
  if (item.getHighlight() != null || item.getMap() != null) {
    node.execute=true;
  }
  if (item.getTOC() != null || item.getBookmark() != null || item.getAction() != null) {
    node.execute=true;
  }
  if (item.getQueries() != null) {
    node.execute=true;
  }
  if (item.getVisibility() != null) {
    node.execute=true;
  }
}

Fixed version (ground truth):
protected void setupPageBreak(PolicyNode node){
  ReportItemDesign item=node.design;
  IStyle style=item.getStyle();
  if (style != null) {
    CSSValue masterPage=style.getProperty(IStyle.STYLE_MASTER_PAGE);
    CSSValue pageBreakBefore=style.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    CSSValue pageBreakAfter=style.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
    if (masterPage != null || (pageBreakBefore != null) && !pageBreakBefore.equals(IStyle.AUTO_VALUE)) {
      node.breakBefore=true;
      node.execute=true;
    }
    if (pageBreakAfter != null && !pageBreakAfter.equals(IStyle.AUTO_VALUE)) {
      node.breakAfter=true;
      node.execute=true;
    }
  }
  if (item.getJavaClass() != null || item.getOnCreate() != null || item.getOnPageBreak() != null) {
    node.breakBefore=true;
    node.breakAfter=true;
    node.execute=true;
  }
  if (node.breakBefore || node.breakAfter) {
    Iterator iter=rows.iterator();
    while (iter.hasNext()) {
      PolicyNode row=(PolicyNode)iter.next();
      row.executeAll=true;
    }
    return;
  }
  if (item.getHighlight() != null || item.getMap() != null) {
    node.execute=true;
  }
  if (item.getTOC() != null || item.getBookmark() != null || item.getAction() != null) {
    node.execute=true;
  }
  if (item.getQueries() != null) {
    node.execute=true;
  }
  if (item.getVisibility() != null) {
    node.execute=true;
  }
}
Program: 71030
Project: 71030
Buggy source:
protected void readStyledElementField(DataInputStream in,StyledElementDesign design,short fieldType) throws IOException {
switch (fieldType) {
case FIELD_STYLE_NAME:
    String styleName=IOUtil.readString(in);
  design.setStyleName(styleName);
break;
case FIELD_MAP:
MapDesign map=readMap(in);
design.setMap(map);
break;
case FIELD_HIGHLIGHT:
HighlightDesign highlight=readHighlight(in);
design.setHighlight(highlight);
break;
default :
readReportElementField(in,design,fieldType);
}
}

Fixed version (ground truth):
protected void readStyledElementField(DataInputStream in,StyledElementDesign design,short fieldType) throws IOException {
switch (fieldType) {
case FIELD_STYLE_CLASS:
    String styleClass=IOUtil.readString(in);
  design.setStyleClass(styleClass);
break;
case FIELD_MAP:
MapDesign map=readMap(in);
design.setMap(map);
break;
case FIELD_HIGHLIGHT:
HighlightDesign highlight=readHighlight(in);
design.setHighlight(highlight);
break;
default :
readReportElementField(in,design,fieldType);
}
}
Program: 71031
Project: 71031
Buggy source:
protected void writeStyledElement(DataOutputStream out,StyledElementDesign design) throws IOException {
  writeReportElement(out,design);
  String styleName=design.getStyleName();
  if (styleName != null) {
    IOUtil.writeShort(out,FIELD_STYLE_NAME);
    IOUtil.writeString(out,styleName);
  }
  MapDesign map=design.getMap();
  if (map != null) {
    IOUtil.writeShort(out,FIELD_MAP);
    writeMap(out,map);
  }
  HighlightDesign highlight=design.getHighlight();
  ;
  if (highlight != null) {
    IOUtil.writeShort(out,FIELD_HIGHLIGHT);
    writeHighlight(out,highlight);
  }
}

Fixed version (ground truth):
protected void writeStyledElement(DataOutputStream out,StyledElementDesign design) throws IOException {
  writeReportElement(out,design);
  String styleClass=design.getStyleClass();
  if (styleClass != null) {
    IOUtil.writeShort(out,FIELD_STYLE_CLASS);
    IOUtil.writeString(out,styleClass);
  }
  MapDesign map=design.getMap();
  if (map != null) {
    IOUtil.writeShort(out,FIELD_MAP);
    writeMap(out,map);
  }
  HighlightDesign highlight=design.getHighlight();
  ;
  if (highlight != null) {
    IOUtil.writeShort(out,FIELD_HIGHLIGHT);
    writeHighlight(out,highlight);
  }
}
Program: 71032
Project: 71032
Buggy source:
/** 
 * Gets the width
 * @return the width
 */
public int getWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(handle.getUnits())) {
    Object obj=getTableParent();
    if (obj instanceof GridHandle) {
      obj=HandleAdapterFactory.getInstance().getGridHandleAdapter(obj);
    }
 else {
      obj=HandleAdapterFactory.getInstance().getTableHandleAdapter(obj);
    }
    if (obj instanceof TableHandleAdapter) {
      int containerWidth=((TableHandleAdapter)obj).getClientAreaSize().width;
      return (int)(handle.getMeasure() * containerWidth / 100);
    }
  }
  int px=(int)DEUtil.convertoToPixel(handle);
  if (px <= 0) {
    TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
    return adapter.getDefaultWidth(getColumnNumber());
  }
  return px;
}

Fixed version (ground truth):
/** 
 * Gets the width
 * @return the width
 */
public int getWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(handle.getUnits())) {
    Object obj=getTableParent();
    if (obj instanceof GridHandle) {
      obj=HandleAdapterFactory.getInstance().getGridHandleAdapter(obj);
    }
 else {
      obj=HandleAdapterFactory.getInstance().getTableHandleAdapter(obj);
    }
    if (obj instanceof TableHandleAdapter) {
      int containerWidth=((TableHandleAdapter)obj).getClientAreaSize().width;
      return (int)(handle.getMeasure() * containerWidth / 100);
    }
  }
  int px=(int)DEUtil.convertoToPixel(handle);
  if (px <= 0) {
    if (handle.isSet()) {
      return 1;
    }
    TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
    return adapter.getDefaultWidth(getColumnNumber());
  }
  return px;
}
Program: 71033
Project: 71033
Buggy source:
/** 
 * Returns the raw column with, if it's a fix value, covert it to Pixel unit, if it's a relative value or none, retain it.
 * @return The raw width
 */
public String getRawWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  String unit=handle.getUnits();
  if (unit == null || unit.length() == 0) {
    return "String_Node_Str";
  }
 else   if (unit.equals(DesignChoiceConstants.UNITS_PERCENTAGE)) {
    return String.valueOf(handle.getMeasure()) + unit;
  }
 else {
    int px=(int)DEUtil.convertoToPixel(handle);
    if (px <= 0) {
      TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
      return String.valueOf(adapter.getDefaultWidth(getColumnNumber()));
    }
    return String.valueOf(px);
  }
}

Fixed version (ground truth):
/** 
 * Returns the raw column with, if it's a fix value, covert it to Pixel unit, if it's a relative value or none, retain it.
 * @return The raw width
 */
public String getRawWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  String unit=handle.getUnits();
  if (unit == null || unit.length() == 0) {
    return "String_Node_Str";
  }
 else   if (unit.equals(DesignChoiceConstants.UNITS_PERCENTAGE)) {
    return String.valueOf(handle.getMeasure()) + unit;
  }
 else {
    int px=(int)DEUtil.convertoToPixel(handle);
    if (handle.isSet()) {
      px=1;
    }
    if (px <= 0) {
      TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
      return String.valueOf(adapter.getDefaultWidth(getColumnNumber()));
    }
    return String.valueOf(px);
  }
}
Program: 71034
Project: 71034
Buggy source:
public Object visitValue(TextTemplate.ValueNode node,Object value){
  String text="String_Node_Str";
  Object result=null;
  if (values != null) {
    result=values.get(node.getValue());
  }
  String format=node.getFormat();
  String formatExpression=node.getFormatExpression();
  if (format == null && formatExpression != null) {
    format=values.get(formatExpression).toString();
  }
  if ("String_Node_Str".equalsIgnoreCase(format)) {
    if (result != null) {
      text=result.toString();
    }
  }
 else {
    if (result != null) {
      if (result instanceof Number) {
        NumberFormatter fmt=context.getNumberFormatter(format);
        text=fmt.format((Number)result);
      }
 else       if (result instanceof String) {
        StringFormatter fmt=context.getStringFormatter(format);
        text=fmt.format((String)result);
      }
 else       if (result instanceof Date) {
        DateFormatter fmt=context.getDateFormatter(format);
        text=fmt.format((Date)result);
      }
 else {
        text=result.toString();
      }
    }
    text=encodeHtmlText(text);
  }
  buffer.append(text);
  return value;
}

Fixed version (ground truth):
public Object visitValue(TextTemplate.ValueNode node,Object value){
  String text="String_Node_Str";
  Object result=null;
  if (values != null) {
    result=values.get(node.getValue());
  }
  String format=node.getFormat();
  String formatExpression=node.getFormatExpression();
  if (format == null && formatExpression != null) {
    Object formatValue=values.get(formatExpression);
    if (formatValue != null) {
      format=formatValue.toString();
    }
  }
  if ("String_Node_Str".equalsIgnoreCase(format)) {
    if (result != null) {
      text=result.toString();
    }
  }
 else {
    if (result != null) {
      if (result instanceof Number) {
        NumberFormatter fmt=context.getNumberFormatter(format);
        text=fmt.format((Number)result);
      }
 else       if (result instanceof String) {
        StringFormatter fmt=context.getStringFormatter(format);
        text=fmt.format((String)result);
      }
 else       if (result instanceof Date) {
        DateFormatter fmt=context.getDateFormatter(format);
        text=fmt.format((Date)result);
      }
 else {
        text=result.toString();
      }
    }
    text=encodeHtmlText(text);
  }
  buffer.append(text);
  return value;
}
Program: 71035
Project: 71035
Buggy source:
public Object get(String name,Scriptable start){
  Object result=getScriptableParameter(name);
  if (result == null) {
    String errorMessage="String_Node_Str" + name + "String_Node_Str";
    throw new JavaScriptException(errorMessage,"String_Node_Str",-1);
  }
  return result;
}

Fixed version (ground truth):
public Object get(int index,Scriptable start){
  return get(String.valueOf(index),start);
}
Program: 71036
Project: 71036
Buggy source:
/** 
 * @see EventDispatcher#dispatchKeyTraversed(TraverseEvent)
 */
public void dispatchKeyTraversed(TraverseEvent e){
  IFigure focusOwner=null;
  List list=getViewer().getSelectedEditParts();
  int size=list.size();
  IFigure nextFigure=null;
  if (e.detail == SWT.TRAVERSE_TAB_NEXT) {
    AbstractGraphicalEditPart part=size == 0 ? null : (AbstractGraphicalEditPart)list.get(list.size() - 1);
    IFigure figure=part == null ? null : part.getFigure();
    focusOwner=getFocusOwner(figure);
    if ((e.stateMask & SWT.CTRL) > 0) {
      nextFigure=focusManager.getNextFocusableFigure(getRoot(),focusOwner);
    }
 else {
      nextFigure=focusManager.getNextFocusableFigureInSameOrder(getRoot(),focusOwner);
    }
  }
 else   if (e.detail == SWT.TRAVERSE_TAB_PREVIOUS) {
    AbstractGraphicalEditPart part=size == 0 ? null : (AbstractGraphicalEditPart)list.get(0);
    IFigure figure=part == null ? null : part.getFigure();
    focusOwner=getFocusOwner(figure);
    if ((e.stateMask & SWT.CTRL) > 0) {
      nextFigure=focusManager.getPreviousFocusableFigure(getRoot(),focusOwner);
    }
 else {
      nextFigure=focusManager.getPreviousFocusableFigureInSameOrder(getRoot(),focusOwner);
    }
  }
  if (nextFigure != null) {
    e.doit=false;
    setFocus(nextFigure);
    Object obj=getViewer().getVisualPartMap().get(nextFigure);
    if (obj != null) {
      getViewer().setSelection(new StructuredSelection(obj));
    }
    if (obj instanceof EditPart) {
      getViewer().reveal((EditPart)obj);
    }
  }
}

Fixed version (ground truth):
/** 
 * @see EventDispatcher#dispatchKeyTraversed(TraverseEvent)
 */
public void dispatchKeyTraversed(TraverseEvent e){
  IFigure focusOwner=null;
  List list=((IStructuredSelection)getViewer().getSelection()).toList();
  int size=list.size();
  IFigure nextFigure=null;
  if (e.detail == SWT.TRAVERSE_TAB_NEXT) {
    AbstractGraphicalEditPart part=size == 0 ? null : (AbstractGraphicalEditPart)list.get(list.size() - 1);
    IFigure figure=part == null ? null : part.getFigure();
    focusOwner=getFocusOwner(figure);
    if ((e.stateMask & SWT.CTRL) > 0) {
      nextFigure=focusManager.getNextFocusableFigure(getRoot(),focusOwner);
    }
 else {
      nextFigure=focusManager.getNextFocusableFigureInSameOrder(getRoot(),focusOwner);
    }
  }
 else   if (e.detail == SWT.TRAVERSE_TAB_PREVIOUS) {
    AbstractGraphicalEditPart part=size == 0 ? null : (AbstractGraphicalEditPart)list.get(0);
    IFigure figure=part == null ? null : part.getFigure();
    focusOwner=getFocusOwner(figure);
    if ((e.stateMask & SWT.CTRL) > 0) {
      nextFigure=focusManager.getPreviousFocusableFigure(getRoot(),focusOwner);
    }
 else {
      nextFigure=focusManager.getPreviousFocusableFigureInSameOrder(getRoot(),focusOwner);
    }
  }
  if (nextFigure != null) {
    e.doit=false;
    setFocus(nextFigure);
    Object obj=getViewer().getVisualPartMap().get(nextFigure);
    if (obj != null) {
      getViewer().setSelection(new StructuredSelection(obj));
    }
    if (obj instanceof EditPart) {
      getViewer().reveal((EditPart)obj);
    }
  }
}
Program: 71037
Project: 71037
Buggy source:
public void activate(){
  super.activate();
  getFigure().setFocusTraversable(false);
  getViewer().addPropertyChangeListener(new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent evt){
      if (DeferredGraphicalViewer.PROPERTY_MARGIN_VISIBILITY.equals(evt.getPropertyName())) {
        showMargin=((Boolean)evt.getNewValue()).booleanValue();
        refresh();
        markDirty(true);
      }
    }
  }
);
  if (getModel() instanceof ReportDesignHandle) {
    getViewer().setProperty(IReportGraphicConstants.REPORT_LAYOUT_PROPERTY,((ReportDesignHandle)getModel()).getLayoutPreference());
    getViewer().setProperty(IReportGraphicConstants.REPORT_BIDIORIENTATION_PROPERTY,((ReportDesignHandle)getModel()).getBidiOrientation());
  }
}

Fixed version (ground truth):
public void activate(){
  super.activate();
  getViewer().addPropertyChangeListener(new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent evt){
      if (DeferredGraphicalViewer.PROPERTY_MARGIN_VISIBILITY.equals(evt.getPropertyName())) {
        showMargin=((Boolean)evt.getNewValue()).booleanValue();
        refresh();
        markDirty(true);
      }
    }
  }
);
  if (getModel() instanceof ReportDesignHandle) {
    getViewer().setProperty(IReportGraphicConstants.REPORT_LAYOUT_PROPERTY,((ReportDesignHandle)getModel()).getLayoutPreference());
    getViewer().setProperty(IReportGraphicConstants.REPORT_BIDIORIENTATION_PROPERTY,((ReportDesignHandle)getModel()).getBidiOrientation());
  }
}
Program: 71038
Project: 71038
Buggy source:
public void widgetSelected(SelectionEvent e){
  txtMaxDataSetRow.setEnabled(!noLimitBtn.getSelection(),noLimitBtn.getParent());
  if (!noLimitBtn.getSelection()) {
    txtMaxDataSetRow.setFocus();
  }
  txtMaxDataSetRow.checkState();
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  txtMaxDataSetRow.setEnabled(!noLimitBtn.getSelection(),noLimitBtn.getParent());
  if (!noLimitBtn.getSelection()) {
    txtMaxDataSetRow.setFocus();
  }
  if (txtMaxDataSetRow.checkState()) {
  }
}
Program: 71039
Project: 71039
Buggy source:
public boolean checkState(){
  if (noLimitBtn.getSelection()) {
    if (!super.checkState())     clearErrorMessage();
    return true;
  }
  return super.checkState();
}

Fixed version (ground truth):
public boolean checkState(){
  if (noLimitBtn.getSelection()) {
    setValid(true);
    if (!super.checkState())     clearErrorMessage();
    return true;
  }
 else {
    setValid(isValid());
  }
  return super.checkState();
}
Program: 71041
Project: 71041
Buggy source:
public void propertyChange(PropertyChangeEvent event){
  if (event.getProperty().equals(FieldEditor.IS_VALID))   setValid(txtMaxInMemoryCubeSize.isValid());
}

Fixed version (ground truth):
public void propertyChange(PropertyChangeEvent event){
  if (event.getProperty().equals(FieldEditor.IS_VALID))   setValid(txtMaxDataSetRow.isValid());
}
Program: 71045
Project: 71045
Buggy source:
public static String convertHAlign(String align){
  String ha=null;
  align=ExcelUtil.getValue(align);
  if ("String_Node_Str".equalsIgnoreCase(align)) {
    ha="String_Node_Str";
  }
 else   if ("String_Node_Str".equalsIgnoreCase(align)) {
    ha="String_Node_Str";
  }
 else   if ("String_Node_Str".equalsIgnoreCase(align)) {
    ha="String_Node_Str";
  }
  return ha;
}

Fixed version (ground truth):
public static String convertHAlign(String align,String direction){
  String ha=null;
  align=ExcelUtil.getValue(align);
  if ("String_Node_Str".equalsIgnoreCase(align)) {
    ha="String_Node_Str";
  }
 else   if ("String_Node_Str".equalsIgnoreCase(align)) {
    ha="String_Node_Str";
  }
 else   if ("String_Node_Str".equalsIgnoreCase(align)) {
    ha="String_Node_Str";
  }
 else   if ("String_Node_Str".equalsIgnoreCase(direction))   ha="String_Node_Str";
 else   ha="String_Node_Str";
  return ha;
}
Program: 71046
Project: 71046
Buggy source:
/** 
 * Add expression to query definition
 * @param queryDefn
 */
private void prepareExpression(QueryDefinition queryDefn){
  beName=new String[3];
  beArray=new ScriptExpression[3];
  beName[0]="String_Node_Str";
  ScriptExpression se=new ScriptExpression("String_Node_Str");
  beArray[0]=se;
  beName[1]="String_Node_Str";
  se=new ScriptExpression("String_Node_Str");
  beArray[1]=se;
  beName[2]="String_Node_Str";
  se=new ScriptExpression("String_Node_Str");
  beArray[2]=se;
  for (int i=0; i < beName.length; i++) {
    queryDefn.addResultSetExpression(beName[i],beArray[i]);
  }
}

Fixed version (ground truth):
/** 
 * Add expression to query definition
 * @param queryDefn
 * @throws DataException 
 */
private void prepareExpression(QueryDefinition queryDefn) throws DataException {
  beName=new String[3];
  beArray=new ScriptExpression[3];
  beName[0]="String_Node_Str";
  ScriptExpression se=new ScriptExpression("String_Node_Str");
  se.setDataType(DataType.INTEGER_TYPE);
  beArray[0]=se;
  beName[1]="String_Node_Str";
  se=new ScriptExpression("String_Node_Str");
  se.setDataType(DataType.STRING_TYPE);
  beArray[1]=se;
  beName[2]="String_Node_Str";
  se=new ScriptExpression("String_Node_Str");
  se.setDataType(DataType.BLOB_TYPE);
  beArray[2]=se;
  for (int i=0; i < beName.length; i++) {
    queryDefn.addBinding(new Binding(beName[i],beArray[i]));
  }
}
Program: 71048
Project: 71048
Buggy source:
public void getMetadataTestImpl(boolean dynamicMetadata) throws Exception {
  init(dynamicMetadata);
  IQueryDefinition rqDefn=getReportQueryDefn(TEST_SORT);
  IPreparedQuery pq=dataEngine.prepare(rqDefn);
  IQueryResults qr=pq.execute(jsScope);
  IResultMetaData metaData=qr.getResultMetaData();
  int count=getNoneTempColumCount(metaData);
  for (int i=0; i < count; i++) {
    if (i < scriptColumnNames.length) {
      assertEquals(metaData.getColumnName(i + 1),scriptColumnNames[i]);
      assertEquals(metaData.getColumnType(i + 1),scriptColumnTypes[i]);
    }
 else     assertEquals(metaData.getColumnName(i + 1),computedColumnNames[i - scriptColumnNames.length]);
  }
}

Fixed version (ground truth):
public void getMetadataTestImpl(boolean dynamicMetadata) throws Exception {
  init(dynamicMetadata);
  IQueryDefinition rqDefn=getReportQueryDefn(TEST_SORT);
  IPreparedQuery pq=dataEngine.prepare(rqDefn);
  IQueryResults qr=pq.execute(jsScope);
  IResultMetaData metaData=qr.getResultMetaData();
  int count=getNoneTempColumCount(metaData);
  for (int i=0; i < count; i++) {
    if (i < scriptColumnNames.length) {
      assertEquals(metaData.getColumnName(i + 1),"String_Node_Str" + scriptColumnNames[i]);
      assertEquals(metaData.getColumnType(i + 1),scriptColumnTypes[i]);
    }
 else     if (i < scriptColumnNames.length + scriptColumnAliasNames.length)     assertEquals(metaData.getColumnName(i + 1),"String_Node_Str" + scriptColumnAliasNames[i - scriptColumnNames.length]);
  }
}
Program: 71049
Project: 71049
Buggy source:
public void test4_ProjectedCol() throws Exception {
  OdaDataSetDesign dset=newDataSet("String_Node_Str","String_Node_Str" + this.getTestTableName());
  QueryDefinition query=this.newReportQuery(dset);
  ComputedColumn compCol=new ComputedColumn("String_Node_Str","String_Node_Str",DataType.ANY_TYPE);
  dset.addComputedColumn(compCol);
  ColumnDefinition coldef=new ColumnDefinition("String_Node_Str");
  coldef.setAlias("String_Node_Str");
  dset.addResultSetHint(coldef);
  query.setColumnProjection(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  IPreparedQuery pq=this.dataEngine.prepare(query);
  IQueryResults qr=pq.execute(null);
  IResultMetaData md=qr.getResultMetaData();
  this.testPrint(Util.getMetaDadataInfo(md));
  checkOutputFile();
  query.setColumnProjection(new String[]{});
  pq=this.dataEngine.prepare(query);
  qr=pq.execute(null);
  assertTrue(qr.getResultMetaData().getColumnCount() == 18);
  assertTrue(qr.getResultIterator().getResultMetaData().getColumnCount() == 18);
  query.setColumnProjection(new String[]{"String_Node_Str"});
  pq=this.dataEngine.prepare(query);
  try {
    qr=pq.execute(null);
  }
 catch (  DataException e) {
  }
}

Fixed version (ground truth):
public void test4_ProjectedCol() throws Exception {
  OdaDataSetDesign dset=newDataSet("String_Node_Str","String_Node_Str" + this.getTestTableName());
  QueryDefinition query=this.newReportQuery(dset);
  query.setAutoBinding(true);
  ComputedColumn compCol=new ComputedColumn("String_Node_Str","String_Node_Str",DataType.ANY_TYPE);
  dset.addComputedColumn(compCol);
  ColumnDefinition coldef=new ColumnDefinition("String_Node_Str");
  coldef.setAlias("String_Node_Str");
  dset.addResultSetHint(coldef);
  query.setColumnProjection(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  IPreparedQuery pq=this.dataEngine.prepare(query);
  IQueryResults qr=pq.execute(null);
  IResultMetaData md=qr.getResultMetaData();
  this.testPrint(Util.getMetaDadataInfo(md));
  checkOutputFile();
  query.setColumnProjection(new String[]{});
  pq=this.dataEngine.prepare(query);
  qr=pq.execute(null);
  assertTrue(qr.getResultMetaData().getColumnCount() == 18);
  assertTrue(qr.getResultIterator().getResultMetaData().getColumnCount() == 18);
  query.setColumnProjection(new String[]{"String_Node_Str"});
  pq=this.dataEngine.prepare(query);
  try {
    qr=pq.execute(null);
  }
 catch (  DataException e) {
  }
}
Program: 71050
Project: 71050
Buggy source:
public void test2_ResultHints() throws Exception {
  OdaDataSetDesign dset=newDataSet("String_Node_Str","String_Node_Str" + this.getTestTableName());
  QueryDefinition query=this.newReportQuery(dset);
  ColumnDefinition coldef=new ColumnDefinition("String_Node_Str");
  coldef.setColumnPosition(1);
  coldef.setAlias("String_Node_Str");
  coldef.setDataType(DataType.DOUBLE_TYPE);
  dset.addResultSetHint(coldef);
  coldef=new ColumnDefinition("String_Node_Str");
  coldef.setAlias("String_Node_Str");
  dset.addResultSetHint(coldef);
  coldef=new ColumnDefinition("String_Node_Str");
  coldef.setAlias("String_Node_Str");
  dset.addResultSetHint(coldef);
  coldef=new ColumnDefinition("String_Node_Str");
  coldef.setAlias("String_Node_Str");
  coldef.setColumnPosition(30);
  dset.addResultSetHint(coldef);
  IPreparedQuery pq=this.dataEngine.prepare(query);
  IQueryResults qr=pq.execute(null);
  IResultMetaData md=qr.getResultMetaData();
  this.testPrint(Util.getMetaDadataInfo(md));
  checkOutputFile();
}

Fixed version (ground truth):
public void test2_ResultHints() throws Exception {
  OdaDataSetDesign dset=newDataSet("String_Node_Str","String_Node_Str" + this.getTestTableName());
  QueryDefinition query=this.newReportQuery(dset);
  query.setAutoBinding(true);
  ColumnDefinition coldef=new ColumnDefinition("String_Node_Str");
  coldef.setColumnPosition(1);
  coldef.setAlias("String_Node_Str");
  coldef.setDataType(DataType.DOUBLE_TYPE);
  dset.addResultSetHint(coldef);
  coldef=new ColumnDefinition("String_Node_Str");
  coldef.setAlias("String_Node_Str");
  dset.addResultSetHint(coldef);
  coldef=new ColumnDefinition("String_Node_Str");
  coldef.setAlias("String_Node_Str");
  dset.addResultSetHint(coldef);
  coldef=new ColumnDefinition("String_Node_Str");
  coldef.setAlias("String_Node_Str");
  coldef.setColumnPosition(30);
  dset.addResultSetHint(coldef);
  IPreparedQuery pq=this.dataEngine.prepare(query);
  IQueryResults qr=pq.execute(null);
  IResultMetaData md=qr.getResultMetaData();
  this.testPrint(Util.getMetaDadataInfo(md));
  checkOutputFile();
}
Program: 71051
Project: 71051
Buggy source:
public void test1_SelectAll() throws Exception {
  OdaDataSetDesign dset=newDataSet("String_Node_Str","String_Node_Str" + this.getTestTableName());
  QueryDefinition query=this.newReportQuery(dset);
  IPreparedQuery pq=this.dataEngine.prepare(query);
  IQueryResults qr=pq.execute(null);
  IResultMetaData md=qr.getResultMetaData();
  this.testPrint(Util.getMetaDadataInfo(md));
  checkOutputFile();
  closeOutputFile();
  openOutputFile();
  md=qr.getResultIterator().getResultMetaData();
  this.testPrint(Util.getMetaDadataInfo(md));
  checkOutputFile();
  assertEquals(17,md.getColumnCount());
  try {
    md.getColumnName(-1);
    fail("String_Node_Str");
  }
 catch (  java.lang.ArrayIndexOutOfBoundsException e) {
  }
  try {
    md.getColumnName(18);
    fail("String_Node_Str");
  }
 catch (  DataException e) {
  }
}

Fixed version (ground truth):
public void test1_SelectAll() throws Exception {
  OdaDataSetDesign dset=newDataSet("String_Node_Str","String_Node_Str" + this.getTestTableName());
  QueryDefinition query=this.newReportQuery(dset);
  query.setAutoBinding(true);
  IPreparedQuery pq=this.dataEngine.prepare(query);
  IQueryResults qr=pq.execute(null);
  IResultMetaData md=qr.getResultMetaData();
  this.testPrint(Util.getMetaDadataInfo(md));
  checkOutputFile();
  closeOutputFile();
  openOutputFile();
  md=qr.getResultIterator().getResultMetaData();
  this.testPrint(Util.getMetaDadataInfo(md));
  checkOutputFile();
  assertEquals(17,md.getColumnCount());
  try {
    md.getColumnName(-1);
    fail("String_Node_Str");
  }
 catch (  DataException e) {
  }
  try {
    md.getColumnName(18);
    fail("String_Node_Str");
  }
 catch (  DataException e) {
  }
}
Program: 71053
Project: 71053
Buggy source:
/** 
 */
public int compare(Object o1,Object o2){
  Object[] sortKeys1=((GroupBoundaryInfo)o1).getSortKeys();
  Object[] sortKeys2=((GroupBoundaryInfo)o2).getSortKeys();
  boolean[] sortDirection=((GroupBoundaryInfo)o1).getSortDirection();
  Comparator[] comparator=((GroupBoundaryInfo)o1).getCollarComparator();
  int result=0;
  for (int i=0; i < sortKeys1.length; i++) {
    try {
      result=ScriptEvalUtil.compare(sortKeys1[i],sortKeys2[i],comparator[i]);
    }
 catch (    DataException e) {
      result=0;
    }
    if (result != 0) {
      if (sortDirection[i] == false) {
        result=result * -1;
        break;
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 */
public int compare(Object o1,Object o2){
  Object[] sortKeys1=((GroupBoundaryInfo)o1).getSortKeys();
  Object[] sortKeys2=((GroupBoundaryInfo)o2).getSortKeys();
  boolean[] sortDirection=((GroupBoundaryInfo)o1).getSortDirection();
  Comparator[] comparator=((GroupBoundaryInfo)o1).getCollarComparator();
  int result=0;
  for (int i=0; i < sortKeys1.length; i++) {
    try {
      result=ScriptEvalUtil.compare(sortKeys1[i],sortKeys2[i],comparator[i]);
    }
 catch (    DataException e) {
      result=0;
    }
    if (result != 0) {
      if (sortDirection[i] == false) {
        result=result * -1;
      }
      break;
    }
  }
  return result;
}
Program: 71054
Project: 71054
Buggy source:
public static boolean containsYOptionalGrouping(Chart chart){
  boolean YOG=false;
  SeriesDefinition os=ChartUtil.getAllOrthogonalSeriesDefinitions(chart).get(0);
  if (os != null && os.getQuery() != null && os.getQuery().getDefinition() != null && os.getQuery().getDefinition().length() != 0) {
    YOG=true;
  }
  return YOG;
}

Fixed version (ground truth):
public static boolean containsYOptionalGrouping(Chart chart){
  boolean YOG=false;
  List<SeriesDefinition> sds=ChartUtil.getAllOrthogonalSeriesDefinitions(chart);
  if (sds.size() > 0) {
    SeriesDefinition os=sds.get(0);
    if (os != null && os.getQuery() != null && os.getQuery().getDefinition() != null && os.getQuery().getDefinition().length() != 0) {
      YOG=true;
    }
  }
  return YOG;
}
Program: 71055
Project: 71055
Buggy source:
public void testExecutor(){
  TextTemplate template=new TemplateParser().parse(input);
  ExecutionContext context=new ExecutionContext();
  TemplateExecutor executor=new TemplateExecutor(context);
  HashMap values=new HashMap();
  values.put("String_Node_Str","String_Node_Str");
  values.put("String_Node_Str",new byte[]{});
  String output=executor.execute(template,values);
  boolean matched=output.matches("String_Node_Str");
  assertTrue(matched);
}

Fixed version (ground truth):
public void testExecutor(){
  TextTemplate template=new TemplateParser().parse(input);
  ExecutionContext context=new ExecutionContext();
  TemplateExecutor executor=new TemplateExecutor(context);
  HashMap<String,Object> values=new HashMap<String,Object>();
  values.put("String_Node_Str","String_Node_Str");
  values.put("String_Node_Str",new byte[]{});
  String output=executor.execute(template,values);
  boolean matched=output.matches("String_Node_Str");
  assertTrue(matched);
}
Program: 71056
Project: 71056
Buggy source:
public Object visitValue(TextTemplate.ValueNode node,Object value){
  String text="String_Node_Str";
  String format=node.getFormat();
  Object result=null;
  if (values != null) {
    result=values.get(node.getValue());
  }
  if ("String_Node_Str".equalsIgnoreCase(format)) {
    if (result != null) {
      text=result.toString();
    }
  }
 else {
    if (result != null) {
      if (result instanceof Number) {
        NumberFormatter fmt=context.getNumberFormatter(format);
        text=fmt.format((Number)result);
      }
 else       if (result instanceof String) {
        StringFormatter fmt=context.getStringFormatter(format);
        text=fmt.format((String)result);
      }
 else       if (result instanceof Date) {
        DateFormatter fmt=context.getDateFormatter(format);
        text=fmt.format((Date)result);
      }
 else {
        text=result.toString();
      }
    }
    text=encodeHtmlText(text);
  }
  buffer.append(text);
  return value;
}

Fixed version (ground truth):
public Object visitValue(TextTemplate.ValueNode node,Object value){
  String text="String_Node_Str";
  Object result=null;
  if (values != null) {
    result=values.get(node.getValue());
  }
  String format=node.getFormat();
  String formatExpression=node.getFormatExpression();
  if (format == null && formatExpression != null) {
    format=values.get(formatExpression).toString();
  }
  if ("String_Node_Str".equalsIgnoreCase(format)) {
    if (result != null) {
      text=result.toString();
    }
  }
 else {
    if (result != null) {
      if (result instanceof Number) {
        NumberFormatter fmt=context.getNumberFormatter(format);
        text=fmt.format((Number)result);
      }
 else       if (result instanceof String) {
        StringFormatter fmt=context.getStringFormatter(format);
        text=fmt.format((String)result);
      }
 else       if (result instanceof Date) {
        DateFormatter fmt=context.getDateFormatter(format);
        text=fmt.format((Date)result);
      }
 else {
        text=result.toString();
      }
    }
    text=encodeHtmlText(text);
  }
  buffer.append(text);
  return value;
}
Program: 71057
Project: 71057
Buggy source:
public String execute(TextTemplate template,HashMap values){
  this.buffer=new StringBuffer();
  this.values=values;
  if (template == null) {
    return "String_Node_Str";
  }
  ArrayList nodes=template.getNodes();
  Iterator iter=nodes.iterator();
  while (iter.hasNext()) {
    TextTemplate.Node node=(TextTemplate.Node)iter.next();
    node.accept(this,null);
  }
  return buffer.toString();
}

Fixed version (ground truth):
public String execute(TextTemplate template,HashMap<String,Object> values){
  this.buffer=new StringBuffer();
  this.values=values;
  if (template == null) {
    return "String_Node_Str";
  }
  ArrayList nodes=template.getNodes();
  Iterator iter=nodes.iterator();
  while (iter.hasNext()) {
    TextTemplate.Node node=(TextTemplate.Node)iter.next();
    node.accept(this,null);
  }
  return buffer.toString();
}
Program: 71058
Project: 71058
Buggy source:
public HashMap getExpressions(){
  if (text == null) {
    return null;
  }
  if (exprs != null) {
    return exprs;
  }
  if (HTML_TEXT.equals(textType) || (AUTO_TEXT.equals(textType) && startsWithIgnoreCase(text,"String_Node_Str"))) {
    exprs=new HashMap();
    TextTemplate template=new TemplateParser().parse(text);
    if (template != null && template.getNodes() != null) {
      Iterator itor=template.getNodes().iterator();
      Object obj;
      String expression=null;
      while (itor.hasNext()) {
        obj=itor.next();
        if (obj instanceof TextTemplate.ValueNode) {
          expression=((TextTemplate.ValueNode)obj).getValue();
        }
 else         if (obj instanceof TextTemplate.ImageNode) {
          expression=((TextTemplate.ImageNode)obj).getExpr();
        }
        if (expression != null && !expression.trim().equals("String_Node_Str")) {
          exprs.put(expression,expression);
          expression=null;
        }
      }
    }
  }
  return exprs;
}

Fixed version (ground truth):
public HashMap<String,String> getExpressions(){
  if (text == null) {
    return null;
  }
  if (exprs != null) {
    return exprs;
  }
  if (HTML_TEXT.equals(textType) || (AUTO_TEXT.equals(textType) && startsWithIgnoreCase(text,"String_Node_Str"))) {
    exprs=new HashMap<String,String>();
    TextTemplate template=new TemplateParser().parse(text);
    if (template != null && template.getNodes() != null) {
      Iterator itor=template.getNodes().iterator();
      Object obj;
      while (itor.hasNext()) {
        obj=itor.next();
        if (obj instanceof TextTemplate.ValueNode) {
          ValueNode valueNode=(TextTemplate.ValueNode)obj;
          addExpression(valueNode.getValue());
          addExpression(valueNode.getFormatExpression());
        }
 else         if (obj instanceof TextTemplate.ImageNode) {
          addExpression(((TextTemplate.ImageNode)obj).getExpr());
        }
      }
    }
  }
  return exprs;
}
Program: 71059
Project: 71059
Buggy source:
/** 
 * Advance the leaf group with offset.
 * @param offset
 * @throws DataException 
 */
public void move() throws DataException {
  if (groups.length > 0) {
    for (int i=leafGroupIdx; i < this.getGroups()[groups.length - 1].size(); i++) {
      GroupInfo nextLeafGroup=findGroup(groups.length - 1,leafGroupIdx + 1);
      if (nextLeafGroup != null && cacheProvider.getCurrentIndex() >= nextLeafGroup.firstChild) {
        ++leafGroupIdx;
      }
 else {
        break;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Advance the leaf group with offset.
 * @param offset
 * @throws DataException 
 */
public void move() throws DataException {
  if (groups.length > 0) {
    binaryMove();
  }
}
Program: 71060
Project: 71060
Buggy source:
public ReportletExecutorV4(ExecutionContext context,long offset) throws IOException {
  super(context);
  fragment=createFragment(offset);
  bodyExecutor=new ReportBodyExecutor(manager,fragment);
}

Fixed version (ground truth):
public ReportletExecutorV4(ExecutionContext context,long offset) throws IOException {
  super(context);
  fragment=createFragment(offset);
  bodyExecutor=new ReportletBodyExecutor(manager,fragment,offset);
}
Program: 71061
Project: 71061
Buggy source:
public IReportItemExecutor getNextChild(){
  return bodyExecutor.getNextChild();
}

Fixed version (ground truth):
public IReportItemExecutor getNextChild(){
  if (bodyExecutor != null) {
    IReportItemExecutor executor=bodyExecutor;
    bodyExecutor=null;
    return executor;
  }
  return null;
}
Program: 71062
Project: 71062
Buggy source:
public void close(){
  bodyExecutor.close();
  super.close();
}

Fixed version (ground truth):
public void close(){
  try {
    if (bodyExecutor != null) {
      try {
        bodyExecutor.close();
      }
 catch (      BirtException e) {
      }
    }
  }
  finally {
    bodyExecutor=null;
    super.close();
  }
}
Program: 71063
Project: 71063
Buggy source:
public IReportContent execute(){
  bodyExecutor.execute();
  return reportContent;
}

Fixed version (ground truth):
public IReportContent execute(){
  return reportContent;
}
Program: 71064
Project: 71064
Buggy source:
public boolean hasNextChild(){
  return bodyExecutor.hasNextChild();
}

Fixed version (ground truth):
public boolean hasNextChild(){
  return bodyExecutor != null;
}
Program: 71065
Project: 71065
Buggy source:
public BlankData(SheetData data){
  super(null,0,null);
  this.data=data;
}

Fixed version (ground truth):
public BlankData(SheetData data){
  super(data);
  this.data=data;
}
Program: 71066
Project: 71066
Buggy source:
private void clearCachedSheetData(){
  for (int i=0; i < getColumnCount(); i++) {
    columns.set(i,new ArrayList<SheetData>());
  }
  Set<Entry<Integer,Integer>> entrySets=columnId2StartRowId.entrySet();
  for (  Map.Entry<Integer,Integer> entry : entrySets) {
    entry.setValue(0);
  }
  bookmarks.clear();
}

Fixed version (ground truth):
public void clearCachedSheetData(){
  for (int i=0; i < getColumnCount(); i++) {
    columns.set(i,new ArrayList<SheetData>());
  }
  bookmarks.clear();
  maxRowIndex=1;
}
Program: 71067
Project: 71067
Buggy source:
protected boolean valid(int row,int col){
  if (col >= getColumnCount() || row > getStartRowId(col)) {
    return false;
  }
  int start=columnId2StartRowId.get(new Integer(col)).intValue();
  return (row >= start && row < getStartRowId(col) && col < getColumnCount());
}

Fixed version (ground truth):
protected boolean valid(int row,int col){
  if (col >= getColumnCount()) {
    return false;
  }
  return true;
}
Program: 71068
Project: 71068
Buggy source:
public void addData(int col,SheetData data){
  if ((getStartRowId(col) > height) || (col >= getColumnCount())) {
    emitter.outputSheet();
    clearCachedSheetData();
  }
  List<SheetData> column=columns.get(col);
  int size=column.size();
  if (size > 0) {
    column.get(size - 1).clearContainer();
  }
  column.add(data);
  BookmarkDef bookmark=data.getBookmark();
  if (bookmark == null) {
    return;
  }
  int rowNo=columnId2StartRowId.get(new Integer(col)).intValue() + getStartRowId(col);
  bookmark.setColumnNo(col + 1);
  bookmark.setRowNo(rowNo);
  bookmarks.add(bookmark);
}

Fixed version (ground truth):
public void addData(int col,SheetData data){
  int rowIndex=data.getRowIndex();
  columns.get(col).add(data);
  maxRowIndex=maxRowIndex > rowIndex ? maxRowIndex : rowIndex;
  BookmarkDef bookmark=data.getBookmark();
  if (bookmark == null) {
    return;
  }
  bookmark.setColumnNo(col + 1);
  bookmark.setRowNo(rowIndex);
  bookmarks.add(bookmark);
}
Program: 71069
Project: 71069
Buggy source:
public void insertColumns(int col,int size){
  if (size == 0) {
    return;
  }
  int columnCount=getColumnCount();
  int m_start=col + 1;
  int m_size=columnCount - m_start;
  m_size=Math.max(0,m_size);
  ArrayList<SheetData>[] mcol=(ArrayList<SheetData>[])new ArrayList[m_size];
  Map<Integer,Integer> temp=new HashMap<Integer,Integer>();
  for (int i=m_start, j=0; j < m_size; i++, j++) {
    Integer column=new Integer(i);
    Integer row=columnId2StartRowId.get(column);
    int npos=i + size;
    if (npos < width) {
      temp.put(new Integer(npos),row);
      mcol[j]=columns.get(m_start);
    }
    columns.remove(m_start);
  }
  columnId2StartRowId.putAll(temp);
  int rowCount=getStartRowId(col);
  for (int i=m_start; i <= col + size; i++) {
    if (i < width) {
      if (i > columns.size()) {
        columns.add(new ArrayList<SheetData>());
        columnId2StartRowId.put(columns.size() - 1,rowCount);
      }
 else {
        columns.add(i,new ArrayList<SheetData>());
        columnId2StartRowId.put(i,rowCount);
      }
    }
  }
  for (int i=0; i < mcol.length; i++) {
    if (mcol[i] == null) {
      continue;
    }
    columns.add(mcol[i]);
  }
}

Fixed version (ground truth):
public void insertColumns(int startColumn,int columnCount){
  if (columnCount == 0) {
    return;
  }
  int startPosition=startColumn + 1;
  for (int i=startPosition; i <= startColumn + columnCount; i++) {
    if (i < width) {
      columns.add(i,new ArrayList<SheetData>());
    }
  }
}
Program: 71070
Project: 71070
Buggy source:
public int getMaxRow(){
  int max=0;
  for (int i=0; i < columns.size(); i++) {
    int size=getStartRowId(i);
    max=max >= size ? max : size;
  }
  return max;
}

Fixed version (ground truth):
public int getMaxRow(){
  return maxRowIndex;
}
Program: 71071
Project: 71071
Buggy source:
public DataCache(int width,int height,ExcelEmitter emitter){
  columns.add(new ArrayList<SheetData>());
  columnId2StartRowId.put(0,0);
  this.width=width;
  this.height=height;
  this.emitter=emitter;
}

Fixed version (ground truth):
public DataCache(int width,int height){
  columns.add(new ArrayList<SheetData>());
  this.width=width;
}
Program: 71072
Project: 71072
Buggy source:
/** 
 * Execute the Script Function with an array of arguments.
 * @param arguments
 * @return
 */
public Object execute(Object[] arguments) throws BirtException ;

Fixed version (ground truth):
/** 
 * Execute the Script Function with an array of arguments.
 * @param arguments
 * @return
 */
public Object execute(Object[] arguments,IScriptFunctionContext context) throws BirtException ;
Program: 71073
Project: 71073
Buggy source:
public Object execute(Object[] arguments) throws BirtException {
  if (this.executor != null)   return this.executor.execute(arguments);
  return null;
}

Fixed version (ground truth):
public Object execute(Object[] arguments,IScriptFunctionContext context) throws BirtException {
  if (this.executor != null)   return this.executor.execute(arguments,context);
  return null;
}
Program: 71074
Project: 71074
Buggy source:
public Object execute(Object[] arguments) throws BirtException {
  return this.executor.execute(arguments);
}

Fixed version (ground truth):
public Object execute(Object[] arguments,IScriptFunctionContext context) throws BirtException {
  return this.executor.execute(arguments,context);
}
Program: 71075
Project: 71075
Buggy source:
/** 
 * @return
 */
private static SimpleDateFormat getMonthFormat(){
  if (monthFormat != null)   return monthFormat;
  try {
    Locale defaultLocale=Context.enter().getLocale();
    monthFormat=new SimpleDateFormat("String_Node_Str",defaultLocale);
    return monthFormat;
  }
  finally {
    Context.exit();
  }
}

Fixed version (ground truth):
/** 
 * @return
 */
private static SimpleDateFormat getMonthFormat(){
  if (monthFormat == null)   monthFormat=new SimpleDateFormat("String_Node_Str",defaultLocale);
  return monthFormat;
}
Program: 71076
Project: 71076
Buggy source:
public Object execute(Object[] arguments) throws BirtException {
  return this.executor.execute(arguments);
}

Fixed version (ground truth):
public Object execute(Object[] arguments,IScriptFunctionContext context) throws BirtException {
  scriptContext=context;
  if (scriptContext != null) {
    ULocale locale=(ULocale)scriptContext.findProperty(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.LOCALE);
    if (defaultLocale != null && !defaultLocale.equals(locale)) {
      abbrMonthFormat=null;
      monthFormat=null;
      abbrWeekFormat=null;
      weekFormat=null;
      defaultLocale=locale;
    }
 else     defaultLocale=locale;
  }
  return this.executor.execute(arguments,context);
}
Program: 71077
Project: 71077
Buggy source:
/** 
 * @return
 */
private static SimpleDateFormat getWeekFormat(){
  if (weekFormat != null)   return weekFormat;
  try {
    Locale defaultLocale=Context.enter().getLocale();
    weekFormat=new SimpleDateFormat("String_Node_Str",defaultLocale);
    return weekFormat;
  }
  finally {
    Context.exit();
  }
}

Fixed version (ground truth):
/** 
 * @return
 */
private static SimpleDateFormat getWeekFormat(){
  if (weekFormat == null)   weekFormat=new SimpleDateFormat("String_Node_Str",defaultLocale);
  return weekFormat;
}
Program: 71078
Project: 71078
Buggy source:
/** 
 * @return
 */
private static SimpleDateFormat getAbbrWeekFormat(){
  if (abbrWeekFormat != null)   return abbrWeekFormat;
  try {
    Locale defaultLocale=Context.enter().getLocale();
    abbrWeekFormat=new SimpleDateFormat("String_Node_Str",defaultLocale);
    return abbrWeekFormat;
  }
  finally {
    Context.exit();
  }
}

Fixed version (ground truth):
/** 
 * @return
 */
private static SimpleDateFormat getAbbrWeekFormat(){
  if (abbrWeekFormat == null)   abbrWeekFormat=new SimpleDateFormat("String_Node_Str",defaultLocale);
  return abbrWeekFormat;
}
Program: 71079
Project: 71079
Buggy source:
/** 
 * @return
 */
private static SimpleDateFormat getAbbrMonthFormat(){
  if (abbrMonthFormat != null)   return abbrMonthFormat;
  try {
    Locale defaultLocale=Context.enter().getLocale();
    abbrMonthFormat=new SimpleDateFormat("String_Node_Str",defaultLocale);
    return abbrMonthFormat;
  }
  finally {
    Context.exit();
  }
}

Fixed version (ground truth):
/** 
 * @return
 */
private static SimpleDateFormat getAbbrMonthFormat(){
  if (abbrMonthFormat == null)   abbrMonthFormat=new SimpleDateFormat("String_Node_Str",defaultLocale);
  return abbrMonthFormat;
}
Program: 71080
Project: 71080
Buggy source:
public Object execute(Object[] arguments) throws BirtException {
  return this.executor.execute(arguments);
}

Fixed version (ground truth):
public Object execute(Object[] arguments,IScriptFunctionContext context) throws BirtException {
  return this.executor.execute(arguments,context);
}