nus-yam/ex-repair huggingface dataset:
Program: 77914
Project: 77914
Buggy source:
public void renderLegendGraphic(IPrimitiveRenderer ipr,Legend lg,Fill fPaletteEntry,Bounds bo) throws ChartException {
  final LineAttributes lia=LineAttributesImpl.create(ColorDefinitionImpl.GREY(),LineStyle.SOLID_LITERAL,1);
  if (fPaletteEntry == null) {
    fPaletteEntry=ColorDefinitionImpl.RED();
  }
  final double dXOffset=(bo.getWidth() - bo.getHeight()) / 2;
  Location[] loaFrontFace=null;
  loaFrontFace=new Location[4];
  loaFrontFace[0]=LocationImpl.create(bo.getLeft() + dXOffset,bo.getTop());
  loaFrontFace[1]=LocationImpl.create(bo.getLeft() + dXOffset,bo.getTop() + bo.getHeight());
  loaFrontFace[2]=LocationImpl.create(bo.getLeft() + dXOffset + bo.getHeight(),bo.getTop() + bo.getHeight());
  loaFrontFace[3]=LocationImpl.create(bo.getLeft() + dXOffset + bo.getHeight(),bo.getTop());
  renderPlane(ipr,StructureSource.createLegend(lg),loaFrontFace,fPaletteEntry,lia,getModel().getDimension(),3,false);
}

Fixed version (ground truth):
public void renderLegendGraphic(IPrimitiveRenderer ipr,Legend lg,Fill fPaletteEntry,Bounds bo) throws ChartException {
  final LineAttributes lia=LineAttributesImpl.create(ColorDefinitionImpl.GREY(),LineStyle.SOLID_LITERAL,1);
  if (fPaletteEntry == null) {
    fPaletteEntry=ColorDefinitionImpl.RED();
  }
  final double dXOffset=(bo.getWidth() - bo.getHeight()) / 2;
  Location[] loaFrontFace=null;
  loaFrontFace=new Location[4];
  loaFrontFace[0]=LocationImpl.create(bo.getLeft() + dXOffset,bo.getTop());
  loaFrontFace[1]=LocationImpl.create(bo.getLeft() + dXOffset,bo.getTop() + bo.getHeight());
  loaFrontFace[2]=LocationImpl.create(bo.getLeft() + dXOffset + bo.getHeight(),bo.getTop() + bo.getHeight());
  loaFrontFace[3]=LocationImpl.create(bo.getLeft() + dXOffset + bo.getHeight(),bo.getTop());
  renderPlane(ipr,StructureSource.createLegend(lg),loaFrontFace,fPaletteEntry,lia,getModel().getDimension(),3 * getDeviceScale(),false);
}
Program: 77915
Project: 77915
Buggy source:
public void renderLegendGraphic(IPrimitiveRenderer ipr,Legend lg,Fill fPaletteEntry,Bounds bo) throws ChartException {
  final LineAttributes lia=LineAttributesImpl.create(ColorDefinitionImpl.GREY(),LineStyle.SOLID_LITERAL,1);
  final double dXOffset=(bo.getWidth() - bo.getHeight()) / 2;
  Location[] loaFrontFace=null;
  loaFrontFace=new Location[4];
  loaFrontFace[0]=LocationImpl.create(bo.getLeft() + dXOffset,bo.getTop());
  loaFrontFace[1]=LocationImpl.create(bo.getLeft() + dXOffset,bo.getTop() + bo.getHeight());
  loaFrontFace[2]=LocationImpl.create(bo.getLeft() + dXOffset + bo.getHeight(),bo.getTop() + bo.getHeight());
  loaFrontFace[3]=LocationImpl.create(bo.getLeft() + dXOffset + bo.getHeight(),bo.getTop());
  renderPlane(ipr,StructureSource.createLegend(lg),loaFrontFace,fPaletteEntry,lia,getModel().getDimension(),3,false);
}

Fixed version (ground truth):
public void renderLegendGraphic(IPrimitiveRenderer ipr,Legend lg,Fill fPaletteEntry,Bounds bo) throws ChartException {
  final LineAttributes lia=LineAttributesImpl.create(ColorDefinitionImpl.GREY(),LineStyle.SOLID_LITERAL,1);
  final double dXOffset=(bo.getWidth() - bo.getHeight()) / 2;
  Location[] loaFrontFace=null;
  loaFrontFace=new Location[4];
  loaFrontFace[0]=LocationImpl.create(bo.getLeft() + dXOffset,bo.getTop());
  loaFrontFace[1]=LocationImpl.create(bo.getLeft() + dXOffset,bo.getTop() + bo.getHeight());
  loaFrontFace[2]=LocationImpl.create(bo.getLeft() + dXOffset + bo.getHeight(),bo.getTop() + bo.getHeight());
  loaFrontFace[3]=LocationImpl.create(bo.getLeft() + dXOffset + bo.getHeight(),bo.getTop());
  renderPlane(ipr,StructureSource.createLegend(lg),loaFrontFace,fPaletteEntry,lia,getModel().getDimension(),3 * getDeviceScale(),false);
}
Program: 77916
Project: 77916
Buggy source:
/** 
 * @param groups
 * @param groupIndex
 * @param deletedNum
 * @param level
 */
