nus-yam/ex-repair huggingface dataset:
Program: 76644
Project: 76644
Buggy source:
/** 
 * @throws DesignFileException
 * @throws SemanticException
 */
public void test_regression_134018() throws DesignFileException, SemanticException {
  openLibrary(LIBRARY);
  DesignEngine engine=new DesignEngine(new DesignConfig());
  SessionHandle session=engine.newSessionHandle(ULocale.ENGLISH);
  ReportDesignHandle designHandle=session.createDesign();
  LibraryHandle lib=designHandle.getLibrary("String_Node_Str");
  MasterPageHandle basePage=lib.findMasterPage("String_Node_Str");
  assertNull(basePage);
  ElementFactory factory=designHandle.getElementFactory();
  SimpleMasterPageHandle newPage=(SimpleMasterPageHandle)factory.newElementFrom(basePage,"String_Node_Str");
  designHandle.getMasterPages().add(newPage);
  LabelHandle baseLabel=(LabelHandle)((SimpleMasterPageHandle)libraryHandle.findMasterPage("String_Node_Str")).getPageHeader().get(0);
  assertEquals("String_Node_Str",baseLabel.getName());
  assertEquals("String_Node_Str",baseLabel.getText());
  baseLabel.setText("String_Node_Str");
  designHandle.reloadLibrary(libraryHandle);
  LabelHandle childLabel=(LabelHandle)((SimpleMasterPageHandle)designHandle.findMasterPage("String_Node_Str")).getPageHeader().get(0);
  assertNotNull(childLabel);
}

Fixed version (ground truth):
/** 
 * @throws DesignFileException
 * @throws SemanticException
 * @throws IOException
 */
public void test_regression_134018() throws DesignFileException, SemanticException, IOException {
  String report=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ INPUT;
  String libA=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ LIBRARY;
  sessionHandle=new DesignEngine(new DesignConfig()).newSessionHandle(ULocale.ENGLISH);
  designHandle=sessionHandle.openDesign(report);
  designHandle.includeLibrary(LIBRARY,"String_Node_Str");
  libraryHandle=designHandle.getLibrary("String_Node_Str");
  MasterPageHandle basePage=libraryHandle.findMasterPage("String_Node_Str");
  assertNotNull(basePage);
  ElementFactory factory=designHandle.getElementFactory();
  SimpleMasterPageHandle newPage=(SimpleMasterPageHandle)factory.newElementFrom(basePage,"String_Node_Str");
  assertNotNull(newPage);
  designHandle.getMasterPages().add(newPage);
  designHandle.saveAs(report);
  libraryHandle=sessionHandle.openLibrary(libA);
  LabelHandle baseLabel=(LabelHandle)((SimpleMasterPageHandle)libraryHandle.findMasterPage("String_Node_Str")).getPageHeader().get(0);
  assertNotNull(baseLabel);
  assertEquals("String_Node_Str",baseLabel.getName());
  assertEquals("String_Node_Str",baseLabel.getText());
  baseLabel.setText("String_Node_Str");
  libraryHandle.saveAs(getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ LIBRARY);
  designHandle.reloadLibrary(libraryHandle);
  LabelHandle baseLabel1=(LabelHandle)((SimpleMasterPageHandle)libraryHandle.findMasterPage("String_Node_Str")).getPageHeader().get(0);
  assertNotNull(baseLabel1);
  assertEquals("String_Node_Str",baseLabel1.getText());
}
Program: 76645
Project: 76645
Buggy source:
protected void setUp() throws Exception {
  super.setUp();
  removeResource();
  copyInputToFile(INPUT_FOLDER + "String_Node_Str" + LIBRARY);
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  removeResource();
  copyInputToFile(INPUT_FOLDER + "String_Node_Str" + INPUT);
  copyInputToFile(INPUT_FOLDER + "String_Node_Str" + LIBRARY);
}
Program: 76649
Project: 76649
Buggy source:
/** 
 * Initializes the data view page.
 */
