nus-yam/ex-repair huggingface dataset:
Program: 72202
Project: 72202
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 0xFFFFFF;
  }
  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);
  int color=handle.getPropertyHandle(StyleHandle.BACKGROUND_COLOR_PROP).getIntValue();
  if (obj == null) {
    return SWT.COLOR_LIST_BACKGROUND;
  }
  return color;
}
Program: 72203
Project: 72203
Buggy source:
/** 
 * Get session handle
 * @return Session handle
 */
public SessionHandle getSessionHandle(){
  if (sessionHandle == null) {
    sessionHandle=new DesignEngine(new DesignConfig()).newSessionHandle(ULocale.getDefault());
  }
  return sessionHandle;
}

Fixed version (ground truth):
/** 
 * Get session handle
 * @return Session handle
 */
public SessionHandle getSessionHandle(){
  if (sessionHandle == null) {
    sessionHandle=new DesignEngine(new DesignConfig()).newSessionHandle(ULocale.getDefault());
    try {
      if (!CorePlugin.isUseNormalTheme()) {
        sessionHandle.setDefaultValue(StyleHandle.COLOR_PROP,DEUtil.getRGBInt(CorePlugin.ReportForeground.getRGB()));
      }
    }
 catch (    PropertyValueException e) {
    }
  }
  return sessionHandle;
}
Program: 72204
Project: 72204
Buggy source:
protected IFigure createDragSourceFeedbackFigure(){
  Figure r=new Figure(){
    protected void paintFigure(    Graphics graphics){
      Rectangle rect=getBounds().getCopy();
      graphics.setXORMode(true);
      graphics.setForegroundColor(ColorConstants.white);
      graphics.setBackgroundColor(new Color(null,31,31,31));
      graphics.translate(getLocation());
      PointList outline=new PointList();
      outline.addPoint(0,0);
      outline.addPoint(rect.width,0);
      outline.addPoint(rect.width - 1,0);
      outline.addPoint(rect.width - 1,rect.height - 1);
      outline.addPoint(0,rect.height - 1);
      graphics.fillPolygon(outline);
      PointList innerLine=new PointList();
      innerLine.addPoint(rect.width - 0 - 1,0);
      innerLine.addPoint(rect.width - 0 - 1,0);
      innerLine.addPoint(rect.width - 1,0);
      innerLine.addPoint(rect.width - 0 - 1,0);
      innerLine.addPoint(0,0);
      innerLine.addPoint(0,rect.height - 1);
      innerLine.addPoint(rect.width - 1,rect.height - 1);
      innerLine.addPoint(rect.width - 1,0);
      graphics.drawPolygon(innerLine);
      graphics.drawLine(rect.width - 0 - 1,0,rect.width - 1,0);
      graphics.translate(getLocation().getNegated());
    }
  }
;
  r.setBounds(getInitialFeedbackBounds());
  addFeedback(r);
  return r;
}

Fixed version (ground truth):
protected IFigure createDragSourceFeedbackFigure(){
  Figure r=new Figure(){
    protected void paintFigure(    Graphics graphics){
      Rectangle rect=getBounds().getCopy();
      graphics.setXORMode(true);
      graphics.setForegroundColor(ColorConstants.white);
      graphics.setBackgroundColor(ColorManager.getColor(31,31,31));
      graphics.translate(getLocation());
      PointList outline=new PointList();
      outline.addPoint(0,0);
      outline.addPoint(rect.width,0);
      outline.addPoint(rect.width - 1,0);
      outline.addPoint(rect.width - 1,rect.height - 1);
      outline.addPoint(0,rect.height - 1);
      graphics.fillPolygon(outline);
      PointList innerLine=new PointList();
      innerLine.addPoint(rect.width - 0 - 1,0);
      innerLine.addPoint(rect.width - 0 - 1,0);
      innerLine.addPoint(rect.width - 1,0);
      innerLine.addPoint(rect.width - 0 - 1,0);
      innerLine.addPoint(0,0);
      innerLine.addPoint(0,rect.height - 1);
      innerLine.addPoint(rect.width - 1,rect.height - 1);
      innerLine.addPoint(rect.width - 1,0);
      graphics.drawPolygon(innerLine);
      graphics.drawLine(rect.width - 0 - 1,0,rect.width - 1,0);
      graphics.translate(getLocation().getNegated());
    }
  }
;
  r.setBounds(getInitialFeedbackBounds());
  addFeedback(r);
  return r;
}
Program: 72205
Project: 72205
Buggy source:
protected void paintFigure(Graphics graphics){
  Rectangle rect=getBounds().getCopy();
  graphics.setXORMode(true);
  graphics.setForegroundColor(ColorConstants.white);
  graphics.setBackgroundColor(new Color(null,31,31,31));
  graphics.translate(getLocation());
  PointList outline=new PointList();
  outline.addPoint(0,0);
  outline.addPoint(rect.width,0);
  outline.addPoint(rect.width - 1,0);
  outline.addPoint(rect.width - 1,rect.height - 1);
  outline.addPoint(0,rect.height - 1);
  graphics.fillPolygon(outline);
  PointList innerLine=new PointList();
  innerLine.addPoint(rect.width - 0 - 1,0);
  innerLine.addPoint(rect.width - 0 - 1,0);
  innerLine.addPoint(rect.width - 1,0);
  innerLine.addPoint(rect.width - 0 - 1,0);
  innerLine.addPoint(0,0);
  innerLine.addPoint(0,rect.height - 1);
  innerLine.addPoint(rect.width - 1,rect.height - 1);
  innerLine.addPoint(rect.width - 1,0);
  graphics.drawPolygon(innerLine);
  graphics.drawLine(rect.width - 0 - 1,0,rect.width - 1,0);
  graphics.translate(getLocation().getNegated());
}

