nus-yam/ex-repair huggingface dataset:
Program: 71283
Project: 71283
Buggy source:
private void checkValueLabel(LegendItemHints lih){
  if (sed != lih.getSeriesDefinition()) {
    if (laiValue != null) {
      laiValue.dispose();
    }
    Label laValue=LabelImpl.copyInstance(lih.getSeriesDefinition().getDesignTimeSeries().getLabel());
    laValue.setEllipsis(1);
    this.laiValue=new LabelItem(lgData.xs,lgData.rtc,laValue,lgData.maxWrappingSize);
  }
}

Fixed version (ground truth):
private void checkValueLabel(LegendItemHints lih){
  if (sed != lih.getSeriesDefinition()) {
    if (laiValue != null) {
      laiValue.dispose();
    }
    Series series=(Series)lih.getSeriesDefinition().getSeries().get(0);
    Label laValue=LabelImpl.copyInstance(series.getLabel());
    laValue.setEllipsis(1);
    this.laiValue=new LabelItem(lgData.xs,lgData.rtc,laValue,lgData.maxWrappingSize);
  }
}
Program: 71284
Project: 71284
Buggy source:
/** 
 * Get the foreground color.
 * @param handle The handle of design element.
 * @return fore ground color
 */
public int getForegroundColor(DesignElementHandle handle){
  Object obj=handle.getProperty(StyleHandle.COLOR_PROP);
  int color=handle.getPropertyHandle(StyleHandle.COLOR_PROP).getIntValue();
  if (obj == null) {
    return SWT.COLOR_LIST_FOREGROUND;
  }
  return color;
}

Fixed version (ground truth):
/** 
 * Get the foreground color.
 * @param handle The handle of design element.
 * @return fore ground color
 */
public int getForegroundColor(DesignElementHandle handle){
  Object obj=handle.getProperty(StyleHandle.COLOR_PROP);
  if (obj == null) {
    return SWT.COLOR_LIST_FOREGROUND;
  }
  int color=handle.getPropertyHandle(StyleHandle.COLOR_PROP).getIntValue();
  return color;
}
Program: 71285
Project: 71285
Buggy source:
/** 
 * Get the background color.
 * @param handle The handle of design element.
 * @return back ground color
 */
public int getBackgroundColor(DesignElementHandle handle){
  Object obj=handle.getProperty(StyleHandle.BACKGROUND_COLOR_PROP);
  int color=handle.getPropertyHandle(StyleHandle.BACKGROUND_COLOR_PROP).getIntValue();
  if (obj == null) {
    return SWT.COLOR_LIST_BACKGROUND;
  }
  return color;
}

Fixed version (ground truth):
/** 
 * Get the background color.
 * @param handle The handle of design element.
 * @return back ground color
 */
public int getBackgroundColor(DesignElementHandle handle){
  Object obj=handle.getProperty(StyleHandle.BACKGROUND_COLOR_PROP);
  if (obj == null) {
    return SWT.COLOR_LIST_BACKGROUND;
  }
  int color=handle.getPropertyHandle(StyleHandle.BACKGROUND_COLOR_PROP).getIntValue();
  return color;
}
Program: 71286
Project: 71286
Buggy source:
/** 
 * Map GUI defined property key to DE defined property key
 * @param key
 * @return DE defined property key
 */