protected void initPage(){
  createContextMenus();
  handleGlobalAction();
  new RenameListener(getTreeViewer()).apply();
  getTreeViewer().setSorter(new ItemSorter());
  getTreeViewer().getTree().addMouseTrackListener(new MouseTrackAdapter(){
    public void mouseHover(    MouseEvent event){
      Widget widget=event.widget;
      if (widget == getTreeViewer().getTree()) {
        Point pt=new Point(event.x,event.y);
        TreeItem item=getTreeViewer().getTree().getItem(pt);
        getTreeViewer().getTree().setToolTipText(getTooltip(item));
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Initializes the data view page.
 */
protected void initPage(){
  createContextMenus();
  handleGlobalAction();
  new RenameListener(getTreeViewer()).apply();
  getTreeViewer().setSorter(new ItemSorter());
  getTreeViewer().getTree().addMouseTrackListener(new MouseTrackAdapter(){
    public void mouseHover(    MouseEvent event){
      Widget widget=event.widget;
      if (widget == getTreeViewer().getTree()) {
        Point pt=new Point(event.x,event.y);
        TreeItem item=getTreeViewer().getTree().getItem(pt);
        getTreeViewer().getTree().setToolTipText(getTooltip(item));
      }
    }
  }
);
  getTreeViewer().getTree().addSelectionListener(new SelectionListener(){
    public void widgetSelected(    SelectionEvent e){
    }
    public void widgetDefaultSelected(    SelectionEvent e){
      if (getSelection() instanceof StructuredSelection) {
        Object selectedObject=((StructuredSelection)getSelection()).getFirstElement();
        try {
          Tree tree=(Tree)e.getSource();
          TreeItem[] selectedItems=tree.getSelection();
          if (selectedItems.length > 0) {
            if (selectedItems[0].getExpanded()) {
              selectedItems[0].setExpanded(false);
            }
 else {
              getTreeViewer().expandToLevel(selectedObject,selectedItems[0].getExpanded() ? 0 : 1);
            }
          }
        }
 catch (        Exception e2) {
        }
      }
    }
  }
);
}
Program: 76650
Project: 76650
Buggy source:
public void widgetDefaultSelected(SelectionEvent e){
  if (getSelection() instanceof StructuredSelection) {
    List list=new ArrayList();
    list.add(((StructuredSelection)getSelection()).getFirstElement());
    ReportRequest r=new ReportRequest();
    r.setType(ReportRequest.OPEN_EDITOR);
    r.setRequestConvert(new IRequestConvert(){
      public List convertSelectionToModelLisr(      List list){
        List lst=new ArrayList();
        for (Iterator itr=list.iterator(); itr.hasNext(); ) {
          Object obj=itr.next();
          lst.add(obj);
        }
        return lst;
      }
    }
);
    r.setSelectionObject(list);
    SessionHandleAdapter.getInstance().getMediator().notifyRequest(r);
  }
}

Fixed version (ground truth):
public void widgetDefaultSelected(SelectionEvent e){
  if (getSelection() instanceof StructuredSelection) {
    List list=new ArrayList();
    Object selectedObject=((StructuredSelection)getSelection()).getFirstElement();
    list.add(selectedObject);
    ReportRequest r=new ReportRequest();
    r.setType(ReportRequest.OPEN_EDITOR);
    r.setRequestConvert(new IRequestConvert(){
      public List convertSelectionToModelLisr(      List list){
        List lst=new ArrayList();
        for (Iterator itr=list.iterator(); itr.hasNext(); ) {
          Object obj=itr.next();
          lst.add(obj);
        }
        return lst;
      }
    }
);
    r.setSelectionObject(list);
    SessionHandleAdapter.getInstance().getMediator().notifyRequest(r);
    try {
      Tree tree=(Tree)e.getSource();
      TreeItem[] selectedItems=tree.getSelection();
      if (selectedItems.length > 0) {
        if (selectedItems[0].getExpanded()) {
          selectedItems[0].setExpanded(false);
        }
 else {
          getTreeViewer().expandToLevel(selectedObject,selectedItems[0].getExpanded() ? 0 : 1);
        }
      }
    }
 catch (    Exception e2) {
    }
  }
}
Program: 76652
Project: 76652
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(AttributeBuilderTest.class);
  suite.addTestSuite(HTMLWriterTest.class);
  suite.addTestSuite(HTMLReportEmitterTest.class);
  suite.addTestSuite(MetadataEmitterTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(AttributeBuilderTest.class);
  suite.addTestSuite(HTMLWriterTest.class);
  suite.addTestSuite(HTMLReportEmitterTest.class);
  suite.addTestSuite(MetadataEmitterTest.class);
  suite.addTestSuite(TableLayoutTest.class);
  suite.addTestSuite(ScriptTest.class);
  return suite;
}
Program: 76653
Project: 76653
Buggy source:
protected void repeatHeader(){
  if (!isFirstLayout) {
    IGroupContent group=(IGroupContent)content;
    IBandContent header=group.getHeader();
    if (group.isHeaderRepeat() && header != null) {
      boolean pageBreak=context.allowPageBreak();
      boolean skipPageHint=context.getSkipPageHint();
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(true);
      engine.layout(this,header,emitter);
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(skipPageHint);
    }
  }
  isFirstLayout=false;
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (!isFirstLayout) {
    IGroupContent group=(IGroupContent)content;
    IBandContent header=group.getHeader();
    if (group.isHeaderRepeat() && header != null) {
      boolean pageBreak=context.allowPageBreak();
      boolean skipPageHint=context.getSkipPageHint();
      context.setAllowPageBreak(false);
      context.setSkipPageHint(true);
      engine.layout(this,header,emitter);
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(skipPageHint);
    }
  }
  isFirstLayout=false;
}
Program: 76654
Project: 76654
Buggy source:
protected boolean allowPageBreak(){
  IBandContent band=(IBandContent)content;
  int type=band.getBandType();
  if (type == IBandContent.BAND_HEADER) {
    if (IStyle.SOFT_VALUE.equals(content.getStyle().getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE))) {
      return true;
    }
    IElement listContent=band.getParent();
    if (listContent instanceof IListContent) {
      return !((IListContent)listContent).isHeaderRepeat();
    }
  }
 else   if (type == IBandContent.BAND_GROUP_HEADER) {
    if (IStyle.SOFT_VALUE.equals(content.getStyle().getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE))) {
      return true;
    }
    IElement groupContent=band.getParent();
    if (groupContent instanceof IGroupContent) {
      return !((IGroupContent)groupContent).isHeaderRepeat();
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean allowPageBreak(){
  IBandContent band=(IBandContent)content;
  int type=band.getBandType();
  if (type == IBandContent.BAND_HEADER) {
    if (IStyle.SOFT_VALUE.equals(content.getStyle().getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE))) {
      return true;
    }
    IElement listContent=band.getParent();
    if (listContent instanceof IListContent) {
      return !((IListContent)listContent).isHeaderRepeat();
    }
    if (listContent instanceof ITableContent) {
      return !((ITableContent)listContent).isHeaderRepeat();
    }
  }
 else   if (type == IBandContent.BAND_GROUP_HEADER) {
    if (IStyle.SOFT_VALUE.equals(content.getStyle().getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE))) {
      return true;
    }
    IElement groupContent=band.getParent();
    if (groupContent instanceof IGroupContent) {
      return !((IGroupContent)groupContent).isHeaderRepeat();
    }
  }
  return true;
}
Program: 76655
Project: 76655
Buggy source:
protected void repeatHeader(){
  if (!isFirstLayout) {
    ITableContent table=(ITableContent)content;
    if (table.isHeaderRepeat()) {
      IBandContent header=table.getHeader();
      if (header != null) {
        boolean pageBreak=context.allowPageBreak();
        boolean skipPageHint=context.getSkipPageHint();
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(true);
        engine.layout(this,header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(skipPageHint);
      }
    }
  }
  isFirstLayout=false;
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (!isFirstLayout) {
    ITableContent table=(ITableContent)content;
    if (table.isHeaderRepeat()) {
      IBandContent header=table.getHeader();
      if (header != null) {
        boolean pageBreak=context.allowPageBreak();
        boolean skipPageHint=context.getSkipPageHint();
        context.setAllowPageBreak(false);
        context.setSkipPageHint(true);
        engine.layout(this,header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(skipPageHint);
      }
    }
  }
  isFirstLayout=false;
}
Program: 76656
Project: 76656
Buggy source:
/** 
 * @param groupLevel
 * @throws DataException
 * @throws BirtException
 */
protected void goThroughGapRows(int groupLevel) throws DataException, BirtException {
  while (groupLevel != odiResult.getEndingGroupLevel() && this.next()) {
  }
}

Fixed version (ground truth):
/** 
 * @param groupLevel
 * @throws DataException
 * @throws BirtException
 */
protected void goThroughGapRows(int groupLevel) throws DataException, BirtException {
  while (groupLevel < odiResult.getEndingGroupLevel() && odiResult.getEndingGroupLevel() != 0 && odiResult.next()) {
    this.prepareCurrentRow();
  }
}
Program: 76657
Project: 76657
Buggy source:
/** 
 * @param engine reference to report engine
 * @param appContext a user-defined object that capsulates the context for running a task. The context object is passed to callback functions (i.e., functions in image handlers, action handlers, etc. ) that are written by those who embeds engine in their applications
 */
protected EngineTask(IReportEngine engine,IReportRunnable runnable){
  taskID=id++;
  executionContext=new ExecutionContext(this);
  executionContext.setReportContext(new ReportContextImpl(executionContext));
  setReportEngine(engine);
  setReportRunnable(runnable);
  executionContext.setAppContext(engine.getConfig().getAppContext());
  cancelFlag=false;
  runningStatus=RUNNING_STATUS_START;
}

Fixed version (ground truth):
/** 
 * @param engine reference to report engine
 * @param appContext a user-defined object that capsulates the context for running a task. The context object is passed to callback functions (i.e., functions in image handlers, action handlers, etc. ) that are written by those who embeds engine in their applications
 */
protected EngineTask(IReportEngine engine,IReportRunnable runnable){
  taskID=id++;
  this.engine=engine;
  executionContext=new ExecutionContext(this);
  executionContext.setReportContext(new ReportContextImpl(executionContext));
  setReportRunnable(runnable);
  executionContext.setAppContext(engine.getConfig().getAppContext());
  cancelFlag=false;
  runningStatus=RUNNING_STATUS_START;
}
Program: 76659
Project: 76659
Buggy source:
private void updateOutLineView(IFormPage activePageInstance){
  if (outlinePage == null) {
    return;
  }
  Object designOutLinePage=activePageInstance.getAdapter(IContentOutlinePage.class);
  outlinePage.setActivePage((IPageBookViewPage)designOutLinePage);
}

Fixed version (ground truth):
private void updateOutLineView(IFormPage activePageInstance){
  if (outlinePage == null) {
    return;
  }
  if (reloadOutlinePage()) {
    return;
  }
  Object designOutLinePage=activePageInstance.getAdapter(IContentOutlinePage.class);
  outlinePage.setActivePage((IPageBookViewPage)designOutLinePage);
}
Program: 76660
Project: 76660
Buggy source:
public void reloadOutlinePage(){
  if (!getActivePageInstance().getId().equals(XMLSourcePage_ID) || outlinePage == null) {
    return;
  }
  if (outlinePage.getCurrentPage() instanceof DesignerOutlinePage) {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(IContentOutlinePage.class));
  }
 else {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(ContentOutlinePage.class));
  }
  outlinePage.getSite().getActionBars().updateActionBars();
}

Fixed version (ground truth):
public boolean reloadOutlinePage(){
  if (!getActivePageInstance().getId().equals(XMLSourcePage_ID) || outlinePage == null) {
    return false;
  }
  if (outlinePage.getCurrentPage() instanceof DesignerOutlinePage) {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(IContentOutlinePage.class));
  }
 else {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(ContentOutlinePage.class));
  }
  outlinePage.getSite().getActionBars().updateActionBars();
  return true;
}
Program: 76662
Project: 76662
Buggy source:
public boolean performFinish(){
  return newLibraryFileWizardPage.performFinish();
}

Fixed version (ground truth):
public boolean performFinish(){
  boolean bool=newLibraryFileWizardPage.performFinish();
  if (bool == true) {
    newLibraryFileWizardPage.updatePerspective(getConfigElement());
  }
  return bool;
}
Program: 76663
Project: 76663
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));
  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));
  GridData layoutData=(GridData)getTitleImageLabel().getParent().getLayoutData();
  layoutData.widthHint=iWizardWidthMinimum;
  return composite;
}
Program: 76664
Project: 76664
Buggy source:
public boolean modify(Object data,String property,Object value) throws NameException, SemanticException {
  if (property.equals(modelAdapter.getColumnNames(columnKeys)[1])) {
    if (!(value.equals(getDisplayName(FilterCondition.OPERATOR_MEMBER,DesignChoiceConstants.FILTER_OPERATOR_BETWEEN)) || value.equals(getDisplayName(FilterCondition.OPERATOR_MEMBER,DesignChoiceConstants.FILTER_OPERATOR_NOT_BETWEEN)))) {
      modelAdapter.setStringValue(input.get(0),data,FilterCondition.VALUE2_MEMBER,"String_Node_Str");
    }
  }
  int index=Arrays.asList(columnNames).indexOf(property);
  String key=columnKeys[index];
  String strValue="String_Node_Str";
  if (value instanceof Integer) {
    int intValue=((Integer)value).intValue();
    if (intValue == -1) {
      CCombo combo=(CCombo)editors[index].getControl();
      strValue=combo.getText();
    }
 else {
      String[] choices=modelAdapter.getChoiceSet(input.get(0),columnKeys[index]);
      strValue=choices[intValue];
    }
  }
 else {
    strValue=(String)value;
  }
  return modelAdapter.setStringValue(input.get(0),data,key,strValue);
}