Fixed version (ground truth):
protected void paintFigure(Graphics graphics){
  Rectangle rect=getBounds().getCopy();
  graphics.setXORMode(true);
  graphics.setForegroundColor(ColorConstants.white);
  graphics.setBackgroundColor(ColorManager.getColor(31,31,31));
  graphics.translate(getLocation());
  PointList outline=new PointList();
  outline.addPoint(0,0);
  outline.addPoint(rect.width,0);
  outline.addPoint(rect.width - 1,0);
  outline.addPoint(rect.width - 1,rect.height - 1);
  outline.addPoint(0,rect.height - 1);
  graphics.fillPolygon(outline);
  PointList innerLine=new PointList();
  innerLine.addPoint(rect.width - 0 - 1,0);
  innerLine.addPoint(rect.width - 0 - 1,0);
  innerLine.addPoint(rect.width - 1,0);
  innerLine.addPoint(rect.width - 0 - 1,0);
  innerLine.addPoint(0,0);
  innerLine.addPoint(0,rect.height - 1);
  innerLine.addPoint(rect.width - 1,rect.height - 1);
  innerLine.addPoint(rect.width - 1,0);
  graphics.drawPolygon(innerLine);
  graphics.drawLine(rect.width - 0 - 1,0,rect.width - 1,0);
  graphics.translate(getLocation().getNegated());
}
Program: 72206
Project: 72206
Buggy source:
protected EditPolicy createChildEditPolicy(EditPart child){
  return new ResizableEditPolicy(){
    protected IFigure createDragSourceFeedbackFigure(){
      Figure r=new Figure(){
        protected void paintFigure(        Graphics graphics){
          Rectangle rect=getBounds().getCopy();
          graphics.setXORMode(true);
          graphics.setForegroundColor(ColorConstants.white);
          graphics.setBackgroundColor(new Color(null,31,31,31));
          graphics.translate(getLocation());
          PointList outline=new PointList();
          outline.addPoint(0,0);
          outline.addPoint(rect.width,0);
          outline.addPoint(rect.width - 1,0);
          outline.addPoint(rect.width - 1,rect.height - 1);
          outline.addPoint(0,rect.height - 1);
          graphics.fillPolygon(outline);
          PointList innerLine=new PointList();
          innerLine.addPoint(rect.width - 0 - 1,0);
          innerLine.addPoint(rect.width - 0 - 1,0);
          innerLine.addPoint(rect.width - 1,0);
          innerLine.addPoint(rect.width - 0 - 1,0);
          innerLine.addPoint(0,0);
          innerLine.addPoint(0,rect.height - 1);
          innerLine.addPoint(rect.width - 1,rect.height - 1);
          innerLine.addPoint(rect.width - 1,0);
          graphics.drawPolygon(innerLine);
          graphics.drawLine(rect.width - 0 - 1,0,rect.width - 1,0);
          graphics.translate(getLocation().getNegated());
        }
      }
;
      r.setBounds(getInitialFeedbackBounds());
      addFeedback(r);
      return r;
    }
  }
;
}

Fixed version (ground truth):
protected EditPolicy createChildEditPolicy(EditPart child){
  return new ResizableEditPolicy(){
    protected IFigure createDragSourceFeedbackFigure(){
      Figure r=new Figure(){
        protected void paintFigure(        Graphics graphics){
          Rectangle rect=getBounds().getCopy();
          graphics.setXORMode(true);
          graphics.setForegroundColor(ColorConstants.white);
          graphics.setBackgroundColor(ColorManager.getColor(31,31,31));
          graphics.translate(getLocation());
          PointList outline=new PointList();
          outline.addPoint(0,0);
          outline.addPoint(rect.width,0);
          outline.addPoint(rect.width - 1,0);
          outline.addPoint(rect.width - 1,rect.height - 1);
          outline.addPoint(0,rect.height - 1);
          graphics.fillPolygon(outline);
          PointList innerLine=new PointList();
          innerLine.addPoint(rect.width - 0 - 1,0);
          innerLine.addPoint(rect.width - 0 - 1,0);
          innerLine.addPoint(rect.width - 1,0);
          innerLine.addPoint(rect.width - 0 - 1,0);
          innerLine.addPoint(0,0);
          innerLine.addPoint(0,rect.height - 1);
          innerLine.addPoint(rect.width - 1,rect.height - 1);
          innerLine.addPoint(rect.width - 1,0);
          graphics.drawPolygon(innerLine);
          graphics.drawLine(rect.width - 0 - 1,0,rect.width - 1,0);
          graphics.translate(getLocation().getNegated());
        }
      }
;
      r.setBounds(getInitialFeedbackBounds());
      addFeedback(r);
      return r;
    }
  }
;
}
Program: 72207
Project: 72207
Buggy source:
public void paintControl(PaintEvent e){
  GC gc=e.gc;
  Rectangle rect=sep.getBounds();
  gc.setForeground(ColorConstants.darkGray);
  gc.drawLine(0,0,rect.width,0);
}

