nus-yam/ex-repair huggingface dataset:
Program: 72762
Project: 72762
Buggy source:
protected void createDocument(){
  try {
    IDocArchiveWriter archive=new FileArchiveWriter(REPORT_DOCUMENT);
    ReportDocumentWriter document=new ReportDocumentWriter(engine,archive);
    ReportRunnable runnable=(ReportRunnable)engine.openReportDesign(REPORT_DESIGN);
    Report reportIR=new ReportParser().parse((ReportDesignHandle)runnable.getDesignHandle());
    document.saveDesign(runnable,null,reportIR);
    HashMap parameters=createParamters();
    document.saveParamters(parameters);
    TOCTree tocTree=createTOC();
    document.saveTOC(tocTree);
    HashMap bookmarks=createBookmarks();
    document.saveBookmarks(bookmarks);
    Map map=createPersistentObjects();
    document.savePersistentObjects(map);
    document.close();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}

Fixed version (ground truth):
protected void createDocument(){
  try {
    IDocArchiveWriter archive=new FileArchiveWriter(REPORT_DOCUMENT);
    ReportDocumentWriter document=new ReportDocumentWriter(engine,archive);
    ReportRunnable runnable=(ReportRunnable)engine.openReportDesign(REPORT_DESIGN);
    Report reportIR=new ReportParser().parse((ReportDesignHandle)runnable.getDesignHandle());
    document.saveDesign(runnable,null);
    document.saveReportIR(reportIR);
    HashMap parameters=createParamters();
    document.saveParamters(parameters);
    TOCTree tocTree=createTOC();
    document.saveTOC(tocTree);
    HashMap bookmarks=createBookmarks();
    document.saveBookmarks(bookmarks);
    Map map=createPersistentObjects();
    document.savePersistentObjects(map);
    document.close();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}
Program: 72763
Project: 72763
Buggy source:
/** 
 * save the design into the stream.
 * @param design design handler
 */
public ReportRunnable saveDesign(ReportRunnable runnable,ReportRunnable originalRunnable,Report reportIR){
  RAOutputStream out=null;
  ReportRunnable newRunnable=runnable;
  try {
    if (originalRunnable != null && runnable != originalRunnable) {
      ReportDesignHandle design=runnable.getReport();
      out=archive.createRandomAccessStream(ORIGINAL_DESIGN_STREAM);
      DocumentUtil.serialize(design,out);
    }
    ReportDesignHandle design=runnable.getReport();
    out=archive.createRandomAccessStream(DESIGN_STREAM);
    ReportDesignHandle newDesign=DocumentUtil.serialize(design,out);
    designName=design.getFileName();
    newRunnable=new ReportRunnable(newDesign);
    newRunnable.setReportEngine(engine);
    newRunnable.setReportName(runnable.getReportName());
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
      }
    }
    out=null;
  }
  try {
    out=archive.createRandomAccessStream(DESIGN_IR_STREAM);
    new EngineIRWriter().write(out,reportIR);
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
      }
    }
  }
  return newRunnable;
}

Fixed version (ground truth):
/** 
 * save the design into the stream.
 * @param design design handler
 */
public ReportRunnable saveDesign(ReportRunnable runnable,ReportRunnable originalRunnable){
  RAOutputStream out=null;
  ReportRunnable newRunnable=runnable;
  try {
    if (originalRunnable != null && runnable != originalRunnable) {
      ReportDesignHandle design=runnable.getReport();
      out=archive.createRandomAccessStream(ORIGINAL_DESIGN_STREAM);
      DocumentUtil.serialize(design,out);
    }
    ReportDesignHandle design=runnable.getReport();
    out=archive.createRandomAccessStream(DESIGN_STREAM);
    ReportDesignHandle newDesign=DocumentUtil.serialize(design,out);
    designName=design.getFileName();
    newRunnable=new ReportRunnable(newDesign);
    newRunnable.setReportEngine(engine);
    newRunnable.setReportName(runnable.getReportName());
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
      }
    }
    out=null;
  }
  return newRunnable;
}
Program: 72765
Project: 72765
Buggy source:
public void updateRunnable(IReportRunnable newRunnable){
  if (originalRunnable == null) {
    this.originalRunnable=this.runnable;
  }
  this.runnable=(ReportRunnable)newRunnable;
}

Fixed version (ground truth):
public void updateRunnable(IReportRunnable newRunnable){
  if (originalRunnable == null) {
    this.originalRunnable=this.runnable;
  }
  this.runnable=(ReportRunnable)newRunnable;
  reportIR=null;
}
Program: 72768
Project: 72768
Buggy source:
private void initParameters(){
  Properties propertys=System.getProperties();
  Iterator itor=propertys.keySet().iterator();
  while (itor.hasNext()) {
    String str=(String)itor.next();
    if (str.startsWith(ATTR_PARAMRTER)) {
      addParameter(paramValues,str,propertys.getProperty(str));
    }
  }
}

Fixed version (ground truth):
private void initParameters(){
  Properties propertys=System.getProperties();
  Iterator itor=propertys.keySet().iterator();
  while (itor.hasNext()) {
    String str=(String)itor.next();
    if (str.startsWith(ATTR_PARAMRTER)) {
      addParameter(paramValues,str,propertys.getProperty(str));
    }
 else     if (str.startsWith(ATTR_MULPARAMRTER + "String_Node_Str")) {
      addMulitipleParameter(paramValues,str,propertys.getProperty(str));
    }
  }
}
Program: 72769
Project: 72769
Buggy source:
void addParameterArgs(List list){
  Iterator iterator=paramValues.keySet().iterator();
  while (iterator.hasNext()) {
    String key=(String)iterator.next();
    String value=String.valueOf(paramValues.get(key));
    StringBuffer buff=new StringBuffer();
    buff.append("String_Node_Str");
    buff.append(ATTR_PARAMRTER);
    buff.append(key);
    buff.append("String_Node_Str");
    buff.append(value);
    list.add(buff.toString());
  }
}