Fixed version (ground truth):
public boolean modify(Object data,String property,Object value) throws NameException, SemanticException {
  int index=Arrays.asList(columnNames).indexOf(property);
  String key=columnKeys[index];
  String strValue="String_Node_Str";
  if (value instanceof Integer) {
    int intValue=((Integer)value).intValue();
    if (intValue == -1) {
      CCombo combo=(CCombo)editors[index].getControl();
      strValue=combo.getText();
    }
 else {
      String[] choices=modelAdapter.getChoiceSet(input.get(0),columnKeys[index]);
      strValue=choices[intValue];
    }
  }
 else {
    strValue=(String)value;
  }
  return modelAdapter.setStringValue(input.get(0),data,key,strValue);
}
Program: 76666
Project: 76666
Buggy source:
private void fillStyles(Combo stylesChooser){
  stylesChooser.removeAll();
  styles.clear();
  stylesChooser.add(NONE_DISPLAY_TEXT);
  for (Iterator iter=DEUtil.getStyles(); iter.hasNext(); ) {
    StyleHandle styleHandle=(StyleHandle)iter.next();
    String styleName=styleHandle.getName();
    stylesChooser.add(styleName);
    styles.put((Object)styleName,(Object)styleHandle);
  }
  if (handle != null && handle.getStyle() != null) {
    stylesChooser.setText(handle.getStyle().getName());
  }
 else {
    stylesChooser.setText(NONE_DISPLAY_TEXT);
  }
}