Fixed version (ground truth):
public void paintControl(PaintEvent e){
  GC gc=e.gc;
  Rectangle rect=sep.getBounds();
  gc.setForeground(ReportColorConstants.DarkGrayForground);
  gc.drawLine(0,0,rect.width,0);
}
Program: 72209
Project: 72209
Buggy source:
public void handleEvent(Event event){
  TreeItem item=(TreeItem)event.item;
  if (event.item.getData() instanceof CssStyleSheetHandle || event.item.getData() instanceof CssSharedStyleHandle) {
    Color gray=Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
    if (!item.getForeground().equals(gray)) {
      item.setForeground(gray);
    }
  }
 else {
    Color black=Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
    if (!item.getForeground().equals(black)) {
      item.setForeground(black);
    }
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  TreeItem item=(TreeItem)event.item;
  if (event.item.getData() instanceof CssStyleSheetHandle || event.item.getData() instanceof CssSharedStyleHandle) {
    Color gray=Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
    if (!item.getForeground().equals(gray)) {
      item.setForeground(gray);
    }
  }
 else {
    Color black=ReportColorConstants.ReportForeground;
    if (!item.getForeground().equals(black)) {
      item.setForeground(black);
    }
  }
}
Program: 72212
Project: 72212
Buggy source:
protected void setToggleButtonEnabled(String buttonId,boolean isEnabled){
  String id=getNodePath() + buttonId;
  if (getContext().isEnabled(buttonId)) {
    getToggleButton(id).setEnabled(isEnabled);
  }
 else {
    getToggleButton(id).setEnabled(false);
  }
}

Fixed version (ground truth):
protected void setToggleButtonEnabled(String buttonId,boolean isEnabled){
  String id=getNodePath() + buttonId;
  if (getContext().isEnabled(id)) {
    getToggleButton(id).setEnabled(isEnabled);
  }
 else {
    getToggleButton(id).setEnabled(false);
  }
}
Program: 72213
Project: 72213
Buggy source:
protected DataSetDesign collectDataSetDesign(DataSetDesign design){
  if (getControl() == null || getControl().isDisposed() || m_sqbDialog == null)   return design;
  if (m_sqbDialog.isDirty()) {
    SQLQueryUtility.updateDataSetDesign(design,m_sqbDialog.getSQLQueryStatement(),getConnectionProfile(false,false));
    m_sqbDialog.setDirty(false);
  }
  return design;
}

Fixed version (ground truth):
protected DataSetDesign collectDataSetDesign(DataSetDesign design){
  if (getControl() == null || getControl().isDisposed() || m_sqbDialog == null)   return design;
  String name=this.getInitializationDesign().getName();
  if (m_sqbDialog.isDirty()) {
    SQLQueryUtility.updateDataSetDesign(design,m_sqbDialog.getSQLQueryStatement(),getConnectionProfile(false,false),name);
    m_sqbDialog.setDirty(false);
  }
  return design;
}
Program: 72214
Project: 72214
Buggy source:
static void updateDataSetDesign(DataSetDesign dataSetDesign,final QueryStatement queryStmt,IConnectionProfile connProfile){
  dataSetDesign.setQueryText(EMPTY_STRING);
  boolean wasProfileConnected=(connProfile.getConnectionState() == IConnectionProfile.CONNECTED_STATE);
  IConnection customConn=null;
  try {
    IDriver customDriver=new Driver();
    customConn=customDriver.getConnection(null);
    assert(customConn instanceof Connection);
    ((Connection)customConn).open(connProfile);
    updateQueryMetaData(dataSetDesign,customConn,queryStmt);
  }
 catch (  OdaException e) {
    e.printStackTrace();
    String queryText=dataSetDesign.getQueryText();
    if (queryText == null || queryText.length() == 0)     updateQueryText(dataSetDesign,queryStmt);
    dataSetDesign.setResultSets(null);
    dataSetDesign.setParameters(null);
  }
 finally {
    if (!wasProfileConnected)     closeConnection(customConn);
  }
}

Fixed version (ground truth):
static void updateDataSetDesign(DataSetDesign dataSetDesign,final QueryStatement queryStmt,IConnectionProfile connProfile,String dataSetName){
  if (dataSetName != null)   dataSetDesign.setName(dataSetName);
  dataSetDesign.setQueryText(EMPTY_STRING);
  boolean wasProfileConnected=(connProfile.getConnectionState() == IConnectionProfile.CONNECTED_STATE);
  IConnection customConn=null;
  try {
    IDriver customDriver=new Driver();
    customConn=customDriver.getConnection(null);
    assert(customConn instanceof Connection);
    ((Connection)customConn).open(connProfile);
    updateQueryMetaData(dataSetDesign,customConn,queryStmt);
  }
 catch (  OdaException e) {
    e.printStackTrace();
    String queryText=dataSetDesign.getQueryText();
    if (queryText == null || queryText.length() == 0)     updateQueryText(dataSetDesign,queryStmt);
    dataSetDesign.setResultSets(null);
    dataSetDesign.setParameters(null);
  }
 finally {
    if (!wasProfileConnected)     closeConnection(customConn);
  }
}
Program: 72215
Project: 72215
Buggy source:
/** 
 * @param queryDefn
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSourceDataSet(IQueryDefinition queryDefn,boolean keepDataSetFilter,boolean allowAggregation) throws AdapterException, BirtException {
  String dataSetName=queryDefn.getDataSetName();
  ModuleHandle module=sessionContext.getModuleHandle();
  if (module != null) {
    List l=module.getAllDataSets();
    DataSetHandle handle=null;
    for (int i=0; i < l.size(); i++) {
      if (((DataSetHandle)l.get(i)).getQualifiedName() != null && ((DataSetHandle)l.get(i)).getQualifiedName().equals(dataSetName)) {
        handle=(DataSetHandle)l.get(i);
      }
    }
    major=handle;
    defineDataSet(handle,keepDataSetFilter,allowAggregation);
  }
}

Fixed version (ground truth):
/** 
 * @param queryDefn
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSourceDataSet(IQueryDefinition queryDefn,boolean keepDataSetFilter,boolean allowAggregation) throws AdapterException, BirtException {
  String dataSetName=queryDefn.getDataSetName();
  ModuleHandle module=sessionContext.getModuleHandle();
  if (module != null) {
    List l=module.getAllDataSets();
    DataSetHandle handle=null;
    for (int i=0; i < l.size(); i++) {
      if (((DataSetHandle)l.get(i)).getQualifiedName() != null && ((DataSetHandle)l.get(i)).getQualifiedName().equals(dataSetName)) {
        handle=(DataSetHandle)l.get(i);
        break;
      }
    }
    major=handle;
    defineDataSet(handle,keepDataSetFilter,allowAggregation);
  }
}
Program: 72217
Project: 72217
Buggy source:
public void dataEngineShutdown(){
  Map<ConnectionProp,Set<CacheConnection>> odaConnectionsMap=DataSource.dataEngineLevelConnectionPool.get(this.session);
  if (odaConnectionsMap == null)   return;
  ConnectionProp connProp=new ConnectionProp(DataSource.this.driverName,DataSource.this.connectionProps,DataSource.this.appContext);
  Set<CacheConnection> odaConnections=odaConnectionsMap.get(connProp);
  if (odaConnections == null)   return;
  for (  CacheConnection conn : odaConnections) {
    try {
      conn.odaConn.close();
    }
 catch (    DataException e) {
      e.printStackTrace();
    }
  }
  DataSource.dataEngineLevelConnectionPool.remove(this.session);
}

Fixed version (ground truth):
public void dataEngineShutdown(){
  Map<ConnectionProp,Set<CacheConnection>> odaConnectionsMap=DataSource.dataEngineLevelConnectionPool.remove(this.session);
  if (odaConnectionsMap == null)   return;
  ConnectionProp connProp=new ConnectionProp(DataSource.this.driverName,DataSource.this.connectionProps,DataSource.this.appContext);
  Set<CacheConnection> odaConnections=odaConnectionsMap.get(connProp);
  if (odaConnections == null)   return;
  for (  CacheConnection conn : odaConnections) {
    try {
      conn.odaConn.close();
    }
 catch (    DataException e) {
      e.printStackTrace();
    }
  }
}
Program: 72218
Project: 72218
Buggy source:
protected Control createDialogArea(Composite parent){
  ChartUIUtil.bindHelp(parent,ChartHelpContextIds.DIALOG_DATA_SET_FILTER);
  getShell().setText(Messages.getString("String_Node_Str"));
  Composite composite=(Composite)super.createDialogArea(parent);
  GridLayout gl=new GridLayout();
  composite.setLayout(gl);
  FormPage filterFormPage=new FormPage(composite,FormPage.FULL_FUNCTION,fFilterHandleProvider,true);
  filterFormPage.setLayoutData(new GridData(GridData.FILL_BOTH));
  List handleList=new ArrayList();
  handleList.add(fReportItemHandle);
  filterFormPage.setInput(handleList);
  return composite;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  ChartUIUtil.bindHelp(parent,ChartHelpContextIds.DIALOG_DATA_SET_FILTER);
  getShell().setText(Messages.getString("String_Node_Str"));
  Composite composite=(Composite)super.createDialogArea(parent);
  FormPage filterFormPage=new FormPage(composite,FormPage.FULL_FUNCTION,fFilterHandleProvider,true);
  filterFormPage.setLayoutData(new GridData(GridData.FILL_BOTH));
  List handleList=new ArrayList();
  handleList.add(fReportItemHandle);
  filterFormPage.setInput(handleList);
  return composite;
}
Program: 72220
Project: 72220
Buggy source:
/** 
 * @param paramBindingIt
 * @return
 */
private List convertParamterBindings(Iterator paramBindingIt){
  if (paramBindingIt == null)   return null;
  List parameterBindings=new ArrayList();
  while (paramBindingIt.hasNext()) {
    ParamBindingHandle paramBinding=(ParamBindingHandle)paramBindingIt.next();
    if (paramBinding.getExpression() != null) {
      ScriptExpression paramValueExpr=new ScriptExpression(paramBinding.getExpression());
      InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getParamName(),paramValueExpr);
      parameterBindings.add(inputParamBinding);
    }
  }
  return parameterBindings;
}

