nus-yam/ex-repair huggingface dataset:
Program: 77979
Project: 77979
Buggy source:
/** 
 * Returns the localized content for the text. If the localized text for the text resource key is found, it will be returned. Otherwise, the static text will be returned.
 * @return the localized content for the text.
 */
public String getDisplayContent(){
  String textKey=getStringProperty(TextItem.CONTENT_RESOURCE_KEY_PROP);
  ;
  if (!StringUtil.isBlank(textKey)) {
    String localizedText=getModule().getMessage(textKey);
    if (!StringUtil.isBlank(localizedText))     return localizedText;
  }
  return getStringProperty(TextItem.CONTENT_PROP);
}

Fixed version (ground truth):
/** 
 * Returns the localized content for the text. If the localized text for the text resource key is found, it will be returned. Otherwise, the static text will be returned.
 * @return the localized content for the text.
 */
public String getDisplayContent(){
  return super.getExternalizedValue(TextItem.CONTENT_RESOURCE_KEY_PROP,TextItem.CONTENT_PROP);
}
Program: 77980
Project: 77980
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  previouPage=prePage;
  ISelection selection=new StructuredSelection(SessionHandleAdapter.getInstance().getMediator().getCurrentState().getSelectionObject());
  jsEditor.handleSelectionChanged(selection);
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  previouPage=prePage;
  IMediatorState state=SessionHandleAdapter.getInstance().getMediator().getCurrentState();
  ReportRequest request=new ReportRequest(state.getSource());
  List list=state.getSelectionObject();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  return true;
}
Program: 77981
Project: 77981
Buggy source:
protected void pageChange(int newPageIndex){
  int oldPageIndex=getCurrentPage();
  if (oldPageIndex == newPageIndex) {
    return;
  }
  if (oldPageIndex != -1) {
    Object oldPage=pages.get(oldPageIndex);
    Object newPage=pages.get(newPageIndex);
    super.pageChange(newPageIndex);
    if (!prePageChanges(oldPage,newPage)) {
      super.setActivePage(oldPageIndex);
      updateRelatedViews();
      return;
    }
  }
 else {
    super.pageChange(newPageIndex);
  }
  updateRelatedViews();
  bingdingKey(newPageIndex);
}

Fixed version (ground truth):
protected void pageChange(int newPageIndex){
  int oldPageIndex=getCurrentPage();
  if (oldPageIndex == newPageIndex) {
    return;
  }
  if (oldPageIndex != -1) {
    Object oldPage=pages.get(oldPageIndex);
    Object newPage=pages.get(newPageIndex);
    super.pageChange(newPageIndex);
    updateRelatedViews();
    if (!prePageChanges(oldPage,newPage)) {
      super.setActivePage(oldPageIndex);
      updateRelatedViews();
      return;
    }
  }
 else {
    super.pageChange(newPageIndex);
    updateRelatedViews();
  }
  bingdingKey(newPageIndex);
}
Program: 77983
Project: 77983
Buggy source:
/** 
 * Returns the IFigure that will receive focus upon a 'shift-tab' traverse event.
 * @param root The {@link LightweightSystem LightweightSystem's} root figure
 * @param focusOwner The IFigure who currently owns focus 
 * @return the previous focusable figure
 */
public IFigure getPreviousFocusableFigureInSameOrder(IFigure root,IFigure focusOwner){
  IFigure nextFocusOwner=focusOwner;
  if (focusOwner == null) {
    if (root.getChildren().size() != 0) {
      nextFocusOwner=findDeepestRightmostChildOf(root);
      if (isFocusEligible(nextFocusOwner))       return nextFocusOwner;
    }
 else     return null;
  }
  boolean found=false;
  while (!found) {
    IFigure parent=nextFocusOwner.getParent();
    if (parent == null)     return null;
    List siblings=parent.getChildren();
    int siblingPos=siblings.indexOf(nextFocusOwner);
    if (siblingPos != 0) {
      nextFocusOwner=((IFigure)(siblings.get(siblingPos - 1)));
      if (isFocusEligible(nextFocusOwner))       found=true;
    }
 else {
      nextFocusOwner=((IFigure)(siblings.get(siblings.size() - 1)));
      if (isFocusEligible(nextFocusOwner))       found=true;
    }
  }
  return nextFocusOwner;
}

Fixed version (ground truth):
/** 
 * Returns the IFigure that will receive focus upon a 'shift-tab' traverse event.
 * @param root The {@link LightweightSystem LightweightSystem's} root figure
 * @param focusOwner The IFigure who currently owns focus 
 * @return the previous focusable figure
 */
public IFigure getPreviousFocusableFigureInSameOrder(IFigure root,IFigure focusOwner){
  IFigure nextFocusOwner=focusOwner;
  if (focusOwner == null) {
    if (root.getChildren().size() != 0) {
      nextFocusOwner=findDeepestRightmostChildOf(root);
      if (isFocusEligible(nextFocusOwner))       return nextFocusOwner;
    }
 else     return null;
  }
  boolean found=false;
  ArrayList list=new ArrayList();
  while (!found) {
    IFigure parent=nextFocusOwner.getParent();
    if (parent == null)     return null;
    List siblings=parent.getChildren();
    int siblingPos=siblings.indexOf(nextFocusOwner);
    if (siblingPos != 0) {
      nextFocusOwner=((IFigure)(siblings.get(siblingPos - 1)));
      list.add(nextFocusOwner);
      if (isFocusEligible(nextFocusOwner))       found=true;
    }
 else     if (siblings.size() == 1) {
      nextFocusOwner=((IFigure)(siblings.get(0)));
      if (isFocusEligible(nextFocusOwner)) {
        found=true;
      }
 else {
        return null;
      }
    }
 else {
      nextFocusOwner=((IFigure)(siblings.get(siblings.size() - 1)));
      if (isFocusEligible(nextFocusOwner)) {
        found=true;
      }
 else       if (list.contains(nextFocusOwner)) {
        return null;
      }
 else {
        list.add(nextFocusOwner);
      }
    }
  }
  return nextFocusOwner;
}
Program: 77984
Project: 77984
Buggy source:
/** 
 * Returns the IFigure that will receive focus upon a 'tab' traverse event.
 * @param root the {@link LightweightSystem LightweightSystem's} root figure
 * @param focusOwner the IFigure who currently owns focus
 * @return the next focusable figure
 */