Fixed version (ground truth):
private void fillStyles(Combo stylesChooser){
  stylesChooser.removeAll();
  styles.clear();
  stylesChooser.add(NONE_DISPLAY_TEXT);
  for (Iterator iter=DEUtil.getStyles(); iter.hasNext(); ) {
    StyleHandle styleHandle=(StyleHandle)iter.next();
    if (styleHandle.isPredefined()) {
      continue;
    }
    String styleName=styleHandle.getName();
    stylesChooser.add(styleName);
    styles.put((Object)styleName,(Object)styleHandle);
  }
  if (handle != null && handle.getStyle() != null) {
    stylesChooser.setText(handle.getStyle().getName());
  }
 else {
    stylesChooser.setText(NONE_DISPLAY_TEXT);
  }
}
Program: 76667
Project: 76667
Buggy source:
protected void okPressed(){
  try {
    if (handle == null) {
      MapRule rule=StructureFactory.createMapRule();
      rule.setProperty(HighlightRule.OPERATOR_MEMBER,DEUtil.resolveNull(getValueForOperator(operator.getText())));
      rule.setProperty(HighlightRule.VALUE1_MEMBER,DEUtil.resolveNull(value1.getText()));
      rule.setProperty(HighlightRule.VALUE2_MEMBER,DEUtil.resolveNull(value2.getText()));
      rule.setProperty(MapRule.DISPLAY_MEMBER,DEUtil.resolveNull(display.getText()));
      rule.setTestExpression(DEUtil.resolveNull(expression.getText()));
      handle=provider.doAddItem(rule,handleCount);
    }
 else {
      handle.setOperator(DEUtil.resolveNull(getValueForOperator(operator.getText())));
      handle.setValue1(DEUtil.resolveNull(value1.getText()));
      handle.setValue2(DEUtil.resolveNull(value2.getText()));
      handle.setDisplay(DEUtil.resolveNull(display.getText()));
      handle.setTestExpression(DEUtil.resolveNull(expression.getText()));
    }
  }
 catch (  Exception e) {
    WidgetUtil.processError(getShell(),e);
  }
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  try {
    if (handle == null) {
      MapRule rule=StructureFactory.createMapRule();
      rule.setProperty(HighlightRule.OPERATOR_MEMBER,DEUtil.resolveNull(getValueForOperator(operator.getText())));
      if (value1.isVisible()) {
        rule.setProperty(HighlightRule.VALUE1_MEMBER,DEUtil.resolveNull(value1.getText()));
      }
      if (value2.isVisible()) {
        rule.setProperty(HighlightRule.VALUE2_MEMBER,DEUtil.resolveNull(value2.getText()));
      }
      rule.setProperty(MapRule.DISPLAY_MEMBER,DEUtil.resolveNull(display.getText()));
      rule.setTestExpression(DEUtil.resolveNull(expression.getText()));
      handle=provider.doAddItem(rule,handleCount);
    }
 else {
      handle.setOperator(DEUtil.resolveNull(getValueForOperator(operator.getText())));
      if (value1.isVisible()) {
        handle.setValue1(DEUtil.resolveNull(value1.getText()));
      }
      if (value2.isVisible()) {
        handle.setValue2(DEUtil.resolveNull(value2.getText()));
      }
      handle.setDisplay(DEUtil.resolveNull(display.getText()));
      handle.setTestExpression(DEUtil.resolveNull(expression.getText()));
    }
  }
 catch (  Exception e) {
    WidgetUtil.processError(getShell(),e);
  }
  super.okPressed();
}
Program: 76668
Project: 76668
Buggy source:
public boolean reloadOutlinePage(){
  if (!getActivePageInstance().getId().equals(XMLSourcePage_ID) || outlinePage == null) {
    return false;
  }
  if (outlinePage.getCurrentPage() instanceof DesignerOutlinePage) {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(IContentOutlinePage.class));
  }
 else {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(ContentOutlinePage.class));
  }
  outlinePage.getSite().getActionBars().updateActionBars();
  return true;
}