Fixed version (ground truth):
/** 
 * @param paramBindingIt
 * @return
 */
private List convertParamterBindings(Iterator paramBindingIt){
  if (paramBindingIt == null)   return null;
  List parameterBindings=new ArrayList();
  while (paramBindingIt.hasNext()) {
    Object paramObj=paramBindingIt.next();
    if (paramObj instanceof ParamBindingHandle) {
      ParamBindingHandle paramBinding=(ParamBindingHandle)paramObj;
      if (paramBinding.getExpression() != null) {
        ScriptExpression paramValueExpr=new ScriptExpression(paramBinding.getExpression());
        InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getParamName(),paramValueExpr);
        parameterBindings.add(inputParamBinding);
      }
    }
 else     if (paramObj instanceof OdaDataSetParameterHandle) {
      OdaDataSetParameterHandle paramBinding=(OdaDataSetParameterHandle)paramObj;
      if (paramBinding.getDefaultValue() != null) {
        ScriptExpression paramValueExpr=new ScriptExpression(paramBinding.getDefaultValue());
        InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getName(),paramValueExpr);
        parameterBindings.add(inputParamBinding);
      }
    }
  }
  return parameterBindings;
}
Program: 72221
Project: 72221
Buggy source:
/** 
 * Deletes existed problem markers and adds new markers
 * @throws CoreException
 */
