nus-yam/ex-repair huggingface dataset:
Program: 65260
Project: 65260
Buggy source:
protected String getSelectionValue(Combo combo){
  String retValue=null;
  bindingName=getExpressionBindingName();
  if (bindingName == null && getExpression().length() > 0)   bindingName=getExpression();
  if (bindingName != null) {
    try {
      List selectValueList=getSelectValueList();
      SelectValueDialog dialog=new SelectValueDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"));
      dialog.setSelectedValueList(selectValueList);
      if (bindingParams != null) {
        dialog.setBindingParams(bindingParams);
      }
      if (dialog.open() == IDialogConstants.OK_ID) {
        IExpressionConverter converter=ExpressionButtonUtil.getCurrentExpressionConverter(combo);
        retValue=dialog.getSelectedExprValue(converter);
      }
    }
 catch (    Exception ex) {
      MessageDialog.openError(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + "String_Node_Str" + ex.getMessage());
    }
  }
 else {
    MessageDialog.openInformation(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return retValue;
}

Fixed version (ground truth):
protected String getSelectionValue(Combo combo){
  String retValue=null;
  bindingName=getExpressionBindingName();
  if (bindingName == null && getExpression().length() > 0)   bindingName=getExpression();
  if (bindingName != null) {
    try {
      List selectValueList=getSelectValueList();
      if (selectValueList == null || selectValueList.size() == 0) {
        MessageDialog.openInformation(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
      }
 else {
        SelectValueDialog dialog=new SelectValueDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"));
        dialog.setSelectedValueList(selectValueList);
        if (bindingParams != null) {
          dialog.setBindingParams(bindingParams);
        }
        if (dialog.open() == IDialogConstants.OK_ID) {
          IExpressionConverter converter=ExpressionButtonUtil.getCurrentExpressionConverter(combo);
          retValue=dialog.getSelectedExprValue(converter);
        }
      }
    }
 catch (    Exception ex) {
      MessageDialog.openError(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + "String_Node_Str" + ex.getMessage());
    }
  }
 else {
    MessageDialog.openInformation(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return retValue;
}
Program: 65265
Project: 65265
Buggy source:
protected ActionHandle getDefaultAction(ExtendedItemHandle handle,String expression){
  ExpressionCodec exprCodec=ChartModelHelper.instance().createExpressionCodec();
  String bindingname=exprCodec.getBindingName(expression);
  if (bindingname == null) {
    return null;
  }
  CubeHandle cube=handle.getCube();
  DataSetHandle dataset=handle.getDataSet();
  if (cube != null && ChartReportItemHelper.instance().getBindingCubeHandle(handle) != null) {
    for (    LevelHandle lh : ChartCubeUtil.getAllLevels(cube)) {
      if (bindingname.equals(ChartCubeUtil.createLevelBindingName(lh))) {
        return lh.getActionHandle();
      }
    }
    for (    MeasureHandle mh : ChartCubeUtil.getAllMeasures(cube)) {
      if (bindingname.equals(ChartCubeUtil.createMeasureBindingName(mh))) {
        return mh.getActionHandle();
      }
    }
  }
 else   if (dataset != null && ChartReportItemHelper.instance().getBindingDataSetHandle(handle) != null) {
    for (Iterator<?> iter=dataset.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP).iterator(); iter.hasNext(); ) {
      ColumnHintHandle element=(ColumnHintHandle)iter.next();
      if (element.getColumnName().equals(bindingname) || bindingname.equals(element.getAlias())) {
        return element.getActionHandle();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
protected ActionHandle getDefaultAction(ExtendedItemHandle handle,String expression){
  ExpressionCodec exprCodec=ChartModelHelper.instance().createExpressionCodec();
  String bindingname=exprCodec.getBindingName(expression);
  if (bindingname == null) {
    return null;
  }
  CubeHandle cube=handle.getCube();
  DataSetHandle dataset=handle.getDataSet();
  if (cube != null && ChartReportItemHelper.instance().getBindingCubeHandle(handle) != null) {
    for (    LevelHandle lh : ChartCubeUtil.getAllLevels(cube)) {
      if (bindingname.equals(ChartCubeUtil.createLevelBindingName(lh))) {
        return lh.getActionHandle();
      }
      Iterator<?> iter=lh.attributesIterator();
      while (iter.hasNext()) {
        LevelAttributeHandle laHandle=(LevelAttributeHandle)iter.next();
        if (bindingname.equals(ChartCubeUtil.createLevelAttrBindingName(lh,laHandle))) {
          return lh.getActionHandle();
        }
      }
    }
    for (    MeasureHandle mh : ChartCubeUtil.getAllMeasures(cube)) {
      if (bindingname.equals(ChartCubeUtil.createMeasureBindingName(mh))) {
        return mh.getActionHandle();
      }
    }
  }
 else   if (dataset != null && ChartReportItemHelper.instance().getBindingDataSetHandle(handle) != null) {
    for (Iterator<?> iter=dataset.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP).iterator(); iter.hasNext(); ) {
      ColumnHintHandle element=(ColumnHintHandle)iter.next();
      if (element.getColumnName().equals(bindingname) || bindingname.equals(element.getAlias())) {
        return element.getActionHandle();
      }
    }
  }
  return null;
}
Program: 65268
Project: 65268
Buggy source:
public static boolean isLinkedDataModelMeasureView(MeasureViewHandle mv){
  String refColumn=getRefLinkedDataModelColumnName(mv);
  return refColumn != null && !refColumn.isEmpty();
}

Fixed version (ground truth):
public static boolean isLinkedDataModelMeasureView(MeasureViewHandle mv){
  String refColumn=getRefLinkedDataModelColumnName(mv);
  return refColumn != null && refColumn.trim().length() > 0;
}
Program: 65269
Project: 65269
Buggy source:
public static String getRefLinkedDataModelColumnName(MeasureViewHandle mv){
  if (mv == null) {
    return null;
  }
  if (!isBoundToLinkedDataSet(mv.getCrosstab())) {
    return null;
  }
  String refColumnName=null;
  if (mv instanceof ComputedMeasureViewHandle) {
    ComputedColumnHandle ch=getMeasureBindingColumnHandle(mv);
    if (ch != null && ch.getAggregateFunction() != null && !ch.getAggregateFunction().isEmpty() && ch.getCalculationType() == null) {
      ExpressionHandle expr=ch.getExpressionProperty(ComputedColumn.EXPRESSION_MEMBER);
      String expression=expr.getStringExpression();
      if (expression != null) {
        Pattern p=null;
        if (ExpressionType.JAVASCRIPT.equalsIgnoreCase(expr.getType())) {
          p=Pattern.compile(ExpressionUtil.DATASET_ROW_INDICATOR + "String_Node_Str");
        }
 else {
          p=Pattern.compile("String_Node_Str" + BRS_DATASET_ROW_INDICATOR + "String_Node_Str");
        }
        Matcher m=p.matcher(expression);
        if (m.find()) {
          return m.group(1);
        }
      }
    }
  }
 else {
    refColumnName=mv.getCubeMeasureName();
  }
  return refColumnName;
}

Fixed version (ground truth):
public static String getRefLinkedDataModelColumnName(MeasureViewHandle mv){
  if (mv == null) {
    return null;
  }
  if (!isBoundToLinkedDataSet(mv.getCrosstab())) {
    return null;
  }
  String refColumnName=null;
  if (mv instanceof ComputedMeasureViewHandle) {
    ComputedColumnHandle ch=getMeasureBindingColumnHandle(mv);
    if (ch != null && ch.getAggregateFunction() != null && ch.getAggregateFunction().trim().length() > 0 && ch.getCalculationType() == null) {
      ExpressionHandle expr=ch.getExpressionProperty(ComputedColumn.EXPRESSION_MEMBER);
      String expression=expr.getStringExpression();
      if (expression != null) {
        Pattern p=null;
        if (ExpressionType.JAVASCRIPT.equalsIgnoreCase(expr.getType())) {
          p=Pattern.compile(ExpressionUtil.DATASET_ROW_INDICATOR + "String_Node_Str");
        }
 else {
          p=Pattern.compile("String_Node_Str" + BRS_DATASET_ROW_INDICATOR + "String_Node_Str");
        }
        Matcher m=p.matcher(expression);
        if (m.find()) {
          return m.group(1);
        }
      }
    }
  }
 else {
    refColumnName=mv.getCubeMeasureName();
  }
  return refColumnName;
}
Program: 65270
Project: 65270
Buggy source:
public static boolean validateBinding(ComputedColumnHandle column,String columnName){
  if (column == null) {
    return false;
  }
  if (columnName == null || columnName.isEmpty()) {
    columnName="String_Node_Str";
  }
  ExpressionHandle expr=column.getExpressionProperty(ComputedColumn.EXPRESSION_MEMBER);
  String expression=expr.getStringExpression();
  if (expression != null) {
    if (ExpressionType.JAVASCRIPT.equalsIgnoreCase(expr.getType())) {
      Pattern p=Pattern.compile("String_Node_Str" + columnName + "String_Node_Str");
      return p.matcher(expression).find();
    }
 else {
      Pattern p=Pattern.compile("String_Node_Str" + columnName + "String_Node_Str");
      return p.matcher(expression).find();
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean validateBinding(ComputedColumnHandle column,String columnName){
  if (column == null) {
    return false;
  }
  if (columnName == null || columnName.trim().length() <= 0) {
    columnName="String_Node_Str";
  }
  ExpressionHandle expr=column.getExpressionProperty(ComputedColumn.EXPRESSION_MEMBER);
  String expression=expr.getStringExpression();
  if (expression != null) {
    if (ExpressionType.JAVASCRIPT.equalsIgnoreCase(expr.getType())) {
      Pattern p=Pattern.compile("String_Node_Str" + columnName + "String_Node_Str");
      return p.matcher(expression).find();
    }
 else {
      Pattern p=Pattern.compile("String_Node_Str" + columnName + "String_Node_Str");
      return p.matcher(expression).find();
    }
  }
  return false;
}
Program: 65271
Project: 65271
Buggy source:
private SheetHandler(StylesTable st,SharedStringsTable sst,XlsxRowCallBack callback,int xlsxRowsToRead){
  this.sst=sst;
  this.st=st;
  this.callback=callback;
  values=new ArrayList<Object>();
  this.cellDataType=cDataType.NUMBER;
  this.xlsxRowsToRead=xlsxRowsToRead;
  sdf=new SimpleDateFormat();
}

Fixed version (ground truth):
private SheetHandler(StylesTable st,SharedStringsTable sst,XlsxRowCallBack callback,int xlsxRowsToRead){
  this.sst=sst;
  this.st=st;
  this.callback=callback;
  values=new ArrayList<Object>();
  this.cellDataType=cDataType.NUMBER;
  this.xlsxRowsToRead=xlsxRowsToRead;
  sdf=new SimpleDateFormat("String_Node_Str");
}
Program: 65273
Project: 65273
Buggy source:
/** 
 * Anything before do service.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
protected void doPreService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  BaseAttributeBean attrBean=(BaseAttributeBean)request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
  String format=attrBean.getFormat();
  String emitterId=attrBean.getEmitterId();
  String openType=ParameterAccessor.getOpenType(request);
  if (ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format)) {
    response.setContentType("String_Node_Str");
  }
 else {
    String mimeType=ParameterAccessor.getEmitterMimeType(emitterId);
    if (mimeType == null) {
      mimeType=ReportEngineService.getInstance().getMIMEType(format);
    }
    if (mimeType != null && mimeType.length() > 0)     response.setContentType(mimeType);
 else     response.setContentType("String_Node_Str");
  }
  String filename=ParameterAccessor.getExportFilename(new BirtContext(request,response),format,emitterId);
  response.setHeader("String_Node_Str",openType + "String_Node_Str" + filename+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Anything before do service.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
protected void doPreService(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  BaseAttributeBean attrBean=(BaseAttributeBean)request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
  String format=attrBean.getFormat();
  String emitterId=attrBean.getEmitterId();
  String openType=ParameterAccessor.getOpenType(request);
  if (ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format)) {
    response.setContentType("String_Node_Str");
  }
 else {
    String mimeType=ParameterAccessor.getEmitterMimeType(emitterId);
    if (mimeType == null) {
      mimeType=ReportEngineService.getInstance().getMIMEType(format);
    }
    if (mimeType != null && mimeType.length() > 0)     response.setContentType(mimeType);
 else     response.setContentType("String_Node_Str");
  }
  String filename=ParameterAccessor.getExportFilename(new BirtContext(request,response),format,emitterId);
  response.setHeader("String_Node_Str",ParameterAccessor.htmlHeaderValueEncode(openType) + "String_Node_Str" + ParameterAccessor.htmlHeaderValueEncode(filename)+ "String_Node_Str");
}
Program: 65275
Project: 65275
Buggy source:
/** 
 * Get report locale from a given string.
 * @param locale locale string
 * @return report locale
 */
public static Locale getLocaleFromString(String locale){
  if (locale == null || locale.length() <= 0) {
    return null;
  }
  String[] sp=locale.split("String_Node_Str");
  if (sp.length == 1) {
    return new Locale(locale);
  }
 else   if (sp.length == 2) {
    return new Locale(sp[0],sp[1]);
  }
 else {
    return new Locale(sp[0],sp[1],sp[2]);
  }
}

Fixed version (ground truth):
/** 
 * Get report locale from a given string.
 * @param locale locale string
 * @return report locale
 */
public static Locale getLocaleFromString(String locale){
  if (locale == null || locale.length() <= 0) {
    return null;
  }
  int len=locale.length();
  if (len != 2 && len != 5 && len < 7) {
    return null;
  }
  char ch0=locale.charAt(0);
  char ch1=locale.charAt(1);
  if (ch0 < 'a' || ch0 > 'z' || ch1 < 'a' || ch1 > 'z') {
    return null;
  }
  if (len == 2) {
    return new Locale(locale,"String_Node_Str");
  }
 else {
    if (locale.charAt(2) != '_') {
      return null;
    }
    char ch3=locale.charAt(3);
    if (ch3 == '_') {
      return new Locale(locale.substring(0,2),"String_Node_Str",locale.substring(4));
    }
    char ch4=locale.charAt(4);
    if (ch3 < 'A' || ch3 > 'Z' || ch4 < 'A' || ch4 > 'Z') {
      return null;
    }
    if (len == 5) {
      return new Locale(locale.substring(0,2),locale.substring(3,5));
    }
 else {
      if (locale.charAt(5) != '_') {
        return null;
      }
      return new Locale(locale.substring(0,2),locale.substring(3,5),locale.substring(6));
    }
  }
}
Program: 65276
Project: 65276
Buggy source:
private static boolean isCubeTopLevel(Query query,ReportItemHandle itemHandle){
  ExpressionCodec exprc=ChartModelHelper.instance().createExpressionCodec();
  String bindName=exprc.getBindingName(query.getDefinition());
  Iterator<ComputedColumnHandle> iterator=ChartReportItemUtil.getColumnDataBindings(itemHandle);
  while (iterator.hasNext()) {
    ComputedColumnHandle binding=iterator.next();
    if (binding.getName().equals(bindName)) {
      ChartItemUtil.loadExpression(exprc,binding);
      break;
    }
  }
  if (!exprc.isDimensionExpresion()) {
    return false;
  }
  CubeHandle cube=ChartReportItemHelper.instance().getBindingCubeHandle(itemHandle);
  String[] levels=exprc.getLevelNames();
  String dimensionName=levels[0];
  HierarchyHandle hieHandle=cube.getDimension(dimensionName).getDefaultHierarchy();
  if (hieHandle.getLevelCount() > 1) {
    LevelHandle lh=hieHandle.getLevel(0);
    if (lh.getName().equals(levels[1])) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private static boolean isCubeTopLevel(Query query,ReportItemHandle itemHandle){
  ExpressionCodec exprc=ChartModelHelper.instance().createExpressionCodec();
  String bindName=exprc.getBindingName(query.getDefinition());
  Iterator<ComputedColumnHandle> iterator=ChartReportItemUtil.getColumnDataBindings(itemHandle);
  while (iterator.hasNext()) {
    ComputedColumnHandle binding=iterator.next();
    if (binding.getName().equals(bindName)) {
      ChartItemUtil.loadExpression(exprc,binding);
      break;
    }
  }
  if (!exprc.isDimensionExpresion()) {
    return false;
  }
  CubeHandle cube=ChartReportItemHelper.instance().getBindingCubeHandle(itemHandle);
  String[] levels=exprc.getLevelNames();
  String dimensionName=levels[0];
  HierarchyHandle hieHandle=cube.getDimension(dimensionName).getDefaultHierarchy();
  if (hieHandle.getLevelCount() != 0 && (hieHandle.getLevelCount() == 1 || hieHandle.getLevel(0).getName().equals(levels[1]))) {
    return true;
  }
 else {
    return false;
  }
}
Program: 65277
Project: 65277
Buggy source:
private String getColumnName(String expression){
  List columnList=DEUtil.getVisiableColumnBindingsList(inputElement);
  for (Iterator iter=columnList.iterator(); iter.hasNext(); ) {
    ComputedColumnHandle cachedColumn=(ComputedColumnHandle)iter.next();
    String columnName=cachedColumn.getName();
    if (DEUtil.getColumnExpression(columnName).equals(expression)) {
      return columnName;
    }
  }
  return null;
}

Fixed version (ground truth):
private String getColumnName(String expression){
  List columnList=DEUtil.getVisiableColumnBindingsList(inputElement);
  for (Iterator iter=columnList.iterator(); iter.hasNext(); ) {
    ComputedColumnHandle cachedColumn=(ComputedColumnHandle)iter.next();
    String columnName=cachedColumn.getName();
    if (LinkedDataSetUtil.bindToLinkedDataSet(inputElement) ? DEUtil.getDataExpression(columnName).equals(expression) : DEUtil.getColumnExpression(columnName).equals(expression)) {
      return columnName;
    }
  }
  return null;
}
Program: 65278
Project: 65278
Buggy source:
protected void updateQueryProperties(QueryProperties queryProps){
  if (hasMaxDocumentToSkip()) {
    queryProps.setNumDocsToSkip(getMaxDocumentToSkip());
  }
 else {
    queryProps.setNumDocsToSkip(null);
  }
  if (hasBatchSize()) {
    queryProps.setBatchSize(getMaxBatchSize());
  }
 else {
    queryProps.setBatchSize(null);
  }
  if (hasDocumentSearchLimit()) {
    queryProps.setRuntimeMetaDataSearchLimit(getDocumentSearchLimit());
  }
  if (indexExpr != null) {
    queryProps.setIndexHints(indexExpr);
  }
  if (queryPreferenceMode != null) {
    queryProps.setQueryReadPreference(queryPreferenceMode);
  }
  if (tagSetValue != null) {
    queryProps.setQueryReadPreferenceTags(tagSetValue);
  }
  queryProps.setNoTimeOut(noTimeOut);
  queryProps.setPartialResultsOk(allowsPartialResults);
  queryProps.setAutoFlattening(flattenNestedDocument);
}

Fixed version (ground truth):
protected void updateQueryProperties(QueryProperties queryProps){
  if (hasMaxDocumentToSkip()) {
    queryProps.setNumDocsToSkip(getMaxDocumentToSkip());
  }
 else {
    queryProps.setNumDocsToSkip(null);
  }
  if (hasBatchSize()) {
    queryProps.setBatchSize(getMaxBatchSize());
  }
 else {
    queryProps.setBatchSize(null);
  }
  if (hasDocumentSearchLimit()) {
    queryProps.setRuntimeMetaDataSearchLimit(getDocumentSearchLimit());
  }
 else {
    queryProps.setRuntimeMetaDataSearchLimit(null);
  }
  if (indexExpr != null) {
    queryProps.setIndexHints(indexExpr);
  }
  if (queryPreferenceMode != null) {
    queryProps.setQueryReadPreference(queryPreferenceMode);
  }
  if (tagSetValue != null) {
    queryProps.setQueryReadPreferenceTags(tagSetValue);
  }
  queryProps.setNoTimeOut(noTimeOut);
  queryProps.setPartialResultsOk(allowsPartialResults);
  queryProps.setAutoFlattening(flattenNestedDocument);
}
Program: 65280
Project: 65280
Buggy source:
public void run(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  IWorkbenchPage page=window.getActivePage();
  try {
    if (page == null) {
      throw new IllegalArgumentException();
    }
    page.openEditor(new ReportEditorInput(file),IReportEditorContants.DESIGN_EDITOR_ID,true);
    if (showCheatSheet && !cheatSheetId.equals("String_Node_Str")) {
      Display.getCurrent().getActiveShell().setData(page);
      new OpenCheatSheetAction(cheatSheetId).run();
    }
  }
 catch (  Exception e) {
    ExceptionUtil.handle(e);
  }
}

Fixed version (ground truth):
public void run(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  IWorkbenchPage page=window.getActivePage();
  try {
    if (page == null) {
      throw new IllegalArgumentException();
    }
    page.openEditor(new ReportEditorInput(file),IReportEditorContants.DESIGN_EDITOR_ID,true);
    if (showCheatSheet && !cheatSheetId.equals("String_Node_Str")) {
      Display.getCurrent().getActiveShell().setData(page);
      new OpenCheatSheetAction(cheatSheetId).run();
    }
    IReportResourceSynchronizer synchronizer=ReportPlugin.getDefault().getResourceSynchronizerService();
    if (synchronizer != null) {
      synchronizer.notifyResourceChanged(new ReportResourceChangeEvent(this,Path.fromOSString(file.getAbsolutePath()),IReportResourceChangeEvent.NewResource));
    }
  }
 catch (  Exception e) {
    ExceptionUtil.handle(e);
  }
}
Program: 65283
Project: 65283
Buggy source:
public void run(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  IWorkbenchPage page=window.getActivePage();
  try {
    if (page == null) {
      throw new IllegalArgumentException();
    }
    page.openEditor(new ReportEditorInput(file),IReportEditorContants.DESIGN_EDITOR_ID,true);
    if (showCheatSheet && !cheatSheetId.equals("String_Node_Str")) {
      Display.getCurrent().getActiveShell().setData(page);
      new OpenCheatSheetAction(cheatSheetId).run();
    }
  }
 catch (  Exception e) {
    ExceptionUtil.handle(e);
  }
}

Fixed version (ground truth):
public void run(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  IWorkbenchPage page=window.getActivePage();
  try {
    if (page == null) {
      throw new IllegalArgumentException();
    }
    page.openEditor(new ReportEditorInput(file),IReportEditorContants.DESIGN_EDITOR_ID,true);
    if (showCheatSheet && !cheatSheetId.equals("String_Node_Str")) {
      Display.getCurrent().getActiveShell().setData(page);
      new OpenCheatSheetAction(cheatSheetId).run();
    }
    IReportResourceSynchronizer synchronizer=ReportPlugin.getDefault().getResourceSynchronizerService();
    if (synchronizer != null) {
      synchronizer.notifyResourceChanged(new ReportResourceChangeEvent(this,Path.fromOSString(file.getAbsolutePath()),IReportResourceChangeEvent.NewResource));
    }
  }
 catch (  Exception e) {
    ExceptionUtil.handle(e);
  }
}
Program: 65284
Project: 65284
Buggy source:
public void startForeign(IForeignContent foreign) throws BirtException {
}

Fixed version (ground truth):
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    if (embedHtml) {
      int width=WordUtil.convertTo(foreign.getWidth(),context.getCurrentWidth(),reportDpi);
      width=Math.min(width,context.getCurrentWidth());
      wordWriter.startTable(foreign.getComputedStyle(),width,true);
      wordWriter.startTableRow(-1);
      wordWriter.startTableCell(width,foreign.getComputedStyle(),null);
      wordWriter.writeForeign(foreign);
      if (isInSpannedCell(foreign)) {
        wordWriter.endTableCell(true,true);
      }
 else {
        wordWriter.endTableCell(true,false);
      }
      wordWriter.endTableRow();
      wordWriter.endTable();
      context.setIsAfterTable(true);
      context.addContainer(true);
    }
 else {
      writeBookmark(foreign);
      writeToc(foreign);
      HTML2Content.html2Content(foreign);
      contentVisitor.visitChildren(foreign,null);
      adjustInline();
    }
  }
 else {
    Object rawValue=foreign.getRawValue();
    String foreignText=rawValue == null ? "String_Node_Str" : rawValue.toString();
    writeContent(AbstractEmitterImpl.NORMAL,foreignText,foreign);
  }
}
Program: 65286
Project: 65286
Buggy source:
boolean isInheritColumnsGroups(){
  return itemHandle.getDataSet() == null && ChartReportItemUtil.isContainerInheritable(itemHandle) && !context.isInheritColumnsOnly();
}

Fixed version (ground truth):
boolean isInheritColumnsGroups(){
  return itemHandle.getDataSet() == null && ChartReportItemUtil.isContainerInheritable(itemHandle) && !ChartReportItemUtil.isContainerGridHandle(itemHandle) && !context.isInheritColumnsOnly();
}
Program: 65287
Project: 65287
Buggy source:
/** 
 * Checks if the item's container is inheritable. Usually only Table and List can support inheritance.
 * @param itemHandle item
 * @return true means inheritable
 * @since 2.5
 */
public static boolean isContainerInheritable(ReportItemHandle itemHandle){
  DesignElementHandle container=itemHandle.getContainer();
  if (container instanceof CellHandle || container instanceof ListHandle || container instanceof ListGroupHandle) {
    while (container != null) {
      if (container instanceof ListingHandle) {
        return true;
      }
      container=container.getContainer();
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if the item's container is inheritable. Usually only Table and List can support inheritance.
 * @param itemHandle item
 * @return true means inheritable
 * @since 2.5
 */
public static boolean isContainerInheritable(ReportItemHandle itemHandle){
  DesignElementHandle container=itemHandle.getContainer();
  if (container instanceof CellHandle || container instanceof ListHandle || container instanceof ListGroupHandle) {
    while (container != null) {
      if (container instanceof ListingHandle) {
        return true;
      }
 else       if (container instanceof GridHandle) {
        return true;
      }
      container=container.getContainer();
    }
  }
  return false;
}
Program: 65288
Project: 65288
Buggy source:
private ISelection getNewSelection(ISelection selection){
  if (!(getModel() instanceof DesignElementHandle)) {
    return selection;
  }
  if (!(selection instanceof IStructuredSelection)) {
    return selection;
  }
  List temp=new ArrayList();
  List list=((IStructuredSelection)selection).toList();
  for (int i=0; i < list.size(); i++) {
    if (list.get(i) instanceof IElementPropertyDefn) {
      String name=((IElementPropertyDefn)list.get(i)).getName();
      Object obj=findData(name);
      if (obj != null) {
        temp.add(obj);
      }
 else {
        temp.add(list.get(i));
      }
    }
 else {
      temp.add(list.get(i));
    }
  }
  return new StructuredSelection(temp);
}

Fixed version (ground truth):
private ISelection getNewSelection(ISelection selection){
  if (!(getModel() instanceof DesignElementHandle)) {
    return selection;
  }
  if (!(selection instanceof IStructuredSelection)) {
    return selection;
  }
  List<Object> temp=new ArrayList<Object>();
  List list=((IStructuredSelection)selection).toList();
  for (int i=0; i < list.size(); i++) {
    if (list.get(i) instanceof IElementPropertyDefn) {
      String name=((IElementPropertyDefn)list.get(i)).getName();
      Object obj=findData(name);
      if (obj != null) {
        temp.add(obj);
      }
 else {
        temp.add(list.get(i));
      }
    }
 else {
      temp.add(list.get(i));
    }
  }
  return new StructuredSelection(temp);
}
Program: 65289
Project: 65289
Buggy source:
private String createSignature(IMethodInfo info){
  StringBuffer signature=new StringBuffer();
  String javaDoc=info.getJavaDoc();
  if (javaDoc != null && javaDoc.length() > 0) {
    signature.append("String_Node_Str");
    signature.append(info.getJavaDoc());
  }
  if (info instanceof ITemplateMethodInfo) {
    String code=((ITemplateMethodInfo)info).getCodeTemplate();
    if (code != null) {
      signature.append("String_Node_Str").append(code).append("String_Node_Str");
      return signature.toString();
    }
  }
  signature.append("String_Node_Str");
  signature.append(info.getName());
  signature.append("String_Node_Str");
  Iterator iter=info.argumentListIterator();
  if (iter.hasNext()) {
    IArgumentInfoList argumentList=(IArgumentInfoList)iter.next();
    for (Iterator argumentIter=argumentList.argumentsIterator(); argumentIter.hasNext(); ) {
      IArgumentInfo argument=(IArgumentInfo)argumentIter.next();
      String argName=argument.getName();
      if (argName == null || argName.length() == 0) {
        String type=argument.getType();
        argName=JSEditor.convertToParameterName(type);
      }
      signature.append(argName);
      if (argumentIter.hasNext()) {
        signature.append("String_Node_Str");
      }
    }
  }
  signature.append("String_Node_Str");
  return signature.toString();
}

Fixed version (ground truth):
private String createSignature(IMethodInfo info){
  StringBuffer signature=new StringBuffer();
  String javaDoc=info.getJavaDoc();
  if (javaDoc != null && javaDoc.length() > 0) {
    signature.append("String_Node_Str");
    signature.append(info.getJavaDoc());
  }
  if (info instanceof ITemplateMethodInfo) {
    String code=((ITemplateMethodInfo)info).getCodeTemplate();
    if (code != null) {
      signature.append("String_Node_Str").append(code).append("String_Node_Str");
      return signature.toString();
    }
  }
  signature.append("String_Node_Str");
  signature.append(info.getName());
  signature.append("String_Node_Str");
  Iterator<IArgumentInfoList> iter=info.argumentListIterator();
  if (iter.hasNext()) {
    IArgumentInfoList argumentList=iter.next();
    for (Iterator<IArgumentInfo> argumentIter=argumentList.argumentsIterator(); argumentIter.hasNext(); ) {
      IArgumentInfo argument=argumentIter.next();
      String argName=argument.getName();
      if (argName == null || argName.length() == 0) {
        String type=argument.getType();
        argName=JSEditor.convertToParameterName(type);
      }
      signature.append(argName);
      if (argumentIter.hasNext()) {
        signature.append("String_Node_Str");
      }
    }
  }
  signature.append("String_Node_Str");
  return signature.toString();
}
Program: 65290
Project: 65290
Buggy source:
public Object[] getElements(Object inputElement){
  List elements=new ArrayList();
  if (inputElement instanceof ExtendedItemHandle) {
    int selectedIndex=editor.cmbExpList.getSelectionIndex();
    if (selectedIndex >= 0) {
      String scriptName=editor.cmbExpList.getItem(editor.cmbExpList.getSelectionIndex());
      ExtendedItemHandle extHandle=(ExtendedItemHandle)inputElement;
      List methods=extHandle.getMethods(scriptName);
      if (methods != null && methods.size() > 0) {
        elements.add(0,Messages.getString("String_Node_Str"));
        elements.addAll(methods);
      }
    }
  }
 else   if (inputElement instanceof ReportDesignHandle) {
    int selectedIndex=editor.cmbExpList.getSelectionIndex();
    if (selectedIndex >= 0) {
      String scriptName=editor.cmbExpList.getItem(editor.cmbExpList.getSelectionIndex());
      if (JSEditor.CLIENT_SCRIPTS.equals(scriptName)) {
        List items=(List)((StructuredSelection)editor.cmbExprListViewer.getSelection()).getFirstElement();
        elements.addAll(items);
      }
    }
  }
  return elements.toArray();
}

Fixed version (ground truth):
public Object[] getElements(Object inputElement){
  List<Object> elements=new ArrayList<Object>();
  if (inputElement instanceof ExtendedItemHandle) {
    int selectedIndex=editor.cmbExpList.getSelectionIndex();
    if (selectedIndex >= 0) {
      String scriptName=editor.cmbExpList.getItem(editor.cmbExpList.getSelectionIndex());
      ExtendedItemHandle extHandle=(ExtendedItemHandle)inputElement;
      List methods=extHandle.getMethods(scriptName);
      if (methods != null && methods.size() > 0) {
        elements.add(0,Messages.getString("String_Node_Str"));
        elements.addAll(methods);
      }
    }
  }
 else   if (inputElement instanceof ReportDesignHandle) {
    int selectedIndex=editor.cmbExpList.getSelectionIndex();
    if (selectedIndex >= 0) {
      Object mainSelection=((StructuredSelection)editor.cmbExprListViewer.getSelection()).getFirstElement();
      if (mainSelection instanceof List) {
        elements.addAll((List)mainSelection);
      }
    }
  }
  return elements.toArray();
}
Program: 65292
Project: 65292
Buggy source:
public void handleEvent(Event event){
  cmbSubFunctions.deselectAll();
  ScriptParser parser=new ScriptParser(getEditorText());
  Collection coll=parser.getAllMethodInfo();
  for (Iterator itr=coll.iterator(); itr.hasNext(); ) {
    IScriptMethodInfo mtd=(IScriptMethodInfo)itr.next();
    cmbSubFunctions.markSelection(METHOD_DISPLAY_INDENT + mtd.getName());
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  cmbSubFunctions.deselectAll();
  ScriptParser parser=new ScriptParser(getEditorText());
  Collection<IScriptMethodInfo> coll=parser.getAllMethodInfo();
  for (Iterator<IScriptMethodInfo> itr=coll.iterator(); itr.hasNext(); ) {
    IScriptMethodInfo mtd=itr.next();
    cmbSubFunctions.markSelection(METHOD_DISPLAY_INDENT + mtd.getName());
  }
}
Program: 65294
Project: 65294
Buggy source:
private Position findMethod(IMethodInfo methodInfo){
  ScriptParser parser=new ScriptParser(editor.getEditorText());
  Collection coll=parser.getAllMethodInfo();
  for (Iterator itr=coll.iterator(); itr.hasNext(); ) {
    IScriptMethodInfo mtd=(IScriptMethodInfo)itr.next();
    if (methodInfo.getName().equals(mtd.getName())) {
      return mtd.getPosition();
    }
  }
  return null;
}

Fixed version (ground truth):
private Position findMethod(IMethodInfo methodInfo){
  ScriptParser parser=new ScriptParser(editor.getEditorText());
  Collection<IScriptMethodInfo> coll=parser.getAllMethodInfo();
  for (Iterator<IScriptMethodInfo> itr=coll.iterator(); itr.hasNext(); ) {
    IScriptMethodInfo mtd=itr.next();
    if (methodInfo.getName().equals(mtd.getName())) {
      return mtd.getPosition();
    }
  }
  return null;
}
Program: 65296
Project: 65296
Buggy source:
protected static String convertToParameterName(String fullName){
  fullName=fullName.substring(fullName.lastIndexOf('.') + 1);
  int upCase=0;
  SortedMap caps=new TreeMap();
  for (int i=0; i < fullName.length(); i++) {
    char character=fullName.charAt(i);
    if (Character.isUpperCase(character)) {
      upCase++;
      caps.put(Integer.valueOf(i),Integer.valueOf(character));
    }
  }
  if (upCase > 2) {
    StringBuffer result=new StringBuffer();
    for (Iterator iter=caps.values().iterator(); iter.hasNext(); ) {
      result.append((char)((Integer)iter.next()).intValue());
    }
    return result.toString().toLowerCase();
  }
 else   return fullName.substring(0,1).toLowerCase() + fullName.substring(1);
}

Fixed version (ground truth):
protected static String convertToParameterName(String fullName){
  fullName=fullName.substring(fullName.lastIndexOf('.') + 1);
  int upCase=0;
  SortedMap<Object,Object> caps=new TreeMap<Object,Object>();
  for (int i=0; i < fullName.length(); i++) {
    char character=fullName.charAt(i);
    if (Character.isUpperCase(character)) {
      upCase++;
      caps.put(Integer.valueOf(i),Integer.valueOf(character));
    }
  }
  if (upCase > 2) {
    StringBuffer result=new StringBuffer();
    for (Iterator<Object> iter=caps.values().iterator(); iter.hasNext(); ) {
      result.append((char)((Integer)iter.next()).intValue());
    }
    return result.toString().toLowerCase();
  }
 else   return fullName.substring(0,1).toLowerCase() + fullName.substring(1);
}
Program: 65297
Project: 65297
Buggy source:
public void partBroughtToTop(IWorkbenchPart part){
}

Fixed version (ground truth):
public void partBroughtToTop(IWorkbenchPart part){
  if (part instanceof MultiPageReportEditor) {
    MultiPageReportEditor topEditor=(MultiPageReportEditor)part;
    if (topEditor.getModel() != null && topEditor.getModel() != SessionHandleAdapter.getInstance().getModule()) {
      SessionHandleAdapter.getInstance().setModule(topEditor.getModel());
      updateRelatedViews();
    }
  }
}
Program: 65299
Project: 65299
Buggy source:
public void partBroughtToTop(IWorkbenchPart part){
  if (instance == null)   return;
  if (part instanceof ReportEditorProxy) {
    instance.partBroughtToTop(((ReportEditorProxy)part).getEditorPart());
  }
 else {
    instance.partBroughtToTop(part);
  }
  partActivated(part);
}

Fixed version (ground truth):
public void partBroughtToTop(IWorkbenchPart part){
  if (instance == null)   return;
  if (part instanceof ReportEditorProxy) {
    instance.partBroughtToTop(((ReportEditorProxy)part).getEditorPart());
  }
 else {
    instance.partBroughtToTop(part);
  }
}
Program: 65300
Project: 65300
Buggy source:
protected void processGroup(ListingDesign listing,int groupLevel,boolean breakBefore){
  GroupDesign group=listing.getGroup(groupLevel);
  PolicyNode parent=parentNode;
  visitReportItem(group,Boolean.TRUE);
  parentNode=currentNode;
  if (group.getPageBreakAfter() != null) {
    currentNode.breakAfter=true;
  }
  if (breakBefore || group.getPageBreakBefore() != null) {
    currentNode.breakBefore=true;
  }
  BandDesign header=group.getHeader();
  if (header != null) {
    header.accept(this,null);
  }
  if (++groupLevel < listing.getGroupCount()) {
    processGroup(listing,groupLevel,header != null);
    processGroup(listing,groupLevel,false);
  }
 else {
    processDetail(listing,true);
    processDetail(listing,false);
  }
  BandDesign footer=group.getFooter();
  if (footer != null) {
    footer.accept(this,Boolean.TRUE);
  }
  parentNode=parent;
}

Fixed version (ground truth):
protected void processGroup(ListingDesign listing,int groupLevel,boolean breakBefore){
  GroupDesign group=listing.getGroup(groupLevel);
  PolicyNode parent=parentNode;
  visitReportItem(group,Boolean.TRUE);
  parentNode=currentNode;
  if (group.getPageBreakAfter() != null) {
    currentNode.breakAfter=true;
  }
  if (breakBefore || group.getPageBreakBefore() != null) {
    currentNode.breakBefore=true;
  }
  BandDesign header=group.getHeader();
  if (header != null) {
    header.accept(this,null);
  }
  if (++groupLevel < listing.getGroupCount()) {
    processGroup(listing,groupLevel,header != null);
  }
 else {
    processDetail(listing,true);
    processDetail(listing,false);
  }
  BandDesign footer=group.getFooter();
  if (footer != null) {
    footer.accept(this,Boolean.TRUE);
  }
  parentNode=parent;
}
Program: 65301
Project: 65301
Buggy source:
protected PolicyNode findNextNode(PolicyNode node){
  if (node == null || node.parent == null) {
    return null;
  }
  int index=node.parent.children.indexOf(node);
  int count=node.parent.children.size();
  if (index < count - 1) {
    return (PolicyNode)node.parent.children.get(index + 1);
  }
 else {
    return findPreviousNode(node.parent);
  }
}

Fixed version (ground truth):
protected PolicyNode findNextNode(PolicyNode node){
  if (node.design instanceof GroupDesign)   return node;
  if (node == null || node.parent == null) {
    return null;
  }
  int index=node.parent.children.indexOf(node);
  int count=node.parent.children.size();
  if (index < count - 1) {
    return (PolicyNode)node.parent.children.get(index + 1);
  }
 else {
    return findNextNode(node.parent);
  }
}
Program: 65302
Project: 65302
Buggy source:
protected PolicyNode findPreviousNode(PolicyNode node){
  if (node == null || node.parent == null) {
    return null;
  }
  int index=node.parent.children.indexOf(node);
  if (index < 1) {
    return findPreviousNode(node.parent);
  }
 else {
    return (PolicyNode)node.parent.children.get(index - 1);
  }
}

Fixed version (ground truth):
protected PolicyNode findPreviousNode(PolicyNode node){
  if (node.design instanceof GroupDesign)   return node;
  if (node == null || node.parent == null) {
    return null;
  }
  int index=node.parent.children.indexOf(node);
  if (index < 1) {
    return findPreviousNode(node.parent);
  }
 else {
    return (PolicyNode)node.parent.children.get(index - 1);
  }
}
Program: 65303
Project: 65303
Buggy source:
private String getOrthogonalSeriesTitle(Chart chart){
  if (chart instanceof ChartWithAxes) {
    return Messages.getString("String_Node_Str");
  }
 else   if (chart instanceof DialChart) {
    return Messages.getString("String_Node_Str");
  }
  return Messages.getString("String_Node_Str");
}

Fixed version (ground truth):
protected String getOrthogonalSeriesTitle(Chart chart){
  if (chart instanceof ChartWithAxes) {
    return Messages.getString("String_Node_Str");
  }
 else   if (chart instanceof DialChart) {
    return Messages.getString("String_Node_Str");
  }
  return Messages.getString("String_Node_Str");
}
Program: 65304
Project: 65304
Buggy source:
private String getBaseSeriesTitle(Chart chart){
  if (chart instanceof ChartWithAxes) {
    return Messages.getString("String_Node_Str");
  }
  return Messages.getString("String_Node_Str");
}

Fixed version (ground truth):
protected String getBaseSeriesTitle(Chart chart){
  if (chart instanceof ChartWithAxes) {
    return Messages.getString("String_Node_Str");
  }
  return Messages.getString("String_Node_Str");
}
Program: 65305
Project: 65305
Buggy source:
public boolean performOk(){
  if (isValid()) {
    saveOutputColumns();
    ((DataSetHandle)getContainer().getModel()).removeListener(this);
    if (this.modelChanged) {
      ((DataSetEditor)this.getContainer()).updateDataSetDesign(this);
      this.modelChanged=false;
    }
    if (!pageActivated)     this.setAnalysisTypeForColumn();
    ((DataSetHandle)getContainer().getModel()).removeListener(this);
    return super.performOk();
  }
 else {
    ((DataSetHandle)getContainer().getModel()).removeListener(this);
    return false;
  }
}

Fixed version (ground truth):
public boolean performOk(){
  if (isValid()) {
    saveOutputColumns();
    ((DataSetHandle)getContainer().getModel()).removeListener(this);
    if (this.modelChanged) {
      ((DataSetEditor)this.getContainer()).updateDataSetDesign(this);
      this.modelChanged=false;
    }
    try {
      if (!pageActivated) {
        setAnalysisTypeForColumn();
      }
    }
 catch (    BirtException e) {
      ExceptionHandler.handle(e,true);
    }
    ((DataSetHandle)getContainer().getModel()).removeListener(this);
    return super.performOk();
  }
 else {
    ((DataSetHandle)getContainer().getModel()).removeListener(this);
    return false;
  }
}
Program: 65306
Project: 65306
Buggy source:
/** 
 * validates that the new name/alias from a column hint or a new custom column doesn't conflict with existing column names or aliases
 */
private boolean isValid(){
  boolean validate=true;
  String newColumnNameOrAlias;
  DataSetViewData[] items=null;
  if (viewer == null || viewer.getViewer() == null) {
    try {
      items=DataSetProvider.getCurrentInstance().getColumns(((DataSetEditor)getContainer()).getHandle(),false,true);
    }
 catch (    Exception e) {
      DataSetExceptionHandler.handle(e);
    }
  }
 else {
    items=(DataSetViewData[])viewer.getViewer().getInput();
  }
  for (int i=0; items != null && i < items.length && validate; i++) {
    newColumnNameOrAlias=items[i].getAlias();
    if (newColumnNameOrAlias != null && newColumnNameOrAlias.length() > 0) {
      for (int n=0; n < items.length; n++) {
        if (i == n)         continue;
        if ((items[n].getName() != null && items[n].getName().equals(newColumnNameOrAlias)) || (items[n].getAlias() != null && items[n].getAlias().equals(newColumnNameOrAlias))) {
          validate=false;
          getContainer().setMessage(Messages.getFormattedString("String_Node_Str",new Object[]{newColumnNameOrAlias,Integer.valueOf(n + 1)}),IMessageProvider.ERROR);
          break;
        }
      }
    }
  }
  return validate;
}

Fixed version (ground truth):
/** 
 * validates that the new name/alias from a column hint or a new custom column doesn't conflict with existing column names or aliases
 */
private boolean isValid(){
  boolean validate=true;
  String newColumnNameOrAlias;
  DataSetViewData[] items=null;
  if (viewer == null || viewer.getViewer() == null) {
    try {
      items=DataSetProvider.getCurrentInstance().getColumns(((DataSetEditor)getContainer()).getHandle(),false,true);
    }
 catch (    Exception e) {
      ExceptionHandler.handle(e,true);
    }
  }
 else {
    items=(DataSetViewData[])viewer.getViewer().getInput();
  }
  for (int i=0; items != null && i < items.length && validate; i++) {
    newColumnNameOrAlias=items[i].getAlias();
    if (newColumnNameOrAlias != null && newColumnNameOrAlias.length() > 0) {
      for (int n=0; n < items.length; n++) {
        if (i == n)         continue;
        if ((items[n].getName() != null && items[n].getName().equals(newColumnNameOrAlias)) || (items[n].getAlias() != null && items[n].getAlias().equals(newColumnNameOrAlias))) {
          validate=false;
          getContainer().setMessage(Messages.getFormattedString("String_Node_Str",new Object[]{newColumnNameOrAlias,Integer.valueOf(n + 1)}),IMessageProvider.ERROR);
          break;
        }
      }
    }
  }
  return validate;
}
Program: 65307
Project: 65307
Buggy source:
protected void setAnalysisTypeForColumn(){
  try {
    if (!isNewlyCreated) {
      DataSetHandle ds=((DataSetEditor)getContainer()).getHandle();
      DataSetViewData[] viewData=DataSetProvider.getCurrentInstance().getColumns(ds,true);
      PropertyHandle handle=ds.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
      Iterator iter=handle.iterator();
      if (iter != null) {
        while (iter.hasNext()) {
          ColumnHintHandle hint=(ColumnHintHandle)iter.next();
          for (int i=0; i < viewData.length; i++) {
            if (viewData[i].getName().equals(hint.getColumnName())) {
              if (hint.getAnalysis() == null) {
                try {
                  hint.setAnalysis(DataSetUIUtility.getDefaultAnalysisType(viewData[i].getDataTypeName()));
                }
 catch (                SemanticException e) {
                  ExceptionHandler.handle(e);
                }
              }
              continue;
            }
          }
        }
      }
    }
  }
 catch (  BirtException e) {
    DataSetExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
protected void setAnalysisTypeForColumn() throws BirtException {
  if (!isNewlyCreated) {
    DataSetHandle ds=((DataSetEditor)getContainer()).getHandle();
    DataSetViewData[] viewData=DataSetProvider.getCurrentInstance().getColumns(ds,true);
    PropertyHandle handle=ds.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
    Iterator iter=handle.iterator();
    if (iter != null) {
      while (iter.hasNext()) {
        ColumnHintHandle hint=(ColumnHintHandle)iter.next();
        for (int i=0; i < viewData.length; i++) {
          if (viewData[i].getName().equals(hint.getColumnName())) {
            if (hint.getAnalysis() == null) {
              try {
                hint.setAnalysis(DataSetUIUtility.getDefaultAnalysisType(viewData[i].getDataTypeName()));
              }
 catch (              SemanticException e) {
                ExceptionHandler.handle(e,true);
              }
            }
            continue;
          }
        }
      }
    }
  }
}