public IFigure getNextFocusableFigureInSameOrder(IFigure root,IFigure focusOwner){
  boolean found=false;
  IFigure nextFocusOwner=focusOwner;
  if (focusOwner == null) {
    if (root.getChildren().size() != 0) {
      nextFocusOwner=((IFigure)root.getChildren().get(0));
      if (isFocusEligible(nextFocusOwner))       return nextFocusOwner;
    }
 else     return null;
  }
  while (!found) {
    IFigure parent=nextFocusOwner.getParent();
    List siblings=parent.getChildren();
    int siblingPos=siblings.indexOf(nextFocusOwner);
    if (siblingPos < siblings.size() - 1) {
      nextFocusOwner=((IFigure)(siblings.get(siblingPos + 1)));
      if (isFocusEligible(nextFocusOwner))       found=true;
    }
 else {
      nextFocusOwner=((IFigure)(siblings.get(0)));
      if (isFocusEligible(nextFocusOwner))       found=true;
    }
  }
  return nextFocusOwner;
}

Fixed version (ground truth):
/** 
 * Returns the IFigure that will receive focus upon a 'tab' traverse event.
 * @param root the {@link LightweightSystem LightweightSystem's} root figure
 * @param focusOwner the IFigure who currently owns focus
 * @return the next focusable figure
 */
public IFigure getNextFocusableFigureInSameOrder(IFigure root,IFigure focusOwner){
  boolean found=false;
  IFigure nextFocusOwner=focusOwner;
  if (focusOwner == null) {
    if (root.getChildren().size() != 0) {
      nextFocusOwner=((IFigure)root.getChildren().get(0));
      if (isFocusEligible(nextFocusOwner))       return nextFocusOwner;
    }
 else     return null;
  }
  ArrayList list=new ArrayList();
  while (!found) {
    IFigure parent=nextFocusOwner.getParent();
    List siblings=parent.getChildren();
    int siblingPos=siblings.indexOf(nextFocusOwner);
    if (siblingPos < siblings.size() - 1) {
      nextFocusOwner=((IFigure)(siblings.get(siblingPos + 1)));
      list.add(nextFocusOwner);
      if (isFocusEligible(nextFocusOwner))       found=true;
    }
 else     if (siblings.size() == 1) {
      nextFocusOwner=((IFigure)(siblings.get(0)));
      if (isFocusEligible(nextFocusOwner)) {
        found=true;
      }
 else {
        return null;
      }
    }
 else {
      nextFocusOwner=((IFigure)(siblings.get(0)));
      if (isFocusEligible(nextFocusOwner)) {
        found=true;
      }
 else       if (list.contains(nextFocusOwner)) {
        return null;
      }
 else {
        list.add(nextFocusOwner);
      }
    }
  }
  return nextFocusOwner;
}
Program: 77985
Project: 77985
Buggy source:
/** 
 * get parameter object.
 * @param request HttpServletRequest
 * @param parameter ScalarParameterHandle
 * @return
 */
protected String getParamValueAsString(HttpServletRequest request,ScalarParameterHandle parameter){
  String paramName=parameter.getName();
  String paramValue=null;
  if (ParameterAccessor.isReportParameterExist(request,paramName)) {
    paramValue=ParameterAccessor.getReportParameter(request,paramName,null);
  }
  if (paramValue != null)   return paramValue;
  Object paramValueObj=null;
  if (ParameterAccessor.isDesigner(request) && this.configMap != null && this.configMap.containsKey(paramName)) {
    paramValueObj=this.configMap.get(paramName);
  }
 else   if (this.parameterMap != null && this.parameterMap.containsKey(paramName)) {
    paramValueObj=this.parameterMap.get(paramName);
    paramValueObj=ParameterValidationUtil.getDisplayValue(parameter.getDataType(),parameter.getPattern(),paramValueObj,locale);
  }
  if (paramValueObj != null)   paramValue=paramValueObj.toString();
  return paramValue;
}

Fixed version (ground truth):
/** 
 * get parameter object.
 * @param request HttpServletRequest
 * @param parameter ScalarParameterHandle
 * @return
 */
protected String getParamValueAsString(HttpServletRequest request,ScalarParameterHandle parameter){
  String paramName=parameter.getName();
  String paramValue=null;
  if (ParameterAccessor.isReportParameterExist(request,paramName)) {
    paramValue=ParameterAccessor.getReportParameter(request,paramName,null);
  }
  if (paramValue != null)   return paramValue;
  Object paramValueObj=null;
  if (ParameterAccessor.isDesigner(request) && this.configMap != null && this.configMap.containsKey(paramName)) {
    paramValueObj=this.configMap.get(paramName);
  }
 else   if (this.parameterMap != null && this.parameterMap.containsKey(paramName)) {
    paramValueObj=this.parameterMap.get(paramName);
    paramValueObj=ParameterValidationUtil.getDisplayValue(null,parameter.getPattern(),paramValueObj,locale);
  }
  if (paramValueObj != null)   paramValue=paramValueObj.toString();
  return paramValue;
}
Program: 77986
Project: 77986
Buggy source:
/** 
 * compile the expression
 * @param expression
 * @return List contains all column reference
 * @throws BirtException
 */
static List compileColumnExpression(String expression) throws BirtException {
  if (expression == null || expression.trim().length() == 0)   return null;
  List columnExprList=new ArrayList();
  columnExprList.clear();
  Context context=Context.enter();
  try {
    ScriptOrFnNode tree=instance.parse(expression,context);
    instance.CompiledExprFromTree(expression,context,tree,columnExprList);
  }
 catch (  Exception ex) {
    throw new CoreException(instance.pluginId,ResourceConstants.INVALID_EXPRESSION,ex);
  }
 finally {
    Context.exit();
  }
  return columnExprList;
}