public static String getGUIPropertyKey(String key){
  if (key != null) {
    return (String)propertiesMap.get(key);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Map GUI defined property key to DE defined property key
 * @param key
 * @return DE defined property key
 */
public static String getGUIPropertyKey(String key){
  if (key != null) {
    return propertiesMap.get(key);
  }
  return null;
}
Program: 71288
Project: 71288
Buggy source:
public ICategoryProvider getCategoryProvider(Object input){
  CategoryProvider provider=new CategoryProvider(new String[]{CategoryProviderFactory.CATEGORY_KEY_GENERAL,CategoryProviderFactory.CATEGORY_KEY_COMMENTS,CategoryProviderFactory.CATEGORY_KEY_ADVANCEPROPERTY},new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},new Class[]{CubePage.class,CommentsPage.class,AdvancePropertyPage.class});
  return provider;
}

Fixed version (ground truth):
public ICategoryProvider getCategoryProvider(Object input){
  return AttributesUtil.createCategoryProvider(new String[]{null,CATEGORY_KEY_COMMENTS,CATEGORY_KEY_ADVANCEPROPERTY},new String[]{CATEGORY_KEY_GENERAL},new String[]{Messages.getString("String_Node_Str")},new Class[]{CubePage.class});
}
Program: 71289
Project: 71289
Buggy source:
protected boolean canContain(Object target,Object transfer){
  if (transfer instanceof DataSetHandle || transfer instanceof DataSourceHandle || transfer instanceof ParameterHandle|| transfer instanceof ParameterGroupHandle|| transfer instanceof CascadingParameterGroupHandle|| transfer instanceof CubeHandle)   return true;
  if (DNDUtil.handleValidateTargetCanContainMore(target,DNDUtil.getObjectLength(transfer))) {
    canContain=DNDUtil.handleValidateTargetCanContain(target,transfer,true);
    return canContain == DNDUtil.CONTAIN_THIS;
  }
  return false;
}

Fixed version (ground truth):
protected boolean canContain(Object target,Object transfer){
  if (transfer instanceof DataSetHandle || transfer instanceof DataSourceHandle || transfer instanceof ParameterHandle|| transfer instanceof ParameterGroupHandle|| transfer instanceof CascadingParameterGroupHandle|| transfer instanceof CubeHandle|| transfer instanceof MasterPageHandle)   return true;
  if (DNDUtil.handleValidateTargetCanContainMore(target,DNDUtil.getObjectLength(transfer))) {
    canContain=DNDUtil.handleValidateTargetCanContain(target,transfer,true);
    return canContain == DNDUtil.CONTAIN_THIS;
  }
  return false;
}
Program: 71291
Project: 71291
Buggy source:
public void run(){
  SetCurrentEditModelCommand c=new SetCurrentEditModelCommand(getNewObject(),LibraryHandleAdapter.CREATE_ELEMENT);
  c.execute();
}

Fixed version (ground truth):
public void run(){
  Object model=evt.getNewValue();
  Object editpart=getViewer().getEditPartRegistry().get(model);
  if (editpart instanceof EditPart) {
    getViewer().flush();
    if (!(editpart instanceof EmptyEditPart)) {
      getViewer().select((EditPart)editpart);
    }
  }
  if (editpart != null) {
    getViewer().reveal((EditPart)editpart);
    if (LibraryHandleAdapter.CREATE_ELEMENT.equals(evt.getPropertyName())) {
      Request request=new Request(ReportRequest.CREATE_ELEMENT);
      if (((EditPart)editpart).understandsRequest(request)) {
        ((EditPart)editpart).performRequest(request);
      }
    }
  }
}
Program: 71292
Project: 71292
Buggy source:
protected void createEditPolicies(){
  installEditPolicy(EditPolicy.LAYOUT_ROLE,new ReportFlowLayoutEditPolicy(){
    protected org.eclipse.gef.commands.Command getCreateCommand(    CreateRequest request){
      CreateCommand command=new CreateCommand(request.getExtendedData()){
        public void execute(){
          super.execute();
          Display.getCurrent().asyncExec(new Runnable(){
            public void run(){
              SetCurrentEditModelCommand c=new SetCurrentEditModelCommand(getNewObject(),LibraryHandleAdapter.CREATE_ELEMENT);
              c.execute();
            }
          }
);
        }
      }
;
      Object model=this.getHost().getModel();
      if (model instanceof SlotHandle) {
        command.setParent(model);
      }
 else       if (model instanceof ListBandProxy) {
        command.setParent(((ListBandProxy)model).getSlotHandle());
      }
 else {
        command.setParent(model);
      }
      return command;
    }
  }
);
  installEditPolicy(EditPolicy.CONTAINER_ROLE,new ReportContainerEditPolicy());
}

Fixed version (ground truth):
protected void createEditPolicies(){
  installEditPolicy(EditPolicy.LAYOUT_ROLE,new ReportFlowLayoutEditPolicy(){
    protected org.eclipse.gef.commands.Command getCreateCommand(    CreateRequest request){
      CreateCommand command=new CreateCommand(request.getExtendedData());
      Object model=this.getHost().getModel();
      if (model instanceof SlotHandle) {
        command.setParent(model);
      }
 else       if (model instanceof ListBandProxy) {
        command.setParent(((ListBandProxy)model).getSlotHandle());
      }
 else {
        command.setParent(model);
      }
      return command;
    }
  }
);
  installEditPolicy(EditPolicy.CONTAINER_ROLE,new ReportContainerEditPolicy());
}
Program: 71293
Project: 71293
Buggy source:
protected org.eclipse.gef.commands.Command getCreateCommand(CreateRequest request){
  CreateCommand command=new CreateCommand(request.getExtendedData()){
    public void execute(){
      super.execute();
      Display.getCurrent().asyncExec(new Runnable(){
        public void run(){
          SetCurrentEditModelCommand c=new SetCurrentEditModelCommand(getNewObject(),LibraryHandleAdapter.CREATE_ELEMENT);
          c.execute();
        }
      }
);
    }
  }
;
  Object model=this.getHost().getModel();
  if (model instanceof SlotHandle) {
    command.setParent(model);
  }
 else   if (model instanceof ListBandProxy) {
    command.setParent(((ListBandProxy)model).getSlotHandle());
  }
 else {
    command.setParent(model);
  }
  return command;
}

Fixed version (ground truth):
protected org.eclipse.gef.commands.Command getCreateCommand(CreateRequest request){
  CreateCommand command=new CreateCommand(request.getExtendedData());
  Object model=this.getHost().getModel();
  if (model instanceof SlotHandle) {
    command.setParent(model);
  }
 else   if (model instanceof ListBandProxy) {
    command.setParent(((ListBandProxy)model).getSlotHandle());
  }
 else {
    command.setParent(model);
  }
  return command;
}
Program: 71294
Project: 71294
Buggy source:
public void run(){
  Object editpart=viewer.getEditPartRegistry().get(model);
  if (editpart instanceof EditPart) {
    viewer.flush();
    viewer.select((EditPart)editpart);
  }
 else {
    return;
  }
  if (((EditPart)editpart).understandsRequest(request)) {
    ((EditPart)editpart).performRequest(request);
  }
  if (editpart != null) {
    viewer.reveal((EditPart)editpart);
  }
}

Fixed version (ground truth):
public void run(){
  Object editpart=viewer.getEditPartRegistry().get(model);
  if (editpart instanceof EditPart) {
    viewer.flush();
    viewer.select((EditPart)editpart);
    if (edit && ((EditPart)editpart).understandsRequest(request)) {
      ((EditPart)editpart).performRequest(request);
    }
    viewer.reveal((EditPart)editpart);
  }
 else {
    List list=new ArrayList();
    list.add(model);
    ReportRequest r=new ReportRequest();
    r.setType(ReportRequest.CREATE_ELEMENT);
    r.setSelectionObject(list);
    SessionHandleAdapter.getInstance().getMediator().notifyRequest(r);
  }
}
Program: 71295
Project: 71295
Buggy source:
/** 
 * Selects or clicks added object
 * @param model new object, null will do nothing
 * @param viewer edit part viewer, null will do nothing
 * @param request the request sended to EditPart
 */
public static void selectAddedObject(final Object model,final EditPartViewer viewer,final Request request){
  if (model == null || viewer == null)   return;
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      Object editpart=viewer.getEditPartRegistry().get(model);
      if (editpart instanceof EditPart) {
        viewer.flush();
        viewer.select((EditPart)editpart);
      }
 else {
        return;
      }
      if (((EditPart)editpart).understandsRequest(request)) {
        ((EditPart)editpart).performRequest(request);
      }
      if (editpart != null) {
        viewer.reveal((EditPart)editpart);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Selects or clicks added object
 * @param model new object, null will do nothing
 * @param viewer edit part viewer, null will do nothing
 * @param request the request sended to EditPart
 */
public static void selectAddedObject(final Object model,final EditPartViewer viewer,final Request request,final boolean edit){
  if (model == null || viewer == null)   return;
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      Object editpart=viewer.getEditPartRegistry().get(model);
      if (editpart instanceof EditPart) {
        viewer.flush();
        viewer.select((EditPart)editpart);
        if (edit && ((EditPart)editpart).understandsRequest(request)) {
          ((EditPart)editpart).performRequest(request);
        }
        viewer.reveal((EditPart)editpart);
      }
 else {
        List list=new ArrayList();
        list.add(model);
        ReportRequest r=new ReportRequest();
        r.setType(ReportRequest.CREATE_ELEMENT);
        r.setSelectionObject(list);
        SessionHandleAdapter.getInstance().getMediator().notifyRequest(r);
      }
    }
  }
);
}
Program: 71296
Project: 71296
Buggy source:
protected void selectElement(final Object element,final boolean edit){
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      if (element instanceof ReportItemHandle) {
        IWorkbenchPart part=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().getActivePart();
        IEditorPart epart=null;
        if (part instanceof AbstractMultiPageEditor) {
          epart=((AbstractMultiPageEditor)part).getActivePageInstance();
        }
 else         if (part instanceof IReportEditor) {
          IEditorPart activeEditor=((IReportEditor)part).getEditorPart();
          if (activeEditor instanceof AbstractMultiPageEditor) {
            epart=((AbstractMultiPageEditor)activeEditor).getActivePageInstance();
          }
        }
        if (epart instanceof GraphicalEditorWithFlyoutPalette) {
          GraphicalViewer viewer=((GraphicalEditorWithFlyoutPalette)epart).getGraphicalViewer();
          Object cpart=viewer.getEditPartRegistry().get(element);
          if (cpart instanceof EditPart) {
            viewer.flush();
            viewer.select((EditPart)cpart);
          }
          if (edit && cpart instanceof LabelEditPart) {
            ((LabelEditPart)cpart).performDirectEdit();
          }
 else           if (edit && cpart instanceof ImageEditPart) {
            ((ImageEditPart)cpart).performDirectEdit();
          }
 else {
            List list=new ArrayList();
            list.add(element);
            ReportRequest r=new ReportRequest();
            r.setType(ReportRequest.CREATE_ELEMENT);
            r.setSelectionObject(list);
            SessionHandleAdapter.getInstance().getMediator().notifyRequest(r);
          }
        }
      }
    }
  }
);
}

