nus-yam/ex-repair huggingface dataset:
Program: 76800
Project: 76800
Buggy source:
/** 
 * With group and filter
 * @throws BirtException
 */
public void testBasicIVSubQuery() throws Exception {
  this.GEN_add_filter=false;
  this.GEN_add_group=true;
  this.GEN_subquery_on_group=true;
  this._genBasicIVWithSubQuery();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  this.PRE_add_filter=true;
  this.PRE_add_sort=true;
  this.PRE_add_group=true;
  this.PRE_use_oldbinding=true;
  this._preBasicIVWithSubQuery();
  this.closeArchiveReader();
  this.checkOutputFile();
}

Fixed version (ground truth):
/** 
 * With group and filter
 * @throws BirtException
 */
public void testBasicIVSubQuery() throws Exception {
  this.GEN_add_filter=false;
  this.GEN_add_group=true;
  this.GEN_subquery_on_group=true;
  this._genBasicIVWithSubQuery();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  this.PRE_add_filter=true;
  this.PRE_add_sort=true;
  this.PRE_add_group=true;
  this._preBasicIVWithSubQuery();
  this.closeArchiveReader();
  this.checkOutputFile();
}
Program: 76801
Project: 76801
Buggy source:
public void setUp() throws Exception {
  super.setUp();
  expectedValue=new ArrayList();
  this.GEN_add_filter=false;
  this.GEN_add_group=false;
  this.GEN_subquery_on_group=false;
  this.PRE_add_filter=false;
  this.PRE_add_sort=false;
  this.PRE_use_oldbinding=false;
  this.PRE_add_group=false;
}

Fixed version (ground truth):
public void setUp() throws Exception {
  super.setUp();
  expectedValue=new ArrayList();
  this.GEN_add_filter=false;
  this.GEN_add_group=false;
  this.GEN_subquery_on_group=false;
  this.PRE_add_filter=false;
  this.PRE_add_sort=false;
  this.PRE_change_oldbinding=false;
  this.PRE_add_group=false;
}
Program: 76802
Project: 76802
Buggy source:
/** 
 * @throws Exception
 */