private static void resetStatus(List[] groups,int groupIndex,int deletedNum,int level){
  List levelList=groups[level];
  GroupInfo groupInfo=(GroupInfo)levelList.get(groupIndex);
  groupInfo.firstChild=-2;
}

Fixed version (ground truth):
/** 
 * @param groups
 * @param groupIndex
 * @param deletedNum
 * @param level
 */
private static void resetStatus(List[] groups,int groupIndex,int deletedNum,int level){
  List levelList=groups[level];
  GroupInfo deletedGroup=(GroupInfo)levelList.get(groupIndex);
  int index=groupIndex + 1;
  GroupInfo groupInfo;
  while (index < levelList.size()) {
    groupInfo=(GroupInfo)levelList.get(index);
    if (groupInfo.firstChild > 0 && groupInfo.firstChild > deletedGroup.firstChild)     groupInfo.firstChild=groupInfo.firstChild - deletedNum;
    index++;
  }
  deletedGroup.firstChild=-2;
}
Program: 77917
Project: 77917
Buggy source:
protected QueryExecutor newExecutor(){
  return new IVDataSourceExecutor(engine.getSharedScope(),queryDefn,new AggregateTable());
}

Fixed version (ground truth):
protected QueryExecutor newExecutor(){
  return new IVDataSourceExecutor(engine.getSharedScope(),queryDefn,this.preparedQuery.getAggrTable());
}
Program: 77918
Project: 77918
Buggy source:
/** 
 * Look up a user-defined message for the given locale in the referenced message files, the search uses a reduced form of Java locale-driven search algorithm: Language&Country, language, default.
 * @param resourceKey Resource key of the user defined message.
 * @param locale locale of message, if the input <code>locale</code> is <code>null</code>, the locale for the current thread will be used instead.
 * @return the corresponding locale-dependent messages. Return<code>""</code> if resoueceKey is blank or the message is not found.
 */
public String getMessage(String resourceKey,ULocale locale){
  Iterator bundleIter=gatherMessageBundles(locale).iterator();
  while (bundleIter.hasNext()) {
    String translation=(String)((PropertyResourceBundle)bundleIter.next()).handleGetObject(resourceKey);
    if (translation != null)     return translation;
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Look up a user-defined message for the given locale in the referenced message files, the search uses a reduced form of Java locale-driven search algorithm: Language&Country, language, default.
 * @param resourceKey Resource key of the user defined message.
 * @param locale locale of message, if the input <code>locale</code> is <code>null</code>, the locale for the current thread will be used instead.
 * @return the corresponding locale-dependent messages. Return<code>""</code> if resoueceKey is blank. Return <code>null</code> if the message is not found.
 */
public String getMessage(String resourceKey,ULocale locale){
  Iterator bundleIter=gatherMessageBundles(locale).iterator();
  while (bundleIter.hasNext()) {
    String translation=(String)((PropertyResourceBundle)bundleIter.next()).handleGetObject(resourceKey);
    if (translation != null)     return translation;
  }
  return null;
}
Program: 77919
Project: 77919
Buggy source:
/** 
 * Finds user-defined messages for the given locale. <p> First we look up in the report itself, then look into the referenced message file. Each search uses a reduced form of Java locale-driven search algorithm: Language&Country, language, default.
 * @param resourceKey Resource key of the user defined message.
 * @param locale locale of message, if the input <code>locale</code> is <code>null</code>, the locale for the current thread will be used instead.
 * @return the corresponding locale-dependent messages. Return<code>""</code> if translation can not be found, or <code>resourceKey</code> is blank or <code>null</code>.
 */
public String getMessage(String resourceKey,ULocale locale){
  if (StringUtil.isBlank(resourceKey))   return "String_Node_Str";
  if (locale == null)   locale=ThreadResources.getLocale();
  String msg=translations.getMessage(resourceKey,locale);
  if (msg != null)   return msg;
  String baseName=getStringProperty(this,INCLUDE_RESOURCE_PROP);
  if (baseName == null)   return "String_Node_Str";
  msg=BundleHelper.getHelper(this,baseName).getMessage(resourceKey,locale);
  return msg;
}

Fixed version (ground truth):
/** 
 * Finds user-defined messages for the given locale. <p> First we look up in the report itself, then look into the referenced message file. Each search uses a reduced form of Java locale-driven search algorithm: Language&Country, language, default.
 * @param resourceKey Resource key of the user defined message.
 * @param locale locale of message, if the input <code>locale</code> is <code>null</code>, the locale for the current thread will be used instead.
 * @return the corresponding locale-dependent messages. Return<code>""</code> if translation can not be found, or <code>resourceKey</code> is blank or <code>null</code>.
 */
public String getMessage(String resourceKey,ULocale locale){
  if (StringUtil.isBlank(resourceKey))   return null;
  if (locale == null)   locale=ThreadResources.getLocale();
  String msg=translations.getMessage(resourceKey,locale);
  if (msg != null)   return msg;
  String baseName=getStringProperty(this,INCLUDE_RESOURCE_PROP);
  if (baseName == null)   return null;
  msg=BundleHelper.getHelper(this,baseName).getMessage(resourceKey,locale);
  return msg;
}
Program: 77920
Project: 77920
Buggy source:
/** 
 * @param callNode
 * @param tree
 * @param columnExprList
 * @throws BirtException
 */
private void compileAggregationFunction(Node callNode,ScriptOrFnNode tree,List columnExprList) throws BirtException {
  Node firstChild=callNode.getFirstChild();
  compileComplexExpr(firstChild,tree,columnExprList);
}

Fixed version (ground truth):
/** 
 * @param callNode
 * @param tree
 * @param columnExprList
 * @throws BirtException
 */
private void compileAggregationFunction(Node callNode,ScriptOrFnNode tree,List columnExprList) throws BirtException {
  Node firstChild=callNode.getFirstChild();
  if (firstChild.getType() != Token.GETPROP)   return;
  Node getPropLeftChild=firstChild.getFirstChild();
  if (getPropLeftChild.getType() == Token.NAME && getPropLeftChild.getString().equals(TOTAL))   hasAggregation=true;
  compileComplexExpr(firstChild,tree,columnExprList);
}
Program: 77921
Project: 77921
Buggy source:
public void createPageCustomControl(Composite parent){
  setControl(createPageControl(parent));
  initializeControl();
}

Fixed version (ground truth):
public void createPageCustomControl(Composite parent){
  setControl(createPageControl(parent));
  initializeControl();
  getControl().setFocus();
  PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),this.CONEXT_ID_DATASET_JDBC);
}
Program: 77923
Project: 77923
Buggy source:
void createCustomControl(Composite parent){
  Composite content=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  content.setLayout(layout);
  new Label(content,SWT.LEFT).setText(Messages.getMessage("String_Node_Str"));
  m_driverClass=new Label(content,SWT.LEFT);
  m_driverClass.setText(SampleDBConstants.DRIVER_CLASS);
  new Label(content,SWT.LEFT).setText(Messages.getMessage("String_Node_Str"));
  m_driverURL=new Label(content,SWT.LEFT);
  m_driverURL.setText(SampleDBConstants.DRIVER_URL);
  new Label(content,SWT.LEFT).setText(Messages.getMessage("String_Node_Str"));
  m_sampleUser=new Label(content,SWT.LEFT);
  m_sampleUser.setText(SampleDBJDBCConnectionFactory.getDbUser());
  setMessage(DEFAULT_MESSAGE);
}