Fixed version (ground truth):
public boolean reloadOutlinePage(){
  if (!getActivePageInstance().getId().equals(XMLSourcePage_ID) || outlinePage == null || !getCurrentPageInstance().getId().equals(XMLSourcePage_ID)) {
    return false;
  }
  if (outlinePage.getCurrentPage() instanceof DesignerOutlinePage || outlinePage.getCurrentPage() == null) {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(IContentOutlinePage.class));
  }
 else {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(ContentOutlinePage.class));
  }
  if (outlinePage.getSite() != null) {
    outlinePage.getSite().getActionBars().updateActionBars();
  }
  return true;
}
Program: 76669
Project: 76669
Buggy source:
public void stackChanged(ActivityStackEvent event){
  if (isActive()) {
    reloadEditorInput();
  }
}

Fixed version (ground truth):
public void stackChanged(ActivityStackEvent event){
  if (isActive() && event.getAction() != ActivityStackEvent.ROLL_BACK) {
    reloadEditorInput();
  }
}
Program: 76670
Project: 76670
Buggy source:
private ActivityStackListener getCommandStackListener(){
  if (commandStackListener == null) {
    commandStackListener=new ActivityStackListener(){
      public void stackChanged(      ActivityStackEvent event){
        if (isActive()) {
          reloadEditorInput();
        }
      }
    }
;
  }
  return commandStackListener;
}

Fixed version (ground truth):
private ActivityStackListener getCommandStackListener(){
  if (commandStackListener == null) {
    commandStackListener=new ActivityStackListener(){
      public void stackChanged(      ActivityStackEvent event){
        if (isActive() && event.getAction() != ActivityStackEvent.ROLL_BACK) {
          reloadEditorInput();
        }
      }
    }
;
  }
  return commandStackListener;
}
Program: 76671
Project: 76671
Buggy source:
/** 
 * Test the rerpot design initialize method. After the initialize method is called, there should be one master page created for the report. The properties values given by the argument should be set to the report deisgn element. All thos operation should not go into command stack.
 * @throws SemanticException
 * @throws IOException
 */
public void testInitializeReportDesign() throws SemanticException, IOException {
  SessionHandle sessionHandle=new SessionHandle((ULocale)null);
  designHandle=sessionHandle.createDesign();
  Map properties=new HashMap();
  String createdBy="String_Node_Str";
  properties.put(ReportDesign.CREATED_BY_PROP,createdBy);
  designHandle.initializeModule(properties);
  assertEquals(0,designHandle.getMasterPages().getCount());
  assertEquals(createdBy,designHandle.getCreatedBy());
  CommandStack stack=designHandle.getCommandStack();
  assertFalse(stack.canRedo());
  assertFalse(stack.canUndo());
}

Fixed version (ground truth):
/** 
 * Test the rerpot design initialize method. After the initialize method is called, there should be one master page created for the report. The properties values given by the argument should be set to the report deisgn element. All thos operation should not go into command stack.
 * @throws SemanticException
 * @throws IOException
 */
public void testInitializeReportDesign() throws SemanticException, IOException {
  SessionHandle sessionHandle=new SessionHandle((ULocale)null);
  designHandle=sessionHandle.createDesign();
  Map properties=new HashMap();
  String createdBy="String_Node_Str";
  properties.put("String_Node_Str","String_Node_Str");
  properties.put(ReportDesign.CREATED_BY_PROP,createdBy);
  designHandle.initializeModule(properties);
  assertEquals(0,designHandle.getMasterPages().getCount());
  assertNull(designHandle.getProperty("String_Node_Str"));
  assertEquals(createdBy,designHandle.getProperty(ReportDesign.CREATED_BY_PROP));
  CommandStack stack=designHandle.getCommandStack();
  assertFalse(stack.canRedo());
  assertFalse(stack.canUndo());
}
Program: 76672
Project: 76672
Buggy source:
/** 
 * Initializes the report design when it is just created. <p> Set the value to the properties on repot design element which need the initialize valuel. All initialize operations will not go into the command stack and can not be undo redo.
 * @param properties the property name value pairs.Those properties in the map are which need to be initialized.
 * @throws SemanticException SemamticException will throw out when the give properties map contians invlid property name or property value.
 */
public void initializeModule(Map properties) throws SemanticException {
  if (isInitialized)   return;
  String name=null;
  Object value=null;
  Module root=(Module)getElement();
  Set propNames=properties.keySet();
  Iterator itre=propNames.iterator();
  while (itre.hasNext()) {
    name=(String)itre.next();
    value=PropertyValueValidationUtil.validateProperty(this,name,properties.get(name));
    root.setProperty(name,value);
  }
  isInitialized=true;
}

Fixed version (ground truth):
/** 
 * Initializes the report design when it is just created. <p> Set the value to the properties on repot design element which need the initialize valuel. All initialize operations will not go into the command stack and can not be undo redo.
 * @param properties the property name value pairs.Those properties in the map are which need to be initialized.
 * @throws SemanticException SemamticException will throw out when the give properties map contians invlid property name or property value.
 */