Fixed version (ground truth):
void addParameterArgs(List list){
  Iterator iterator=paramValues.keySet().iterator();
  while (iterator.hasNext()) {
    String key=(String)iterator.next();
    Object obj=paramValues.get(key);
    if (obj instanceof Object[]) {
      Object[] temp=(Object[])obj;
      for (int i=0; i < temp.length; i++) {
        String value=String.valueOf(temp[i]);
        StringBuffer buff=new StringBuffer();
        buff.append("String_Node_Str");
        buff.append(ATTR_MULPARAMRTER);
        buff.append(i);
        buff.append(key);
        buff.append("String_Node_Str");
        buff.append(value);
        list.add(buff.toString());
      }
    }
 else {
      String value=String.valueOf(paramValues.get(key));
      StringBuffer buff=new StringBuffer();
      buff.append("String_Node_Str");
      buff.append(ATTR_PARAMRTER);
      buff.append(key);
      buff.append("String_Node_Str");
      buff.append(value);
      list.add(buff.toString());
    }
  }
}
Program: 72770
Project: 72770
Buggy source:
public void select(){
  if (container.isSelect() && getCurrentInput().isMouseButtonDown(3)) {
    return;
  }
  TableEditPart part=(TableEditPart)getSourceEditPart();
  part.selectColumn(new int[]{getNumber()});
}

Fixed version (ground truth):
public void select(){
  if (container.isSelect() && getCurrentInput().isMouseButtonDown(3)) {
    return;
  }
  TableEditPart part=(TableEditPart)getSourceEditPart();
  if (getCurrentInput().isShiftKeyDown()) {
    int columnNumber=getNumber();
    int number=part.getOriColumnNumber();
    List list=part.getViewer().getSelectedEditParts();
    if (list.size() == 0) {
      number=1;
    }
    EditPart child=(EditPart)list.get(0);
    if (!(child.getModel() instanceof org.eclipse.birt.report.model.api.ColumnHandle) || !((org.eclipse.birt.report.model.api.ColumnHandle)child.getModel()).getContainer().equals(part.getModel())) {
      number=1;
    }
    selectColumns(number,columnNumber);
  }
 else {
    part.selectColumn(new int[]{getNumber()});
    part.setOriColumnNumber(getNumber());
  }
}
Program: 72771
Project: 72771
Buggy source:
public void selectDrag(){
  ColumnHandle handle=(ColumnHandle)getHandleUnderMouse();
  int columnNumber=handle.getColumnNumber();
  int number=getNumber();
  int[] columns=new int[]{};
  for (int i=number; i <= number + Math.abs(number - columnNumber); i++) {
    int lenegth=columns.length;
    int[] temp=new int[lenegth + 1];
    System.arraycopy(columns,0,temp,0,lenegth);
    temp[lenegth]=number > columnNumber ? number - (i - number) : i;
    columns=temp;
  }
  if (columns.length > 0) {
    TableEditPart tableEditpart=(TableEditPart)getSourceEditPart();
    tableEditpart.selectColumn(columns);
  }
}

Fixed version (ground truth):
public void selectDrag(){
  ColumnHandle handle=(ColumnHandle)getHandleUnderMouse();
  int columnNumber=handle.getColumnNumber();
  int number=getNumber();
  selectColumns(number,columnNumber);
}
Program: 72774
Project: 72774
Buggy source:
public void visitColumn(ColumnHandle handle){
  ColumnDesign col=new ColumnDesign();
  setupStyledElement(col,handle);
  col.setColumnHeaderState(false);
  DimensionType width=createDimension(handle.getWidth(),false);
  col.setWidth(width);
  boolean supress=handle.suppressDuplicates();
  col.setSuppressDuplicate(supress);
  VisibilityDesign visibility=createVisibility(handle.visibilityRulesIterator());
  col.setVisibility(visibility);
  setCurrentElement(col);
}

Fixed version (ground truth):
public void visitColumn(ColumnHandle handle){
  ColumnDesign col=new ColumnDesign();
  setupReportElement(col,handle);
  StyleDeclaration style=this.createColumnStyle(handle);
  if (style != null && !style.isEmpty()) {
    col.setStyleName(assignStyleName(style));
  }
  col.setColumnHeaderState(false);
  DimensionType width=createDimension(handle.getWidth(),false);
  col.setWidth(width);
  boolean supress=handle.suppressDuplicates();
  col.setSuppressDuplicate(supress);
  VisibilityDesign visibility=createVisibility(handle.visibilityRulesIterator());
  col.setVisibility(visibility);
  setCurrentElement(col);
}
Program: 72775
Project: 72775
Buggy source:
public ColumnWidthResolver(ITableContent table){
  this.table=table;
  String tableId=table.getInstanceID().toUniqueString();
  TableColumnHint hint=PDFTableLM.this.context.getTableColumnHint(tableId);
  if (hint != null) {
    start=hint.getStart();
    end=hint.getColumnCount() + start;
  }
 else {
    start=0;
    end=table.getColumnCount();
  }
}