Fixed version (ground truth):
void createCustomControl(Composite parent){
  Composite content=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  content.setLayout(layout);
  new Label(content,SWT.LEFT).setText(Messages.getMessage("String_Node_Str"));
  m_driverClass=new Label(content,SWT.LEFT);
  m_driverClass.setText(SampleDBConstants.DRIVER_CLASS);
  new Label(content,SWT.LEFT).setText(Messages.getMessage("String_Node_Str"));
  m_driverURL=new Label(content,SWT.LEFT);
  m_driverURL.setText(SampleDBConstants.DRIVER_URL);
  new Label(content,SWT.LEFT).setText(Messages.getMessage("String_Node_Str"));
  m_sampleUser=new Label(content,SWT.LEFT);
  m_sampleUser.setText(SampleDBJDBCConnectionFactory.getDbUser());
  setMessage(DEFAULT_MESSAGE);
  content.setFocus();
  PlatformUI.getWorkbench().getHelpSystem().setHelp(content,CONEXT_ID_DATASOURCE_SAMPLEDB);
}
Program: 77924
Project: 77924
Buggy source:
public WizardBase(){
  TasksManager.instance();
  availableTasks=new LinkedHashMap();
  vTaskLabels=new Vector();
  vTaskIDs=new Vector();
}

Fixed version (ground truth):
public WizardBase(){
  this("String_Node_Str");
}
Program: 77925
Project: 77925
Buggy source:
protected Control createDialogArea(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
{
    GridLayout layout=new GridLayout();
    layout.marginHeight=0;
    layout.marginWidth=0;
    layout.verticalSpacing=0;
    layout.horizontalSpacing=0;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setFont(parent.getFont());
  }
  Label lblSeparator=new Label(composite,SWT.SEPARATOR | SWT.HORIZONTAL);
  lblSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  cmpTaskContainer=new CTabFolder(composite,SWT.TOP | SWT.FLAT);
{
    cmpTaskContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
    cmpTaskContainer.setTabHeight(25);
    cmpTaskContainer.addSelectionListener(this);
  }
  lblSeparator=new Label(composite,SWT.SEPARATOR | SWT.HORIZONTAL);
  lblSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  configureTaskArea(tmpTaskArray,tmpTopTaskId);
  FormData layoutData=(FormData)getTitleImageLabel().getParent().getLayoutData();
  layoutData.width=iWizardWidthMinimum;
  return composite;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
{
    GridLayout layout=new GridLayout();
    layout.marginHeight=0;
    layout.marginWidth=0;
    layout.verticalSpacing=0;
    layout.horizontalSpacing=0;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setFont(parent.getFont());
  }
  Label lblSeparator=new Label(composite,SWT.SEPARATOR | SWT.HORIZONTAL);
  lblSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  cmpTaskContainer=new CTabFolder(composite,SWT.TOP | SWT.FLAT);
{
    cmpTaskContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
    cmpTaskContainer.setTabHeight(25);
    cmpTaskContainer.addSelectionListener(this);
  }
  lblSeparator=new Label(composite,SWT.SEPARATOR | SWT.HORIZONTAL);
  lblSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  FormData layoutData=(FormData)getTitleImageLabel().getParent().getLayoutData();
  layoutData.width=iWizardWidthMinimum;
  return composite;
}
Program: 77926
Project: 77926
Buggy source:
protected void initializeBounds(){
  super.initializeBounds();
  getShell().setLocation((getShell().getDisplay().getClientArea().width / 2 - (getShell().getSize().x / 2)),(getShell().getDisplay().getClientArea().height / 2) - (getShell().getSize().y / 2));
}