Fixed version (ground truth):
protected void selectElement(final Object element,final boolean edit){
  if (element instanceof ReportItemHandle) {
    IWorkbenchPart part=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().getActivePart();
    IEditorPart epart=null;
    if (part instanceof AbstractMultiPageEditor) {
      epart=((AbstractMultiPageEditor)part).getActivePageInstance();
    }
 else     if (part instanceof IReportEditor) {
      IEditorPart activeEditor=((IReportEditor)part).getEditorPart();
      if (activeEditor instanceof AbstractMultiPageEditor) {
        epart=((AbstractMultiPageEditor)activeEditor).getActivePageInstance();
      }
    }
    if (epart instanceof GraphicalEditorWithFlyoutPalette) {
      GraphicalViewer viewer=((GraphicalEditorWithFlyoutPalette)epart).getGraphicalViewer();
      ReportCreationTool.selectAddedObject(element,viewer,edit);
    }
  }
}
Program: 71297
Project: 71297
Buggy source:
private void changeOverlaySeriesType(){
  if (getCurrentChartType().canCombine()) {
    ChartCacheManager.getInstance().cacheSeriesType(cbSeriesType.getText());
  }
  boolean bException=false;
  try {
    Axis XAxis=(Axis)((ChartWithAxes)chartModel).getAxes().get(0);
    int iSeriesDefinitionIndex=0 + ((Axis)XAxis.getAssociatedAxes().get(0)).getSeriesDefinitions().size();
    int iOverlaySeriesCount=((Axis)XAxis.getAssociatedAxes().get(1)).getSeriesDefinitions().size();
    ChartAdapter.beginIgnoreNotifications();
    for (int i=0; i < iOverlaySeriesCount; i++) {
      Series newSeries=(Series)EcoreUtil.copy(htSeriesNames.get(cbSeriesType.getText()));
      newSeries.translateFrom(((SeriesDefinition)((Axis)XAxis.getAssociatedAxes().get(1)).getSeriesDefinitions().get(i)).getDesignTimeSeries(),iSeriesDefinitionIndex,chartModel);
      newSeries.eAdapters().addAll(chartModel.eAdapters());
      ((SeriesDefinition)((Axis)XAxis.getAssociatedAxes().get(1)).getSeriesDefinitions().get(i)).getSeries().clear();
      ((SeriesDefinition)((Axis)XAxis.getAssociatedAxes().get(1)).getSeriesDefinitions().get(i)).getSeries().add(newSeries);
      ChartUIUtil.setSeriesName(chartModel);
    }
  }
 catch (  Exception e) {
    bException=true;
    WizardBase.showException(e.getLocalizedMessage());
  }
 finally {
    ChartAdapter.endIgnoreNotifications();
  }
  if (!bException) {
    WizardBase.removeException();
  }
}

Fixed version (ground truth):
private void changeOverlaySeriesType(){
  if (getCurrentChartType().canCombine()) {
    ChartCacheManager.getInstance().cacheSeriesType(cbSeriesType.getText());
  }
  boolean bException=false;
  try {
    Axis XAxis=(Axis)((ChartWithAxes)chartModel).getAxes().get(0);
    int iSeriesDefinitionIndex=0 + ((Axis)XAxis.getAssociatedAxes().get(0)).getSeriesDefinitions().size();
    int iOverlaySeriesCount=((Axis)XAxis.getAssociatedAxes().get(1)).getSeriesDefinitions().size();
    ChartAdapter.beginIgnoreNotifications();
    for (int i=0; i < iOverlaySeriesCount; i++) {
      Series lastSeries=((SeriesDefinition)((Axis)XAxis.getAssociatedAxes().get(1)).getSeriesDefinitions().get(i)).getDesignTimeSeries();
      if (!lastSeries.getDisplayName().equals(cbSeriesType.getText())) {
        Series newSeries=(Series)EcoreUtil.copy(htSeriesNames.get(cbSeriesType.getText()));
        newSeries.translateFrom(lastSeries,iSeriesDefinitionIndex,chartModel);
        newSeries.eAdapters().addAll(chartModel.eAdapters());
        ((SeriesDefinition)((Axis)XAxis.getAssociatedAxes().get(1)).getSeriesDefinitions().get(i)).getSeries().clear();
        ((SeriesDefinition)((Axis)XAxis.getAssociatedAxes().get(1)).getSeriesDefinitions().get(i)).getSeries().add(newSeries);
        ChartUIUtil.setSeriesName(chartModel);
      }
    }
  }
 catch (  Exception e) {
    bException=true;
    WizardBase.showException(e.getLocalizedMessage());
  }
 finally {
    ChartAdapter.endIgnoreNotifications();
  }
  if (!bException) {
    WizardBase.removeException();
  }
}
Program: 71299
Project: 71299
Buggy source:
/** 
 * Handles the alignment property of the row content.
 */