protected void refreshMarkers(IEditorInput input) throws CoreException {
  IResource file=getFile(input);
  if (file != null) {
    file.deleteMarkers(IMarker.PROBLEM,true,IResource.DEPTH_INFINITE);
    ModuleHandle reportDesignHandle=getModel();
    if (reportDesignHandle == null) {
      return;
    }
    reportDesignHandle.checkReport();
    List list=reportDesignHandle.getErrorList();
    int errorListSize=list.size();
    list.addAll(reportDesignHandle.getWarningList());
    for (int i=0, m=list.size(); i < m; i++) {
      ErrorDetail errorDetail=(ErrorDetail)list.get(i);
      IMarker marker=file.createMarker(IMarker.PROBLEM);
      Map<String,Object> attrib=new HashMap<String,Object>();
      if (i < errorListSize) {
        attrib.put(IMarker.SEVERITY,IMarker.SEVERITY_ERROR);
      }
 else {
        attrib.put(IMarker.SEVERITY,IMarker.SEVERITY_WARNING);
      }
      attrib.put(IMarker.MESSAGE,errorDetail.getMessage());
      attrib.put(IMarker.LINE_NUMBER,errorDetail.getLineNo());
      attrib.put(IMarker.LOCATION,errorDetail.getTagName());
      if (errorDetail.getElement() != null && errorDetail.getElement().getID() != 0) {
        attrib.put(ELEMENT_ID,new Integer((int)errorDetail.getElement().getID()));
      }
      marker.setAttributes(attrib);
    }
  }
}

Fixed version (ground truth):
/** 
 * Deletes existed problem markers and adds new markers
 * @throws CoreException
 */
public void refreshMarkers(IEditorInput input) throws CoreException {
  IResource file=getFile(input);
  if (file != null) {
    file.deleteMarkers(IMarker.PROBLEM,true,IResource.DEPTH_INFINITE);
    ModuleHandle reportDesignHandle=getModel();
    if (reportDesignHandle == null) {
      return;
    }
    reportDesignHandle.checkReport();
    List list=reportDesignHandle.getErrorList();
    int errorListSize=list.size();
    list.addAll(reportDesignHandle.getWarningList());
    for (int i=0, m=list.size(); i < m; i++) {
      ErrorDetail errorDetail=(ErrorDetail)list.get(i);
      IMarker marker=file.createMarker(IMarker.PROBLEM);
      Map<String,Object> attrib=new HashMap<String,Object>();
      if (i < errorListSize) {
        attrib.put(IMarker.SEVERITY,IMarker.SEVERITY_ERROR);
      }
 else {
        attrib.put(IMarker.SEVERITY,IMarker.SEVERITY_WARNING);
      }
      attrib.put(IMarker.MESSAGE,errorDetail.getMessage());
      attrib.put(IMarker.LINE_NUMBER,errorDetail.getLineNo());
      attrib.put(IMarker.LOCATION,errorDetail.getTagName());
      if (errorDetail.getElement() != null && errorDetail.getElement().getID() != 0) {
        attrib.put(ELEMENT_ID,new Integer((int)errorDetail.getElement().getID()));
      }
      marker.setAttributes(attrib);
    }
  }
}
Program: 72222
Project: 72222
Buggy source:
public void testAddSecond() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2005,10,22);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(2006,10,5);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1795,10,15,10,10,9);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}

Fixed version (ground truth):
public void testAddSecond() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2005,10,22);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(2006,10,5);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1995,10,15,10,10,9);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}
Program: 72223
Project: 72223
Buggy source:
public void testAddWeek() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2005,10,22);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(2006,10,5);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1795,10,29);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}

Fixed version (ground truth):
public void testAddWeek() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2005,10,22);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(2006,10,5);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1995,10,29);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}
Program: 72224
Project: 72224
Buggy source:
public void testAddHour() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2005,10,22);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(2006,10,5);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1795,10,15,10,0,0);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1970,0,22,0,0,0);
  c.clear();
  Date[] values=new Date[]{d1,d2,d3,null};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}

Fixed version (ground truth):
public void testAddHour() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2005,10,22);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(2006,10,5);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1995,10,15,10,0,0);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1970,0,22,0,0,0);
  c.clear();
  Date[] values=new Date[]{d1,d2,d3,null};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}
Program: 72225
Project: 72225
Buggy source:
public void testAddDay() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2005,10,22);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(2006,10,5);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1795,10,25);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}

Fixed version (ground truth):
public void testAddDay() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2005,10,22);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(2006,10,5);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1995,10,25);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}
Program: 72226
Project: 72226
Buggy source:
public void testAddMonth() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2006,8,15);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1795,10,15);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1901,0,15);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}

Fixed version (ground truth):
public void testAddMonth() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2006,8,15);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1995,10,15);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1941,0,15);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}
Program: 72227
Project: 72227
Buggy source:
public void testAddMinute() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2005,10,22);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(2006,10,5);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1795,10,15,10,10,0);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}

Fixed version (ground truth):
public void testAddMinute() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2005,10,22);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(2006,10,5);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1995,10,15,10,10,0);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}
Program: 72228
Project: 72228
Buggy source:
public void testAddQuarter() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2006,4,15);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1797,3,15);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1903,2,15);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}

Fixed version (ground truth):
public void testAddQuarter() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2006,4,15);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1997,3,15);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1933,2,15);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}
Program: 72229
Project: 72229
Buggy source:
protected void collectResponseState(){
  if (getControl() == null || getControl().isDisposed() || m_sqbDialog == null)   return;
  super.collectResponseState();
  SQLBuilderDesignState sqbState=m_sqbDialog.saveSQBState(getDataSetDesignName());
  if (sqbState == null)   return;
  String sqbStateContent=sqbState.toString();
  if (sqbStateContent.length() == 0)   return;
  DesignerState designerState=DesignFactory.eINSTANCE.createDesignerState();
  designerState.setNewStateContentAsString(sqbStateContent);
  designerState.setVersion(sqbState.getVersion());
  setResponseDesignerState(designerState);
}