public void initializeModule(Map properties) throws SemanticException {
  if (isInitialized)   return;
  String name=null;
  Object value=null;
  Module root=(Module)getElement();
  Set propNames=properties.keySet();
  Iterator itre=propNames.iterator();
  while (itre.hasNext()) {
    name=(String)itre.next();
    try {
      value=PropertyValueValidationUtil.validateProperty(this,name,properties.get(name));
      root.setProperty(name,value);
    }
 catch (    SemanticException e) {
    }
  }
  isInitialized=true;
}
Program: 76675
Project: 76675
Buggy source:
/** 
 * @param absPos the vertical position relative to its containing box
 * @param containerBaseAbsPos the absolute position of the container's top
 * @param containerSize container height
 * @param ImageSize the height of template which image lies in
 * @return a triple(the vertical position of template's left-bottom origin,template height, and image's vertical translation relative to the template )
 */
private tplValueTriple computeTplVerticalValTriple(float absPos,float containerBaseAbsPos,float containerSize,float ImageSize){
  float tplOrigin=0.0f, tplSize=0.0f, translation=0.0f;
  if (absPos <= 0) {
    if (ImageSize + absPos > 0 && ImageSize + absPos <= containerSize) {
      tplOrigin=containerBaseAbsPos - ImageSize - absPos;
      tplSize=ImageSize + absPos;
    }
 else     if (ImageSize + absPos > containerSize) {
      tplOrigin=containerBaseAbsPos - containerSize;
      tplSize=containerSize;
      translation=containerSize - ImageSize;
    }
 else {
    }
  }
 else   if (absPos >= containerSize) {
  }
 else {
    if (ImageSize + absPos <= containerSize) {
      tplOrigin=containerBaseAbsPos - ImageSize - absPos;
      tplSize=ImageSize;
      translation=0.0f;
    }
 else {
      tplOrigin=containerBaseAbsPos - containerSize;
      tplSize=containerSize - absPos;
      translation=containerSize - absPos - ImageSize;
    }
  }
  return new tplValueTriple(tplOrigin,tplSize,translation);
}

Fixed version (ground truth):
/** 
 * @param absPos the vertical position relative to its containing box
 * @param containerBaseAbsPos the absolute position of the container's top
 * @param containerSize container height
 * @param ImageSize the height of template which image lies in
 * @return a triple(the vertical position of template's left-bottom origin,template height, and image's vertical translation relative to the template )
 */
private tplValueTriple computeTplVerticalValTriple(float absPos,float containerBaseAbsPos,float containerSize,float ImageSize){
  float tplOrigin=0.0f, tplSize=0.0f, translation=0.0f;
  if (absPos <= 0) {
    if (ImageSize + absPos > 0 && ImageSize + absPos <= containerSize) {
      tplOrigin=containerBaseAbsPos - ImageSize - absPos;
      tplSize=ImageSize + absPos;
    }
 else     if (ImageSize + absPos > containerSize) {
      tplOrigin=containerBaseAbsPos - containerSize;
      tplSize=containerSize;
      translation=containerSize - ImageSize - absPos;
    }
 else {
    }
  }
 else   if (absPos >= containerSize) {
  }
 else {
    if (ImageSize + absPos <= containerSize) {
      tplOrigin=containerBaseAbsPos - ImageSize - absPos;
      tplSize=ImageSize;
      translation=0.0f;
    }
 else {
      tplOrigin=containerBaseAbsPos - containerSize;
      tplSize=containerSize - absPos;
      translation=containerSize - absPos - ImageSize;
    }
  }
  return new tplValueTriple(tplOrigin,tplSize,translation);
}
Program: 76679
Project: 76679
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();
  selectedList.removeAll();
  for (Iterator iter=choiceList.iterator(); iter.hasNext(); ) {
    selectedList.add((String)iter.next());
  }
  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(); ) {
    String value=(String)iter.next();
    if (value != null) {
      selectedList.add(value);
    }
  }
  refreshColumns();
  return true;
}
Program: 76681
Project: 76681
Buggy source:
/** 
 * Open a design/library file.
 * @param fileName The file name
 * @param input The input stream
 * @throws DesignFileException
 */
public ModuleHandle init(String fileName,InputStream input) throws DesignFileException {
  ModuleHandle handle=null;
  handle=getSessionHandle().openModule(fileName,input);
  postInit(handle,null);
  setReportDesignHandle(handle);
  return handle;
}

Fixed version (ground truth):
/** 
 * Open a design/library file.
 * @param fileName The file name
 * @param input The input stream
 * @throws DesignFileException
 */
public ModuleHandle init(String fileName,InputStream input) throws DesignFileException {
  return init(fileName,input,null);
}
Program: 76682
Project: 76682
Buggy source:
/** 
 * @param handle The moudle handle
 * @param properties The properties
 */