public void handleRowAlign(IRowContent row){
  IStyle rowComputedStyle=row.getComputedStyle();
  CSSValue vAlign=rowComputedStyle.getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  if (null == vAlign || IStyle.BASELINE_VALUE == vAlign) {
    vAlign=IStyle.TOP_VALUE;
  }
  writer.attribute(HTMLTags.ATTR_VALIGN,vAlign.getCssText());
  CSSValue hAlign=rowComputedStyle.getProperty(IStyle.STYLE_TEXT_ALIGN);
  if (null != hAlign) {
    writer.attribute(HTMLTags.ATTR_ALIGN,hAlign.getCssText());
  }
}

Fixed version (ground truth):
/** 
 * Handles the alignment property of the row content.
 */
public void handleRowAlign(IRowContent row){
  IStyle rowComputedStyle=row.getComputedStyle();
  CSSValue vAlign=rowComputedStyle.getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  if (null == vAlign || IStyle.BASELINE_VALUE == vAlign) {
    vAlign=IStyle.TOP_VALUE;
  }
  writer.attribute(HTMLTags.ATTR_VALIGN,vAlign.getCssText());
  String hAlignText=null;
  CSSValue hAlign=rowComputedStyle.getProperty(IStyle.STYLE_TEXT_ALIGN);
  if (null != hAlign) {
    hAlignText=hAlign.getCssText();
  }
  if (null == hAlignText) {
    if (htmlRtLFlag) {
      hAlignText="String_Node_Str";
    }
 else {
      hAlignText="String_Node_Str";
    }
  }
  writer.attribute(HTMLTags.ATTR_ALIGN,hAlignText);
}
Program: 71300
Project: 71300
Buggy source:
public HTMLVisionOptimize(HTMLReportEmitter reportEmitter,HTMLWriter writer,String layoutPreference){
  super(reportEmitter,writer,layoutPreference);
}

Fixed version (ground truth):
public HTMLVisionOptimize(HTMLReportEmitter reportEmitter,HTMLWriter writer,String layoutPreference,boolean htmlRtLFlag){
  super(reportEmitter,writer,layoutPreference);
  this.htmlRtLFlag=htmlRtLFlag;
}
Program: 71301
Project: 71301
Buggy source:
public ScriptContext(ScriptableObject root){
  try {
    this.context=Context.enter();
    global=new ImporterTopLevel();
    if (root != null) {
      global.exportAsJSClass(3,global,false);
      global.delete("String_Node_Str");
      global.setPrototype(root);
    }
 else {
      global.initStandardObjects(context,true);
    }
    this.scope=global;
    sharedScope=context.newObject(scope);
    sharedScope.setParentScope(scope);
  }
 catch (  Exception ex) {
    Context.exit();
    this.scope=null;
    this.context=null;
    if (logger.isLoggable(Level.WARNING)) {
      logger.log(Level.WARNING,ex.getMessage());
    }
  }
}

Fixed version (ground truth):
public ScriptContext(ScriptableObject root){
  try {
    this.context=Context.enter();
    global=new ImporterTopLevel();
    if (root != null) {
      new LazilyLoadedCtor(global,"String_Node_Str","String_Node_Str",false);
      global.exportAsJSClass(3,global,false);
      global.delete("String_Node_Str");
      global.setPrototype(root);
    }
 else {
      global.initStandardObjects(context,true);
    }
    this.scope=global;
    sharedScope=context.newObject(scope);
    sharedScope.setParentScope(scope);
  }
 catch (  Exception ex) {
    Context.exit();
    this.scope=null;
    this.context=null;
    if (logger.isLoggable(Level.WARNING)) {
      logger.log(Level.WARNING,ex.getMessage());
    }
  }
}
Program: 71302
Project: 71302
Buggy source:
public void render() throws Exception {
  setupRenderOption();
  IContentEmitter emitter=createContentEmitter();
  String format=executionContext.getOutputFormat();
  IReportExecutor executor=new ReportletExecutor(executionContext,offset);
  executor=createRenderExtensionExecutor(executor);
  executor=new SuppressDuplciateReportExecutor(executor);
  executor=new LocalizedReportExecutor(executionContext,executor);
  executionContext.setExecutor(executor);
  initializeContentEmitter(emitter,executor);
  IReportLayoutEngine layoutEngine=createReportLayoutEngine(pagination,renderOptions);
  layoutEngine.setLocale(executionContext.getLocale());
  if (ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    OnPageBreakLayoutPageHandle handle=new OnPageBreakLayoutPageHandle(executionContext);
    layoutEngine.setPageHandler(handle);
    CompositeContentEmitter outputEmitters=new CompositeContentEmitter(format);
    outputEmitters.addEmitter(new PDFLayoutEmitterProxy(executor,emitter,renderOptions,executionContext.getLocale(),getTotalPage()));
    outputEmitters.addEmitter(handle.getEmitter());
    emitter=outputEmitters;
  }
  startRender();
  IReportContent report=executor.execute();
  emitter.start(report);
  layoutEngine.layout(executor,report,emitter,false);
  layoutEngine.close();
  emitter.end(report);
  closeRender();
  executor.close();
  outputPageCount=layoutEngine.getPageCount();
}