Fixed version (ground truth):
/** 
 * compile the expression
 * @param expression
 * @return List contains all column reference
 * @throws BirtException
 */
static List compileColumnExpression(String expression) throws BirtException {
  if (expression == null || expression.trim().length() == 0)   return new ArrayList();
  List columnExprList=new ArrayList();
  columnExprList.clear();
  Context context=Context.enter();
  try {
    ScriptOrFnNode tree=instance.parse(expression,context);
    instance.CompiledExprFromTree(expression,context,tree,columnExprList);
  }
 catch (  Exception ex) {
    throw new CoreException(instance.pluginId,ResourceConstants.INVALID_EXPRESSION,ex);
  }
 finally {
    Context.exit();
  }
  return columnExprList;
}
Program: 77987
Project: 77987
Buggy source:
/** 
 * Gets the display string for the value with the given data type and the locale. The value must be the valid data type.
 * @param dataType the data type of the input value
 * @param value the input value to validate
 * @param locale the locale information
 * @return the formatted string
 */
static private String getDisplayValue(String dataType,Object value,ULocale locale){
}

Fixed version (ground truth):
/** 
 * Gets the display string for the value with the given data type and the locale. The value must be the valid data type.
 * @param dataType the data type of the input value
 * @param value the input value to validate
 * @param locale the locale information
 * @return the formatted string
 */
static private String getDisplayValue(String dataType,Object value,ULocale locale){
  if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType) || value instanceof Date) {
    DateFormat formatter=DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM,locale);
    return formatter.format((Date)value);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equalsIgnoreCase(dataType) || value instanceof Float || value instanceof Double) {
    NumberFormat formatter=NumberFormat.getNumberInstance(locale);
    return formatter.format(((Double)value).doubleValue());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equalsIgnoreCase(dataType) || value instanceof BigDecimal) {
    NumberFormat formatter=NumberFormat.getNumberInstance(locale);
    return formatter.format(((BigDecimal)value).doubleValue());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equalsIgnoreCase(dataType) || value instanceof Boolean) {
    if (((Boolean)value).booleanValue()) {
      return getMessage(locale,BooleanPropertyType.BOOLEAN_TRUE_RESOURCE_KEY);
    }
    return getMessage(locale,BooleanPropertyType.BOOLEAN_FALSE_RESOURCE_KEY);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_STRING.equalsIgnoreCase(dataType) || value instanceof String) {
    return (String)value;
  }
 else {
    return value.toString();
  }
}
Program: 77989
Project: 77989
Buggy source:
/** 
 * Validates drop target from data set column in data view.
 * @return validate result
 */