Fixed version (ground truth):
protected void collectResponseState(){
  if (getControl() == null || getControl().isDisposed() || m_sqbDialog == null) {
    setResponseDesignerState(getInitializationDesignerState());
    return;
  }
  super.collectResponseState();
  SQLBuilderDesignState sqbState=m_sqbDialog.saveSQBState(getDataSetDesignName());
  if (sqbState == null)   return;
  String sqbStateContent=sqbState.toString();
  if (sqbStateContent.length() == 0)   return;
  DesignerState designerState=DesignFactory.eINSTANCE.createDesignerState();
  designerState.setNewStateContentAsString(sqbStateContent);
  designerState.setVersion(sqbState.getVersion());
  setResponseDesignerState(designerState);
}
Program: 72230
Project: 72230
Buggy source:
public void addArgument(IBaseExpression expr) throws DataException ;

Fixed version (ground truth):
public void addArgument(String name,IBaseExpression expr) throws DataException ;
Program: 72231
Project: 72231
Buggy source:
/** 
 * populate the extended extensions information.
 * @param name
 * @param aggrFunc
 * @param elem
 * @param aggrWrapper 
 */
private void populateExtendedAggrInfo(String name,IAggregation aggrFunc,IConfigurationElement elem,AggrFunctionWrapper aggrWrapper){
  IConfigurationElement[] uiInfo=elem.getChildren(ELEMENT_UIINFO);
  assert(uiInfo != null && uiInfo.length == 1);
  String paramInfo=uiInfo[0].getAttribute(ATTRIBUTE_PARAMETER_META_INFO);
  String textInfo=uiInfo[0].getAttribute(ATTRIBUTE_TEXT_DATA);
  aggrWrapper.setDisplayName(textInfo);
  List paramList=new ArrayList();
  String[] paramInfos=paramInfo.split("String_Node_Str");
  boolean[] paramFlags=aggrFunc.getParameterDefn();
  if (paramInfos != null && paramInfos.length > 0) {
    populateDataFiledParameterDefn(paramList);
    for (int k=0; k < paramInfos.length; k++) {
      final String s=paramInfos[k].trim();
      int index=s.indexOf(' ');
      String paramName=null;
      if (index > 0) {
        paramName=s.substring(index + 1).trim();
      }
 else {
        paramName=paramInfos[k];
      }
      if (k + 1 >= paramFlags.length) {
        break;
      }
      ParameterDefn paramDefn=new ParameterDefn(paramName,paramName,!paramFlags[k + 1],false);
      paramList.add(paramDefn);
    }
  }
  IParameterDefn[] params=new IParameterDefn[paramList.size()];
  paramList.toArray(params);
  aggrWrapper.setParameterDefn(params);
}

Fixed version (ground truth):
/** 
 * populate the extended extensions information.
 * @param name
 * @param aggrFunc
 * @param elem
 * @param aggrWrapper 
 */
private void populateExtendedAggrInfo(String name,IAggregation aggrFunc,IConfigurationElement elem,AggrFunctionWrapper aggrWrapper){
  IConfigurationElement[] uiInfo=elem.getChildren(ELEMENT_UIINFO);
  assert(uiInfo != null && uiInfo.length == 1);
  String paramInfo=uiInfo[0].getAttribute(ATTRIBUTE_PARAMETER_META_INFO);
  String textInfo=uiInfo[0].getAttribute(ATTRIBUTE_TEXT_DATA);
  aggrWrapper.setDisplayName(textInfo);
  List paramList=new ArrayList();
  String[] paramInfos=paramInfo.split("String_Node_Str");
  boolean[] paramFlags=aggrFunc.getParameterDefn();
  if (paramInfos != null && paramInfos.length > 0) {
    for (int k=0; k < paramInfos.length; k++) {
      final String s=paramInfos[k].trim();
      int index=s.indexOf(' ');
      String paramName=null;
      if (index > 0) {
        paramName=s.substring(index + 1).trim();
      }
 else {
        paramName=paramInfos[k];
      }
      ParameterDefn paramDefn=new ParameterDefn(paramName,paramName,!paramFlags[k],true);
      paramList.add(paramDefn);
    }
  }
  IParameterDefn[] params=new IParameterDefn[paramList.size()];
  paramList.toArray(params);
  aggrWrapper.setParameterDefn(params);
}
Program: 72232
Project: 72232
Buggy source:
public Binding(String name,IBaseExpression expr){
  if (name == null || name.trim().equals("String_Node_Str")) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.name=name;
  this.expr=expr;
  this.aggregateOn=new ArrayList();
  this.argument=new ArrayList();
  if (expr != null)   this.dataType=expr.getDataType();
 else   this.dataType=DataType.ANY_TYPE;
}

Fixed version (ground truth):
public Binding(String name,IBaseExpression expr){
  this.name=name;
  this.expr=expr;
  this.aggregateOn=new ArrayList();
  this.argument=new LinkedHashMap();
  this.orderedArgument=new ArrayList();
  if (expr != null)   this.dataType=expr.getDataType();
 else   this.dataType=DataType.ANY_TYPE;
  this.exportable=true;
}
Program: 72233
Project: 72233
Buggy source:
public void addArgument(IBaseExpression expr){
  this.argument.add(expr);
}

Fixed version (ground truth):
public void addArgument(String name,IBaseExpression expr){
  this.argument.put(name,expr);
}
Program: 72234
Project: 72234
Buggy source:
public List getArguments(){
  return this.argument;
}