Fixed version (ground truth):
protected void initializeBounds(){
  configureTaskArea(tmpTaskArray,tmpTopTaskId);
  super.initializeBounds();
  getShell().setLocation((getShell().getDisplay().getClientArea().width / 2 - (getShell().getSize().x / 2)),(getShell().getDisplay().getClientArea().height / 2) - (getShell().getSize().y / 2));
}
Program: 77927
Project: 77927
Buggy source:
public boolean preHandleMouseUp(){
  ExtendedItemHandle handle=DesignElementFactory.getInstance().newExtendedItem(null,extensionName);
  if (handle == null) {
    return false;
  }
  IReportItemBuilderUI builder=getbuilder();
  if (builder != null) {
    if (builder.open(handle) == Window.CANCEL) {
      return false;
    }
  }
  setModel(handle);
  return super.preHandleMouseUp();
}

Fixed version (ground truth):
public boolean preHandleMouseUp(){
  ExtendedItemHandle handle=DesignElementFactory.getInstance().newExtendedItem(null,extensionName);
  if (handle == null) {
    return false;
  }
  setModel(handle);
  return super.preHandleMouseUp();
}
Program: 77928
Project: 77928
Buggy source:
protected void createEditPolicies(){
  installEditPolicy(EditPolicy.COMPONENT_ROLE,new ReportComponentEditPolicy());
}