Fixed version (ground truth):
public void render() throws Exception {
  setupRenderOption();
  IContentEmitter emitter=createContentEmitter();
  String format=executionContext.getOutputFormat();
  IReportExecutor executor=new ReportletExecutor(executionContext,offset);
  executor=createRenderExtensionExecutor(executor);
  executor=new SuppressDuplciateReportExecutor(executor);
  executor=new LocalizedReportExecutor(executionContext,executor);
  executionContext.setExecutor(executor);
  initializeContentEmitter(emitter,executor);
  IReportLayoutEngine layoutEngine=createReportLayoutEngine(pagination,renderOptions);
  layoutEngine.setPageHandler(new LayoutPageHandler(((HTMLReportLayoutEngine)layoutEngine).getContext()));
  layoutEngine.setLocale(executionContext.getLocale());
  if (ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    OnPageBreakLayoutPageHandle handle=new OnPageBreakLayoutPageHandle(executionContext);
    layoutEngine.setPageHandler(handle);
    CompositeContentEmitter outputEmitters=new CompositeContentEmitter(format);
    outputEmitters.addEmitter(new PDFLayoutEmitterProxy(executor,emitter,renderOptions,executionContext.getLocale(),getTotalPage()));
    outputEmitters.addEmitter(handle.getEmitter());
    emitter=outputEmitters;
  }
  startRender();
  IReportContent report=executor.execute();
  emitter.start(report);
  layoutEngine.layout(executor,report,emitter,false);
  layoutEngine.close();
  emitter.end(report);
  closeRender();
  executor.close();
  outputPageCount=layoutEngine.getPageCount();
}
Program: 71304
Project: 71304
Buggy source:
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Connection.class.getName(),"String_Node_Str","String_Node_Str");
  if (jdbcConn == null) {
    return;
  }
  try {
    if ((jdbcConn instanceof java.sql.Connection)) {
      Object option=this.appContext.get(IConnectionFactory.CLOSE_PASS_IN_CONNECTION);
      boolean closePassInConnection=(option instanceof Boolean) ? ((Boolean)option).booleanValue() : true;
      if (!closePassInConnection)       return;
    }
    if (jdbcConn.isClosed() == false)     jdbcConn.close();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.CONN_CANNOT_CLOSE,e);
  }
  jdbcConn=null;
}

Fixed version (ground truth):
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Connection.class.getName(),"String_Node_Str","String_Node_Str");
  if (jdbcConn == null) {
    return;
  }
  try {
    if (this.appContext != null && (jdbcConn instanceof java.sql.Connection)) {
      Object option=this.appContext.get(IConnectionFactory.CLOSE_PASS_IN_CONNECTION);
      boolean closePassInConnection=(option instanceof Boolean) ? ((Boolean)option).booleanValue() : true;
      if (!closePassInConnection)       return;
    }
    if (jdbcConn.isClosed() == false)     jdbcConn.close();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.CONN_CANNOT_CLOSE,e);
  }
  jdbcConn=null;
}
Program: 71305
Project: 71305
Buggy source:
protected CategoryContentProvider(LegendData lgData) throws ChartException {
  super(lgData);
  sdBase=ChartUtil.getBaseSeriesDefinitions(lgData.cm).get(0);
  seBase=sdBase.getRunTimeSeries().get(0);
  dsiBase=createDataSetIterator(seBase,lgData.cm);
  fs=lgData.cm.getLegend().getFormatSpecifier();
  if (fs == null && sdBase != null) {
    fs=sdBase.getFormatSpecifier();
  }
  boolean bDataReverse=bNeedInvert;
  if (lgData.cm instanceof ChartWithAxes) {
    ChartWithAxes cwa=(ChartWithAxes)lgData.cm;
    bDataReverse=ChartUtil.XOR(bNeedInvert,cwa.isReverseCategory());
  }
  dsiBase.reverse(bDataReverse);
}

Fixed version (ground truth):
protected CategoryContentProvider(LegendData lgData) throws ChartException {
  super(lgData);
  sdBase=ChartUtil.getBaseSeriesDefinitions(lgData.cm).get(0);
  seBase=sdBase.getRunTimeSeries().get(0);
  dsiBase=createDataSetIterator(seBase,lgData.cm);
  fs=lgData.cm.getLegend().getFormatSpecifier();
  boolean bDataReverse=bNeedInvert;
  if (lgData.cm instanceof ChartWithAxes) {
    ChartWithAxes cwa=(ChartWithAxes)lgData.cm;
    bDataReverse=ChartUtil.XOR(bNeedInvert,cwa.isReverseCategory());
  }
  dsiBase.reverse(bDataReverse);
}
Program: 71306
Project: 71306
Buggy source:
public void deserialize(String propName,ByteArrayInputStream data) throws ExtendedElementException {
  if (propName != null && propName.equalsIgnoreCase(ChartReportItemUtil.PROPERTY_XMLPRESENTATION)) {
    try {
      cm=SerializerImpl.instance().fromXml(data,true);
      String reportVer=handle.getModuleHandle().getVersion();
      adjustNumberFormat(reportVer);
    }
 catch (    IOException e) {
      e.printStackTrace();
      cm=null;
    }
  }
}