protected static boolean handleValidateDataSetColumn(ResultSetColumnHandle insertObj,EditPart target){
  if (handleValidateDataSetColumnDropContainer(target) && DNDUtil.handleValidateTargetCanContainType(target.getModel(),ReportDesignConstants.DATA_ITEM)) {
    if (target.getModel() instanceof ModuleHandle) {
      return true;
    }
    DesignElementHandle handle=(DesignElementHandle)target.getParent().getModel();
    if (handle instanceof ReportItemHandle) {
      ReportItemHandle bindingHolder=DEUtil.getListingContainer(handle);
      DataSetHandle dataSet=DEUtil.getFirstDataSet(handle);
      return dataSet == null && (bindingHolder == null || !bindingHolder.getColumnBindings().iterator().hasNext()) || insertObj.getElementHandle().equals(dataSet);
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Validates drop target from data set column in data view.
 * @return validate result
 */
protected static boolean handleValidateDataSetColumn(ResultSetColumnHandle insertObj,EditPart target){
  if (handleValidateDataSetColumnDropContainer(target) && DNDUtil.handleValidateTargetCanContainType(target.getModel(),ReportDesignConstants.DATA_ITEM)) {
    if (target.getModel() instanceof ModuleHandle || isMasterPageHeaderOrFooter(target.getModel())) {
      return true;
    }
    DesignElementHandle handle=(DesignElementHandle)target.getParent().getModel();
    if (handle instanceof ReportItemHandle) {
      ReportItemHandle bindingHolder=DEUtil.getListingContainer(handle);
      DataSetHandle dataSet=DEUtil.getFirstDataSet(handle);
      return dataSet == null && (bindingHolder == null || !bindingHolder.getColumnBindings().iterator().hasNext()) || insertObj.getElementHandle().equals(dataSet);
    }
  }
  return false;
}
Program: 77990
Project: 77990
Buggy source:
/** 
 * Validates container of drop target from data set column in data view
 * @param dropPart
 * @return validate result
 */
protected static boolean handleValidateDataSetColumnDropContainer(EditPart dropPart){
  if (dropPart.getParent() == null) {
    return false;
  }
  Object container=dropPart.getParent().getModel();
  return (container instanceof GridHandle || container instanceof TableHandle || container instanceof FreeFormHandle|| container instanceof ListHandle|| dropPart.getModel() instanceof ModuleHandle);
}

Fixed version (ground truth):
/** 
 * Validates container of drop target from data set column in data view
 * @param dropPart
 * @return validate result
 */
protected static boolean handleValidateDataSetColumnDropContainer(EditPart dropPart){
  if (dropPart.getParent() == null) {
    return false;
  }
  Object container=dropPart.getParent().getModel();
  return (container instanceof GridHandle || container instanceof TableHandle || container instanceof FreeFormHandle|| container instanceof ListHandle|| container instanceof MasterPageHandle|| dropPart.getModel() instanceof ModuleHandle);
}
Program: 77991
Project: 77991
Buggy source:
/** 
 * Validates object can be inserted to layout. Support the multiple.
 * @param insertObj single inserted object or multi-objects
 * @param targetPart
 * @return if can be inserted to layout
 */
public static boolean handleValidateInsertToLayout(Object insertObj,EditPart targetPart){
  if (targetPart == null) {
    return false;
  }
  if (insertObj instanceof Object[]) {
    Object[] array=(Object[])insertObj;
    if (!checkSameDataSetInMultiColumns(array)) {
      return false;
    }
    for (int i=0; i < array.length; i++) {
      if (!handleValidateInsertToLayout(array[i],targetPart)) {
        return false;
      }
    }
    return true;
  }
 else   if (insertObj instanceof IStructuredSelection) {
    return handleValidateInsertToLayout(((IStructuredSelection)insertObj).toArray(),targetPart);
  }
 else   if (insertObj instanceof DataSetHandle) {
    if (insertObj instanceof JointDataSetHandle)     return isHandleValid((DataSetHandle)insertObj) && handleValidateDataSet(targetPart);
 else     return isHandleValid((DataSetHandle)insertObj) && ((DataSetHandle)insertObj).getDataSource() != null && handleValidateDataSet(targetPart);
  }
 else   if (insertObj instanceof ResultSetColumnHandle) {
    return handleValidateDataSetColumn((ResultSetColumnHandle)insertObj,targetPart);
  }
 else   if (insertObj instanceof ScalarParameterHandle) {
    return isHandleValid((ScalarParameterHandle)insertObj) && handleValidateParameter(targetPart);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Validates object can be inserted to layout. Support the multiple.
 * @param insertObj single inserted object or multi-objects
 * @param targetPart
 * @return if can be inserted to layout
 */
public static boolean handleValidateInsertToLayout(Object insertObj,EditPart targetPart){
  if (targetPart == null) {
    return false;
  }
  if (insertObj instanceof Object[]) {
    Object[] array=(Object[])insertObj;
    if (!checkSameDataSetInMultiColumns(array)) {
      return false;
    }
    if (!checkContainContainMulitItem(array,targetPart.getModel())) {
      return false;
    }
    for (int i=0; i < array.length; i++) {
      if (!handleValidateInsertToLayout(array[i],targetPart)) {
        return false;
      }
    }
    return true;
  }
 else   if (insertObj instanceof IStructuredSelection) {
    return handleValidateInsertToLayout(((IStructuredSelection)insertObj).toArray(),targetPart);
  }
 else   if (insertObj instanceof DataSetHandle) {
    if (insertObj instanceof JointDataSetHandle)     return isHandleValid((DataSetHandle)insertObj) && handleValidateDataSet(targetPart);
 else     return isHandleValid((DataSetHandle)insertObj) && ((DataSetHandle)insertObj).getDataSource() != null && handleValidateDataSet(targetPart);
  }
 else   if (insertObj instanceof ResultSetColumnHandle) {
    return handleValidateDataSetColumn((ResultSetColumnHandle)insertObj,targetPart);
  }
 else   if (insertObj instanceof ScalarParameterHandle) {
    return isHandleValid((ScalarParameterHandle)insertObj) && handleValidateParameter(targetPart);
  }
  return false;
}
Program: 77993
Project: 77993
Buggy source:
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(String dataSetName) throws BirtException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName(dataSetName);
  query.setMaxRows(1);
  return new QueryExecutionHelper(dataEngine,modelAdaptor,moduleHandle).executeQuery(query,null,null,null).getResultMetaData();
}

Fixed version (ground truth):
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName(dataSetHandle.getQualifiedName());
  query.setMaxRows(1);
  boolean useResultHints=dataSetHandle instanceof ScriptDataSetHandle;
  return new QueryExecutionHelper(dataEngine,modelAdaptor,moduleHandle,useResultHints).executeQuery(query).getResultMetaData();
}
Program: 77994
Project: 77994
Buggy source:
/** 
 * @param dataSetHandle
 * @param useCache
 * @return
 * @throws BirtException
 */
IResultMetaData getDataSetMetaData(DataSetHandle dataSetHandle,boolean useCache) throws BirtException {
  if (dataSetHandle == null) {
    throw new AdapterException(ResourceConstants.DATASETHANDLE_NULL_ERROR);
  }
  if (useCache) {
    return getCachedMetaData(dataSetHandle.getCachedMetaDataHandle());
  }
 else {
    return getRealMetaData(dataSetHandle.getName());
  }
}

Fixed version (ground truth):
/** 
 * @param dataSetHandle
 * @param useCache
 * @return
 * @throws BirtException
 */
IResultMetaData getDataSetMetaData(DataSetHandle dataSetHandle,boolean useCache) throws BirtException {
  if (dataSetHandle == null) {
    throw new AdapterException(ResourceConstants.DATASETHANDLE_NULL_ERROR);
  }
  if (useCache) {
    return getCachedMetaData(dataSetHandle.getCachedMetaDataHandle());
  }
 else {
    return getRealMetaData(dataSetHandle);
  }
}
Program: 77995
Project: 77995
Buggy source:
/** 
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
IResultMetaData refreshMetaData(DataSetHandle dataSetHandle) throws BirtException {
  IResultMetaData rsMeta=null;
  BirtException e=null;
  try {
    rsMeta=this.getDataSetMetaData(dataSetHandle,false);
  }
 catch (  BirtException e1) {
    e=e1;
  }
  if (needsSetCachedMetaData(dataSetHandle,rsMeta)) {
    dataSetHandle.setCachedMetaData(StructureFactory.createCachedMetaData());
    if (rsMeta != null && rsMeta.getColumnCount() != 0) {
      for (int i=1; i <= rsMeta.getColumnCount(); i++) {
        ResultSetColumn rsc=StructureFactory.createResultSetColumn();
        rsc.setColumnName(getColumnName(rsMeta,i));
        rsc.setDataType(toModelDataType(rsMeta.getColumnType(i)));
        rsc.setPosition(new Integer(i));
        dataSetHandle.getCachedMetaDataHandle().getResultSet().addItem(rsc);
      }
    }
  }
  if (e != null)   throw e;
  return rsMeta;
}

Fixed version (ground truth):
/** 
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
IResultMetaData refreshMetaData(DataSetHandle dataSetHandle) throws BirtException {
  IResultMetaData rsMeta=null;
  BirtException e=null;
  try {
    rsMeta=this.getDataSetMetaData(dataSetHandle,false);
  }
 catch (  BirtException e1) {
    e=e1;
  }
  if (needsSetCachedMetaData(dataSetHandle,rsMeta)) {
    dataSetHandle.setCachedMetaData(StructureFactory.createCachedMetaData());
    if (rsMeta != null && rsMeta.getColumnCount() != 0) {
      for (int i=1; i <= rsMeta.getColumnCount(); i++) {
        ResultSetColumn rsc=StructureFactory.createResultSetColumn();
        rsc.setColumnName(getColumnName(rsMeta,i));
        rsc.setDataType(toModelDataType(rsMeta.getColumnType(i)));
        rsc.setPosition(new Integer(i));
        dataSetHandle.getCachedMetaDataHandle().getResultSet().addItem(rsc);
      }
    }
    if (dataSetHandle instanceof ScriptDataSetHandle == false)     dataSetHandle.getPropertyHandle(DataSetHandle.RESULT_SET_PROP).clearValue();
  }
  if (e != null)   throw e;
  return rsMeta;
}
Program: 77996
Project: 77996
Buggy source:
/** 
 * @param dataSetName
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSet(DataSetHandle handle) throws AdapterException, BirtException {
  if (handle == null)   throw new AdapterException(ResourceConstants.DATASETHANDLE_NULL_ERROR);
  DataSourceHandle dataSourceHandle=handle.getDataSource();
  if (dataSourceHandle != null) {
    IBaseDataSourceDesign dsourceDesign=this.modelAdaptor.adaptDataSource(dataSourceHandle);
    dataEngine.defineDataSource(dsourceDesign);
  }
  if (handle instanceof JointDataSetHandle) {
    defineSourceDataSets((JointDataSetHandle)handle);
  }
  dataEngine.defineDataSet(this.modelAdaptor.adaptDataSet(handle));
}

Fixed version (ground truth):
/** 
 * @param dataSetName
 * @throws AdapterException
 * @throws BirtException
 */
private void defineDataSet(DataSetHandle handle) throws AdapterException, BirtException {
  if (handle == null)   throw new AdapterException(ResourceConstants.DATASETHANDLE_NULL_ERROR);
  DataSourceHandle dataSourceHandle=handle.getDataSource();
  if (dataSourceHandle != null) {
    IBaseDataSourceDesign dsourceDesign=this.modelAdaptor.adaptDataSource(dataSourceHandle);
    dataEngine.defineDataSource(dsourceDesign);
  }
  if (handle instanceof JointDataSetHandle) {
    defineSourceDataSets((JointDataSetHandle)handle);
  }
  BaseDataSetDesign baseDS=this.modelAdaptor.adaptDataSet(handle);
  if (useResultHints == false)   baseDS.getResultSetHints().clear();
  dataEngine.defineDataSet(baseDS);
}
Program: 77997
Project: 77997
Buggy source:
/** 
 * @param dataEngine
 * @param modelAdaptor
 * @param moduleHandle
 */
QueryExecutionHelper(DataEngine dataEngine,IModelAdapter modelAdaptor,ModuleHandle moduleHandle){
  this.dataEngine=dataEngine;
  this.modelAdaptor=modelAdaptor;
  this.moduleHandle=moduleHandle;
}

Fixed version (ground truth):
/** 
 * @param dataEngine
 * @param modelAdaptor
 * @param moduleHandle
 * @param useResultHints
 */
QueryExecutionHelper(DataEngine dataEngine,IModelAdapter modelAdaptor,ModuleHandle moduleHandle,boolean useResultHints){
  this.dataEngine=dataEngine;
  this.modelAdaptor=modelAdaptor;
  this.moduleHandle=moduleHandle;
  this.useResultHints=useResultHints;
}
Program: 77998
Project: 77998
Buggy source:
private void createGeneralPart(Composite parent){
  Group group=new Group(parent,SWT.NULL);
  group.setText(LABEL_GROUP_GENERAL);
  group.setLayout(new GridLayout(2,false));
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  new Label(group,SWT.NULL).setText(LABEL_CASCADING_PARAMETER_NAME);
  cascadingNameEditor=new Text(group,SWT.BORDER);
  cascadingNameEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  new Label(group,SWT.NULL).setText(LABEL_PROMPT_TEXT1);
  promptTextEditor=new Text(group,SWT.BORDER);
  promptTextEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}

Fixed version (ground truth):
private void createGeneralPart(Composite parent){
  Group group=new Group(parent,SWT.NULL);
  group.setText(LABEL_GROUP_GENERAL);
  group.setLayout(new GridLayout(2,false));
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  new Label(group,SWT.NULL).setText(LABEL_CASCADING_PARAMETER_NAME);
  cascadingNameEditor=new Text(group,SWT.BORDER);
  cascadingNameEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  new Label(group,SWT.NULL).setText(LABEL_GROUP_PROMPT_TEXT);
  promptTextEditor=new Text(group,SWT.BORDER);
  promptTextEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
Program: 78000
Project: 78000
Buggy source:
/** 
 * Validates the input value at the given locale. The format is: short date and medium time.
 * @param value the value to validate
 * @param locale the locale information
 * @return the date value if validation is successful
 * @throws ValidationValueException if the value is invalid
 */
static final Date doVidateDateTime(String value,ULocale locale) throws ValidationValueException {
  DateFormat formatter=DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.MEDIUM,locale);
  try {
    return formatter.parse(value);
  }
 catch (  ParseException e) {
    throw new ValidationValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,DesignChoiceConstants.PARAM_TYPE_DATETIME);
  }
}

Fixed version (ground truth):
/** 
 * Validates the input value at the given locale. The format is: short date and medium time.
 * @param value the value to validate
 * @param locale the locale information
 * @return the date value if validation is successful
 * @throws ValidationValueException if the value is invalid
 */
static final Date doVidateDateTime(String value,ULocale locale) throws ValidationValueException {
  DateFormat formatter=DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM,locale);
  try {
    return formatter.parse(value);
  }
 catch (  ParseException e) {
    throw new ValidationValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,DesignChoiceConstants.PARAM_TYPE_DATETIME);
  }
}
Program: 78001
Project: 78001
Buggy source:
/** 
 * @throws DataException
 */