Fixed version (ground truth):
protected void createEditPolicies(){
  installEditPolicy(EditPolicy.COMPONENT_ROLE,new ReportComponentEditPolicy(){
    public boolean understandsRequest(    Request request){
      if (RequestConstants.REQ_DIRECT_EDIT.equals(request.getType()) || RequestConstants.REQ_OPEN.equals(request.getType()) || ReportRequest.CREATE_ELEMENT.equals(request.getType()))       return true;
      return super.understandsRequest(request);
    }
  }
);
}
Program: 77930
Project: 77930
Buggy source:
protected void adjustGridLayout(){
  super.adjustGridLayout();
  ((GridData)name.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint=166;
  ((GridData)color.getColorSelector().getLayoutData()).widthHint=96;
  ((GridData)size.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint=88;
  ((GridData)size.getMeasureControl(getFieldEditorParent()).getLayoutData()).widthHint=50;
  ((GridData)style.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint=170;
  ((GridData)weight.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint=170;
}

Fixed version (ground truth):
protected void adjustGridLayout(){
  super.adjustGridLayout();
  ((GridData)name.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint=166;
  ((GridData)color.getColorSelector().getLayoutData()).widthHint=96;
  ((GridData)size.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint=108;
  ((GridData)size.getMeasureControl(getFieldEditorParent()).getLayoutData()).widthHint=50;
  ((GridData)style.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint=170;
  ((GridData)weight.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint=170;
}
Program: 77931
Project: 77931
Buggy source:
private String getPatternForCategory(String category){
  String pattern;
  if (DesignChoiceConstants.NUMBER_FORMAT_TYPE_CURRENCY.equals(category)) {
    String sym="String_Node_Str";
    Currency currency=Currency.getInstance(ULocale.getDefault());
    if (currency != null) {
      sym=currency.getSymbol();
    }
    pattern=sym + "String_Node_Str";
  }
 else   if (DesignChoiceConstants.NUMBER_FORMAT_TYPE_FIXED.equals(category)) {
    pattern="String_Node_Str";
  }
 else   if (DesignChoiceConstants.NUMBER_FORMAT_TYPE_PERCENT.equals(category)) {
    pattern="String_Node_Str";
  }
 else   if (DesignChoiceConstants.NUMBER_FORMAT_TYPE_SCIENTIFIC.equals(category)) {
    pattern="String_Node_Str";
  }
 else {
    pattern="String_Node_Str";
  }
  return pattern;
}

Fixed version (ground truth):
private String getPatternForCategory(String category){
  String pattern=null;
  if (DesignChoiceConstants.NUMBER_FORMAT_TYPE_CURRENCY.equals(category)) {
    pattern="String_Node_Str";
    Currency currency=Currency.getInstance(ULocale.getDefault());
    if (currency != null) {
      String symbol=currency.getSymbol();
      NumberFormat formater=NumberFormat.getCurrencyInstance();
      String result=formater.format(1);
      if (result.endsWith(symbol)) {
        pattern="String_Node_Str";
      }
    }
  }
 else   if (DesignChoiceConstants.NUMBER_FORMAT_TYPE_FIXED.equals(category)) {
    pattern="String_Node_Str";
  }
 else   if (DesignChoiceConstants.NUMBER_FORMAT_TYPE_PERCENT.equals(category)) {
    pattern="String_Node_Str";
  }
 else   if (DesignChoiceConstants.NUMBER_FORMAT_TYPE_SCIENTIFIC.equals(category)) {
    pattern="String_Node_Str";
  }
 else {
    pattern="String_Node_Str";
  }
  return pattern;
}
Program: 77932
Project: 77932
Buggy source:
/** 
 * Test feature of aggregation expression 
 */
public void test_RunningAggregationExpression() throws Exception {
  String testSQL="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(testSQL);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",2),new ScriptExpression("String_Node_Str",2)};
  GroupDefinition[] groupDef=new GroupDefinition[]{new GroupDefinition("String_Node_Str"),new GroupDefinition("String_Node_Str")};
  groupDef[0].setKeyExpression("String_Node_Str");
  groupDef[1].setKeyExpression("String_Node_Str");
  QueryDefinition queryDefn=newReportQuery();
  queryDefn.addGroup(groupDef[0]);
  queryDefn.addGroup(groupDef[1]);
  queryDefn.addExpression(expressions[0],BaseTransform.ON_EACH_ROW);
  queryDefn.addExpression(expressions[1],BaseTransform.AFTER_LAST_ROW);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResults=preparedQuery.execute(null);
  IResultIterator resultIt=queryResults.getResultIterator();
  assertTrue(resultIt.next());
  resultIt.getValue(expressions[0]);
  resultIt.getValue(expressions[1]);
}

Fixed version (ground truth):
/** 
 * Test feature of aggregation expression 
 */
public void test_RunningAggregationExpression() throws Exception {
  String testSQL="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(testSQL);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",2),new ScriptExpression("String_Node_Str",2)};
  String names[]={"String_Node_Str","String_Node_Str","String_Node_Str"};
  GroupDefinition[] groupDef=new GroupDefinition[]{new GroupDefinition("String_Node_Str"),new GroupDefinition("String_Node_Str")};
  groupDef[0].setKeyExpression("String_Node_Str");
  groupDef[1].setKeyExpression("String_Node_Str");
  QueryDefinition queryDefn=newReportQuery();
  queryDefn.addGroup(groupDef[0]);
  queryDefn.addGroup(groupDef[1]);
  queryDefn.addResultSetExpression(names[0],expressions[0]);
  queryDefn.addResultSetExpression(names[1],expressions[1]);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResults=preparedQuery.execute(jsScope);
  IResultIterator resultIt=queryResults.getResultIterator();
  assertTrue(resultIt.next());
  resultIt.getValue(names[0]);
  resultIt.getValue(names[1]);
}
Program: 77933
Project: 77933
Buggy source:
/** 
 * filter on group with bottom N with invalid value
 * @throws Exception
 */
public void test_InvalidValueFilterGroup() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str")};
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  int expreLength=expressions.length;
  int i=0;
  while (i < expreLength) {
    queryDefn.addExpression(expressions[i],BaseTransform.ON_EACH_ROW);
    i++;
  }
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_BOTTOM_PERCENT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.setInterval(2);
  groupDefn.setIntervalRange(IGroupDefinition.MONTH_INTERVAL);
  groupDefn.addFilter(filterDefn);
  try {
    queryDefn.addGroup(groupDefn);
    IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
    IQueryResults queryResults=preparedQuery.execute(null);
    IResultIterator resultIt=queryResults.getResultIterator();
    fail("String_Node_Str");
  }
 catch (  DataException e) {
  }
}

Fixed version (ground truth):
/** 
 * filter on group with bottom N with invalid value
 * @throws Exception
 */
public void test_InvalidValueFilterGroup() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str")};
  String names[]={"String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  for (int i=0; i < expressions.length; i++) {
    queryDefn.addResultSetExpression(names[i],expressions[i]);
  }
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_BOTTOM_PERCENT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.setInterval(2);
  groupDefn.setIntervalRange(IGroupDefinition.MONTH_INTERVAL);
  groupDefn.addFilter(filterDefn);
  try {
    queryDefn.addGroup(groupDefn);
    IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
    IQueryResults queryResults=preparedQuery.execute(null);
    IResultIterator resultIt=queryResults.getResultIterator();
    fail("String_Node_Str");
  }
 catch (  DataException e) {
  }
}
Program: 77934
Project: 77934
Buggy source:
/** 
 * filter on group with bottom N with negative value
 * @throws Exception
 */
public void test_NegativeValueFilterGroup() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str")};
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  int expreLength=expressions.length;
  int i=0;
  while (i < expreLength) {
    queryDefn.addExpression(expressions[i],BaseTransform.ON_EACH_ROW);
    i++;
  }
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_BOTTOM_PERCENT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.setInterval(2);
  groupDefn.setIntervalRange(IGroupDefinition.MONTH_INTERVAL);
  groupDefn.addFilter(filterDefn);
  try {
    queryDefn.addGroup(groupDefn);
    IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
    IQueryResults queryResults=preparedQuery.execute(null);
    IResultIterator resultIt=queryResults.getResultIterator();
    fail("String_Node_Str");
  }
 catch (  DataException e) {
  }
}

Fixed version (ground truth):
/** 
 * filter on group with bottom N with negative value
 * @throws Exception
 */
public void test_NegativeValueFilterGroup() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str")};
  String names[]={"String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  for (int i=0; i < expressions.length; i++) {
    queryDefn.addResultSetExpression(names[i],expressions[i]);
  }
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_BOTTOM_PERCENT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.setInterval(2);
  groupDefn.setIntervalRange(IGroupDefinition.MONTH_INTERVAL);
  groupDefn.addFilter(filterDefn);
  try {
    queryDefn.addGroup(groupDefn);
    IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
    IQueryResults queryResults=preparedQuery.execute(null);
    IResultIterator resultIt=queryResults.getResultIterator();
    fail("String_Node_Str");
  }
 catch (  DataException e) {
  }
}
Program: 77935
Project: 77935
Buggy source:
/** 
 * Test feature of aggregation expression 
 */