Fixed version (ground truth):
public List getArguments() throws DataException {
  if (this.aggrFunc == null)   return this.orderedArgument;
  if (this.orderedArgument.size() > 0)   return this.orderedArgument;
  IAggrFunction info=AggregationManager.getInstance().getAggregation(this.aggrFunc);
  if (info == null)   return this.orderedArgument;
  IParameterDefn[] parameters=info.getParameterDefn();
  if (parameters != null) {
    for (int i=0; i < parameters.length; i++) {
      IParameterDefn pInfo=parameters[i];
      if (this.argument.get(pInfo.getName()) != null) {
        orderedArgument.add(this.argument.get(pInfo.getName()));
      }
    }
  }
  return orderedArgument;
}
Program: 72235
Project: 72235
Buggy source:
protected void addColumBinding(IBaseQueryDefinition transfer,ComputedColumnHandle columnBinding) throws BirtException {
  String name=columnBinding.getName();
  String expr=columnBinding.getExpression();
  String type=columnBinding.getDataType();
  String displayName=columnBinding.getDisplayName();
  String aggregateOn=columnBinding.getAggregateOn();
  int dbType=ModelDteApiAdapter.toDteDataType(type);
  IBaseExpression dbExpr=null;
  if (expr != null) {
    dbExpr=new ScriptExpression(expr,dbType);
    if (aggregateOn != null) {
      dbExpr.setGroupName(aggregateOn);
    }
  }
  IBinding binding=new Binding(name,dbExpr);
  binding.setDisplayName(displayName);
  if (aggregateOn != null) {
    binding.addAggregateOn(aggregateOn);
  }
  if (columnBinding.getAggregateFunction() != null) {
    binding.setAggrFunction(DataAdapterUtil.adaptModelAggregationType(columnBinding.getAggregateFunction()));
  }
  String filter=columnBinding.getFilterExpression();
  if (filter != null) {
    binding.setFilter(new ScriptExpression(filter));
  }
  Iterator arguments=columnBinding.argumentsIterator();
  if (arguments != null) {
    while (arguments.hasNext()) {
      AggregationArgumentHandle argumentHandle=(AggregationArgumentHandle)arguments.next();
      String argument=argumentHandle.getValue();
      if (argument != null) {
        binding.addArgument(new ScriptExpression(argument));
      }
    }
  }
  transfer.addBinding(binding);
}

Fixed version (ground truth):
protected void addColumBinding(IBaseQueryDefinition transfer,ComputedColumnHandle columnBinding) throws BirtException {
  String name=columnBinding.getName();
  String expr=columnBinding.getExpression();
  String type=columnBinding.getDataType();
  String displayName=columnBinding.getDisplayName();
  String aggregateOn=columnBinding.getAggregateOn();
  int dbType=ModelDteApiAdapter.toDteDataType(type);
  IBaseExpression dbExpr=null;
  if (expr != null) {
    dbExpr=new ScriptExpression(expr,dbType);
    if (aggregateOn != null) {
      dbExpr.setGroupName(aggregateOn);
    }
  }
  IBinding binding=new Binding(name,dbExpr);
  binding.setDisplayName(displayName);
  if (aggregateOn != null) {
    binding.addAggregateOn(aggregateOn);
  }
  if (columnBinding.getAggregateFunction() != null) {
    binding.setAggrFunction(DataAdapterUtil.adaptModelAggregationType(columnBinding.getAggregateFunction()));
  }
  String filter=columnBinding.getFilterExpression();
  if (filter != null) {
    binding.setFilter(new ScriptExpression(filter));
  }
  Iterator arguments=columnBinding.argumentsIterator();
  if (arguments != null) {
    while (arguments.hasNext()) {
      AggregationArgumentHandle argumentHandle=(AggregationArgumentHandle)arguments.next();
      String argument=argumentHandle.getValue();
      if (argument != null) {
        binding.addArgument(argumentHandle.getName(),new ScriptExpression(argument));
      }
    }
  }
  transfer.addBinding(binding);
}
Program: 72236
Project: 72236
Buggy source:
/** 
 * Gets the support list of the given property handle. Note: this method returns all supported elements including invisible ones from UI. To get supported UI element list, check  {@link UIUtil#getUIElementSupportList()}
 * @param propertyHandle
 * @return
 */
public static List<IElementDefn> getElementSupportList(PropertyHandle propertyHandle){
  List<IElementDefn> list=new ArrayList<IElementDefn>();
  IPropertyDefn propertyDefn=propertyHandle.getPropertyDefn();
  if (propertyDefn != null) {
    list.addAll(propertyDefn.getAllowedElements(true));
    list.removeAll(notSupportList);
  }
  List<IElementDefn> availableList=new ArrayList<IElementDefn>();
  for (Iterator<IElementDefn> iterator=list.iterator(); iterator.hasNext(); ) {
    IElementDefn type=iterator.next();
    if (propertyHandle.canContain(type.getName())) {
      availableList.add(type);
    }
  }
  return availableList;
}

Fixed version (ground truth):
/** 
 * Gets the support list of the given property handle. Note: this method returns all supported elements including invisible ones from UI. To get supported UI element list, check   {@link UIUtil#getUIElementSupportList()}
 * @param propertyHandle
 * @return
 */
public static List<IElementDefn> getElementSupportList(PropertyHandle propertyHandle){
  List<IElementDefn> list=new ArrayList<IElementDefn>();
  IPropertyDefn propertyDefn=propertyHandle.getPropertyDefn();
  if (propertyDefn != null) {
    list.addAll(propertyDefn.getAllowedElements(true));
    list.removeAll(notSupportList);
  }
  List<IElementDefn> availableList=new ArrayList<IElementDefn>();
  for (Iterator<IElementDefn> iterator=list.iterator(); iterator.hasNext(); ) {
    IElementDefn type=iterator.next();
    if (propertyHandle.canContain(type.getName())) {
      availableList.add(type);
    }
  }
  return availableList;
}
Program: 72237
Project: 72237
Buggy source:
/** 
 * Converts an Integer value to an RGB object value, the Integer format is 0xRRGGBB.
 * @param rgbValue Integer value.
 * @return RGB value.
 */