public void testBasicIV5() throws Exception {
  this.GEN_add_filter=true;
  this.GEN_add_group=true;
  this.genBasicIV();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  this.PRE_add_filter=true;
  this.PRE_add_sort=true;
  this.PRE_use_oldbinding=true;
  this.PRE_add_group=true;
  this.preBasicIV();
  this.closeArchiveReader();
  this.checkOutputFile();
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
public void testBasicIV5() throws Exception {
  this.GEN_add_filter=true;
  this.GEN_add_group=true;
  this.genBasicIV();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  this.PRE_add_filter=true;
  this.PRE_add_sort=true;
  this.PRE_add_group=true;
  this.preBasicIV();
  this.closeArchiveReader();
  this.checkOutputFile();
}
Program: 76803
Project: 76803
Buggy source:
/** 
 * Test <code>IHideRule</code>
 * @throws SemanticException
 * @throws ScriptException
 */
public void testHideRule() throws SemanticException, ScriptException {
  TableHandle tableHandle=factory.newTableItem("String_Node_Str",3);
  designHandle.getBody().add(tableHandle);
  HideRule hide=StructureFactory.createHideRule();
  hide.setFormat("String_Node_Str");
  HideRuleHandle hideHandle=(HideRuleHandle)tableHandle.getPropertyHandle("String_Node_Str").addItem(hide);
  HideRule hide2=StructureFactory.createHideRule();
  hide2.setExpression("String_Node_Str");
  hide2.setFormat("String_Node_Str");
  tableHandle.getPropertyHandle("String_Node_Str").addItem(hide2);
  IReportItem item=new ReportItem(tableHandle);
  String[] rules=item.getHideRuleExpression("String_Node_Str");
  assertEquals(2,rules.length);
  assertEquals("String_Node_Str",rules[0]);
  assertEquals("String_Node_Str",rules[1]);
  IHideRule iHide=new HideRuleImpl(hideHandle);
  assertEquals("String_Node_Str",iHide.getFormat());
  iHide.setValueExpr("String_Node_Str");
  assertEquals("String_Node_Str",iHide.getValueExpr());
  item.removeHideRule("String_Node_Str");
  rules=item.getHideRuleExpression("String_Node_Str");
  assertEquals(0,rules.length);
}

Fixed version (ground truth):
/** 
 * Test <code>IHideRule</code>
 * @throws SemanticException
 * @throws ScriptException
 */
public void testHideRule() throws SemanticException, ScriptException {
  TableHandle tableHandle=factory.newTableItem("String_Node_Str",3);
  designHandle.getBody().add(tableHandle);
  HideRule hide=StructureFactory.createHideRule();
  hide.setFormat("String_Node_Str");
  HideRuleHandle hideHandle=(HideRuleHandle)tableHandle.getPropertyHandle("String_Node_Str").addItem(hide);
  HideRule hide2=StructureFactory.createHideRule();
  hide2.setExpression("String_Node_Str");
  hide2.setFormat("String_Node_Str");
  tableHandle.getPropertyHandle("String_Node_Str").addItem(hide2);
  IReportItem item=new ReportItem(tableHandle);
  IHideRule[] rules=item.getHideRules();
  assertEquals(2,rules.length);
  IHideRule iHide=new HideRuleImpl(hideHandle);
  assertEquals("String_Node_Str",iHide.getFormat());
  iHide.setValueExpr("String_Node_Str");
  assertEquals("String_Node_Str",iHide.getValueExpr());
  item.removeHideRule(iHide);
  rules=item.getHideRules();
  assertEquals(1,rules.length);
}
Program: 76804
Project: 76804
Buggy source:
public void testCell() throws ScriptException {
  CellHandle cellHandle=factory.newCell();
  ICell cell=new Cell(cellHandle);
  cell.setColumn(2);
  assertEquals(2,cell.getColumn());
  cell.setColumnSpan(3);
  assertEquals(3,cell.getColumnSpan());
  cell.setDrop(DesignChoiceConstants.DROP_TYPE_ALL);
  assertEquals(DesignChoiceConstants.DROP_TYPE_ALL,cell.getDrop());
  cell.setRowSpan(4);
  assertEquals(4,cell.getRowSpan());
}

Fixed version (ground truth):
public void testCell() throws ScriptException {
  CellHandle cellHandle=factory.newCell();
  ICell cell=new Cell(cellHandle);
  cell.setColumn(2);
  assertEquals(2,cell.getColumn());
  assertEquals(1,cell.getColumnSpan());
  cell.setDrop(DesignChoiceConstants.DROP_TYPE_ALL);
  assertEquals(DesignChoiceConstants.DROP_TYPE_ALL,cell.getDrop());
  assertEquals(1,cell.getRowSpan());
}
Program: 76805
Project: 76805
Buggy source:
/** 
 * Tests addColumnBinding , addHighLightRule , addHideRule , addFilterCondition , addSortCondition.
 * @throws SemanticException
 * @throws ScriptException
 */
public void testAddFunction() throws SemanticException, ScriptException {
  TableHandle tableHandle=factory.newTableItem("String_Node_Str",3);
  designHandle.getBody().add(tableHandle);
  IDataBinding binding=StructureScriptAPIFactory.createComputedColumn();
  binding.setExpression("String_Node_Str");
  binding.setName("String_Node_Str");
  IListing item=new Listing(tableHandle);
  item.addColumnBinding(binding);
  IDataBinding binding2=StructureScriptAPIFactory.createComputedColumn();
  try {
    item.addColumnBinding(binding2);
    fail();
  }
 catch (  ScriptException e) {
  }
  RowHandle rowHandle=(RowHandle)tableHandle.getFooter().getContents().get(0);
  IRow row=new Row(rowHandle);
  IHighLightRule highlight=StructureScriptAPIFactory.createHighLightRule();
  row.addHighLightRule(highlight);
  IHideRule hideRule=StructureScriptAPIFactory.createHideRule();
  item.addHideRule(hideRule);
  IFilterCondition filter=StructureScriptAPIFactory.createFilterCondition();
  try {
    item.addFilterCondition(filter);
    fail();
  }
 catch (  ScriptException e) {
  }
  filter.setExpr("String_Node_Str");
  item.addFilterCondition(filter);
  ISortCondition sort=StructureScriptAPIFactory.createSortKey();
  try {
    item.addSortCondition(sort);
    fail();
  }
 catch (  ScriptException e) {
  }
  sort.setKey("String_Node_Str");
  item.addSortCondition(sort);
}

Fixed version (ground truth):
/** 
 * Tests addColumnBinding , addHighLightRule , addHideRule , addFilterCondition , addSortCondition.
 * @throws SemanticException
 * @throws ScriptException
 */
public void testAddFunction() throws SemanticException, ScriptException {
  TableHandle tableHandle=factory.newTableItem("String_Node_Str",3);
  designHandle.getBody().add(tableHandle);
  IDataBinding binding=StructureScriptAPIFactory.createDataBinding();
  binding.setExpression("String_Node_Str");
  binding.setName("String_Node_Str");
  IListing item=new Listing(tableHandle);
  item.addDataBinding(binding);
  IDataBinding binding2=StructureScriptAPIFactory.createDataBinding();
  try {
    item.addDataBinding(binding2);
    fail();
  }
 catch (  ScriptException e) {
  }
  RowHandle rowHandle=(RowHandle)tableHandle.getFooter().getContents().get(0);
  IRow row=new Row(rowHandle);
  IHighlightRule highlight=StructureScriptAPIFactory.createHighLightRule();
  row.addHighlightRule(highlight);
  IHideRule hideRule=StructureScriptAPIFactory.createHideRule();
  item.addHideRule(hideRule);
  IFilterCondition filter=StructureScriptAPIFactory.createFilterCondition();
  try {
    item.addFilterCondition(filter);
    fail();
  }
 catch (  ScriptException e) {
  }
  filter.setExpr("String_Node_Str");
  item.addFilterCondition(filter);
  ISortCondition sort=StructureScriptAPIFactory.createSortCondition();
  try {
    item.addSortCondition(sort);
    fail();
  }
 catch (  ScriptException e) {
  }
  sort.setKey("String_Node_Str");
  item.addSortCondition(sort);
}
Program: 76807
Project: 76807
Buggy source:
/** 
 * Test <code>IDataBinding</code> method.
 * @throws ScriptException
 * @throws SemanticException
 */
public void testDataBinding() throws ScriptException, SemanticException {
  TableHandle tableHandle=factory.newTableItem("String_Node_Str",3);
  designHandle.getBody().add(tableHandle);
  ComputedColumn column=StructureFactory.newComputedColumn(tableHandle,"String_Node_Str");
  column.setExpression("String_Node_Str");
  tableHandle.addColumnBinding(column,true);
  ComputedColumn column2=StructureFactory.newComputedColumn(tableHandle,"String_Node_Str");
  column2.setExpression("String_Node_Str");
  tableHandle.addColumnBinding(column2,true);
  IReportItem item=new ReportItem(tableHandle);
  IDataBinding[] bindings=item.getColumnBindings();
  assertEquals(2,bindings.length);
  IDataBinding binding=bindings[0];
  IDataBinding binding2=bindings[1];
  assertEquals("String_Node_Str",binding.getName());
  assertEquals("String_Node_Str",binding2.getName());
  binding.setAggregateOn("String_Node_Str");
  assertEquals("String_Node_Str",binding.getAggregateOn());
  binding.setDataType("String_Node_Str");
  assertEquals("String_Node_Str",binding.getDataType());
  binding.setExpression("String_Node_Str");
  assertEquals("String_Node_Str",binding.getExpression());
  assertEquals("String_Node_Str",binding.getName());
  assertEquals("String_Node_Str",item.getColumnBinding("String_Node_Str"));
  item.removeColumnBinding("String_Node_Str");
  assertNull(item.getColumnBinding("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Test <code>IDataBinding</code> method.
 * @throws ScriptException
 * @throws SemanticException
 */
public void testDataBinding() throws ScriptException, SemanticException {
  TableHandle tableHandle=factory.newTableItem("String_Node_Str",3);
  designHandle.getBody().add(tableHandle);
  ComputedColumn column=StructureFactory.newComputedColumn(tableHandle,"String_Node_Str");
  column.setExpression("String_Node_Str");
  tableHandle.addColumnBinding(column,true);
  ComputedColumn column2=StructureFactory.newComputedColumn(tableHandle,"String_Node_Str");
  column2.setExpression("String_Node_Str");
  tableHandle.addColumnBinding(column2,true);
  IReportItem item=new ReportItem(tableHandle);
  IDataBinding[] bindings=item.getDataBindings();
  assertEquals(2,bindings.length);
  IDataBinding binding=bindings[0];
  IDataBinding binding2=bindings[1];
  assertEquals("String_Node_Str",binding.getName());
  assertEquals("String_Node_Str",binding2.getName());
  binding.setAggregateOn("String_Node_Str");
  assertEquals("String_Node_Str",binding.getAggregateOn());
  binding.setDataType("String_Node_Str");
  assertEquals("String_Node_Str",binding.getDataType());
  binding.setExpression("String_Node_Str");
  assertEquals("String_Node_Str",binding.getExpression());
  assertEquals("String_Node_Str",binding.getName());
  assertEquals("String_Node_Str",item.getDataBinding("String_Node_Str"));
}
Program: 76808
Project: 76808
Buggy source:
/** 
 * Removes Hide Rule through format type.
 */
public void removeHideRule(IHideRule rule) throws ScriptException {
  PropertyHandle propHandle=handle.getPropertyHandle(IReportItemModel.VISIBILITY_PROP);
  try {
    propHandle.removeItem(rule);
  }
 catch (  SemanticException e) {
    throw new ScriptException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * Removes Hide Rule through format type.
 */
public void removeHideRule(IHideRule rule) throws ScriptException {
  PropertyHandle propHandle=handle.getPropertyHandle(IReportItemModel.VISIBILITY_PROP);
  try {
    propHandle.removeItem(rule.getStructure());
  }
 catch (  SemanticException e) {
    throw new ScriptException(e.getLocalizedMessage());
  }
}
Program: 76809
Project: 76809
Buggy source:
private void createDrillthroughSelectFormat(Composite container){
  Group group=new Group(container,SWT.NONE);
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  group.setText(Messages.getString("String_Node_Str"));
  group.setLayout(new GridLayout());
  ReportEngine engine=new ReportEngine(new EngineConfig());
  supportedFormats=engine.getSupportedFormats();
  formatCheckBtns=new HashMap();
  for (int i=0; i < supportedFormats.length; i++) {
    Button btn=new Button(group,SWT.RADIO);
    btn.setText(supportedFormats[i]);
    formatCheckBtns.put(supportedFormats[i],btn);
    btn.addSelectionListener(new SelectionListener(){
      public void widgetSelected(      SelectionEvent e){
        initAnchorChooser(targetReportHandle,true);
      }
      public void widgetDefaultSelected(      SelectionEvent e){
      }
    }
);
  }
}

Fixed version (ground truth):
private void createDrillthroughSelectFormat(Composite container){
  Group group=new Group(container,SWT.NONE);
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  group.setText(Messages.getString("String_Node_Str"));
  group.setLayout(new GridLayout());
  ReportEngine engine=new ReportEngine(new EngineConfig());
  supportedFormats=engine.getSupportedFormats();
  formatCheckBtns=new HashMap();
  for (int i=0; i < supportedFormats.length; i++) {
    Button btn=new Button(group,SWT.RADIO);
    btn.setText(supportedFormats[i]);
    formatCheckBtns.put(supportedFormats[i],btn);
    btn.addSelectionListener(new SelectionListener(){
      public void widgetSelected(      SelectionEvent e){
        if (tocButton.getSelection()) {
          initAnchorChooser(targetReportHandle,true);
        }
 else         if (targetBookmarkButton.getSelection()) {
          initAnchorChooser(targetReportHandle,false);
        }
      }
      public void widgetDefaultSelected(      SelectionEvent e){
      }
    }
);
  }
}
Program: 76811
Project: 76811
Buggy source:
private void updateCheckBoxArea(){
  if ((DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX.equals(getSelectedControlType()) || PARAM_CONTROL_LIST.equals(getSelectedControlType())) && DesignChoiceConstants.PARAM_TYPE_STRING.equals(getSelectedDataType())) {
    allowBlank.setEnabled(true);
  }
 else {
    allowBlank.setEnabled(false);
  }
  if (DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX.equals(getSelectedControlType())) {
    doNotEcho.setEnabled(true);
  }
 else {
    doNotEcho.setEnabled(false);
  }
  if (DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX.equals(getSelectedControlType()) || DesignChoiceConstants.PARAM_CONTROL_CHECK_BOX.equals(getSelectedControlType())) {
    needSort.setEnabled(false);
  }
 else {
    needSort.setEnabled(true);
  }
}

Fixed version (ground truth):
private void updateCheckBoxArea(){
  if ((DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX.equals(getSelectedControlType()) || PARAM_CONTROL_LIST.equals(getSelectedControlType()) || PARAM_CONTROL_COMBO.equals(getSelectedControlType())) && DesignChoiceConstants.PARAM_TYPE_STRING.equals(getSelectedDataType())) {
    allowBlank.setEnabled(true);
  }
 else {
    allowBlank.setEnabled(false);
  }
  if (DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX.equals(getSelectedControlType())) {
    doNotEcho.setEnabled(true);
  }
 else {
    doNotEcho.setEnabled(false);
  }
  if (DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX.equals(getSelectedControlType()) || DesignChoiceConstants.PARAM_CONTROL_CHECK_BOX.equals(getSelectedControlType())) {
    needSort.setEnabled(false);
  }
 else {
    needSort.setEnabled(true);
  }
}
Program: 76812
Project: 76812
Buggy source:
/** 
 * Process BIRT deployment configuration. <p> Save user-defined settings into web.xml file.
 * @param monitor
 * @throws CoreException
 */
protected void processConfiguration(IProgressMonitor monitor,Shell shell) throws CoreException {
  WebArtifactOverwriteQuery query=new WebArtifactOverwriteQuery(shell);
  WebArtifactUtil.configureContextParam((Map)properties.get(EXT_CONTEXT_PARAM),project,query,monitor);
  WebArtifactUtil.configureListener((Map)properties.get(EXT_LISTENER),project,query,monitor);
  WebArtifactUtil.configureServlet((Map)properties.get(EXT_SERVLET),project,query,monitor);
  WebArtifactUtil.configureServletMapping((Map)properties.get(EXT_SERVLET_MAPPING),project,query,monitor);
  WebArtifactUtil.configureTaglib((Map)properties.get(EXT_TAGLIB),project,query,monitor);
}

Fixed version (ground truth):
/** 
 * Process BIRT deployment configuration. <p> Save user-defined settings into web.xml file.
 * @param monitor
 * @throws CoreException
 */
protected void processConfiguration(IProgressMonitor monitor,Shell shell) throws CoreException {
  SimpleImportOverwriteQuery query=new SimpleImportOverwriteQuery();
  WebArtifactUtil.configureContextParam((Map)properties.get(EXT_CONTEXT_PARAM),project,query,monitor);
  WebArtifactUtil.configureListener((Map)properties.get(EXT_LISTENER),project,query,monitor);
  WebArtifactUtil.configureServlet((Map)properties.get(EXT_SERVLET),project,query,monitor);
  WebArtifactUtil.configureServletMapping((Map)properties.get(EXT_SERVLET_MAPPING),project,query,monitor);
  WebArtifactUtil.configureTaglib((Map)properties.get(EXT_TAGLIB),project,query,monitor);
}
Program: 76813
Project: 76813
Buggy source:
public void dispose(){
  super.dispose();
  chartModel=null;
  if (previewPainter != null) {
    previewPainter.dispose();
  }
  previewPainter=null;
  sSubType=null;
  sType=null;
  sDimension=null;
  vSubTypeNames=null;
  orientation=Orientation.VERTICAL_LITERAL;
}

Fixed version (ground truth):
public void dispose(){
  super.dispose();
  chartModel=null;
  if (previewPainter != null) {
    previewPainter.dispose();
  }
  previewPainter=null;
  sSubType=null;
  sType=null;
  sDimension=null;
  vSubTypeNames=null;
  orientation=null;
}
Program: 76814
Project: 76814
Buggy source:
/** 
 * This method populates the subtype panel (creating its components if necessary). It gets called when the type selection changes or when the dimension selection changes (since not all sub types are supported for all dimension selections).
 * @param sSelectedType Type from Type List
 */
private void createAndDisplayTypesSheet(String sSelectedType){
  IChartType chartType=(IChartType)htTypes.get(sSelectedType);
  lblOrientation.setEnabled(chartType.supportsTransposition() && !is3D());
  cbOrientation.setEnabled(chartType.supportsTransposition() && !is3D());
  updateDimensionCombo(sSelectedType);
  Vector vSubTypes=null;
  if (this.sDimension != null && this.orientation != null) {
    vSubTypes=new Vector(chartType.getChartSubtypes(sDimension,orientation));
  }
  if (vSubTypes == null || vSubTypes.size() == 0) {
    vSubTypes=new Vector(chartType.getChartSubtypes(chartType.getDefaultDimension(),chartType.getDefaultOrientation()));
    this.sDimension=chartType.getDefaultDimension();
    this.orientation=chartType.getDefaultOrientation();
  }
  if (!cbOrientation.isEnabled()) {
    this.orientation=chartType.getDefaultOrientation();
  }
  ChartCacheManager.getInstance().cacheOrientation(sType,orientation);
  createGroups(vSubTypes);
  if (this.orientation == Orientation.HORIZONTAL_LITERAL) {
    this.cbOrientation.setSelection(true);
  }
 else {
    this.cbOrientation.setSelection(false);
  }
  cmpType.layout();
}

Fixed version (ground truth):
/** 
 * This method populates the subtype panel (creating its components if necessary). It gets called when the type selection changes or when the dimension selection changes (since not all sub types are supported for all dimension selections).
 * @param sSelectedType Type from Type List
 */
private void createAndDisplayTypesSheet(String sSelectedType){
  IChartType chartType=(IChartType)htTypes.get(sSelectedType);
  lblOrientation.setEnabled(chartType.supportsTransposition() && !is3D());
  cbOrientation.setEnabled(chartType.supportsTransposition() && !is3D());
  updateDimensionCombo(sSelectedType);
  if (this.sDimension == null) {
    this.sDimension=chartType.getDefaultDimension();
  }
  if (this.orientation == null) {
    this.orientation=chartType.getDefaultOrientation();
  }
  Vector vSubTypes=new Vector(chartType.getChartSubtypes(sDimension,orientation));
  if (vSubTypes.size() == 0) {
    vSubTypes=new Vector(chartType.getChartSubtypes(chartType.getDefaultDimension(),chartType.getDefaultOrientation()));
    this.sDimension=chartType.getDefaultDimension();
    this.orientation=chartType.getDefaultOrientation();
  }
  if (!cbOrientation.isEnabled()) {
    this.orientation=chartType.getDefaultOrientation();
  }
  ChartCacheManager.getInstance().cacheOrientation(sType,orientation);
  createGroups(vSubTypes);
  if (this.orientation == Orientation.HORIZONTAL_LITERAL) {
    this.cbOrientation.setSelection(true);
  }
 else {
    this.cbOrientation.setSelection(false);
  }
  cmpType.layout();
}
Program: 76816
Project: 76816
Buggy source:
/** 
 * Test the nested totals.Company with aggregateOn values.
 * @throws Exception 
 * @throws IOException 
 */
public void testNestedTotal4() throws IOException, Exception {
  String[] bindingNameRow=new String[6];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  bindingNameRow[3]="String_Node_Str";
  bindingNameRow[4]="String_Node_Str";
  bindingNameRow[5]="String_Node_Str";
  IBaseExpression[] bindingExprRow=new IBaseExpression[6];
  bindingExprRow[0]=new ScriptExpression("String_Node_Str");
  bindingExprRow[1]=new ScriptExpression("String_Node_Str");
  bindingExprRow[2]=new ScriptExpression("String_Node_Str");
  bindingExprRow[3]=new ScriptExpression("String_Node_Str");
  bindingExprRow[4]=new ScriptExpression("String_Node_Str");
  bindingExprRow[5]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str"),new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[1].setKeyExpression("String_Node_Str");
  try {
    createAndRunQuery(null,null,null,null,null,null,bindingNameRow,bindingExprRow,null,groupDefn,null,null);
    fail("String_Node_Str");
  }
 catch (  DataException e) {
    assertTrue(true);
  }
}

Fixed version (ground truth):
/** 
 * Test the nested totals.Company with aggregateOn values.
 * @throws Exception 
 * @throws IOException 
 */
public void testNestedTotal4() throws IOException, Exception {
  String[] bindingNameRow=new String[6];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  bindingNameRow[3]="String_Node_Str";
  bindingNameRow[4]="String_Node_Str";
  bindingNameRow[5]="String_Node_Str";
  IBaseExpression[] bindingExprRow=new IBaseExpression[6];
  bindingExprRow[0]=new ScriptExpression("String_Node_Str");
  bindingExprRow[1]=new ScriptExpression("String_Node_Str");
  bindingExprRow[2]=new ScriptExpression("String_Node_Str");
  bindingExprRow[3]=new ScriptExpression("String_Node_Str");
  bindingExprRow[4]=new ScriptExpression("String_Node_Str");
  bindingExprRow[5]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str"),new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[1].setKeyExpression("String_Node_Str");
  try {
    createAndRunQuery(null,null,null,null,null,null,bindingNameRow,bindingExprRow,null,groupDefn,null,null);
  }
 catch (  DataException e) {
    fail("String_Node_Str");
  }
}
Program: 76817
Project: 76817
Buggy source:
/** 
 */
public JdbcSQLContentAssistProcessor(DataSetDesign ds){
  super();
  handle=(DataSetDesign)ds;
  DataSourceDesign dataSourceDesign=handle.getDataSourceDesign();
  setDataSourceHandle(dataSourceDesign);
}

Fixed version (ground truth):
/** 
 */
public JdbcSQLContentAssistProcessor(){
  super();
}
Program: 76819
Project: 76819
Buggy source:
/** 
 * Constructs a new instance of the dialog
 */
public ImportValueDialog(String style){
  super(DLG_TITLE);
  Assert.isTrue(DATA_TYPE_CHOICE_SET.contains(style));
  this.style=style;
}

Fixed version (ground truth):
/** 
 * Constructs a new instance of the dialog
 */
public ImportValueDialog(String style,java.util.List choices){
  super(DLG_TITLE);
  Assert.isTrue(DATA_TYPE_CHOICE_SET.contains(style));
  this.style=style;
  this.choiceList=choices;
}
Program: 76820
Project: 76820
Buggy source:
protected boolean initDialog(){
  try {
    engine=DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null));
  }
 catch (  BirtException e) {
    ExceptionHandler.handle(e);
    return false;
  }
  dataSetChooser.setItems(ChoiceSetFactory.getDataSets());
  dataSetChooser.select(0);
  currentDataSetName=dataSetChooser.getText();
  refreshColumns();
  return true;
}

Fixed version (ground truth):
protected boolean initDialog(){
  try {
    engine=DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null));
  }
 catch (  BirtException e) {
    ExceptionHandler.handle(e);
    return false;
  }
  dataSetChooser.setItems(ChoiceSetFactory.getDataSets());
  dataSetChooser.select(0);
  currentDataSetName=dataSetChooser.getText();
  selectedList.removeAll();
  for (Iterator iter=choiceList.iterator(); iter.hasNext(); ) {
    selectedList.add((String)iter.next());
  }
  refreshColumns();
  return true;
}
Program: 76821
Project: 76821
Buggy source:
private boolean containValue(SelectionChoice selectedChoice,String newValue,String property){
  for (Iterator iter=choiceList.iterator(); iter.hasNext(); ) {
    SelectionChoice choice=(SelectionChoice)iter.next();
    if (choice != selectedChoice) {
      String value=null;
      if (COLUMN_VALUE.equals(property)) {
        value=choice.getValue();
        if (isEqual(value,newValue)) {
          return true;
        }
      }
 else       if (COLUMN_DISPLAY_TEXT.equals(property)) {
        value=choice.getLabel();
        if (value == null) {
          value=choice.getValue();
        }
        if (value == null) {
          value=LABEL_NULL;
        }
        if (value.equals(newValue)) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean containValue(SelectionChoice selectedChoice,String newValue,String property){
  for (Iterator iter=choiceList.iterator(); iter.hasNext(); ) {
    SelectionChoice choice=(SelectionChoice)iter.next();
    if (choice != selectedChoice) {
      String value=null;
      if (COLUMN_DISPLAY_TEXT.equals(property)) {
        value=choice.getLabel();
        if (value == null) {
          value=choice.getValue();
        }
        if (value == null) {
          value=LABEL_NULL;
        }
        if (value.equals(newValue)) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 76823
Project: 76823
Buggy source:
/** 
 * Creates standard data filter page.
 * @param parent Parent composite.
 * @return Page object.
 */
public static IPropertyTabUI buildFilterPage(Composite parent,Object input){
  GridLayout gl=new GridLayout();
  parent.setLayout(gl);
  FormPage page=new FormPage(FormPropertyDescriptor.NORMAL_FUNCTION,new FilterHandleProvider(),false,true);
  page.setInput(input);
  page.buildUI(parent);
  return page;
}

Fixed version (ground truth):
/** 
 * Creates standard data filter page.
 * @param parent Parent composite.
 * @return Page object.
 */
public static IPropertyTabUI buildFilterPage(Composite parent,Object input){
  GridLayout gl=new GridLayout();
  parent.setLayout(gl);
  FormPage page=new FormPage(FormPropertyDescriptor.FULL_FUNCTION,new FilterHandleProvider(),false,true);
  page.setInput(input);
  page.buildUI(parent);
  return page;
}
Program: 76825
Project: 76825
Buggy source:
/** 
 * Get svg flag from incoming soap message.
 * @param params
 * @return
 * @throws RemoteException
 */
protected boolean getSVGFlag(Oprand[] params){
  boolean flag=false;
  if (params != null && params.length > 0) {
    for (int i=0; i < params.length; i++) {
      if (IBirtConstants.OPRAND_SVG.equalsIgnoreCase(params[i].getName())) {
        flag="String_Node_Str".equalsIgnoreCase(params[i].getValue());
        break;
      }
    }
  }
  return flag;
}

Fixed version (ground truth):
/** 
 * Get svg flag from incoming soap message or URL.
 * @param params
 * @return
 * @throws RemoteException
 */
protected boolean getSVGFlag(Oprand[] params){
  boolean flag=false;
  HttpServletRequest request=context.getRequest();
  if (ParameterAccessor.isReportParameterExist(request,ParameterAccessor.PARAM_SVG)) {
    return ParameterAccessor.getSVGFlag(request);
  }
  if (params != null && params.length > 0) {
    for (int i=0; i < params.length; i++) {
      if (IBirtConstants.OPRAND_SVG.equalsIgnoreCase(params[i].getName())) {
        flag="String_Node_Str".equalsIgnoreCase(params[i].getValue());
        break;
      }
    }
  }
  return flag;
}
Program: 76826
Project: 76826
Buggy source:
/** 
 * Converts a parameter value to a String expected by ParameterHint
 */
private String getParameterValueString(Class paramType,Object paramValue) throws DataException {
  if (paramValue instanceof String)   return (String)paramValue;
  try {
    paramValue=DataTypeUtil.convert(paramValue,paramType);
    return DataTypeUtil.toString(paramValue);
  }
 catch (  BirtException e) {
    throw new DataException(ResourceConstants.DATATYPEUTIL_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * Converts a parameter value to a String expected by ParameterHint
 */
private String getParameterValueString(Class paramType,Object paramValue) throws DataException {
  if (paramValue instanceof String)   return (String)paramValue;
  try {
    paramValue=DataTypeUtil.convert(paramValue,paramType);
    if (paramValue instanceof Date) {
      SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
      return sdf.format((Date)paramValue);
    }
    return DataTypeUtil.toString(paramValue);
  }
 catch (  BirtException e) {
    throw new DataException(ResourceConstants.DATATYPEUTIL_ERROR,e);
  }
}
Program: 76827
Project: 76827
Buggy source:
/** 
 * @see ViewerDropAdapter#performDrop(Object)
 */
public boolean performDrop(Object data){
  if (data instanceof Object[] && ((Object[])data)[0] instanceof ThemeHandle) {
    if (getCurrentTarget() instanceof ModuleHandle) {
      if (Policy.TRACING_DND_DRAG) {
        System.out.println("String_Node_Str" + getCurrentTarget());
      }
      return ApplyTheme((ThemeHandle)((Object[])data)[0],(ModuleHandle)getCurrentTarget());
    }
 else {
      return false;
    }
  }
  if (getCurrentOperation() == DND.DROP_MOVE) {
    if (Policy.TRACING_DND_DRAG) {
      System.out.println("String_Node_Str" + getCurrentTarget());
    }
    return moveData(data,getCurrentTarget());
  }
 else   if (getCurrentOperation() == DND.DROP_COPY) {
    if (Policy.TRACING_DND_DRAG) {
      System.out.println("String_Node_Str" + getCurrentTarget());
    }
    return copyData(data,getCurrentTarget());
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @see ViewerDropAdapter#performDrop(Object)
 */
public boolean performDrop(Object data){
  if (data instanceof Object[] && ((Object[])data)[0] instanceof ThemeHandle) {
    if (getCurrentTarget() instanceof ModuleHandle) {
      if (Policy.TRACING_DND_DRAG) {
        System.out.println("String_Node_Str" + getCurrentTarget());
      }
      return ApplyTheme((ThemeHandle)((Object[])data)[0],(ModuleHandle)getCurrentTarget());
    }
 else {
      return false;
    }
  }
  if (getCurrentOperation() == DND.DROP_MOVE) {
    if (Policy.TRACING_DND_DRAG) {
      System.out.println("String_Node_Str" + getCurrentTarget());
    }
    return moveData(data,getCurrentTarget());
  }
 else   if (getCurrentOperation() == DND.DROP_COPY || getCurrentOperation() == DND.DROP_LINK) {
    if (Policy.TRACING_DND_DRAG) {
      System.out.println("String_Node_Str" + getCurrentTarget());
    }
    return copyData(data,getCurrentTarget());
  }
  return false;
}
Program: 76828
Project: 76828
Buggy source:
/** 
 * @see ViewerDropAdapter#validateDrop(Object,int,TransferData)
 */
public boolean validateDrop(Object target,int op,TransferData type){
  if (target != null) {
    Object adapter=ElementAdapterManager.getAdatper(target,IElementDropAdapter.class);
    if (adapter != null) {
      IElementDropAdapter dropAdapter=(IElementDropAdapter)adapter;
      return dropAdapter.validateDrop(target,getCurrentOperation(),getCurrentLocation(),null,type);
    }
  }
  return TemplateTransfer.getInstance().isSupportedType(type);
}

Fixed version (ground truth):
/** 
 * @see ViewerDropAdapter#validateDrop(Object,int,TransferData)
 */
public boolean validateDrop(Object target,int op,TransferData type){
  return TemplateTransfer.getInstance().isSupportedType(type);
}
Program: 76830
Project: 76830
Buggy source:
public boolean layout(){
  boolean childBreak=super.layout();
  if (childBreak) {
    IPDFTableLayoutManager itsTableLM=getTableLayoutManager();
    if (itsTableLM != null) {
      if (!isFinished() && needPageBreakBefore(null)) {
        itsTableLM.setTableCloseStateAsForced();
      }
 else       if (isFinished() && needPageBreakAfter(null)) {
        itsTableLM.setTableCloseStateAsForced();
      }
    }
  }
  return childBreak;
}

Fixed version (ground truth):
public boolean layout(){
  boolean childBreak=super.layout();
  if (childBreak) {
    IPDFTableLayoutManager itsTableLM=getTableLayoutManager();
    if (itsTableLM != null) {
      IStyle cStyle=content.getStyle();
      if (!isFinished() && needPageBreakBefore(cStyle.getPageBreakBefore())) {
        itsTableLM.setTableCloseStateAsForced();
      }
 else       if (isFinished() && needPageBreakAfter(cStyle.getPageBreakAfter())) {
        itsTableLM.setTableCloseStateAsForced();
      }
    }
  }
  return childBreak;
}
Program: 76831
Project: 76831
Buggy source:
/** 
 * @see ViewerDropAdapter#performDrop(Object)
 */
public boolean performDrop(Object data){
  Object adapter=ElementAdapterManager.getAdatper(getCurrentTarget(),IElementDropAdapter.class);
  if (adapter != null) {
    IElementDropAdapter dropAdapter=(IElementDropAdapter)adapter;
    return dropAdapter.handleDrop(getCurrentTarget(),getCurrentOperation(),getCurrentLocation(),data);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @see ViewerDropAdapter#performDrop(Object)
 */
public boolean performDrop(Object data){
  if (data instanceof Object[] && ((Object[])data)[0] instanceof ThemeHandle) {
    if (getCurrentTarget() instanceof ModuleHandle) {
      if (Policy.TRACING_DND_DRAG) {
        System.out.println("String_Node_Str" + getCurrentTarget());
      }
      return ApplyTheme((ThemeHandle)((Object[])data)[0],(ModuleHandle)getCurrentTarget());
    }
 else {
      return false;
    }
  }
  if (getCurrentOperation() == DND.DROP_MOVE) {
    if (Policy.TRACING_DND_DRAG) {
      System.out.println("String_Node_Str" + getCurrentTarget());
    }
    return moveData(data,getCurrentTarget());
  }
 else   if (getCurrentOperation() == DND.DROP_COPY) {
    if (Policy.TRACING_DND_DRAG) {
      System.out.println("String_Node_Str" + getCurrentTarget());
    }
    return copyData(data,getCurrentTarget());
  }
  return false;
}
Program: 76832
Project: 76832
Buggy source:
/** 
 * Closes the document.
 * @param rc 					the report content.
 */
public void end(IReportContent rc){
  TOCHandler tocHandler=new TOCHandler(rc.getTOCTree("String_Node_Str",ULocale.getDefault()).getRoot());
  TOCNode tocRoot=tocHandler.getTOCRoot();
  if (tocRoot == null || tocRoot.getChildren().isEmpty()) {
    writer.setViewerPreferences(PdfWriter.PageModeUseNone);
  }
 else {
    writer.setViewerPreferences(PdfWriter.PageModeUseOutlines);
    PdfOutline root=cb.getRootOutline();
    tocHandler.createTOC(tocRoot,root);
  }
  if (doc.isOpen()) {
    doc.close();
  }
}

Fixed version (ground truth):
/** 
 * Closes the document.
 * @param rc 					the report content.
 */
public void end(IReportContent rc){
  ULocale ulocale=null;
  Locale locale=context.getLocale();
  if (locale == null) {
    ulocale=ULocale.getDefault();
  }
 else {
    ulocale=ULocale.forLocale(locale);
  }
  TOCHandler tocHandler=new TOCHandler(rc.getTOCTree("String_Node_Str",ulocale).getRoot());
  TOCNode tocRoot=tocHandler.getTOCRoot();
  if (tocRoot == null || tocRoot.getChildren().isEmpty()) {
    writer.setViewerPreferences(PdfWriter.PageModeUseNone);
  }
 else {
    writer.setViewerPreferences(PdfWriter.PageModeUseOutlines);
    PdfOutline root=cb.getRootOutline();
    tocHandler.createTOC(tocRoot,root);
  }
  if (doc.isOpen()) {
    doc.close();
  }
}
Program: 76833
Project: 76833
Buggy source:
public void handleSelectionChanged(ISelection selection){
  if (getSourceViewer() == null || !getSourceViewer().getTextWidget().isVisible()) {
    return;
  }
  if (editorUIEnabled == true) {
    saveModel();
  }
  if (selection != null) {
    settingText=true;
    Object[] sel=((IStructuredSelection)selection).toArray();
    if (sel.length == 1 && sel[0] instanceof DesignElementHandle) {
      editObject=sel[0];
      palettePage.getSupport().setCurrentEditObject(editObject);
      if (editObject instanceof ExtendedItemHandle) {
        disableEditor();
        cmbExpList.removeAll();
        cmbItemLastSelected=null;
        getSourceViewer().getTextWidget().setEnabled(true);
        setEditorText(((ExtendedItemHandle)editObject).getExternalScript());
        context.setVariable("String_Node_Str","String_Node_Str");
      }
 else {
        setComboViewerInput(editObject);
        cmbItemLastSelected=null;
        setEditorText("String_Node_Str");
        if (cmbExpList.getItemCount() > 0) {
          enableEditor();
          selectItemInComboExpList((ISelection)selectionMap.get(getModel()));
        }
 else {
          disableEditor();
        }
      }
      checkDirty();
      palettePage.getSupport().updateParametersTree();
    }
 else {
      disableEditor();
      cmbExpList.removeAll();
      cmbItemLastSelected=null;
      palettePage.getSupport().setCurrentEditObject(null);
    }
    updateAnnotationLabel(sel.length > 0 ? sel[0] : null);
    settingText=false;
  }
}

Fixed version (ground truth):
public void handleSelectionChanged(ISelection selection){
  if (getSourceViewer() == null || !getSourceViewer().getTextWidget().isVisible()) {
    return;
  }
  if (editorUIEnabled == true) {
    saveModel();
  }
  if (selection != null) {
    settingText=true;
    Object[] sel=((IStructuredSelection)selection).toArray();
    if (sel.length == 1 && sel[0] instanceof DesignElementHandle) {
      editObject=sel[0];
      palettePage.getSupport().setCurrentEditObject(editObject);
      if (editObject instanceof ExtendedItemHandle) {
        disableEditor();
        cmbExpList.removeAll();
        cmbItemLastSelected=null;
        getSourceViewer().getTextWidget().setEnabled(true);
        setEditorText(((ExtendedItemHandle)editObject).getExternalScript());
        context.setVariable("String_Node_Str","String_Node_Str");
      }
 else {
        setComboViewerInput(editObject);
        cmbItemLastSelected=null;
        setEditorText("String_Node_Str");
        if (cmbExpList.getItemCount() > 0) {
          enableEditor();
          selectItemInComboExpList((ISelection)selectionMap.get(getModel()));
        }
 else {
          disableEditor();
        }
      }
      checkDirty();
      palettePage.getSupport().updateParametersTree();
    }
 else {
      disableEditor();
      cmbExpList.removeAll();
      cmbItemLastSelected=null;
      palettePage.getSupport().setCurrentEditObject(null);
    }
    if (sel.length > 0) {
      updateAnnotationLabel(sel[0]);
    }
    settingText=false;
  }
}
Program: 76834
Project: 76834
Buggy source:
/** 
 * Date -> Time String -> Time
 * @param source
 * @return
 * @throws BirtException
 */
public static Time toTime(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof Date) {
    return new Time(((Date)source).getTime());
  }
 else   if (source instanceof String) {
    try {
      return Time.valueOf((String)source);
    }
 catch (    IllegalArgumentException e) {
      e.printStackTrace();
    }
  }
  throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
}

Fixed version (ground truth):
/** 
 * Date -> Time String -> Time
 * @param source
 * @return
 * @throws BirtException
 */
public static Time toTime(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof Date) {
    return new Time(((Date)source).getTime());
  }
 else   if (source instanceof String) {
    try {
      return new Time(toDate((String)source).getTime());
    }
 catch (    IllegalArgumentException e) {
      e.printStackTrace();
    }
  }
  throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
}
Program: 76835
Project: 76835
Buggy source:
/** 
 * Handle style content
 * @param content
 * @return
 */
protected String __handleStyle(String content){
  String style=BLANK_STRING;
  if (content == null)   return style;
  Pattern p=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
  Matcher m=p.matcher(content);
  while (m.find()) {
    int start=m.end();
    int end=content.toLowerCase().indexOf("String_Node_Str",start);
    style=style + content.substring(start + 1,end) + "String_Node_Str";
  }
  return style;
}

Fixed version (ground truth):
/** 
 * Handle style content
 * @param content
 * @param Exception
 * @return
 */
protected String __handleStyle(String content) throws Exception {
  String style=BLANK_STRING;
  if (content == null)   return style;
  Pattern p=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
  Matcher m=p.matcher(content);
  while (m.find()) {
    int start=m.end();
    int end=content.toLowerCase().indexOf("String_Node_Str",start);
    style=style + content.substring(start + 1,end) + "String_Node_Str";
  }
  style=style.replaceAll("String_Node_Str","String_Node_Str" + viewer.getId());
  style="String_Node_Str" + style + "String_Node_Str";
  return style;
}
Program: 76837
Project: 76837
Buggy source:
/** 
 * Returns body style content
 * @param content
 * @return
 */
protected String __handleBodyStyle(String content){
  String style=BLANK_STRING;
  if (content == null)   return style;
  Pattern p=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
  Matcher m=p.matcher(content);
  String bodyStyleId="String_Node_Str";
  if (m.find()) {
    for (int i=1; i < m.groupCount() + 1; i++) {
      String group=m.group(i);
      if (group == null)       continue;
      Pattern pl=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
      Matcher ml=pl.matcher(group.trim());
      if (ml.find()) {
        bodyStyleId=ml.group(1).trim();
        break;
      }
    }
  }
  p=Pattern.compile("String_Node_Str" + bodyStyleId + "String_Node_Str",Pattern.CASE_INSENSITIVE);
  m=p.matcher(content);
  if (m.find())   style=m.group(1).trim();
  return style;
}

Fixed version (ground truth):
/** 
 * Returns body style content
 * @param content
 * @return
 */
protected String __handleBodyStyle(String content){
  String bodyStyleId=BLANK_STRING;
  if (content == null)   return bodyStyleId;
  Pattern p=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
  Matcher m=p.matcher(content);
  if (m.find()) {
    for (int i=1; i < m.groupCount() + 1; i++) {
      String group=m.group(i);
      if (group == null)       continue;
      Pattern pl=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
      Matcher ml=pl.matcher(group.trim());
      if (ml.find()) {
        bodyStyleId=ml.group(1).trim();
        break;
      }
    }
  }
  bodyStyleId=bodyStyleId.replaceAll("String_Node_Str","String_Node_Str" + viewer.getId());
  return bodyStyleId;
}
Program: 76838
Project: 76838
Buggy source:
/** 
 * Handle body content
 * @param content
 * @return
 */
protected String __handleBody(String content){
  String body=content;
  if (content == null)   return BLANK_STRING;
  try {
    Pattern p=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
    Matcher m=p.matcher(content);
    if (m.find()) {
      int start=m.end();
      int end=content.toLowerCase().indexOf("String_Node_Str");
      body=content.substring(start + 1,end);
    }
  }
 catch (  Exception e) {
    body=content;
  }
  return body;
}

Fixed version (ground truth):
/** 
 * Handle body content
 * @param content
 * @return
 */
protected String __handleBody(String content){
  String body=content;
  if (content == null)   return BLANK_STRING;
  try {
    Pattern p=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
    Matcher m=p.matcher(content);
    if (m.find()) {
      int start=m.end();
      int end=content.toLowerCase().indexOf("String_Node_Str");
      body=content.substring(start + 1,end);
    }
  }
 catch (  Exception e) {
    body=content;
  }
  body=body.replaceAll("String_Node_Str","String_Node_Str" + viewer.getId());
  return body;
}
Program: 76840
Project: 76840
Buggy source:
/** 
 * Evaluate a BIRT expression
 * @param expr the expression to be evaluated
 * @param name the file name
 * @param lineNo the line number
 * @return the result if no error exists, otherwise null.
 */
public Object evaluate(String expr,String name,int lineNo){
  if (expr != null) {
    try {
      return scriptContext.eval(expr,name,lineNo);
    }
 catch (    Exception e) {
      log.log(Level.SEVERE,e.getMessage(),e);
      addException(new EngineException(MessageConstants.SCRIPT_EVALUATION_ERROR,expr,e));
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Evaluate a BIRT expression
 * @param expr the expression to be evaluated
 * @param name the file name
 * @param lineNo the line number
 * @return the result if no error exists, otherwise null.
 */
public Object evaluate(String expr,String name,int lineNo){
  if (expr != null) {
    try {
      return scriptContext.eval(expr,name,lineNo);
    }
 catch (    Throwable e) {
      log.log(Level.SEVERE,e.getMessage(),e);
      addException(new EngineException(MessageConstants.SCRIPT_EVALUATION_ERROR,expr,e));
    }
  }
  return null;
}