Fixed version (ground truth):
public void deserialize(String propName,ByteArrayInputStream data) throws ExtendedElementException {
  if (propName != null && propName.equalsIgnoreCase(ChartReportItemUtil.PROPERTY_XMLPRESENTATION)) {
    try {
      cm=SerializerImpl.instance().fromXml(data,true);
      doCompatibility(cm);
      String reportVer=handle.getModuleHandle().getVersion();
      adjustNumberFormat(reportVer);
    }
 catch (    IOException e) {
      logger.log(e);
      cm=null;
    }
  }
}
Program: 71307
Project: 71307
Buggy source:
public void widgetSelected(SelectionEvent e){
  if (detachPopup(e.widget)) {
    return;
  }
  if (isRegistered(e.widget)) {
    attachPopup(((Button)e.widget).getData().toString());
  }
  if (e.widget.equals(cmbColorBy)) {
    if (!getChart().getLegend().getItemType().getName().equals(LiteralHelper.legendItemTypeSet.getNameByDisplayName(cmbColorBy.getText()))) {
      getChart().getLegend().setItemType(LegendItemType.getByName(LiteralHelper.legendItemTypeSet.getNameByDisplayName(cmbColorBy.getText())));
      getChart().getLegend().setFormatSpecifier(null);
      if ((getChart().getLegend().getItemType().getValue() == LegendItemType.CATEGORIES) && isGroupedSeries()) {
        ChartAdapter.beginIgnoreNotifications();
        SeriesDefinition[] osds=getValueSeriesDefinition();
        SeriesDefinition bsd=getCategorySeriesDefinition();
        bsd.getSeriesPalette().shift(0);
        for (int i=0; i < osds.length; i++) {
          bsd.getSeriesPalette().getEntries().set(i,EcoreUtil.copy((Fill)osds[i].getSeriesPalette().getEntries().get(0)));
        }
        ((SeriesPaletteSheet)popup).setCategorySeries(bsd);
        ChartAdapter.endIgnoreNotifications();
      }
      ((SeriesPaletteSheet)popup).setGroupedPalette(isGroupedSeries());
      refreshPopupSheet();
    }
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  if (detachPopup(e.widget)) {
    return;
  }
  if (isRegistered(e.widget)) {
    attachPopup(((Button)e.widget).getData().toString());
  }
  if (e.widget.equals(cmbColorBy)) {
    if (!getChart().getLegend().getItemType().getName().equals(LiteralHelper.legendItemTypeSet.getNameByDisplayName(cmbColorBy.getText()))) {
      getChart().getLegend().setItemType(LegendItemType.getByName(LiteralHelper.legendItemTypeSet.getNameByDisplayName(cmbColorBy.getText())));
      if ((getChart().getLegend().getItemType().getValue() == LegendItemType.CATEGORIES) && isGroupedSeries()) {
        ChartAdapter.beginIgnoreNotifications();
        SeriesDefinition[] osds=getValueSeriesDefinition();
        SeriesDefinition bsd=getCategorySeriesDefinition();
        bsd.getSeriesPalette().shift(0);
        for (int i=0; i < osds.length; i++) {
          bsd.getSeriesPalette().getEntries().set(i,EcoreUtil.copy((Fill)osds[i].getSeriesPalette().getEntries().get(0)));
        }
        ((SeriesPaletteSheet)popup).setCategorySeries(bsd);
        ChartAdapter.endIgnoreNotifications();
      }
      ((SeriesPaletteSheet)popup).setGroupedPalette(isGroupedSeries());
      refreshPopupSheet();
    }
  }
}
Program: 71308
Project: 71308
Buggy source:
public void close(){
  if (tocReader != null) {
    try {
      tocReader.close();
    }
 catch (    IOException ex) {
      logger.log(Level.SEVERE,"String_Node_Str",ex);
    }
    tocReader=null;
  }
  if (indexReader != null) {
    try {
      indexReader.close();
    }
 catch (    IOException ex) {
      logger.log(Level.WARNING,"String_Node_Str",ex);
    }
    indexReader=null;
  }
  if (pageHintReader != null) {
    pageHintReader.close();
    pageHintReader=null;
  }
  if (archive != null) {
    if (!sharedArchive) {
      try {
        archive.close();
      }
 catch (      IOException ex) {
        logger.log(Level.SEVERE,"String_Node_Str",ex);
      }
    }
    archive=null;
  }
  if (extensions != null) {
    for (    Map.Entry<String,IReportDocumentExtension> entry : extensions.entrySet()) {
      String name=entry.getKey();
      IReportDocumentExtension extension=entry.getValue();
      if (extension != null) {
        try {
          extension.close();
        }
 catch (        EngineException ex) {
          logger.log(Level.SEVERE,"String_Node_Str" + name,ex);
        }
      }
    }
    extensions.clear();
    extensions=null;
  }
}

Fixed version (ground truth):
public void close(){
  if (tocReader != null) {
    try {
      tocReader.close();
    }
 catch (    IOException ex) {
      logger.log(Level.SEVERE,"String_Node_Str",ex);
    }
    tocReader=null;
  }
  if (indexReader != null) {
    try {
      indexReader.close();
    }
 catch (    IOException ex) {
      logger.log(Level.WARNING,"String_Node_Str",ex);
    }
    indexReader=null;
  }
  if (pageHintReader != null) {
    pageHintReader.close();
    pageHintReader=null;
  }
  if (archive != null) {
    if (!sharedArchive) {
      try {
        archive.close();
      }
 catch (      IOException ex) {
        logger.log(Level.SEVERE,"String_Node_Str",ex);
      }
    }
    archive=null;
  }
  if (extensions != null) {
    for (    Map.Entry<String,IReportDocumentExtension> entry : extensions.entrySet()) {
      String name=entry.getKey();
      IReportDocumentExtension extension=entry.getValue();
      if (extension != null) {
        try {
          extension.close();
        }
 catch (        EngineException ex) {
          logger.log(Level.SEVERE,"String_Node_Str" + name,ex);
        }
      }
    }
    extensions.clear();
    extensions=null;
  }
  if (engineCacheEntry != null) {
    LinkedObjectManager<ReportDocumentReader> manager=engineCacheEntry.getManager();
synchronized (manager) {
      manager.remove(engineCacheEntry);
    }
  }
}
Program: 71309
Project: 71309
Buggy source:
/** 
 * shuts down the report engine
 */
public void destroy(){
  logger.fine("String_Node_Str");
  rootScope=null;
  helper=null;
  if (config != null) {
    IStatusHandler handler=config.getStatusHandler();
    if (handler != null) {
      handler.finish();
    }
  }
  if (extensionManager != null) {
    extensionManager.close();
    extensionManager=null;
  }
  EngineLogger.stopEngineLogging();
}

Fixed version (ground truth):
/** 
 * shuts down the report engine
 */
public void destroy(){
  logger.fine("String_Node_Str");
  rootScope=null;
  helper=null;
synchronized (openedDocuments) {
    for (    ReportDocumentReader document : openedDocuments) {
      document.setEngineCacheEntry(null);
      document.close();
    }
    openedDocuments.clear();
  }
  if (config != null) {
    IStatusHandler handler=config.getStatusHandler();
    if (handler != null) {
      handler.finish();
    }
  }
  if (extensionManager != null) {
    extensionManager.close();
    extensionManager=null;
  }
  EngineLogger.stopEngineLogging();
}
Program: 71310
Project: 71310
Buggy source:
/** 
 * Constructor. If config is null, engine derives BIRT_HOME from the location of the engine jar file, and derives data driver directory as $BIRT_HOME/drivers. For a simple report with no images and links, engine will run without complaining. If the report has image/chart defined, the engine has to be configured with relevant image and chart handlers.
 * @param config an engine configuration object used to configure the engine
 */
public ReportEngine(EngineConfig config){
  this.config=config;
  mergeConfigToAppContext();
  intializeLogger();
  logger.log(Level.FINE,"String_Node_Str",config);
  this.helper=new ReportEngineHelper(this);
  setupScriptScope();
}

Fixed version (ground truth):
/** 
 * Constructor. If config is null, engine derives BIRT_HOME from the location of the engine jar file, and derives data driver directory as $BIRT_HOME/drivers. For a simple report with no images and links, engine will run without complaining. If the report has image/chart defined, the engine has to be configured with relevant image and chart handlers.
 * @param config an engine configuration object used to configure the engine
 */
public ReportEngine(EngineConfig config){
  this.config=config;
  mergeConfigToAppContext();
  intializeLogger();
  logger.log(Level.FINE,"String_Node_Str",config);
  this.helper=new ReportEngineHelper(this);
  openedDocuments=new LinkedObjectManager<ReportDocumentReader>();
  setupScriptScope();
}
Program: 71311
Project: 71311
Buggy source:
public IReportDocument openReportDocument(String systemId,IDocArchiveReader archive,Map options) throws EngineException {
  if (options == null) {
    options=new HashMap();
  }
  intializeModuleOptions(options);
  ReportDocumentReader reader=new ReportDocumentReader(systemId,engine,archive,options);
  return reader;
}

Fixed version (ground truth):
public IReportDocument openReportDocument(String systemId,IDocArchiveReader archive,Map options) throws EngineException {
  if (options == null) {
    options=new HashMap();
  }
  intializeModuleOptions(options);
  ReportDocumentReader reader=new ReportDocumentReader(systemId,engine,archive,options);
  engine.cacheOpenedDocument(reader);
  return reader;
}
Program: 71312
Project: 71312
Buggy source:
public void test_regression_137174(){
  List infos=ModuleUtil.checkVersion(getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ filename);
  assertEquals(1,infos.size());
  IVersionInfo versionInfo=(IVersionInfo)infos.get(0);
  assertEquals("String_Node_Str",versionInfo.getDesignFileVersion());
  assertNotNull(versionInfo.getLocalizedMessage());
  infos=ModuleUtil.checkVersion(getClassFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ "String_Node_Str");
  assertEquals(1,infos.size());
}

Fixed version (ground truth):
public void test_regression_137174(){
  List infos=ModuleUtil.checkVersion(getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ filename);
  assertEquals(1,infos.size());
  IVersionInfo versionInfo=(IVersionInfo)infos.get(0);
  assertEquals("String_Node_Str",versionInfo.getDesignFileVersion());
  assertNotNull(versionInfo.getLocalizedMessage());
  infos=ModuleUtil.checkVersion(getClassFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ filename_lib);
  assertEquals(1,infos.size());
}
Program: 71313
Project: 71313
Buggy source:
/** 
 */
public void testLike(){
  String[] script=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] result=new boolean[]{true,true,true,true,true,false,false,false,true,false,true,false,false};
  for (int i=0; i < script.length; i++) {
    assertTrue(((Boolean)cx.evaluateString(scope,script[i],"String_Node_Str",1,null)).booleanValue() == result[i]);
  }
}