public static RGB getRGBValue(int rgbValue){
  if (rgbValue == -1) {
    return null;
  }
  return new RGB((rgbValue >> 16) & 0xff,(rgbValue >> 8) & 0xff,rgbValue & 0xff);
}

Fixed version (ground truth):
/** 
 * Converts an Integer value to an RGB object value, the Integer format is xRRGGBB.
 * @param rgbValue Integer value.
 * @return RGB value.
 */
public static RGB getRGBValue(int rgbValue){
  if (rgbValue == -1) {
    return null;
  }
  return new RGB((rgbValue >> 16) & 0xff,(rgbValue >> 8) & 0xff,rgbValue & 0xff);
}
Program: 72238
Project: 72238
Buggy source:
/** 
 * Converts an RGB object value to an Integer value, the Integer format is 0xRRGGBB.
 * @param rgb RGB value.
 * @return Integer value.
 */
public static int getRGBInt(RGB rgb){
  if (rgb == null) {
    return -1;
  }
  return ((rgb.red & 0xff) << 16) | ((rgb.green & 0xff) << 8) | (rgb.blue & 0xff);
}

Fixed version (ground truth):
/** 
 * Converts an RGB object value to an Integer value, the Integer format is xRRGGBB.
 * @param rgb RGB value.
 * @return Integer value.
 */
public static int getRGBInt(RGB rgb){
  if (rgb == null) {
    return -1;
  }
  return ((rgb.red & 0xff) << 16) | ((rgb.green & 0xff) << 8) | (rgb.blue & 0xff);
}
Program: 72239
Project: 72239
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
  ReportPlugin.getDefault().addIgnoreViewID(LibraryExplorerView.ID);
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  super.start(context);
  ReportPlugin.getDefault().addIgnoreViewID(LibraryExplorerView.ID);
  Hashtable<String,Object> dict=new Hashtable<String,Object>();
  dict.put(Constants.SERVICE_RANKING,new Integer(3));
  syncService=context.registerService(IReportResourceSynchronizer.class.getName(),new IDEResourceSynchronizer(),dict);
}
Program: 72240
Project: 72240
Buggy source:
/** 
 * Deletes existed problem markers and adds new markers
 * @throws CoreException
 */
protected void refreshMarkers(IEditorInput input) throws CoreException {
  IResource file=getFile(input);
  if (file != null) {
    file.deleteMarkers(IMarker.PROBLEM,true,IResource.DEPTH_INFINITE);
    ModuleHandle reportDesignHandle=getModel();
    if (reportDesignHandle == null) {
      return;
    }
    reportDesignHandle.checkReport();
    List list=reportDesignHandle.getErrorList();
    int errorListSize=list.size();
    list.addAll(reportDesignHandle.getWarningList());
    for (int i=0, m=list.size(); i < m; i++) {
      ErrorDetail errorDetail=(ErrorDetail)list.get(i);
      IMarker marker=file.createMarker(IMarker.PROBLEM);
      if (i < errorListSize)       marker.setAttribute(IMarker.SEVERITY,IMarker.SEVERITY_ERROR);
 else       marker.setAttribute(IMarker.SEVERITY,IMarker.SEVERITY_WARNING);
      marker.setAttribute(IMarker.MESSAGE,errorDetail.getMessage());
      marker.setAttribute(IMarker.LINE_NUMBER,errorDetail.getLineNo());
      marker.setAttribute(IMarker.LOCATION,errorDetail.getTagName());
      if (errorDetail.getElement() != null && errorDetail.getElement().getID() != 0) {
        marker.setAttribute(ELEMENT_ID,new Integer((int)errorDetail.getElement().getID()));
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Deletes existed problem markers and adds new markers
 * @throws CoreException
 */
protected void refreshMarkers(IEditorInput input) throws CoreException {
  IResource file=getFile(input);
  if (file != null) {
    file.deleteMarkers(IMarker.PROBLEM,true,IResource.DEPTH_INFINITE);
    ModuleHandle reportDesignHandle=getModel();
    if (reportDesignHandle == null) {
      return;
    }
    reportDesignHandle.checkReport();
    List list=reportDesignHandle.getErrorList();
    int errorListSize=list.size();
    list.addAll(reportDesignHandle.getWarningList());
    for (int i=0, m=list.size(); i < m; i++) {
      ErrorDetail errorDetail=(ErrorDetail)list.get(i);
      IMarker marker=file.createMarker(IMarker.PROBLEM);
      Map<String,Object> attrib=new HashMap<String,Object>();
      if (i < errorListSize) {
        attrib.put(IMarker.SEVERITY,IMarker.SEVERITY_ERROR);
      }
 else {
        attrib.put(IMarker.SEVERITY,IMarker.SEVERITY_WARNING);
      }
      attrib.put(IMarker.MESSAGE,errorDetail.getMessage());
      attrib.put(IMarker.LINE_NUMBER,errorDetail.getLineNo());
      attrib.put(IMarker.LOCATION,errorDetail.getTagName());
      if (errorDetail.getElement() != null && errorDetail.getElement().getID() != 0) {
        attrib.put(ELEMENT_ID,new Integer((int)errorDetail.getElement().getID()));
      }
      marker.setAttributes(attrib);
    }
  }
}