void doSaveFinish() throws DataException {
  if (needsSaveToDoc() == false)   return;
  if (isBasicSaved == false) {
    isBasicSaved=true;
    this.getRdSave().saveResultIterator((CachedResultSet)this.odiResult,this.groupLevel,this.subQueryInfo);
  }
  this.getRdSave().saveFinish(odiResult.getCurrentResultIndex());
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
void doSaveFinish() throws DataException {
  if (needsSaveToDoc() == false)   return;
  if (isBasicSaved == false) {
    isBasicSaved=true;
    this.getRdSave().saveResultIterator(this.odiResult,this.groupLevel,this.subQueryInfo);
  }
  this.getRdSave().saveFinish(odiResult.getCurrentResultIndex());
}
Program: 78002
Project: 78002
Buggy source:
protected void adjustForNumColumns(int numColumns){
  Control control=getLabelControl();
  if (control != null) {
    ((GridData)control.getLayoutData()).horizontalSpan=1;
    numColumns--;
  }
  ((GridData)getTextControl(null).getLayoutData()).horizontalSpan=1;
  ((GridData)getTextControl(null).getLayoutData()).widthHint=85;
  numColumns--;
  ((GridData)getButtonControl(null).getLayoutData()).horizontalSpan=numColumns;
  ((GridData)getButtonControl(null).getLayoutData()).widthHint=85;
}

Fixed version (ground truth):
protected void adjustForNumColumns(int numColumns){
  Control control=getLabelControl();
  if (control != null) {
    ((GridData)control.getLayoutData()).horizontalSpan=1;
    numColumns--;
  }
  ((GridData)getTextControl(null).getLayoutData()).horizontalSpan=1;
  ((GridData)getTextControl(null).getLayoutData()).widthHint=85;
  numColumns--;
  ((GridData)getButtonControl(null).getLayoutData()).horizontalSpan=numColumns;
  ((GridData)getButtonControl(null).getLayoutData()).widthHint=Math.max(getButtonControl(null).computeSize(SWT.DEFAULT,SWT.DEFAULT).x,85);
}
Program: 78006
Project: 78006
Buggy source:
public EmptyFigure(){
  setBackgroundColor(ReportColorConstants.greyFillColor);
}

Fixed version (ground truth):
public EmptyFigure(){
  setOpaque(true);
  setBackgroundColor(ReportColorConstants.greyFillColor);
}
Program: 78007
Project: 78007
Buggy source:
/** 
 * if parameter existed in config file, return the correct parameter name
 * @param configVarName
 * @return String
 */
private String getParameterName(String configVarName){
  String paramName=null;
  List parameters=null;
  ModuleHandle model=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (model != null) {
    parameters=model.getFlattenParameters();
  }
  if (parameters != null) {
    for (int i=0; i < parameters.size(); i++) {
      ScalarParameterHandle parameter=null;
      if (parameters.get(i) instanceof ScalarParameterHandle) {
        parameter=((ScalarParameterHandle)parameters.get(i));
      }
      String curName=null;
      if (parameter != null && parameter.getName() != null) {
        curName=parameter.getName() + parameter.getID();
      }
      if (curName != null && curName.equalsIgnoreCase(configVarName)) {
        paramName=parameter.getName();
        break;
      }
    }
  }
  return paramName;
}

Fixed version (ground truth):
/** 
 * if parameter existed in config file, return the correct parameter name
 * @param configVarName
 * @return String
 */
private String getParameterName(String configVarName){
  String paramName=null;
  List parameters=null;
  ModuleHandle model=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (model != null) {
    parameters=model.getFlattenParameters();
  }
  if (parameters != null) {
    for (int i=0; i < parameters.size(); i++) {
      ScalarParameterHandle parameter=null;
      if (parameters.get(i) instanceof ScalarParameterHandle) {
        parameter=((ScalarParameterHandle)parameters.get(i));
      }
      String curName=null;
      if (parameter != null && parameter.getName() != null) {
        curName=parameter.getName() + "String_Node_Str" + parameter.getID();
      }
      if (curName != null && curName.equalsIgnoreCase(configVarName)) {
        paramName=parameter.getName();
        break;
      }
    }
  }
  return paramName;
}
Program: 78012
Project: 78012
Buggy source:
/** 
 * Clears values of all properties. Clearing a property removes any value set for the property on this element. After this, the element will now inherit the property from its parent element, style, or from the default value for the property.
 * @throws SemanticException if the property is not defined on this element
 */
public void clearAllProperties() throws SemanticException {
  List props=getDefn().getProperties();
  for (int i=0; i < props.size(); i++) {
    PropertyDefn propDefn=(PropertyDefn)props.get(i);
    setProperty(propDefn.getName(),null);
  }
}

Fixed version (ground truth):
/** 
 * Clears values of all properties. Clearing a property removes any value set for the property on this element. After this, the element will now inherit the property from its parent element, style, or from the default value for the property.
 * @throws SemanticException if the property is not defined on this element
 */
public void clearAllProperties() throws SemanticException {
  List props=getDefn().getProperties();
  for (int i=0; i < props.size(); i++) {
    PropertyDefn propDefn=(PropertyDefn)props.get(i);
    String propName=propDefn.getName();
    if ((DesignElement.NAME_PROP.equals(propName))) {
      NameCommand nameCmd=new NameCommand(module,getElement());
      try {
        nameCmd.checkName(null);
      }
 catch (      NameException e) {
        continue;
      }
    }
    PropertyHandle propHandle=getPropertyHandle(propName);
    if (propHandle.isLocal())     propHandle.clearValue();
  }
}
Program: 78013
Project: 78013
Buggy source:
public void clearLocalProperties() throws SemanticException {
  ActivityStack stack=module.getActivityStack();
  stack.startTrans();
  try {
    Iterator iter=propertyIterator();
    while (iter.hasNext()) {
      GroupPropertyHandle propHandle=(GroupPropertyHandle)iter.next();
      String propName=propHandle.getPropertyDefn().getName();
      if (DesignElement.EXTENDS_PROP.equals(propName)) {
        continue;
      }
      propHandle.clearValue();
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
}

Fixed version (ground truth):
public void clearLocalProperties() throws SemanticException {
  ActivityStack stack=module.getActivityStack();
  stack.startTrans();
  try {
    Iterator iter=propertyIterator();
    while (iter.hasNext()) {
      GroupPropertyHandle propHandle=(GroupPropertyHandle)iter.next();
      String propName=propHandle.getPropertyDefn().getName();
      if (DesignElement.EXTENDS_PROP.equals(propName)) {
        continue;
      }
      if (DesignElement.NAME_PROP.equals(propName)) {
        for (Iterator elementIter=elements.iterator(); elementIter.hasNext(); ) {
          DesignElementHandle handle=(DesignElementHandle)elementIter.next();
          NameCommand nameCmd=new NameCommand(module,handle.getElement());
          try {
            nameCmd.checkName(null);
          }
 catch (          NameException e) {
            continue;
          }
          PropertyHandle tmpPropHandle=handle.getPropertyHandle(propName);
          if (tmpPropHandle.isLocal())           propHandle.clearValue();
        }
      }
 else {
        String localValue=propHandle.getLocalStringValue();
        if (localValue != null) {
          propHandle.clearValue();
        }
      }
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
}
Program: 78014
Project: 78014
Buggy source:
/** 
 * Checks the current element name. Done when adding a newly created element where the element name is already set on the new element.
 * @param name the name to check.
 * @throws NameException if the element name is not allowed to change.
 */
private void checkName(String name) throws NameException {
  ElementDefn metaData=(ElementDefn)element.getDefn();
  if (name == null) {
    if (element.hasDerived() || element.hasReferences())     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_HAS_REFERENCES);
    if (metaData.getNameOption() == MetaDataConstants.REQUIRED_NAME)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_REQUIRED);
  }
 else {
    if (!isNameValidInContext(name))     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_DUPLICATE);
    if (metaData.getNameOption() == MetaDataConstants.NO_NAME)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_FORBIDDEN);
    if (name.indexOf(ReferenceValue.NAMESPACE_DELIMITER) != -1) {
      throw new NameException(element,name,NameException.DESIGN_EXCEPTION_DOT_FORBIDDEN);
    }
    if (!element.isManagedByNameSpace()) {
      return;
    }
    int ns=metaData.getNameSpaceID();
    DesignElement existedElement=getModule().getNameSpace(ns).getElement(name);
    if (existedElement != null)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_DUPLICATE);
  }
}