Fixed version (ground truth):
/** 
 */
public void testLike(){
  String[] script=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] result=new boolean[]{true,true,true,true,true,false,false,false,true,false,true,false,true};
  for (int i=0; i < script.length; i++) {
    assertEquals(result[i],((Boolean)cx.evaluateString(scope,script[i],"String_Node_Str",1,null)).booleanValue());
  }
}
Program: 71314
Project: 71314
Buggy source:
/** 
 */
public void testNotLike(){
  String[] script=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] result=new boolean[]{false,false,false,false,false,true,true,true,false,true,false,true};
  for (int i=0; i < script.length; i++) {
    assertTrue(((Boolean)cx.evaluateString(scope,script[i],"String_Node_Str",1,null)).booleanValue() == result[i]);
  }
}

Fixed version (ground truth):
/** 
 */
public void testNotLike(){
  String[] script=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] result=new boolean[]{false,false,false,false,false,true,true,true,false,true,false,true,false};
  for (int i=0; i < script.length; i++) {
    assertEquals(result[i],((Boolean)cx.evaluateString(scope,script[i],"String_Node_Str",1,null)).booleanValue());
  }
}
Program: 71315
Project: 71315
Buggy source:
/** 
 * Transfers the user-input string to the Pattern regular expression
 * @param regex
 * @return
 */
private static String toPatternString(String regex){
  String pattern="String_Node_Str";
  for (int i=0; i < regex.length(); i++) {
    char c=regex.charAt(i);
    if (c == '\\') {
      i++;
      if (i < regex.length()) {
        pattern+=regex.charAt(i);
      }
    }
 else     if (c == '%') {
      pattern+="String_Node_Str";
    }
 else     if (c == '_') {
      pattern+="String_Node_Str";
    }
 else {
      pattern+=c;
    }
  }
  return pattern;
}

Fixed version (ground truth):
/** 
 * Transfers the user-input string to the Pattern regular expression
 * @param regex
 * @return
 */
private static String toPatternString(String regex){
  String pattern="String_Node_Str";
  boolean preserveFlag=false;
  for (int i=0; i < regex.length(); i++) {
    char c=regex.charAt(i);
    if (c == '\\') {
      pattern=handlePreservedString(preserveFlag,pattern);
      preserveFlag=false;
      pattern+=c;
      i++;
      if (i < regex.length()) {
        pattern+=regex.charAt(i);
      }
    }
 else     if (c == '%') {
      pattern=handlePreservedString(preserveFlag,pattern);
      preserveFlag=false;
      pattern+="String_Node_Str";
    }
 else     if (c == '_') {
      pattern=handlePreservedString(preserveFlag,pattern);
      preserveFlag=false;
      pattern+="String_Node_Str";
    }
 else {
      if (preserveFlag) {
        pattern+=c;
      }
 else {
        pattern=pattern + "String_Node_Str" + c;
        preserveFlag=true;
      }
    }
  }
  if (preserveFlag) {
    pattern+="String_Node_Str";
  }
  return pattern;
}
Program: 71316
Project: 71316
Buggy source:
@Override public T next(){
  if (modCount != expectedModCount)   throw new ConcurrentModificationException();
  LinkedEntry<T> entry=next;
  if (entry == null)   throw new NoSuchElementException();
  T value=entry.getValue();
  current=entry;
  next=entry.getNext();
  return value;
}