private void postInit(ModuleHandle handle,Map properties){
  if (properties != null && !properties.isEmpty()) {
    String createInfo=model.getCreatedBy();
    if (createInfo == null || createInfo.length() == 0) {
      try {
        handle.initializeModule(properties);
      }
 catch (      SemanticException e) {
      }
    }
  }
  SimpleMasterPageHandle masterPage=null;
  if (handle.getMasterPages().getCount() == 0) {
    masterPage=handle.getElementFactory().newSimpleMasterPage(null);
    try {
      handle.getMasterPages().add(masterPage);
    }
 catch (    ContentException e) {
      new DesignFileException(handle.getFileName(),e);
    }
catch (    NameException e) {
      new DesignFileException(handle.getFileName(),e);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param handle The moudle handle
 * @param properties The properties
 */
private void postInit(ModuleHandle handle,Map properties){
  if (properties != null && !properties.isEmpty()) {
    String createInfo=handle.getCreatedBy();
    if (createInfo == null || createInfo.length() == 0) {
      try {
        handle.initializeModule(properties);
      }
 catch (      SemanticException e) {
      }
    }
  }
  SimpleMasterPageHandle masterPage=null;
  if (handle.getMasterPages().getCount() == 0) {
    masterPage=handle.getElementFactory().newSimpleMasterPage(null);
    try {
      handle.getMasterPages().add(masterPage);
    }
 catch (    ContentException e) {
      new DesignFileException(handle.getFileName(),e);
    }
catch (    NameException e) {
      new DesignFileException(handle.getFileName(),e);
    }
  }
}
Program: 76683
Project: 76683
Buggy source:
public ModuleHandle getReportModuleHandle(Object element,boolean reset){
  if ((model == null && element instanceof IPathEditorInput) || reset) {
    IPath path=((IPathEditorInput)element).getPath();
    if (path != null) {
      String fileName=path.toOSString();
      try {
        InputStream stream=new FileInputStream(path.toFile());
        Map properties=new HashMap();
        properties.put(IModuleModel.CREATED_BY_PROP,MessageFormat.format(VERSION_MESSAGE,new String[]{ReportPlugin.getVersion(),ReportPlugin.getBuildInfo()}));
        model=SessionHandleAdapter.getInstance().init(fileName,stream,properties);
      }
 catch (      DesignFileException e) {
      }
catch (      FileNotFoundException e) {
        e.printStackTrace();
      }
    }
  }
  return model;
}

Fixed version (ground truth):
public ModuleHandle getReportModuleHandle(Object element,boolean reset){
  if ((model == null || reset) && element instanceof IPathEditorInput) {
    IPath path=((IPathEditorInput)element).getPath();
    if (path != null) {
      String fileName=path.toOSString();
      try {
        InputStream stream=new FileInputStream(path.toFile());
        Map properties=new HashMap();
        properties.put(IModuleModel.CREATED_BY_PROP,MessageFormat.format(VERSION_MESSAGE,new String[]{ReportPlugin.getVersion(),ReportPlugin.getBuildInfo()}));
        String projectFolder=getProjectFolder((IPathEditorInput)element);
        if (projectFolder != null) {
          properties.put(IModuleOption.RESOURCE_FOLDER_KEY,projectFolder);
        }
        model=SessionHandleAdapter.getInstance().init(fileName,stream,properties);
      }
 catch (      DesignFileException e) {
      }
catch (      FileNotFoundException e) {
        e.printStackTrace();
      }
    }
  }
  return model;
}
Program: 76684
Project: 76684
Buggy source:
public String getFontFamily(Object object){
  HighlightRuleHandle hrHandle=(HighlightRuleHandle)object;
  String rfm=hrHandle.getFontFamilyHandle().getStringValue();
  if (rfm == null || rfm.length() == 0) {
    if (getDesignElementHandle() != null) {
      rfm=getDesignElementHandle().getPrivateStyle().getFontFamilyHandle().getStringValue();
    }
 else {
      rfm=DesignChoiceConstants.FONT_FAMILY_SERIF;
    }
  }
  return HighlightHandleProvider.getFontFamily(rfm);
}

Fixed version (ground truth):
public String getFontFamily(Object object){
  HighlightRuleHandle hrHandle=(HighlightRuleHandle)object;
  String rfm=DEUtil.RemoveQuote(hrHandle.getFontFamilyHandle().getStringValue());
  if (rfm == null || rfm.length() == 0) {
    if (getDesignElementHandle() != null) {
      rfm=getDesignElementHandle().getPrivateStyle().getFontFamilyHandle().getStringValue();
    }
 else {
      rfm=DesignChoiceConstants.FONT_FAMILY_SERIF;
    }
  }
  return HighlightHandleProvider.getFontFamily(rfm);
}
Program: 76685
Project: 76685
Buggy source:
protected void updatePreview(Object handle){
  if (handle != null) {
    String familyValue=provider.getFontFamily(handle);
    int sizeValue=provider.getFontSize(handle);
    previewLabel.setFontFamily(familyValue);
    previewLabel.setFontSize(sizeValue);
    previewLabel.setBold(provider.isBold(handle));
    previewLabel.setItalic(provider.isItalic(handle));
    previewLabel.setForeground(provider.getColor(handle));
    previewLabel.setBackground(provider.getBackgroundColor(handle));
    previewLabel.setUnderline(provider.isUnderline(handle));
    previewLabel.setLinethrough(provider.isLinethrough(handle));
    previewLabel.updateView();
    if (provider.getBackgroundColor(handle) == null && isFormStyle()) {
      FormWidgetFactory.getInstance().paintFormStyle(previewLabel);
      FormWidgetFactory.getInstance().adapt(previewLabel);
    }
  }
 else {
    previewLabel.restoreDefaultState();
    previewLabel.setForeground(ColorManager.getColor(-1));
    previewLabel.setBackground(ColorManager.getColor(-1));
    previewLabel.updateView();
    if (isFormStyle()) {
      FormWidgetFactory.getInstance().paintFormStyle(previewLabel);
      FormWidgetFactory.getInstance().adapt(previewLabel);
    }
  }
}

Fixed version (ground truth):
protected void updatePreview(Object handle){
  if (handle != null) {
    String familyValue=provider.getFontFamily(handle);
    int sizeValue=provider.getFontSize(handle);
    previewLabel.setFontFamily(familyValue);
    previewLabel.setFontSize(sizeValue);
    previewLabel.setBold(provider.isBold(handle));
    previewLabel.setItalic(provider.isItalic(handle));
    previewLabel.setForeground(provider.getColor(handle));
    previewLabel.setBackground(provider.getBackgroundColor(handle));
    previewLabel.setUnderline(provider.isUnderline(handle));
    previewLabel.setLinethrough(provider.isLinethrough(handle));
    previewLabel.setOverline(provider.isOverline(handle));
    previewLabel.updateView();
    if (provider.getBackgroundColor(handle) == null && isFormStyle()) {
      FormWidgetFactory.getInstance().paintFormStyle(previewLabel);
      FormWidgetFactory.getInstance().adapt(previewLabel);
    }
  }
 else {
    previewLabel.restoreDefaultState();
    previewLabel.setForeground(ColorManager.getColor(-1));
    previewLabel.setBackground(ColorManager.getColor(-1));
    previewLabel.updateView();
    if (isFormStyle()) {
      FormWidgetFactory.getInstance().paintFormStyle(previewLabel);
      FormWidgetFactory.getInstance().adapt(previewLabel);
    }
  }
}
Program: 76688
Project: 76688
Buggy source:
/** 
 * Then entry to validate tag
 * @throws Exception
 */
public abstract void __validate() throws Exception ;

Fixed version (ground truth):
/** 
 * Then entry to validate tag
 * @throws Exception
 */
public abstract boolean __validate() throws Exception ;
Program: 76689
Project: 76689
Buggy source:
/** 
 * When reach the end tag, fire this operation
 * @see javax.servlet.jsp.tagext.TagSupport#doEndTag()
 */
public int doEndTag() throws JspException {
  try {
    __validate();
    __beforeEndTag();
    __process();
  }
 catch (  Exception e) {
    __handleException(e);
  }
  return EVAL_PAGE;
}

Fixed version (ground truth):
/** 
 * When reach the end tag, fire this operation
 * @see javax.servlet.jsp.tagext.TagSupport#doEndTag()
 */
public int doEndTag() throws JspException {
  try {
    if (__validate()) {
      __beforeEndTag();
      __process();
    }
  }
 catch (  Exception e) {
    __handleException(e);
  }
  return EVAL_PAGE;
}
Program: 76690
Project: 76690
Buggy source:
/** 
 * Handle event before doEndTag
 */
protected void __beforeEndTag(){
  super.__beforeEndTag();
  viewer.setParameters(parameters);
  pageContext.setAttribute(viewer.getId(),viewer.getId());
}

Fixed version (ground truth):
/** 
 * Handle event before doEndTag
 */
protected void __beforeEndTag(){
  super.__beforeEndTag();
  viewer.setParameters(parameters);
  pageContext.setAttribute(viewer.getId(),viewer.getId());
  if (viewer.isHostPage())   pageContext.setAttribute(ATTR_HOSTPAGE,"String_Node_Str");
}
Program: 76691
Project: 76691
Buggy source:
/** 
 * validate the tag
 * @see org.eclipse.birt.report.taglib.AbstractBaseTag#__validate()
 */
public void __validate() throws Exception {
  this.locale=BirtTagUtil.getLocale((HttpServletRequest)pageContext.getRequest(),viewer.getLocale());
  BirtResources.setLocale(this.locale);
  if (viewer.getId() == null || viewer.getId().length() <= 0) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_VIEWER_ID));
  }
  if (!__validateViewerId()) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_INVALID_VIEWER_ID));
  }
  if (pageContext.findAttribute(viewer.getId()) != null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_VIEWER_ID_DUPLICATE));
  }
  if (viewer.getReportDesign() == null && viewer.getReportDocument() == null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_REPORT_SOURCE));
  }
  if (viewer.getReportletId() != null && viewer.getReportDocument() == null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_REPORT_DOCUMENT));
  }
}