Fixed version (ground truth):
/** 
 * Checks the current element name. Done when adding a newly created element where the element name is already set on the new element.
 * @param name the name to check.
 * @throws NameException if the element name is not allowed to change.
 */
public void checkName(String name) throws NameException {
  ElementDefn metaData=(ElementDefn)element.getDefn();
  if (name == null) {
    if (element.hasDerived() || element.hasReferences())     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_HAS_REFERENCES);
    if (metaData.getNameOption() == MetaDataConstants.REQUIRED_NAME)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_REQUIRED);
    if ((module instanceof Library) && (element.getContainer() instanceof Library)) {
      throw new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_REQUIRED);
    }
  }
 else {
    if (!isNameValidInContext(name))     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_DUPLICATE);
    if (metaData.getNameOption() == MetaDataConstants.NO_NAME)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_FORBIDDEN);
    if (name.indexOf(ReferenceValue.NAMESPACE_DELIMITER) != -1) {
      throw new NameException(element,name,NameException.DESIGN_EXCEPTION_DOT_FORBIDDEN);
    }
    if (!element.isManagedByNameSpace()) {
      return;
    }
    int ns=metaData.getNameSpaceID();
    DesignElement existedElement=getModule().getNameSpace(ns).getElement(name);
    if (existedElement != null)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_DUPLICATE);
  }
}
Program: 78015
Project: 78015
Buggy source:
private void createDefaultEditor(){
  createLabel(valueArea,LABEL_DEFAULT_VALUE,maxStrLengthProperty);
  defaultValueEditor=new Text(valueArea,SWT.BORDER);
  defaultValueEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  defaultValueEditor.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      defaultValue=UIUtil.convertToModelString(defaultValueEditor.getText(),false);
      if (isStatic()) {
        refreshValueTable();
      }
      updateFormatField();
      updateMessageLine();
    }
  }
);
}