Fixed version (ground truth):
public T next(){
  if (modCount != expectedModCount)   throw new ConcurrentModificationException();
  LinkedEntry<T> entry=next;
  if (entry == null)   throw new NoSuchElementException();
  T value=entry.getValue();
  current=entry;
  next=entry.getNext();
  return value;
}
Program: 71317
Project: 71317
Buggy source:
public void clear(){
  LinkedEntry<T> entry=first;
  first=null;
  last=null;
  modCount=0;
}

Fixed version (ground truth):
public void clear(){
  first=null;
  last=null;
  modCount=0;
}
Program: 71318
Project: 71318
Buggy source:
@Override public boolean hasNext(){
  return next != null;
}

Fixed version (ground truth):
public boolean hasNext(){
  return next != null;
}
Program: 71319
Project: 71319
Buggy source:
@Override public void remove(){
  if (current == null)   throw new IllegalStateException();
  if (modCount != expectedModCount)   throw new ConcurrentModificationException();
  LinkedObjectManager.this.remove(current);
  current=null;
  expectedModCount=modCount;
}

Fixed version (ground truth):
public void remove(){
  if (current == null)   throw new IllegalStateException();
  if (modCount != expectedModCount)   throw new ConcurrentModificationException();
  LinkedObjectManager.this.remove(current);
  current=null;
  expectedModCount=modCount;
}
Program: 71320
Project: 71320
Buggy source:
@Override public Iterator<T> iterator(){
  return new InternalIterator();
}

Fixed version (ground truth):
public Iterator<T> iterator(){
  return new InternalIterator();
}
Program: 71321
Project: 71321
Buggy source:
/** 
 * @param s
 * @return
 */
private static String cleanDate(String s){
  s=s.trim();
  if (s.indexOf('T') < 12) {
    s=s.replaceFirst("String_Node_Str","String_Node_Str");
  }
  int zoneIndex=s.indexOf("String_Node_Str");
  if (zoneIndex > 0) {
    return s.substring(0,zoneIndex).trim();
  }
  zoneIndex=s.indexOf('Z');
  if (zoneIndex == s.length() - 1) {
    return s.substring(0,zoneIndex).trim();
  }
  zoneIndex=getZoneIndex(s);
  if (zoneIndex > 0) {
    return s.substring(0,zoneIndex).trim();
  }
  return s;
}

Fixed version (ground truth):
/** 
 * @param s
 * @return
 */
private static String cleanDate(String s){
  s=s.trim();
  if (s.indexOf('T') < 12) {
    s=s.replaceFirst("String_Node_Str","String_Node_Str");
  }
  int zoneIndex=s.indexOf('Z');
  if (zoneIndex == s.length() - 1) {
    return s.substring(0,zoneIndex).trim();
  }
  return s;
}
Program: 71323
Project: 71323
Buggy source:
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Connection.class.getName(),"String_Node_Str","String_Node_Str");
  if (jdbcConn == null) {
    return;
  }
  try {
    if (jdbcConn.isClosed() == false)     jdbcConn.close();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.CONN_CANNOT_CLOSE,e);
  }
  jdbcConn=null;
}

Fixed version (ground truth):
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Connection.class.getName(),"String_Node_Str","String_Node_Str");
  if (jdbcConn == null) {
    return;
  }
  try {
    if ((jdbcConn instanceof java.sql.Connection)) {
      Object option=this.appContext.get(IConnectionFactory.CLOSE_PASS_IN_CONNECTION);
      boolean closePassInConnection=(option instanceof Boolean) ? ((Boolean)option).booleanValue() : true;
      if (!closePassInConnection)       return;
    }
    if (jdbcConn.isClosed() == false)     jdbcConn.close();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.CONN_CANNOT_CLOSE,e);
  }
  jdbcConn=null;
}
Program: 71325
Project: 71325
Buggy source:
private void updateLabel(String strText) throws ChartException {
  la.getCaption().setValue(strText);
  itm.reuse(la,maxWrappingSize);
  bb=Methods.computeLabelSize(xs,la);
}

Fixed version (ground truth):
private void updateLabel(String strText) throws ChartException {
  la.getCaption().setValue(strText);
  bb=Methods.computeLabelSize(xs,la,maxWrappingSize,fontHeight);
}
Program: 71326
Project: 71326
Buggy source:
@Override public boolean placeContent(LegendItemHints lih) throws ChartException {
  if (lih.getType() == LegendItemHints.Type.LG_SEPERATOR) {
    if (bIsLeftRight) {
      flushColumnList();
      dX+=dSepThick;
      lih.left(dX - dSepThick * 0.5);
      lih.itemHeight(dMaxH);
    }
 else {
      dY+=dSepThick;
      lih.left(dX);
      lih.top(dY - dSepThick * 0.5);
      lih.width(dMaxW - lgData.dHorizontalSpacing);
    }
    lgData.legendItems.add(lih);
    return true;
  }
 else {
    Point size=computeContentSize(lih);
    return placeContentWithSize(lih,size);
  }
}

Fixed version (ground truth):
@Override public boolean placeContent(LegendItemHints lih) throws ChartException {
  if (lih.getType() == LegendItemHints.Type.LG_SEPERATOR) {
    if (bIsLeftRight) {
      flushColumnList();
      dX+=dSepThick;
      lih.left(dX - dSepThick * 0.5);
      lih.itemHeight(dMaxH);
    }
 else {
      dY+=dSepThick;
      lih.left(dX);
      lih.top(dY - dSepThick * 0.5);
      lih.width(dMaxW - lgData.dHorizontalSpacing);
    }
    columnList.add(lih);
    return true;
  }
 else {
    Point size=computeContentSize(lih);
    return placeContentWithSize(lih,size);
  }
}