public void test_FilteWithTopN() throws Exception {
  String testSQL="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(testSQL);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",2)};
  FilterDefinition filterDef=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_TOP_N,"String_Node_Str"));
  QueryDefinition queryDefn=newReportQuery();
  queryDefn.addFilter(filterDef);
  queryDefn.addExpression(expressions[0],BaseTransform.ON_EACH_ROW);
  queryDefn.addExpression(expressions[1],BaseTransform.AFTER_LAST_ROW);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResults=preparedQuery.execute(null);
  IResultIterator resultIt=queryResults.getResultIterator();
  outputQueryResult(resultIt,expressions);
  checkOutputFile();
}

Fixed version (ground truth):
/** 
 * Test feature of aggregation expression 
 */
public void test_FilteWithTopN() throws Exception {
  String testSQL="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(testSQL);
  ScriptExpression[] expressions=new ScriptExpression[2];
  expressions[0]=new ScriptExpression("String_Node_Str");
  expressions[1]=new ScriptExpression("String_Node_Str");
  FilterDefinition filterDef=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_TOP_N,"String_Node_Str"));
  QueryDefinition queryDefn=newReportQuery();
  queryDefn.addFilter(filterDef);
  queryDefn.addResultSetExpression("String_Node_Str",expressions[0]);
  queryDefn.addResultSetExpression("String_Node_Str",expressions[1]);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResults=preparedQuery.execute(null);
  IResultIterator resultIt=queryResults.getResultIterator();
  outputQueryResult(resultIt,new String[]{"String_Node_Str","String_Node_Str"});
  checkOutputFile();
}
Program: 77936
Project: 77936
Buggy source:
/** 
 * filter on date time type column with operator Bottom N 
 */
public void test_FilterWithBottomN() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",2),new ScriptExpression("String_Node_Str",6)};
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_BOTTOM_N,"String_Node_Str"));
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  queryDefn.addFilter(filterDefn);
  queryDefn.addExpression(expressions[0],BaseTransform.ON_EACH_ROW);
  queryDefn.addExpression(expressions[1],BaseTransform.ON_EACH_ROW);
  queryDefn.addExpression(expressions[2],BaseTransform.ON_EACH_ROW);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResults=preparedQuery.execute(null);
  IResultIterator resultIt=queryResults.getResultIterator();
  outputQueryResult(resultIt,expressions);
  checkOutputFile();
}

Fixed version (ground truth):
/** 
 * filter on date time type column with operator Bottom N 
 */
public void test_FilterWithBottomN() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",2),new ScriptExpression("String_Node_Str",6)};
  String names[]={"String_Node_Str","String_Node_Str","String_Node_Str"};
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_BOTTOM_N,"String_Node_Str"));
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  queryDefn.addFilter(filterDefn);
  for (int i=0; i < expressions.length; i++) {
    queryDefn.addResultSetExpression(names[i],expressions[i]);
  }
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResults=preparedQuery.execute(null);
  IResultIterator resultIt=queryResults.getResultIterator();
  outputQueryResult(resultIt,names);
  checkOutputFile();
}
Program: 77937
Project: 77937
Buggy source:
/** 
 * add a filter to group
 */
public void test_FilterGroup() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str")};
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  int expreLength=expressions.length;
  int i=0;
  while (i < expreLength) {
    queryDefn.addExpression(expressions[i],BaseTransform.ON_EACH_ROW);
    i++;
  }
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_TOP_PERCENT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.addFilter(filterDefn);
  queryDefn.addGroup(groupDefn);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResults=preparedQuery.execute(null);
  IResultIterator resultIt=queryResults.getResultIterator();
  outputQueryResult(resultIt,expressions);
  checkOutputFile();
}

Fixed version (ground truth):
/** 
 * add a filter to group
 */
public void test_FilterGroup() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str")};
  String names[]={"String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  for (int i=0; i < expressions.length; i++) {
    queryDefn.addResultSetExpression(names[i],expressions[i]);
  }
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_TOP_PERCENT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.addFilter(filterDefn);
  queryDefn.addGroup(groupDefn);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResults=preparedQuery.execute(null);
  IResultIterator resultIt=queryResults.getResultIterator();
  outputQueryResult(resultIt,names);
  checkOutputFile();
}
Program: 77938
Project: 77938
Buggy source:
/** 
 * filter on group with bottom N
 * @throws Exception
 */
public void test_MultiPassFilterGroup() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str")};
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  int expreLength=expressions.length;
  int i=0;
  while (i < expreLength) {
    queryDefn.addExpression(expressions[i],BaseTransform.ON_EACH_ROW);
    i++;
  }
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_BOTTOM_PERCENT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.setInterval(2);
  groupDefn.setIntervalRange(IGroupDefinition.MONTH_INTERVAL);
  groupDefn.addFilter(filterDefn);
  queryDefn.addGroup(groupDefn);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResults=preparedQuery.execute(null);
  IResultIterator resultIt=queryResults.getResultIterator();
  outputQueryResult(resultIt,expressions);
  checkOutputFile();
}