Fixed version (ground truth):
private void createDefaultEditor(){
  createLabel(valueArea,LABEL_DEFAULT_VALUE);
  defaultValueEditor=new Text(valueArea,SWT.BORDER);
  defaultValueEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  defaultValueEditor.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      defaultValue=UIUtil.convertToModelString(defaultValueEditor.getText(),false);
      if (isStatic()) {
        refreshValueTable();
      }
      updateFormatField();
      updateMessageLine();
    }
  }
);
}
Program: 78017
Project: 78017
Buggy source:
private void updateTableButtons(){
  boolean isEnable=true;
  SelectionChoice selectedChoice=null;
  if (valueTable.getSelection().isEmpty()) {
    isEnable=false;
  }
 else {
    selectedChoice=(SelectionChoice)((IStructuredSelection)valueTable.getSelection()).getFirstElement();
    if (selectedChoice == dummyChoice) {
      isEnable=false;
    }
  }
  boolean isDefault=isEnable && isDefaultChoice(selectedChoice);
  if (isDefault) {
    changeDefault.setText(BUTTON_LABEL_REMOVE_DEFAULT);
  }
 else {
    changeDefault.setText(BUTTON_LABEL_SET_DEFAULT);
  }
  setButtonLayoutData(changeDefault);
  changeDefault.setSelection(isDefault);
  changeDefault.setEnabled(isEnable);
  delete.setEnabled(isEnable);
}