Fixed version (ground truth):
public ColumnWidthResolver(ITableContent table){
  this.table=table;
  TableColumnHint hint=null;
  InstanceID id=table.getInstanceID();
  if (id != null) {
    String tableId=id.toUniqueString();
    hint=PDFTableLM.this.context.getTableColumnHint(tableId);
  }
  if (hint != null) {
    start=hint.getStart();
    end=hint.getColumnCount() + start;
  }
 else {
    start=0;
    end=table.getColumnCount();
  }
}
Program: 72776
Project: 72776
Buggy source:
protected void verticalAlign(){
  Iterator iter=root.getChildren();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    IStyle childStyle=child.getStyle();
    String vAlign=childStyle.getVerticalAlign();
    if (childStyle == null) {
      continue;
    }
    if (CSSConstants.CSS_BASELINE_VALUE.equalsIgnoreCase(vAlign)) {
      child.setPosition(child.getX(),child.getY() + getMaxBaseLine() - child.getBaseLine());
    }
 else {
      int spacing=root.getHeight() - child.getAllocatedHeight();
      if (spacing < 0) {
        spacing=0;
      }
      if (CSSConstants.CSS_BOTTOM_VALUE.equalsIgnoreCase(vAlign)) {
        child.setPosition(child.getX(),spacing + child.getY());
      }
 else       if (CSSConstants.CSS_MIDDLE_VALUE.equalsIgnoreCase(vAlign)) {
        child.setPosition(child.getX(),spacing / 2 + child.getY());
      }
 else {
        int lineHeight=((PDFBlockStackingLM)parent).getLineHeight();
        if (lineHeight > 0) {
          child.setPosition(child.getX(),spacing / 2 + child.getY());
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void verticalAlign(){
  Iterator iter=root.getChildren();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    IStyle childStyle=child.getStyle();
    String vAlign=childStyle.getVerticalAlign();
    if (childStyle == null) {
      continue;
    }
    int spacing=root.getHeight() - child.getAllocatedHeight();
    if (spacing < 0) {
      spacing=0;
    }
    if (CSSConstants.CSS_BASELINE_VALUE.equalsIgnoreCase(vAlign)) {
      int lineHeight=((PDFStackingLM)parent).getLineHeight();
      if (lineHeight > 0) {
        child.setPosition(child.getX(),child.getY() + getMaxBaseLine() - child.getBaseLine() + spacing / 2);
      }
 else {
        child.setPosition(child.getX(),child.getY() + getMaxBaseLine() - child.getBaseLine());
      }
    }
 else     if (CSSConstants.CSS_BOTTOM_VALUE.equalsIgnoreCase(vAlign)) {
      child.setPosition(child.getX(),spacing + child.getY());
    }
 else     if (CSSConstants.CSS_MIDDLE_VALUE.equalsIgnoreCase(vAlign)) {
      child.setPosition(child.getX(),spacing / 2 + child.getY());
    }
  }
}
Program: 72777
Project: 72777
Buggy source:
private int getMaxBaseLine(){
  if (maxBaseLine == 0) {
    Iterator iter=root.getChildren();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      maxBaseLine=Math.max(maxBaseLine,child.getBaseLine());
    }
  }
  return maxBaseLine;
}

Fixed version (ground truth):
/** 
 * Calculates the max baseline, and update the root height if necessary.
 * @return the max baseline.
 */
private int getMaxBaseLine(){
  int maxChildrenBaseLine=root.getMaxChildrenBaseLine();
  if (maxChildrenBaseLine == 0) {
    Iterator iter=root.getChildren();
    int maxChildrenBaseLineBelow=root.getMaxChildrenBaseLineBelow();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      maxChildrenBaseLine=Math.max(maxChildrenBaseLine,child.getBaseLine());
      maxChildrenBaseLineBelow=Math.max(maxChildrenBaseLineBelow,child.getAllocatedHeight() - child.getBaseLine());
    }
    root.setContentHeight(Math.max(root.getContentHeight(),maxChildrenBaseLine + maxChildrenBaseLineBelow));
    root.setMaxChildrenBaseLine(maxChildrenBaseLine);
    root.setMaxChildrenBaseLineBelow(maxChildrenBaseLineBelow);
  }
  return maxChildrenBaseLine;
}
Program: 72778
Project: 72778
Buggy source:
/** 
 * Rebuilds model base on editor input.
 */
public Object getAdapter(Class type){
  if (type == IContentOutlinePage.class) {
    DesignerOutlinePage outlinePage=new DesignerOutlinePage(getModel());
    manager.addModelEventProcessor(outlinePage.getModelProcessor());
    return outlinePage;
  }
  if (type == IPropertySheetPage.class) {
    ReportPropertySheetPage sheetPage=new ReportPropertySheetPage();
    return sheetPage;
  }
  if (type == DataViewPage.class) {
    DataViewTreeViewerPage page=new DataViewTreeViewerPage(getModel());
    manager.addModelEventProcessor(page.getModelProcessor());
    return page;
  }
  if (type == AttributeViewPage.class) {
    AttributeViewPage page=new AttributeViewPage();
    return page;
  }
  if (type == ModelEventManager.class) {
    return manager;
  }
  return super.getAdapter(type);
}

Fixed version (ground truth):
/** 
 * Rebuilds model base on editor input.
 */
public Object getAdapter(Class type){
  if (type == IContentOutlinePage.class) {
    DesignerOutlinePage outlinePage=new DesignerOutlinePage(getModel());
    manager.addModelEventProcessor(outlinePage.getModelProcessor());
    return outlinePage;
  }
  if (type == IPropertySheetPage.class) {
    ReportPropertySheetPage sheetPage=new ReportPropertySheetPage(getModel());
    return sheetPage;
  }
  if (type == DataViewPage.class) {
    DataViewTreeViewerPage page=new DataViewTreeViewerPage(getModel());
    manager.addModelEventProcessor(page.getModelProcessor());
    return page;
  }
  if (type == AttributeViewPage.class) {
    AttributeViewPage page=new AttributeViewPage();
    return page;
  }
  if (type == ModelEventManager.class) {
    return manager;
  }
  return super.getAdapter(type);
}
Program: 72779
Project: 72779
Buggy source:
public Object getAdapter(Class adapter){
  if (adapter == ActionRegistry.class) {
    return scriptEditor.getActionRegistry();
  }
 else   if (adapter == PalettePage.class) {
    if (cmbExprListViewer != null) {
      cmbExprListViewer.addSelectionChangedListener(palettePage.getSupport());
    }
    return palettePage;
  }
  if (adapter == IContentOutlinePage.class) {
    DesignerOutlinePage outlinePage=new DesignerOutlinePage(SessionHandleAdapter.getInstance().getReportDesignHandle());
    return outlinePage;
  }
  if (adapter == IPropertySheetPage.class) {
    ReportPropertySheetPage sheetPage=new ReportPropertySheetPage();
    return sheetPage;
  }
  if (adapter == DataViewPage.class) {
    DataViewTreeViewerPage page=new DataViewTreeViewerPage(SessionHandleAdapter.getInstance().getReportDesignHandle());
    return page;
  }
  if (adapter == AttributeViewPage.class) {
    AttributeViewPage page=new AttributeViewPage();
    return page;
  }
  if (adapter == ITextEditor.class) {
    return scriptEditor;
  }
  return super.getAdapter(adapter);
}

Fixed version (ground truth):
public Object getAdapter(Class adapter){
  if (adapter == ActionRegistry.class) {
    return scriptEditor.getActionRegistry();
  }
 else   if (adapter == PalettePage.class) {
    if (cmbExprListViewer != null) {
      cmbExprListViewer.addSelectionChangedListener(palettePage.getSupport());
    }
    return palettePage;
  }
  if (adapter == IContentOutlinePage.class) {
    DesignerOutlinePage outlinePage=new DesignerOutlinePage(SessionHandleAdapter.getInstance().getReportDesignHandle());
    return outlinePage;
  }
  if (adapter == IPropertySheetPage.class) {
    ReportPropertySheetPage sheetPage=new ReportPropertySheetPage(SessionHandleAdapter.getInstance().getReportDesignHandle());
    return sheetPage;
  }
  if (adapter == DataViewPage.class) {
    DataViewTreeViewerPage page=new DataViewTreeViewerPage(SessionHandleAdapter.getInstance().getReportDesignHandle());
    return page;
  }
  if (adapter == AttributeViewPage.class) {
    AttributeViewPage page=new AttributeViewPage();
    return page;
  }
  if (adapter == ITextEditor.class) {
    return scriptEditor;
  }
  return super.getAdapter(adapter);
}
Program: 72780
Project: 72780
Buggy source:
/** 
 * Handles all global actions
 */
private void handleGlobalAction(){
  for (int i=0; i < GlobalActionFactory.GLOBAL_STACK_ACTIONS.length; i++) {
    String id=GlobalActionFactory.GLOBAL_STACK_ACTIONS[i];
    getSite().getActionBars().setGlobalActionHandler(id,GlobalActionFactory.createStackAction(id,SessionHandleAdapter.getInstance().getCommandStack()));
  }
}

Fixed version (ground truth):
/** 
 * Handles all global actions
 */
private void handleGlobalAction(){
  for (int i=0; i < GlobalActionFactory.GLOBAL_STACK_ACTIONS.length; i++) {
    String id=GlobalActionFactory.GLOBAL_STACK_ACTIONS[i];
    getSite().getActionBars().setGlobalActionHandler(id,GlobalActionFactory.createStackAction(id,SessionHandleAdapter.getInstance().getCommandStack(moduleHandle)));
  }
}
Program: 72782
Project: 72782
Buggy source:
public void dispose(){
  SessionHandleAdapter.getInstance().getMediator().removeColleague(this);
  unregisterListeners();
  super.dispose();
}

Fixed version (ground truth):
public void dispose(){
  SessionHandleAdapter.getInstance().getMediator(moduleHandle).removeColleague(this);
  unregisterListeners();
  super.dispose();
}
Program: 72783
Project: 72783
Buggy source:
/** 
 * Returns an object which is an instance of the given class associated with this object. Returns <code>null</code> if no such object can be found.
 * @param adapter the adapter class to look up
 * @return a object castable to the given class, or <code>null</code> ifthis object does not have an adapter for the given class
 */
public Object getAdapter(Class adapter){
  if (adapter == IContentOutlinePage.class) {
    LibraryOutlinePage outline=new LibraryOutlinePage(getModel());
    getModelEventManager().addModelEventProcessor(outline.getModelProcessor());
    return outline;
  }
  if (adapter == DataViewPage.class) {
    DataViewPage page=(DataViewPage)super.getAdapter(adapter);
    if (page == null) {
      return null;
    }
    return page;
  }
  if (adapter == AttributeViewPage.class) {
    AttributeViewPage page=(AttributeViewPage)super.getAdapter(adapter);
    if (page == null) {
      return null;
    }
    return page;
  }
  if (adapter == IPropertySheetPage.class) {
    ReportPropertySheetPage sheetPage=new ReportPropertySheetPage();
    return sheetPage;
  }
  return super.getAdapter(adapter);
}

Fixed version (ground truth):
/** 
 * Returns an object which is an instance of the given class associated with this object. Returns <code>null</code> if no such object can be found.
 * @param adapter the adapter class to look up
 * @return a object castable to the given class, or <code>null</code> ifthis object does not have an adapter for the given class
 */
public Object getAdapter(Class adapter){
  if (adapter == IContentOutlinePage.class) {
    LibraryOutlinePage outline=new LibraryOutlinePage(getModel());
    getModelEventManager().addModelEventProcessor(outline.getModelProcessor());
    return outline;
  }
  if (adapter == DataViewPage.class) {
    DataViewPage page=(DataViewPage)super.getAdapter(adapter);
    if (page == null) {
      return null;
    }
    return page;
  }
  if (adapter == AttributeViewPage.class) {
    AttributeViewPage page=(AttributeViewPage)super.getAdapter(adapter);
    if (page == null) {
      return null;
    }
    return page;
  }
  if (adapter == IPropertySheetPage.class) {
    ReportPropertySheetPage sheetPage=new ReportPropertySheetPage(getModel());
    return sheetPage;
  }
  return super.getAdapter(adapter);
}
Program: 72784
Project: 72784
Buggy source:
private void processChildQuery(IDataQueryDefinition parent,CrosstabCellHandle cell,String emptyVlaue){
  if (cell != null) {
    for (Iterator itr=cell.getContents().iterator(); itr.hasNext(); ) {
      ReportElementHandle handle=(ReportElementHandle)itr.next();
      if (emptyVlaue != null && handle instanceof DataItemHandle) {
        DataItemHandle dataHandle=(DataItemHandle)handle;
        MapRule rule=StructureFactory.createMapRule();
        rule.setTestExpression(ExpressionUtil.createJSDataExpression(dataHandle.getResultSetColumn()));
        rule.setOperator(DesignChoiceConstants.MAP_OPERATOR_NULL);
        rule.setDisplay(emptyVlaue);
        PropertyHandle mapHandle=dataHandle.getPropertyHandle(StyleHandle.MAP_RULES_PROP);
        try {
          mapHandle.addItem(rule);
        }
 catch (        SemanticException e) {
          logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
        }
      }
      context.createQuery(parent,handle);
    }
  }
}

Fixed version (ground truth):
private void processChildQuery(IDataQueryDefinition parent,CrosstabCellHandle cell){
  if (cell != null) {
    for (Iterator itr=cell.getContents().iterator(); itr.hasNext(); ) {
      ReportElementHandle handle=(ReportElementHandle)itr.next();
      context.createQuery(parent,handle);
    }
  }
}
Program: 72786
Project: 72786
Buggy source:
@SuppressWarnings("String_Node_Str") private void handleCell(CrosstabCellHandle cell) throws BirtException {
  if (cell == null) {
    return;
  }
  ICrosstabCell cellItem=new CrosstabCellImpl(cell);
  handler.callFunction(CrosstabScriptHandler.ON_PREPARE_CELL,cellItem,context);
  for (Iterator itr=cell.getContents().iterator(); itr.hasNext(); ) {
    context.prepare((DesignElementHandle)itr.next());
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void handleCell(CrosstabCellHandle cell,String emptyVlaue) throws BirtException {
  if (cell == null) {
    return;
  }
  if (handler != null) {
    ICrosstabCell cellItem=new CrosstabCellImpl(cell);
    handler.callFunction(CrosstabScriptHandler.ON_PREPARE_CELL,cellItem,context);
  }
  for (Iterator itr=cell.getContents().iterator(); itr.hasNext(); ) {
    ReportElementHandle handle=(ReportElementHandle)itr.next();
    context.prepare(handle);
    if (emptyVlaue != null && handle instanceof DataItemHandle) {
      DataItemHandle dataHandle=(DataItemHandle)handle;
      MapRule rule=StructureFactory.createMapRule();
      rule.setTestExpression(ExpressionUtil.createJSDataExpression(dataHandle.getResultSetColumn()));
      rule.setOperator(DesignChoiceConstants.MAP_OPERATOR_NULL);
      rule.setDisplay(emptyVlaue);
      PropertyHandle mapHandle=dataHandle.getPropertyHandle(StyleHandle.MAP_RULES_PROP);
      try {
        mapHandle.addItem(rule);
      }
 catch (      SemanticException e) {
        logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
      }
    }
  }
}
Program: 72787
Project: 72787
Buggy source:
public CrosstabPreparationHandler(CrosstabReportItemHandle crosstab,IPreparationContext context) throws BirtException {
  ExtendedItemHandle modelHandle=(ExtendedItemHandle)crosstab.getModelHandle();
  String javaClass=modelHandle.getEventHandlerClass();
  String script=modelHandle.getOnPrepare();
  if ((javaClass == null || javaClass.trim().length() == 0) && (script == null || script.trim().length() == 0)) {
    return;
  }
  this.crosstab=crosstab;
  this.context=context;
  handler=createScriptHandler(modelHandle,ICrosstabReportItemConstants.ON_PREPARE_METHOD,script,context.getApplicationClassLoader());
}

Fixed version (ground truth):
public CrosstabPreparationHandler(CrosstabReportItemHandle crosstab,IPreparationContext context) throws BirtException {
  ExtendedItemHandle modelHandle=(ExtendedItemHandle)crosstab.getModelHandle();
  String javaClass=modelHandle.getEventHandlerClass();
  String script=modelHandle.getOnPrepare();
  this.crosstab=crosstab;
  this.context=context;
  if ((javaClass == null || javaClass.trim().length() == 0) && (script == null || script.trim().length() == 0)) {
    return;
  }
  handler=createScriptHandler(modelHandle,ICrosstabReportItemConstants.ON_PREPARE_METHOD,script,context.getApplicationClassLoader());
}
Program: 72788
Project: 72788
Buggy source:
public void handle() throws BirtException {
  if (handler == null) {
    return;
  }
  ICrosstab crosstabItem=new CrosstabImpl(crosstab);
  handler.callFunction(CrosstabScriptHandler.ON_PREPARE_CROSSTAB,crosstabItem,context);
  handleChildren();
}

Fixed version (ground truth):
public void handle() throws BirtException {
  if (handler != null) {
    ICrosstab crosstabItem=new CrosstabImpl(crosstab);
    handler.callFunction(CrosstabScriptHandler.ON_PREPARE_CROSSTAB,crosstabItem,context);
  }
  handleChildren();
}
Program: 72789
Project: 72789
Buggy source:
private void handleChildren() throws BirtException {
  handleCell(crosstab.getHeader());
  if (crosstab.getDimensionCount(COLUMN_AXIS_TYPE) > 0) {
    for (int i=0; i < crosstab.getDimensionCount(COLUMN_AXIS_TYPE); i++) {
      DimensionViewHandle dv=crosstab.getDimension(COLUMN_AXIS_TYPE,i);
      for (int j=0; j < dv.getLevelCount(); j++) {
        LevelViewHandle lv=dv.getLevel(j);
        handleCell(lv.getCell());
        handleCell(lv.getAggregationHeader());
      }
    }
  }
  handleCell(crosstab.getGrandTotal(COLUMN_AXIS_TYPE));
  if (crosstab.getDimensionCount(ROW_AXIS_TYPE) > 0) {
    for (int i=0; i < crosstab.getDimensionCount(ROW_AXIS_TYPE); i++) {
      DimensionViewHandle dv=crosstab.getDimension(ROW_AXIS_TYPE,i);
      for (int j=0; j < dv.getLevelCount(); j++) {
        LevelViewHandle lv=dv.getLevel(j);
        handleCell(lv.getCell());
        handleCell(lv.getAggregationHeader());
      }
    }
  }
  handleCell(crosstab.getGrandTotal(ROW_AXIS_TYPE));
  for (int i=0; i < crosstab.getMeasureCount(); i++) {
    MeasureViewHandle mv=crosstab.getMeasure(i);
    handleCell(mv.getHeader());
    handleCell(mv.getCell());
    for (int j=0; j < mv.getAggregationCount(); j++) {
      handleCell(mv.getAggregationCell(j));
    }
  }
}

Fixed version (ground truth):
private void handleChildren() throws BirtException {
  String emptyValue=crosstab.getEmptyCellValue();
  handleCell(crosstab.getHeader(),emptyValue);
  if (crosstab.getDimensionCount(COLUMN_AXIS_TYPE) > 0) {
    for (int i=0; i < crosstab.getDimensionCount(COLUMN_AXIS_TYPE); i++) {
      DimensionViewHandle dv=crosstab.getDimension(COLUMN_AXIS_TYPE,i);
      for (int j=0; j < dv.getLevelCount(); j++) {
        LevelViewHandle lv=dv.getLevel(j);
        handleCell(lv.getCell(),emptyValue);
        handleCell(lv.getAggregationHeader(),emptyValue);
      }
    }
  }
  handleCell(crosstab.getGrandTotal(COLUMN_AXIS_TYPE),emptyValue);
  if (crosstab.getDimensionCount(ROW_AXIS_TYPE) > 0) {
    for (int i=0; i < crosstab.getDimensionCount(ROW_AXIS_TYPE); i++) {
      DimensionViewHandle dv=crosstab.getDimension(ROW_AXIS_TYPE,i);
      for (int j=0; j < dv.getLevelCount(); j++) {
        LevelViewHandle lv=dv.getLevel(j);
        handleCell(lv.getCell(),emptyValue);
        handleCell(lv.getAggregationHeader(),emptyValue);
      }
    }
  }
  handleCell(crosstab.getGrandTotal(ROW_AXIS_TYPE),emptyValue);
  for (int i=0; i < crosstab.getMeasureCount(); i++) {
    MeasureViewHandle mv=crosstab.getMeasure(i);
    handleCell(mv.getHeader(),emptyValue);
    handleCell(mv.getCell(),emptyValue);
    for (int j=0; j < mv.getAggregationCount(); j++) {
      handleCell(mv.getAggregationCell(j),emptyValue);
    }
  }
}
Program: 72790
Project: 72790
Buggy source:
protected void writeComments(HyperlinkDef linkDef){
  String toolTip=linkDef.getToolTip();
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.text(toolTip);
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
protected void writeComments(HyperlinkDef linkDef){
  String toolTip=linkDef.getToolTip();
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.text(toolTip);
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
}
Program: 72791
Project: 72791
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
  ReportPlugin.getDefault().addIgnoreViewID(LibraryExplorerView.ID);
  AttributesUtil.addCategory(AttributesUtil.EVENTHANDLER,"String_Node_Str",HandlerPage.class);
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  super.start(context);
  ReportPlugin.getDefault().addIgnoreViewID(LibraryExplorerView.ID);
}
Program: 72796
Project: 72796
Buggy source:
private Collection doGetSelectionTreeForCascadingGroup(String parameterGroupName){
  CascadingParameterGroupHandle parameterGroup=getCascadingParameterGroup(parameterGroupName);
  if (parameterGroup == null)   return Collections.EMPTY_LIST;
  SlotHandle parameters=parameterGroup.getParameters();
  int parameterCount=parameters.getCount();
  if (DesignChoiceConstants.DATA_SET_MODE_SINGLE.equals(parameterGroup.getDataSetMode())) {
    IResultIterator resultIterator=getResultSetOfCascadingGroup(parameterGroup);
    if (resultIterator == null) {
      return Collections.EMPTY_LIST;
    }
    Collection selectionTree=populateToSelectionTree(resultIterator,parameterGroup);
    close(resultIterator);
    return selectionTree;
  }
 else {
    ParameterHelper[] parameterHelpers=getParameterHelpers(parameterGroup);
    ChoiceListCache cache=new ChoiceListCache(parameterHelpers);
    assert(parameterCount > 0);
    return getSelectionTree(parameters,parameterHelpers,cache,new Object[0]);
  }
}

Fixed version (ground truth):
private Collection doGetSelectionTreeForCascadingGroup(String parameterGroupName){
  CascadingParameterGroupHandle parameterGroup=getCascadingParameterGroup(parameterGroupName);
  if (parameterGroup == null) {
    executionContext.addException(new EngineException(MessageConstants.PARAMETER_GROUP_ISNOT_FOUND_BY_GROUPNAME_EXCEPTION,parameterGroupName));
    return Collections.EMPTY_LIST;
  }
  SlotHandle parameters=parameterGroup.getParameters();
  int parameterCount=parameters.getCount();
  if (DesignChoiceConstants.DATA_SET_MODE_SINGLE.equals(parameterGroup.getDataSetMode())) {
    IResultIterator resultIterator=getResultSetOfCascadingGroup(parameterGroup);
    if (resultIterator == null) {
      return Collections.EMPTY_LIST;
    }
    Collection selectionTree=populateToSelectionTree(resultIterator,parameterGroup);
    close(resultIterator);
    return selectionTree;
  }
 else {
    ParameterHelper[] parameterHelpers=getParameterHelpers(parameterGroup);
    ChoiceListCache cache=new ChoiceListCache(parameterHelpers);
    assert(parameterCount > 0);
    return getSelectionTree(parameters,parameterHelpers,cache,new Object[0]);
  }
}
Program: 72797
Project: 72797
Buggy source:
private Object[] getAccumulatorParameter(Row4Aggregation row,int funcIndex){
  Object[] parameters=null;
  if (parameterColIndex[funcIndex] == -1) {
    parameters=new Object[1];
    if (measureIndexes[funcIndex] < 0) {
      parameters[0]=null;
    }
 else {
      parameters[0]=row.getMeasures()[measureIndexes[funcIndex]];
    }
  }
 else {
    parameters=new Object[2];
    if (measureIndexes[funcIndex] < 0) {
      parameters[0]=null;
    }
 else {
      parameters[0]=row.getMeasures()[measureIndexes[funcIndex]];
    }
    parameters[1]=row.getParameterValues()[parameterColIndex[funcIndex]];
  }
  return parameters;
}

Fixed version (ground truth):
private Object[] getAccumulatorParameter(Row4Aggregation row,int funcIndex){
  Object[] parameters=null;
  if (parameterColIndex[funcIndex] == -1) {
    parameters=new Object[1];
    if (measureIndexes[funcIndex] < 0) {
      return null;
    }
 else {
      parameters[0]=row.getMeasures()[measureIndexes[funcIndex]];
    }
  }
 else {
    parameters=new Object[2];
    if (measureIndexes[funcIndex] < 0) {
      parameters[0]=null;
    }
 else {
      parameters[0]=row.getMeasures()[measureIndexes[funcIndex]];
    }
    parameters[1]=row.getParameterValues()[parameterColIndex[funcIndex]];
  }
  return parameters;
}
Program: 72798
Project: 72798
Buggy source:
/** 
 * Before new aggregation extension point is introduced, The binding expression is serve as first argument of aggregation. This function is used to construct a old version binding. 
 * @param binding
 * @return
 */
private static IBinding constructNewBinding(IBinding binding){
  IBinding newBinding=null;
  try {
    newBinding=new Binding(binding.getBindingName());
    List aggregationOn=binding.getAggregatOns();
    if (aggregationOn != null) {
      for (int i=0; i < aggregationOn.size(); i++) {
        newBinding.addAggregateOn((String)aggregationOn.get(i));
      }
    }
    if (binding.getArguments() != null) {
      for (int i=1; i < binding.getArguments().size(); i++) {
        newBinding.addArgument((IBaseExpression)binding.getArguments().get(i));
      }
    }
    newBinding.setExpression((IBaseExpression)binding.getArguments().get(0));
    newBinding.setAggrFunction(binding.getAggrFunction());
    newBinding.setDataType(binding.getDataType());
    newBinding.setDisplayName(binding.getDisplayName());
    newBinding.setFilter(binding.getFilter());
  }
 catch (  DataException e) {
  }
  return newBinding;
}

Fixed version (ground truth):
/** 
 * Before new aggregation extension point is introduced, The binding expression is serve as first argument of aggregation. This function is used to construct a old version binding. 
 * @param binding
 * @return
 */
private static IBinding constructNewBinding(IBinding binding){
  IBinding newBinding=null;
  try {
    newBinding=new Binding(binding.getBindingName());
    List aggregationOn=binding.getAggregatOns();
    if (aggregationOn != null) {
      for (int i=0; i < aggregationOn.size(); i++) {
        newBinding.addAggregateOn((String)aggregationOn.get(i));
      }
    }
    if (binding.getArguments() != null) {
      for (int i=1; i < binding.getArguments().size(); i++) {
        newBinding.addArgument((IBaseExpression)binding.getArguments().get(i));
      }
    }
    if (binding.getArguments().size() > 0) {
      newBinding.setExpression((IBaseExpression)binding.getArguments().get(0));
    }
    newBinding.setAggrFunction(binding.getAggrFunction());
    newBinding.setDataType(binding.getDataType());
    newBinding.setDisplayName(binding.getDisplayName());
    newBinding.setFilter(binding.getFilter());
  }
 catch (  DataException e) {
  }
  return newBinding;
}
Program: 72799
Project: 72799
Buggy source:
/** 
 * This method returns a list of ICubeAggrDefn instances which describes the aggregations that need to be calculated in cube query.
 * @param bindings
 * @return
 * @throws DataException 
 */
public static ICubeAggrDefn[] getAggrDefns(List bindings) throws DataException {
  if (bindings == null || bindings.size() == 0)   return new ICubeAggrDefn[0];
  List cubeAggrDefns=new ArrayList();
  for (Iterator it=bindings.iterator(); it.hasNext(); ) {
    IBinding binding=((IBinding)it.next());
    try {
      if (binding.getAggrFunction() != null || binding.getAggregatOns().size() != 0)       cubeAggrDefns.add(new CubeAggrDefn(binding.getBindingName(),getMeasure(((IScriptExpression)binding.getExpression()).getText()),convertToDimLevel(binding.getAggregatOns()),binding.getAggrFunction(),convertToDimLevelAttribute(binding.getArguments(),bindings),binding.getFilter()));
    }
 catch (    DataException ex) {
      throw new DataException(ResourceConstants.INVALID_AGGR_BINDING_EXPRESSION,ex,binding.getBindingName());
    }
  }
  ICubeAggrDefn[] result=new ICubeAggrDefn[cubeAggrDefns.size()];
  for (int i=0; i < result.length; i++) {
    result[i]=(ICubeAggrDefn)cubeAggrDefns.get(i);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * This method returns a list of ICubeAggrDefn instances which describes the aggregations that need to be calculated in cube query.
 * @param bindings
 * @return
 * @throws DataException 
 */
public static ICubeAggrDefn[] getAggrDefns(List bindings) throws DataException {
  if (bindings == null || bindings.size() == 0)   return new ICubeAggrDefn[0];
  List cubeAggrDefns=new ArrayList();
  for (Iterator it=bindings.iterator(); it.hasNext(); ) {
    IBinding binding=((IBinding)it.next());
    try {
      if (binding.getAggrFunction() != null || binding.getAggregatOns().size() != 0)       cubeAggrDefns.add(new CubeAggrDefn(binding.getBindingName(),getMeasure(binding.getExpression() == null ? null : ((IScriptExpression)binding.getExpression()).getText()),convertToDimLevel(binding.getAggregatOns()),binding.getAggrFunction(),convertToDimLevelAttribute(binding.getArguments(),bindings),binding.getFilter()));
    }
 catch (    DataException ex) {
      throw new DataException(ResourceConstants.INVALID_AGGR_BINDING_EXPRESSION,ex,binding.getBindingName());
    }
  }
  ICubeAggrDefn[] result=new ICubeAggrDefn[cubeAggrDefns.size()];
  for (int i=0; i < result.length; i++) {
    result[i]=(ICubeAggrDefn)cubeAggrDefns.get(i);
  }
  return result;
}
Program: 72802
Project: 72802
Buggy source:
/** 
 * Gets the color from a CSSValue converted string.
 * @param color CSSValue converted string.
 * @return java.awt.Color
 */
public static Color getColor(String color){
  if (color == null) {
    logger.log(Level.WARNING,"String_Node_Str");
    return null;
  }
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(color);
  if (m.find()) {
    String[] rgb=color.substring(m.start() + 4,m.end() - 1).split("String_Node_Str");
    if (rgb.length == 3) {
      int red=Integer.parseInt(rgb[0].trim());
      int green=Integer.parseInt(rgb[1].trim());
      int blue=Integer.parseInt(rgb[2].trim());
      try {
        return new Color(red,green,blue);
      }
 catch (      RuntimeException ex) {
        logger.log(Level.WARNING,"String_Node_Str");
        return null;
      }
    }
  }
  logger.log(Level.WARNING,"String_Node_Str");
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the color from a CSSValue converted string.
 * @param color CSSValue converted string.
 * @return java.awt.Color
 */
public static Color getColor(String color){
  if (color == null) {
    logger.log(Level.WARNING,"String_Node_Str");
    return null;
  }
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(color);
  if (m.find()) {
    String[] rgb=color.substring(m.start() + 4,m.end() - 1).split("String_Node_Str");
    if (rgb.length == 3) {
      try {
        int red=Integer.parseInt(rgb[0].trim());
        int green=Integer.parseInt(rgb[1].trim());
        int blue=Integer.parseInt(rgb[2].trim());
        return new Color(red,green,blue);
      }
 catch (      RuntimeException ex) {
        logger.log(Level.WARNING,"String_Node_Str");
        return null;
      }
    }
  }
  logger.log(Level.WARNING,"String_Node_Str");
  return null;
}
Program: 72803
Project: 72803
Buggy source:
/** 
 * create a PDF outline for tocNode, using the pol as the parent PDF outline.
 * @param tocNode		The tocNode whose kids need to build a PDF outline tree
 * @param pol			The parent PDF outline for these kids
 * @param bookmarks		All bookMarks created during rendering
 */
private void createTOC(TOCNode tocNode,PdfOutline pol,Set bookmarks){
  if (null == tocNode || null == tocNode.getChildren())   return;
  for (Iterator i=tocNode.getChildren().iterator(); i.hasNext(); ) {
    TOCNode node=(TOCNode)i.next();
    if (!bookmarks.contains(node.getBookmark()))     continue;
    PdfOutline outline=new PdfOutline(pol,PdfAction.gotoLocalPage(node.getBookmark(),false),node.getDisplayString());
    IScriptStyle style=node.getTOCStyle();
    if (style instanceof StyleInstance) {
      StyleInstance instance=(StyleInstance)style;
      CSSValue color=instance.getProperty(StyleConstants.STYLE_COLOR);
      if (color != null && !color.equals(CSSValueConstants.BLACK_VALUE)) {
        outline.setColor(PropertyUtil.getColor(color));
      }
      int styleValue=Font.NORMAL;
      CSSValue fontStyle=instance.getProperty(StyleConstants.STYLE_FONT_STYLE);
      if (CSSValueConstants.OBLIQUE_VALUE.equals(fontStyle) || CSSValueConstants.ITALIC_VALUE.equals(fontStyle)) {
        styleValue|=Font.ITALIC;
      }
      if (PropertyUtil.isBoldFont(instance.getProperty(StyleConstants.STYLE_FONT_WEIGHT))) {
        styleValue|=Font.BOLD;
      }
      outline.setStyle(styleValue);
    }
    createTOC(node,outline,bookmarks);
  }
}

Fixed version (ground truth):
/** 
 * create a PDF outline for tocNode, using the pol as the parent PDF outline.
 * @param tocNode		The tocNode whose kids need to build a PDF outline tree
 * @param pol			The parent PDF outline for these kids
 * @param bookmarks		All bookMarks created during rendering
 */
private void createTOC(TOCNode tocNode,PdfOutline pol,Set bookmarks){
  if (null == tocNode || null == tocNode.getChildren())   return;
  for (Iterator i=tocNode.getChildren().iterator(); i.hasNext(); ) {
    TOCNode node=(TOCNode)i.next();
    if (!bookmarks.contains(node.getBookmark()))     continue;
    PdfOutline outline=new PdfOutline(pol,PdfAction.gotoLocalPage(node.getBookmark(),false),node.getDisplayString());
    IScriptStyle style=node.getTOCStyle();
    String color=style.getColor();
    Color awtColor=PropertyUtil.getColor(color);
    if (awtColor != null) {
      outline.setColor(awtColor);
    }
    String fontStyle=style.getFontStyle();
    String fontWeight=style.getFontWeight();
    int styleValue=PropertyUtil.getFontStyle(fontStyle,fontWeight);
    outline.setStyle(styleValue);
    createTOC(node,outline,bookmarks);
  }
}
Program: 72804
Project: 72804
Buggy source:
public static Color getColor(CSSValue value){
  if (value != null && value instanceof RGBColorValue) {
    RGBColorValue color=(RGBColorValue)value;
    try {
      return new Color(color.getRed().getFloatValue(CSSPrimitiveValue.CSS_NUMBER) / 255.0f,color.getGreen().getFloatValue(CSSPrimitiveValue.CSS_NUMBER) / 255.0f,color.getBlue().getFloatValue(CSSPrimitiveValue.CSS_NUMBER) / 255.0f);
    }
 catch (    RuntimeException ex) {
      logger.log(Level.WARNING,"String_Node_Str",value);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the color from a CSSValue converted string.
 * @param color CSSValue converted string.
 * @return java.awt.Color
 */
public static Color getColor(String color){
  if (color == null) {
    logger.log(Level.WARNING,"String_Node_Str");
    return null;
  }
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(color);
  if (m.find()) {
    String[] rgb=color.substring(m.start() + 4,m.end() - 1).split("String_Node_Str");
    if (rgb.length == 3) {
      int red=Integer.parseInt(rgb[0].trim());
      int green=Integer.parseInt(rgb[1].trim());
      int blue=Integer.parseInt(rgb[2].trim());
      try {
        return new Color(red,green,blue);
      }
 catch (      RuntimeException ex) {
        logger.log(Level.WARNING,"String_Node_Str");
        return null;
      }
    }
  }
  logger.log(Level.WARNING,"String_Node_Str");
  return null;
}
Program: 72806
Project: 72806
Buggy source:
protected void showLayoutTargetFeedback(Request request){
  boolean isCrossTabElement=false;
  if (request instanceof ChangeBoundsRequest) {
    List editParts=((ChangeBoundsRequest)request).getEditParts();
    if (editParts.size() > 0) {
      isCrossTabElement=editParts.get(0) instanceof CrosstabCellEditPart;
    }
  }
  if (isCrossTabElement) {
    Object template=TemplateTransfer.getInstance().getTemplate();
    if (template instanceof Object[] && ((Object[])template).length > 0) {
      Object dragObject=((Object[])template)[0];
      if (!(dragObject instanceof DimensionHandle || dragObject instanceof LevelHandle || dragObject instanceof MeasureHandle)) {
        isCrossTabElement=true;
      }
    }
  }
  if (isCrossTabElement) {
    Transposer transposer=new Transposer();
    transposer.setEnabled(!isHorizontal());
    Rectangle r=transposer.t(getAbsoluteClientBounds((GraphicalEditPart)getHost()));
    Point p=transposer.t(getLocationFromRequest(request));
    boolean before=p.x <= r.x + (r.width / 2);
    Point p1=new Point(before ? r.x : r.x + r.width,r.y - 2);
    p1=transposer.t(p1);
    Point p2=new Point(before ? r.x : r.x + r.width,r.y + r.height + 7);
    p2=transposer.t(p2);
    setTargetFeedbackPoints(p1,p2);
  }
 else {
    super.showLayoutTargetFeedback(request);
  }
}

Fixed version (ground truth):
protected void showLayoutTargetFeedback(Request request){
  boolean isCrossTabElement=false;
  if (request instanceof ChangeBoundsRequest) {
    List editParts=((ChangeBoundsRequest)request).getEditParts();
    if (editParts.size() > 0) {
      isCrossTabElement=editParts.get(0) instanceof CrosstabCellEditPart;
    }
  }
  if (!isCrossTabElement) {
    Object template=TemplateTransfer.getInstance().getTemplate();
    if (template instanceof Object[] && ((Object[])template).length > 0) {
      Object dragObject=((Object[])template)[0];
      if (dragObject instanceof DimensionHandle || dragObject instanceof MeasureHandle || dragObject instanceof LevelHandle) {
        isCrossTabElement=true;
      }
    }
  }
  if (isCrossTabElement) {
    Transposer transposer=new Transposer();
    transposer.setEnabled(!isHorizontal());
    Rectangle r=transposer.t(getAbsoluteClientBounds((GraphicalEditPart)getHost()));
    Point p=transposer.t(getLocationFromRequest(request));
    boolean before=p.x <= r.x + (r.width / 2);
    Point p1=new Point(before ? r.x : r.x + r.width,r.y - 2);
    p1=transposer.t(p1);
    Point p2=new Point(before ? r.x : r.x + r.width,r.y + r.height + 7);
    p2=transposer.t(p2);
    setTargetFeedbackPoints(p1,p2);
  }
 else {
    super.showLayoutTargetFeedback(request);
  }
}