Fixed version (ground truth):
/** 
 * validate the tag
 * @see org.eclipse.birt.report.taglib.AbstractBaseTag#__validate()
 */
public boolean __validate() throws Exception {
  String hasHostPage=(String)pageContext.getAttribute(ATTR_HOSTPAGE);
  if (hasHostPage != null && "String_Node_Str".equalsIgnoreCase(hasHostPage)) {
    return false;
  }
  this.locale=BirtTagUtil.getLocale((HttpServletRequest)pageContext.getRequest(),viewer.getLocale());
  BirtResources.setLocale(this.locale);
  if (viewer.getId() == null || viewer.getId().length() <= 0) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_VIEWER_ID));
  }
  if (!__validateViewerId()) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_INVALID_VIEWER_ID));
  }
  if (pageContext.findAttribute(viewer.getId()) != null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_VIEWER_ID_DUPLICATE));
  }
  if (viewer.getReportDesign() == null && viewer.getReportDocument() == null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_REPORT_SOURCE));
  }
  if (viewer.getReportletId() != null && viewer.getReportDocument() == null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_REPORT_DOCUMENT));
  }
  return true;
}
Program: 76693
Project: 76693
Buggy source:
/** 
 * validate the tag
 * @see org.eclipse.birt.report.taglib.AbstractBaseTag#__validate()
 */
public void __validate() throws Exception {
  Locale locale=BirtTagUtil.getLocale((HttpServletRequest)pageContext.getRequest(),viewer.getLocale());
  BirtResources.setLocale(locale);
  if (viewer.isCustom() && (viewer.getName() == null || viewer.getName().length() <= 0)) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_REQUESTER_NAME));
  }
  if (viewer.getReportDesign() == null && viewer.getReportDocument() == null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_REPORT_SOURCE));
  }
  if (viewer.getReportletId() != null && viewer.getReportDocument() == null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_REPORT_DOCUMENT));
  }
}

Fixed version (ground truth):
/** 
 * validate the tag
 * @see org.eclipse.birt.report.taglib.AbstractBaseTag#__validate()
 */
public boolean __validate() throws Exception {
  Locale locale=BirtTagUtil.getLocale((HttpServletRequest)pageContext.getRequest(),viewer.getLocale());
  BirtResources.setLocale(locale);
  if (viewer.isCustom() && (viewer.getName() == null || viewer.getName().length() <= 0)) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_REQUESTER_NAME));
  }
  if (viewer.getReportDesign() == null && viewer.getReportDocument() == null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_REPORT_SOURCE));
  }
  if (viewer.getReportletId() != null && viewer.getReportDocument() == null) {
    throw new JspTagException(BirtResources.getMessage(ResourceConstants.TAGLIB_NO_REPORT_DOCUMENT));
  }
  return true;
}