Fixed version (ground truth):
private void updateTableButtons(){
  boolean isEnable=true;
  SelectionChoice selectedChoice=null;
  if (valueTable.getSelection().isEmpty()) {
    isEnable=false;
  }
 else {
    selectedChoice=(SelectionChoice)((IStructuredSelection)valueTable.getSelection()).getFirstElement();
    if (selectedChoice == dummyChoice) {
      isEnable=false;
    }
  }
  boolean isDefault=isEnable && isDefaultChoice(selectedChoice);
  if (isDefault) {
    changeDefault.setText(BUTTON_LABEL_REMOVE_DEFAULT);
  }
 else {
    changeDefault.setText(BUTTON_LABEL_SET_DEFAULT);
  }
  changeDefault.setSelection(isDefault);
  changeDefault.setEnabled(isEnable);
  delete.setEnabled(isEnable);
}
Program: 78018
Project: 78018
Buggy source:
private void switchToCheckBox(){
  createLabel(valueArea,LABEL_DEFAULT_VALUE,maxStrLengthProperty);
  defaultValueChooser=new Combo(valueArea,SWT.READ_ONLY | SWT.BORDER);
  defaultValueChooser.add(CHOICE_NO_DEFAULT);
  defaultValueChooser.add(BOOLEAN_TRUE);
  defaultValueChooser.add(BOOLEAN_FALSE);
  defaultValueChooser.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  defaultValueChooser.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
switch (defaultValueChooser.getSelectionIndex()) {
case 0:
        defaultValue=null;
      break;
case 1:
    defaultValue=Boolean.toString(true);
  break;
case 2:
defaultValue=Boolean.toString(false);
break;
}
}
}
);
}

Fixed version (ground truth):
private void switchToCheckBox(){
  createLabel(valueArea,LABEL_DEFAULT_VALUE);
  defaultValueChooser=new Combo(valueArea,SWT.READ_ONLY | SWT.BORDER);
  defaultValueChooser.add(CHOICE_NO_DEFAULT);
  defaultValueChooser.add(BOOLEAN_TRUE);
  defaultValueChooser.add(BOOLEAN_FALSE);
  defaultValueChooser.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  defaultValueChooser.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
switch (defaultValueChooser.getSelectionIndex()) {
case 0:
        defaultValue=null;
      break;
case 1:
    defaultValue=Boolean.toString(true);
  break;
case 2:
defaultValue=Boolean.toString(false);
break;
}
}
}
);
}
Program: 78019
Project: 78019
Buggy source:
protected Control createDialogArea(Composite parent){
  maxStrLengthProperty=getMaxStrLength(parent,PROPERTY_LABEL_STRING);
  maxStrLengthOption=getMaxStrLength(parent,OPTION_LABEL_STRING);
  Composite composite=(Composite)super.createDialogArea(parent);
  createPropertiesSection(composite);
  createMoreOptionSection(composite);
  return composite;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  createPropertiesSection(composite);
  createMoreOptionSection(composite);
  return composite;
}
Program: 78022
Project: 78022
Buggy source:
private void createLabel(Composite parent,String content,int width){
  Label label=new Label(parent,SWT.NONE);
  if (content != null) {
    label.setText(content);
  }
  setLabelLayoutData(label,width);
}

Fixed version (ground truth):
private void createLabel(Composite parent,String content){
  Label label=new Label(parent,SWT.NONE);
  if (content != null) {
    label.setText(content);
  }
  setLabelLayoutData(label);
}
Program: 78023
Project: 78023
Buggy source:
private void switchToText(){
  createDefaultEditor();
  createLabel(valueArea,null,maxStrLengthProperty);
  createPromptLine(valueArea);
}

Fixed version (ground truth):
private void switchToText(){
  createDefaultEditor();
  createLabel(valueArea,null);
  createPromptLine(valueArea);
}
Program: 78024
Project: 78024
Buggy source:
private void setLabelLayoutData(Label label,int width){
  GridData gd=new GridData();
  if (label.getText().equals(LABEL_VALUES)) {
    gd.verticalAlignment=GridData.BEGINNING;
  }
  gd.widthHint=width;
  label.setLayoutData(gd);
}

Fixed version (ground truth):
private void setLabelLayoutData(Label label){
  GridData gd=new GridData();
  if (label.getText().equals(LABEL_VALUES)) {
    gd.verticalAlignment=GridData.BEGINNING;
  }
  label.setLayoutData(gd);
}
Program: 78026
Project: 78026
Buggy source:
protected void handleSelectionChange(ReportRequest request){
  List list=request.getSelectionModelList();
  if ((request.getSource() instanceof LibraryOutlinePage || request.getSource() instanceof TableEditPart) && !isInContainer(list)) {
    int size=list.size();
    Object obj=null;
    if (size != 0) {
      obj=list.get(size - 1);
    }
    SetCurrentEditModelCommand command=new SetCurrentEditModelCommand(obj);
    command.execute();
    return;
  }
  super.handleSelectionChange(request);
}

Fixed version (ground truth):
protected void handleSelectionChange(ReportRequest request){
  List list=request.getSelectionModelList();
  if ((request.getSource() instanceof LibraryOutlinePage || request.getSource() instanceof TableEditPart) && !isInContainer(list)) {
    int size=list.size();
    Object obj=null;
    if (size != 0) {
      obj=list.get(size - 1);
      SetCurrentEditModelCommand command=new SetCurrentEditModelCommand(obj);
      command.execute();
      return;
    }
  }
  super.handleSelectionChange(request);
}