Fixed version (ground truth):
/** 
 * filter on group with bottom N
 * @throws Exception
 */
public void test_MultiPassFilterGroup() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str")};
  String names[]={"String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  for (int i=0; i < expressions.length; i++) {
    queryDefn.addResultSetExpression(names[i],expressions[i]);
  }
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_BOTTOM_PERCENT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.setInterval(2);
  groupDefn.setIntervalRange(IGroupDefinition.MONTH_INTERVAL);
  groupDefn.addFilter(filterDefn);
  queryDefn.addGroup(groupDefn);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResults=preparedQuery.execute(null);
  IResultIterator resultIt=queryResults.getResultIterator();
  outputQueryResult(resultIt,names);
  checkOutputFile();
}
Program: 77939
Project: 77939
Buggy source:
/** 
 * filter on group with nested query expression
 * @throws Exception
 */
public void test_NestedAggregation() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",0)};
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_GT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.addFilter(filterDefn);
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  queryDefn.addExpression(expressions[0],BaseTransform.ON_EACH_ROW);
  queryDefn.addExpression(expressions[1],BaseTransform.ON_EACH_ROW);
  queryDefn.addExpression(expressions[2],BaseTransform.ON_EACH_ROW);
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResult=preparedQuery.execute(null);
  IResultIterator resultIt=queryResult.getResultIterator();
  outputQueryResult(resultIt,expressions);
  checkOutputFile();
}

Fixed version (ground truth):
/** 
 * filter on group with nested query expression
 * @throws Exception
 */
public void test_NestedAggregation() throws Exception {
  String sqlStatement="String_Node_Str" + getTestTableName();
  ((OdaDataSetDesign)this.dataSet).setQueryText(sqlStatement);
  IBaseExpression[] expressions=new IBaseExpression[]{new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",0),new ScriptExpression("String_Node_Str",0)};
  String names[]={"String_Node_Str","String_Node_Str","String_Node_Str"};
  FilterDefinition filterDefn=new FilterDefinition(new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_GT,"String_Node_Str"));
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyExpression("String_Node_Str");
  groupDefn.addFilter(filterDefn);
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(this.dataSet.getName());
  for (int i=0; i < expressions.length; i++) {
    queryDefn.addResultSetExpression(names[i],expressions[i]);
  }
  IPreparedQuery preparedQuery=dataEngine.prepare(queryDefn);
  IQueryResults queryResult=preparedQuery.execute(null);
  IResultIterator resultIt=queryResult.getResultIterator();
  outputQueryResult(resultIt,names);
  checkOutputFile();
}
Program: 77940
Project: 77940
Buggy source:
/** 
 * if parameter existed in config file, return the correct parameter name
 * @param configVarName String
 * @return String
 */
private String getParameterName(String configVarName) throws ReportServiceException {
}

Fixed version (ground truth):
/** 
 * if parameter existed in config file, return the correct parameter name
 * @param configVarName String
 * @return String
 */
private String getParameterName(String configVarName) throws ReportServiceException {
  String paramName=null;
  List parameters=getParameterList();
  if (parameters != null) {
    for (int i=0; i < parameters.size(); i++) {
      ScalarParameterHandle parameter=null;
      if (parameters.get(i) instanceof ScalarParameterHandle) {
        parameter=((ScalarParameterHandle)parameters.get(i));
      }
      String curName=null;
      if (parameter != null && parameter.getName() != null) {
        curName=parameter.getName() + "String_Node_Str" + parameter.getID();
      }
      if (curName != null && curName.equalsIgnoreCase(configVarName)) {
        paramName=parameter.getName();
        break;
      }
    }
  }
  return paramName;
}
Program: 77941
Project: 77941
Buggy source:
protected void __initParameters(HttpServletRequest request) throws Exception {
  this.reportDesignHandle=getDesignHandle(request);
  InputOptions options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,request);
  options.setOption(InputOptions.OPT_LOCALE,locale);
  options.setOption(InputOptions.OPT_RTL,new Boolean(rtl));
  Collection parameterList=getParameterList();
  if (isDesigner)   parseConfigVars(request,parameterList);
  this.parametersAsString=getParsedParametersAsString(parameterList,request,options);
  this.parameters=(HashMap)getParsedParameters(this.reportDesignHandle,parameterList,request,options);
  Collection parameterDefList=this.getReportService().getParameterDefinitions(reportDesignHandle,options,false);
  this.missingParameter=validateParameters(parameterDefList,this.parametersAsString);
}

Fixed version (ground truth):
protected void __initParameters(HttpServletRequest request) throws Exception {
  this.reportDesignHandle=getDesignHandle(request);
  InputOptions options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,request);
  options.setOption(InputOptions.OPT_LOCALE,locale);
  options.setOption(InputOptions.OPT_RTL,new Boolean(rtl));
  Collection parameterList=getParameterList();
  if (this.isDesigner && !IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath()))   parseConfigVars(request,parameterList);
  this.parametersAsString=getParsedParametersAsString(parameterList,request,options);
  this.parameters=(HashMap)getParsedParameters(this.reportDesignHandle,parameterList,request,options);
  Collection parameterDefList=getReportService().getParameterDefinitions(this.reportDesignHandle,options,false);
  this.missingParameter=validateParameters(parameterDefList,this.parametersAsString);
}
Program: 77942
Project: 77942
Buggy source:
/** 
 * @return the parameter handle
 */
public ParameterHandle findParameter(String paramName) throws ReportServiceException {
}

Fixed version (ground truth):
/** 
 * @return the parameter handle
 */
public ParameterHandle findParameter(String paramName) throws ReportServiceException {
  if (paramName == null)   return null;
  IReportRunnable runnable=(IReportRunnable)this.reportDesignHandle.getDesignObject();
  ModuleHandle model=null;
  if (runnable != null)   model=runnable.getDesignHandle().getModuleHandle();
  if (model != null)   return model.findParameter(paramName);
 else   return null;
}
Program: 77943
Project: 77943
Buggy source:
/** 
 * get parsed parameters as string.
 * @param parameterList Collection
 * @param request HttpServletRequest
 * @param options InputOptions
 * @return Map
 */
protected Map getParsedParametersAsString(Collection parameterList,HttpServletRequest request,InputOptions options) throws ReportServiceException {
}

Fixed version (ground truth):
/** 
 * get parsed parameters as string.
 * @param parameterList Collection
 * @param request HttpServletRequest
 * @param options InputOptions
 * @return Map
 */
protected Map getParsedParametersAsString(Collection parameterList,HttpServletRequest request,InputOptions options) throws ReportServiceException {
  Map params=new HashMap();
  if (parameterList == null)   return params;
  for (Iterator iter=parameterList.iterator(); iter.hasNext(); ) {
    ScalarParameterHandle parameter=null;
    Object parameterObj=iter.next();
    if (parameterObj instanceof ScalarParameterHandle) {
      parameter=(ScalarParameterHandle)parameterObj;
    }
    if (parameter == null)     continue;
    String paramName=parameter.getName();
    String paramValue=getParamValueAsString(request,parameter);
    if (paramValue == null && (IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath()) || (this.configMap != null && !this.configMap.containsKey(paramName)))) {
      paramValue=this.getParameterDefaultValues(reportDesignHandle,paramName,options);
    }
    if (paramName != null)     params.put(paramName,paramValue);
  }
  return params;
}
Program: 77944
Project: 77944
Buggy source:
/** 
 * parse paramenters from config file.
 * @param request HttpServletRequest
 * @return
 */
protected void parseConfigVars(HttpServletRequest request,Collection parameterList){
}

Fixed version (ground truth):
/** 
 * parse paramenters from config file.
 * @param request HttpServletRequest
 * @return
 */
protected void parseConfigVars(HttpServletRequest request,Collection parameterList){
  this.configMap=new HashMap();
  String reportConfigName=ParameterAccessor.getConfigFileName(this.reportDesignName);
  if (reportConfigName == null)   return;
  SessionHandle sessionHandle=DesignEngine.newSession(ULocale.US);
  ReportDesignHandle handle=null;
  try {
    handle=sessionHandle.openDesign(reportConfigName);
    if (handle != null) {
      Iterator parameters=parameterList.iterator();
      while (parameters != null && parameters.hasNext()) {
        Object parameterHandle=parameters.next();
        if (parameterHandle instanceof ScalarParameterHandle) {
          ScalarParameterHandle scalarParameterHandle=(ScalarParameterHandle)parameterHandle;
          if (scalarParameterHandle.getName() != null)           this.configMap.put(scalarParameterHandle.getName(),null);
        }
      }
      Iterator configVars=handle.configVariablesIterator();
      while (configVars != null && configVars.hasNext()) {
        ConfigVariableHandle configVar=(ConfigVariableHandle)configVars.next();
        if (configVar != null && configVar.getName() != null) {
          String paramName=getParameterName(configVar.getName());
          String paramValue=configVar.getValue();
          ScalarParameterHandle parameter=(ScalarParameterHandle)findParameter(paramName);
          if (paramValue != null && parameter != null) {
            try {
              Object paramValueObj=ParameterValidationUtil.validate(parameter.getDataType(),parameter.getPattern(),paramValue,ULocale.US);
              paramValue=ParameterValidationUtil.getDisplayValue(parameter.getDataType(),parameter.getPattern(),paramValueObj,locale);
            }
 catch (            Exception err) {
              paramValue=configVar.getValue();
            }
            this.configMap.put(paramName,paramValue);
          }
        }
      }
      handle.close();
    }
  }
 catch (  Exception e) {
    try {
      if (handle != null)       handle.close();
    }
 catch (    Exception err) {
    }
  }
}
Program: 77945
Project: 77945
Buggy source:
/** 
 * @return the parameter handle list
 */
private List getParameterList() throws ReportServiceException {
}

Fixed version (ground truth):
/** 
 * @return the parameter handle list
 */
private List getParameterList() throws ReportServiceException {
  IReportRunnable runnable=(IReportRunnable)this.reportDesignHandle.getDesignObject();
  ModuleHandle model=null;
  if (runnable != null)   model=runnable.getDesignHandle().getModuleHandle();
  if (model != null)   return model.getFlattenParameters();
 else   return null;
}