nus-yam/ex-repair huggingface dataset:
Program: 71959
Project: 71959
Buggy source:
/** 
 * Notifies this listener that the selection has changed. <p> This method is called when the selection changes from one to a <code>non-null</code> value, but not when the selection changes to <code>null</code>. If there is a requirement to be notified in the latter scenario, implement <code>INullSelectionListener</code>. The event will be posted through this method. </p>
 * @param part the workbench part containing the selection
 * @param selection the current selection. This may be <code>null</code> if <code>INullSelectionListener</code> is implemented.
 */
public void handleSelectionChanged(ISelection selection){
  List modelList=getModelList(selection);
  if (modelList == null || modelList.size() == 0)   return;
  pageGenerator=builder.getPageGenerator(modelList);
  if (container != null && !container.isDisposed())   pageGenerator.createControl(container,modelList);
  if (SessionHandleAdapter.getInstance().getReportDesignHandle() != null) {
    restoreLibraryPropertiesAction.setEnabled(hasLocalProperties(selection));
    handleGlobalAction();
    setPartName();
  }
  this.selection=selection;
}

Fixed version (ground truth):
/** 
 * Notifies this listener that the selection has changed. <p> This method is called when the selection changes from one to a <code>non-null</code> value, but not when the selection changes to <code>null</code>. If there is a requirement to be notified in the latter scenario, implement <code>INullSelectionListener</code>. The event will be posted through this method. </p>
 * @param part the workbench part containing the selection
 * @param selection the current selection. This may be <code>null</code> if <code>INullSelectionListener</code> is implemented.
 */
public void handleSelectionChanged(ISelection selection){
  List modelList=getModelList(selection);
  if (modelList == null || modelList.size() == 0)   return;
  pageGenerator=builder.getPageGenerator(modelList);
  if (container != null && !container.isDisposed()) {
    pageGenerator.createControl(container,modelList);
    pageGenerator.refresh();
  }
  if (SessionHandleAdapter.getInstance().getReportDesignHandle() != null) {
    restoreLibraryPropertiesAction.setEnabled(hasLocalProperties(selection));
    handleGlobalAction();
    setPartName();
  }
  this.selection=selection;
}
Program: 71960
Project: 71960
Buggy source:
public void createTabItems(List input){
  if (basicPage == null || basicPage.getControl().isDisposed()) {
    super.createTabItems(input);
    tabFolder.setLayout(new FillLayout());
    basicPage=new BaseAttributePage();
    basicPage.buildUI(tabFolder);
    CTabItem tabItem=new CTabItem(tabFolder,SWT.NONE);
    tabItem.setText(ATTRIBUTESTITLE);
    tabItem.setControl(basicPage.getControl());
    if (customProvider != null)     basicPage.setCategoryProvider(customProvider);
 else     basicPage.setCategoryProvider(factory.getCategoryProvider(input));
  }
  basicPage.setInput(input);
  addSelectionListener(this);
  basicPage.refresh();
}

Fixed version (ground truth):
public void createTabItems(List input){
  if (basicPage == null || basicPage.getControl().isDisposed()) {
    super.createTabItems(input);
    tabFolder.setLayout(new FillLayout());
    basicPage=new BaseAttributePage();
    basicPage.buildUI(tabFolder);
    CTabItem tabItem=new CTabItem(tabFolder,SWT.NONE);
    tabItem.setText(ATTRIBUTESTITLE);
    tabItem.setControl(basicPage.getControl());
    if (customProvider != null)     basicPage.setCategoryProvider(customProvider);
 else     basicPage.setCategoryProvider(factory.getCategoryProvider(input));
  }
}
Program: 71961
Project: 71961
Buggy source:
public void refresh(){
  createTabItems(input);
}

Fixed version (ground truth):
public void refresh(){
  createTabItems(input);
  basicPage.setInput(input);
  addSelectionListener(this);
  basicPage.refresh();
}
Program: 71962
Project: 71962
Buggy source:
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
  createTabItems((List)input);
}

Fixed version (ground truth):
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
}
Program: 71963
Project: 71963
Buggy source:
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
  createTabItems((List)input);
}

Fixed version (ground truth):
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
}
Program: 71964
Project: 71964
Buggy source:
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
  createTabItems((List)input);
}

Fixed version (ground truth):
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
}
Program: 71965
Project: 71965
Buggy source:
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
  createTabItems((List)input);
}

Fixed version (ground truth):
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
}
Program: 71966
Project: 71966
Buggy source:
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
  createTabItems((List)input);
}

Fixed version (ground truth):
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
}
Program: 71967
Project: 71967
Buggy source:
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
  createTabItems((List)input);
}

Fixed version (ground truth):
public void createControl(Composite parent,Object input){
  super.createControl(parent,input);
}
Program: 71968
Project: 71968
Buggy source:
private ColumnHandleAdapter getColumnAdapter(DesignElementHandle handle){
  return (ColumnHandleAdapter)HandleAdapterFactory.getInstance().getColumnHandleAdapter(handle);
}

Fixed version (ground truth):
private ColumnHandleAdapter getColumnAdapter(DesignElementHandle handle){
  return HandleAdapterFactory.getInstance().getColumnHandleAdapter(handle);
}
Program: 71970
Project: 71970
Buggy source:
private RowHandleAdapter getRowAdapter(DesignElementHandle handle){
  return (RowHandleAdapter)HandleAdapterFactory.getInstance().getRowHandleAdapter(handle);
}

Fixed version (ground truth):
private RowHandleAdapter getRowAdapter(DesignElementHandle handle){
  return HandleAdapterFactory.getInstance().getRowHandleAdapter(handle);
}
Program: 71971
Project: 71971
Buggy source:
public void createControl(Composite parent,Object input){
  setCategoryProvider(ChartCategoryProviderFactory.getInstance().getCategoryProvider(input));
  super.createControl(parent,input);
  createTabItems((List)input);
}

Fixed version (ground truth):
public void createControl(Composite parent,Object input){
  setCategoryProvider(ChartCategoryProviderFactory.getInstance().getCategoryProvider(input));
  super.createControl(parent,input);
}
Program: 71972
Project: 71972
Buggy source:
public void createControl(Composite parent,Object input){
  setCategoryProvider(CrosstabCellCategoryProviderFactory.getInstance().getCategoryProvider(input));
  super.createControl(parent,input);
  createTabItems((List)input);
}

Fixed version (ground truth):
public void createControl(Composite parent,Object input){
  setCategoryProvider(CrosstabCellCategoryProviderFactory.getInstance().getCategoryProvider(input));
  super.createControl(parent,input);
}
Program: 71973
Project: 71973
Buggy source:
public void createControl(Composite parent,Object input){
  setCategoryProvider(CrosstabCategoryProviderFactory.getInstance().getCategoryProvider(input));
  super.createControl(parent,input);
  createTabItems((List)input);
}

Fixed version (ground truth):
public void createControl(Composite parent,Object input){
  setCategoryProvider(CrosstabCategoryProviderFactory.getInstance().getCategoryProvider(input));
  super.createControl(parent,input);
}
Program: 71974
Project: 71974
Buggy source:
public static String formatNumberAsScienceNotation(Number data){
  DecimalFormat numberFormat=new DecimalFormat("String_Node_Str");
  return numberFormat.format(data);
}

Fixed version (ground truth):
public static String formatNumberAsScienceNotation(Number data){
}
Program: 71975
Project: 71975
Buggy source:
public static String formatNumberAsDecimal(Number data){
  DecimalFormat numberFormat=new DecimalFormat("String_Node_Str");
  return numberFormat.format(data);
}

Fixed version (ground truth):
public static String formatNumberAsDecimal(Object data){
  Number number=(Number)data;
  DecimalFormat numberFormat=new DecimalFormat("String_Node_Str");
  return numberFormat.format(number);
}
Program: 71976
Project: 71976
Buggy source:
public static boolean isBigNumber(Number number){
  try {
    BigDecimal num=null;
    if (number instanceof BigDecimal) {
      num=(BigDecimal)number;
    }
 else {
      num=new BigDecimal(number.toString());
    }
    return num.compareTo(MAX_DOUBLE) == 1;
  }
 catch (  Exception e) {
    return false;
  }
}

Fixed version (ground truth):
public static boolean isBigNumber(Object number){
  try {
    BigDecimal num=null;
    if (number instanceof BigDecimal) {
      num=(BigDecimal)number;
    }
 else {
      num=new BigDecimal(number.toString());
    }
    return num.compareTo(MAX_DOUBLE) == 1;
  }
 catch (  Exception e) {
    return false;
  }
}
Program: 71977
Project: 71977
Buggy source:
public void writeText(Data d){
  writer.openTag("String_Node_Str");
  if (d.getDatatype().equals(Data.NUMBER)) {
    if (d.getText().equals((NAN_STRING))) {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
 else {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
  }
 else   if (d.getDatatype().equals(Data.DATE)) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  d.formatTxt();
  String txt=d.getText();
  if (CSSConstants.CSS_CAPITALIZE_VALUE.equalsIgnoreCase(d.getStyleEntry().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=capitalize(txt);
  }
 else   if (CSSConstants.CSS_UPPERCASE_VALUE.equalsIgnoreCase(d.getStyleEntry().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toUpperCase();
  }
 else   if (CSSConstants.CSS_LOWERCASE_VALUE.equalsIgnoreCase(d.getStyleEntry().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toLowerCase();
  }
  writer.text(txt);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void writeText(Data d){
  writer.openTag("String_Node_Str");
  if (d.getDatatype().equals(Data.NUMBER)) {
    if (d.getText().equals(NAN_STRING) || d.isBigNumber()) {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
 else {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
  }
 else   if (d.getDatatype().equals(Data.DATE)) {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.attribute("String_Node_Str","String_Node_Str");
  }
  d.formatTxt();
  String txt=d.getText();
  if (CSSConstants.CSS_CAPITALIZE_VALUE.equalsIgnoreCase(d.getStyleEntry().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=capitalize(txt);
  }
 else   if (CSSConstants.CSS_UPPERCASE_VALUE.equalsIgnoreCase(d.getStyleEntry().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toUpperCase();
  }
 else   if (CSSConstants.CSS_LOWERCASE_VALUE.equalsIgnoreCase(d.getStyleEntry().getProperty(StyleConstant.TEXT_TRANSFORM))) {
    txt=txt.toLowerCase();
  }
  writer.text(txt);
  writer.closeTag("String_Node_Str");
}
Program: 71978
Project: 71978
Buggy source:
public void setUp() throws Exception {
  cx=Context.enter();
  scope=cx.initStandardObjects();
  ScriptableObject.putProperty(scope,"String_Node_Str",new BirtComp());
}

Fixed version (ground truth):
public void setUp() throws Exception {
  cx=Context.enter();
  scope=cx.initStandardObjects();
  new CoreJavaScriptInitializer().initialize(cx,scope);
}
Program: 71979
Project: 71979
Buggy source:
public void setUp() throws Exception {
  cx=Context.enter();
  scope=cx.initStandardObjects();
  ScriptableObject.putProperty(scope,"String_Node_Str",new BirtDateTime());
}

Fixed version (ground truth):
public void setUp() throws Exception {
  cx=Context.enter();
  scope=cx.initStandardObjects();
  new CoreJavaScriptInitializer().initialize(cx,scope);
}
Program: 71980
Project: 71980
Buggy source:
public void setUp() throws Exception {
  cx=Context.enter();
  scope=cx.initStandardObjects();
  ScriptableObject.putProperty(scope,"String_Node_Str",new BirtMath());
}

Fixed version (ground truth):
public void setUp() throws Exception {
  cx=Context.enter();
  scope=cx.initStandardObjects();
  new CoreJavaScriptInitializer().initialize(cx,scope);
}
Program: 71981
Project: 71981
Buggy source:
public void setUp() throws Exception {
  cx=Context.enter();
  scope=cx.initStandardObjects();
  ScriptableObject.putProperty(scope,"String_Node_Str",new BirtStr());
}

Fixed version (ground truth):
public void setUp() throws Exception {
  cx=Context.enter();
  scope=cx.initStandardObjects();
  new CoreJavaScriptInitializer().initialize(cx,scope);
}
Program: 71982
Project: 71982
Buggy source:
public void savePreferences(ChartPreferences preferences,OutputStream os) throws IOException {
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=rsChart.createResource(URI.createFileURI("String_Node_Str"));
  rChart.getContents().add(preferences);
  Map options=new HashMap();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  rChart.save(os,options);
}

Fixed version (ground truth):
public void savePreferences(ChartPreferences preferences,OutputStream os) throws IOException {
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=rsChart.createResource(URI.createFileURI("String_Node_Str"));
  rChart.getContents().add(preferences);
  Map<String,Object> options=new HashMap<String,Object>();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  rChart.save(os,options);
}
Program: 71983
Project: 71983
Buggy source:
public Chart read(URI uri) throws IOException {
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=null;
  rChart=rsChart.createResource(uri);
  Map options=new HashMap();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  rChart.load(options);
  return (Chart)rChart.getContents().get(0);
}

Fixed version (ground truth):
public Chart read(URI uri) throws IOException {
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=null;
  rChart=rsChart.createResource(uri);
  Map<String,Object> options=new HashMap<String,Object>();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  rChart.load(options);
  return (Chart)rChart.getContents().get(0);
}
Program: 71984
Project: 71984
Buggy source:
public ByteArrayOutputStream asXml(Chart cModel,boolean bStripHeaders) throws IOException {
  cModel.clearSections(IConstants.RUN_TIME);
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=rsChart.createResource(URI.createFileURI("String_Node_Str"));
  rChart.getContents().add(cModel);
  Map options=new HashMap();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  if (bStripHeaders) {
    options.put(XMLResource.OPTION_DECLARE_XML,Boolean.FALSE);
  }
  rChart.save(baos,options);
  return baos;
}

Fixed version (ground truth):
public ByteArrayOutputStream asXml(Chart cModel,boolean bStripHeaders) throws IOException {
  cModel.clearSections(IConstants.RUN_TIME);
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=rsChart.createResource(URI.createFileURI("String_Node_Str"));
  rChart.getContents().add(cModel);
  Map<String,Object> options=new HashMap<String,Object>();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  if (bStripHeaders) {
    options.put(XMLResource.OPTION_DECLARE_XML,Boolean.FALSE);
  }
  rChart.save(baos,options);
  return baos;
}
Program: 71985
Project: 71985
Buggy source:
public ChartPreferences loadPreferences(InputStream is) throws IOException {
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=rsChart.createResource(URI.createFileURI("String_Node_Str"));
  Map options=new HashMap();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  rChart.load(is,options);
  return (ChartPreferences)rChart.getContents().get(0);
}

Fixed version (ground truth):
public ChartPreferences loadPreferences(InputStream is) throws IOException {
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=rsChart.createResource(URI.createFileURI("String_Node_Str"));
  Map<String,Object> options=new HashMap<String,Object>();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  rChart.load(is,options);
  return (ChartPreferences)rChart.getContents().get(0);
}
Program: 71986
Project: 71986
Buggy source:
public void write(Chart cModel,URI uri) throws IOException {
  cModel.clearSections(IConstants.RUN_TIME);
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=null;
  rChart=rsChart.createResource(uri);
  rChart.getContents().add(cModel);
  Map options=new HashMap();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  rChart.save(options);
}

Fixed version (ground truth):
public void write(Chart cModel,URI uri) throws IOException {
  cModel.clearSections(IConstants.RUN_TIME);
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=null;
  rChart=rsChart.createResource(uri);
  rChart.getContents().add(cModel);
  Map<String,Object> options=new HashMap<String,Object>();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  rChart.save(options);
}
Program: 71987
Project: 71987
Buggy source:
public Chart fromXml(ByteArrayInputStream byais,boolean bStripHeaders) throws IOException {
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=rsChart.createResource(URI.createFileURI("String_Node_Str"));
  Map options=new HashMap();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  if (bStripHeaders) {
    options.put(XMLResource.OPTION_DECLARE_XML,Boolean.FALSE);
  }
  rChart.load(byais,options);
  return (Chart)rChart.getContents().get(0);
}

Fixed version (ground truth):
public Chart fromXml(ByteArrayInputStream byais,boolean bStripHeaders) throws IOException {
  ResourceSet rsChart=new ResourceSetImpl();
  rsChart.getResourceFactoryRegistry().getExtensionToFactoryMap().put("String_Node_Str",new ModelResourceFactoryImpl());
  Resource rChart=rsChart.createResource(URI.createFileURI("String_Node_Str"));
  Map<String,Object> options=new HashMap<String,Object>();
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  if (bStripHeaders) {
    options.put(XMLResource.OPTION_DECLARE_XML,Boolean.FALSE);
  }
  rChart.load(byais,options);
  return (Chart)rChart.getContents().get(0);
}
Program: 71988
Project: 71988
Buggy source:
/** 
 * Get the method definition given the method name.
 * @param name the name of the method to get
 * @return the definition of the method to get
 */
public IMethodInfo getMethod(String name){
  return (MethodInfo)findInfo(methods,name);
}

Fixed version (ground truth):
/** 
 * Get the method definition given the method name.
 * @param name the name of the method to get
 * @return the definition of the method to get
 */
public IMethodInfo getMethod(String name){
  return (IMethodInfo)findInfo(methods,name);
}
Program: 71989
Project: 71989
Buggy source:
/** 
 * Finds out the member/method information of a <code>ClassInfo</code>.
 * @param objs the colllection contains member/method information
 * @param name the name of a member/method
 * @return a <code>MemberInfo</code> or a <code>MethodInfo</code>corresponding to <code>objs</code>
 */
private Object findInfo(LinkedHashMap objs,String name){
  if (objs == null || name == null)   return null;
  return objs.get(name.toLowerCase());
}

Fixed version (ground truth):
/** 
 * Finds out the member/method information of a <code>ClassInfo</code>.
 * @param objs the colllection contains member/method information
 * @param name the name of a member/method
 * @return a <code>MemberInfo</code> or a <code>MethodInfo</code>corresponding to <code>objs</code>
 */
private Object findInfo(LinkedHashMap objs,String name){
  if (objs == null || name == null)   return null;
  return objs.get(name);
}
Program: 71990
Project: 71990
Buggy source:
/** 
 * Adds one member definition to this class definition.
 * @param memberDefn the definition of the member to add
 * @throws MetaDataException if the duplicate member name exists.
 */
public void addMemberDefn(IMemberInfo memberDefn) throws MetaDataException {
  if (members == null)   members=new LinkedHashMap();
  if (StringUtil.isBlank(memberDefn.getName()))   throw new MetaDataException(new String[]{memberDefn.getName()},MetaDataException.DESIGN_EXCEPTION_MISSING_MEMBER_NAME);
  if (findMember(memberDefn.getName()) != null) {
    throw new MetaDataException(new String[]{memberDefn.getName(),name},MetaDataException.DESIGN_EXCEPTION_DUPLICATE_MEMBER_NAME);
  }
  members.put(memberDefn.getName().toLowerCase(),memberDefn);
}

Fixed version (ground truth):
/** 
 * Adds one member definition to this class definition.
 * @param memberDefn the definition of the member to add
 * @throws MetaDataException if the duplicate member name exists.
 */
public void addMemberDefn(IMemberInfo memberDefn) throws MetaDataException {
  if (members == null)   members=new LinkedHashMap();
  if (StringUtil.isBlank(memberDefn.getName()))   throw new MetaDataException(new String[]{memberDefn.getName()},MetaDataException.DESIGN_EXCEPTION_MISSING_MEMBER_NAME);
  if (findMember(memberDefn.getName()) != null) {
    throw new MetaDataException(new String[]{memberDefn.getName(),name},MetaDataException.DESIGN_EXCEPTION_DUPLICATE_MEMBER_NAME);
  }
  members.put(memberDefn.getName(),memberDefn);
}
Program: 71991
Project: 71991
Buggy source:
/** 
 * Adds one method definition to this class definition.
 * @param methodInfo the definition of the method to add
 * @throws MetaDataException if the duplicate method name exists.
 */
public void addMethod(IMethodInfo methodInfo) throws MetaDataException {
  if (methods == null)   methods=new LinkedHashMap();
  if (StringUtil.isBlank(methodInfo.getName()))   throw new MetaDataException(new String[]{methodInfo.getName()},MetaDataException.DESIGN_EXCEPTION_MISSING_METHOD_NAME);
  methods.put(methodInfo.getName().toLowerCase(),methodInfo);
}

Fixed version (ground truth):
/** 
 * Adds one method definition to this class definition.
 * @param methodInfo the definition of the method to add
 * @throws MetaDataException if the duplicate method name exists.
 */
public void addMethod(IMethodInfo methodInfo) throws MetaDataException {
  if (methods == null)   methods=new LinkedHashMap();
  if (StringUtil.isBlank(methodInfo.getName()))   throw new MetaDataException(new String[]{methodInfo.getName()},MetaDataException.DESIGN_EXCEPTION_MISSING_METHOD_NAME);
  methods.put(methodInfo.getName(),methodInfo);
}
Program: 71992
Project: 71992
Buggy source:
/** 
 * Adds an optional argument list to the method information.
 * @param argumentList an optional argument list
 */
public void addArgumentList(IArgumentInfoList argumentList){
  if (arguments == null)   arguments=new ArrayList();
  ((ArrayList)arguments).add(argumentList);
}

Fixed version (ground truth):
/** 
 * Adds an optional argument list to the method information.
 * @param argumentList an optional argument list
 */
public void addArgumentList(IArgumentInfoList argumentList){
  if (arguments == null)   arguments=new ArrayList();
  arguments.add(argumentList);
}
Program: 71993
Project: 71993
Buggy source:
protected void preview(String format,boolean allowPage){
  FormEditor editor=UIUtil.getActiveReportEditor(false);
  ModuleHandle model=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (editor != null) {
    if (model.needsSave()) {
      editor.doSave(null);
    }
  }
  Map options=new HashMap();
  options.put(WebViewer.FORMAT_KEY,format);
  options.put(WebViewer.ALLOW_PAGE_KEY,Boolean.valueOf(allowPage));
  options.put(WebViewer.RESOURCE_FOLDER_KEY,ReportPlugin.getDefault().getResourceFolder());
  WebViewer.display(model.getFileName(),options);
}

Fixed version (ground truth):
protected void preview(String format,boolean allowPage){
  FormEditor editor=UIUtil.getActiveReportEditor(false);
  ModuleHandle model=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (editor != null) {
    if (model.needsSave()) {
      editor.doSave(null);
    }
  }
  Map options=new HashMap();
  options.put(WebViewer.FORMAT_KEY,format);
  options.put(WebViewer.ALLOW_PAGE_KEY,Boolean.valueOf(allowPage));
  options.put(WebViewer.RESOURCE_FOLDER_KEY,ReportPlugin.getDefault().getResourceFolder());
  Map viewerOptions=getViewerOptions();
  if (viewerOptions != null) {
    options.putAll(viewerOptions);
  }
  WebViewer.display(model.getFileName(),options);
}
Program: 71994
Project: 71994
Buggy source:
protected void preview(String format,boolean allowPage){
  FormEditor editor=UIUtil.getActiveReportEditor(false);
  ModuleHandle model=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (editor != null) {
    if (model.needsSave()) {
      editor.doSave(null);
    }
  }
  Map options=new HashMap();
  options.put(WebViewer.FORMAT_KEY,format);
  options.put(WebViewer.ALLOW_PAGE_KEY,Boolean.valueOf(allowPage));
  options.put(WebViewer.RESOURCE_FOLDER_KEY,ReportPlugin.getDefault().getResourceFolder());
  WebViewer.display(model.getFileName(),options);
}

Fixed version (ground truth):
protected void preview(String format,boolean allowPage){
  FormEditor editor=UIUtil.getActiveReportEditor(false);
  ModuleHandle model=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (editor != null) {
    if (model.needsSave()) {
      editor.doSave(null);
    }
  }
  Map options=new HashMap();
  options.put(WebViewer.FORMAT_KEY,format);
  options.put(WebViewer.ALLOW_PAGE_KEY,Boolean.valueOf(allowPage));
  options.put(WebViewer.RESOURCE_FOLDER_KEY,ReportPlugin.getDefault().getResourceFolder());
  Map viewerOptions=getViewerOptions();
  if (viewerOptions != null) {
    options.putAll(viewerOptions);
  }
  WebViewer.display(model.getFileName(),options);
}
Program: 71995
Project: 71995
Buggy source:
/** 
 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 */
public void run(IAction action){
  IFile file=getSelectedFile();
  if (file != null) {
    String url=file.getLocation().toOSString();
    try {
      ModuleHandle handle=SessionHandleAdapter.getInstance().getSessionHandle().openDesign(url);
      Map options=new HashMap();
      options.put(WebViewer.FORMAT_KEY,WebViewer.HTML);
      options.put(WebViewer.RESOURCE_FOLDER_KEY,ReportPlugin.getDefault().getResourceFolder(file.getProject()));
      WebViewer.display(url,options);
      handle.close();
    }
 catch (    Exception e) {
      ExceptionHandler.handle(e);
      return;
    }
  }
 else {
    action.setEnabled(false);
  }
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 */
public void run(IAction action){
  IFile file=getSelectedFile();
  if (file != null) {
    String url=file.getLocation().toOSString();
    try {
      ModuleHandle handle=SessionHandleAdapter.getInstance().getSessionHandle().openDesign(url);
      Map options=new HashMap();
      options.put(WebViewer.FORMAT_KEY,WebViewer.HTML);
      options.put(WebViewer.RESOURCE_FOLDER_KEY,ReportPlugin.getDefault().getResourceFolder(file.getProject()));
      Map viewerOptions=getViewerOptions();
      if (viewerOptions != null) {
        options.putAll(viewerOptions);
      }
      WebViewer.display(url,options);
      handle.close();
    }
 catch (    Exception e) {
      ExceptionHandler.handle(e);
      return;
    }
  }
 else {
    action.setEnabled(false);
  }
}
Program: 71996
Project: 71996
Buggy source:
/** 
 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 */
public void run(IAction action){
  IFile file=getSelectedFile();
  if (file != null) {
    String url=file.getLocation().toString();
    Map options=new HashMap();
    options.put(WebViewer.FORMAT_KEY,WebViewer.HTML);
    options.put(WebViewer.RESOURCE_FOLDER_KEY,ReportPlugin.getDefault().getResourceFolder(file.getProject()));
    WebViewer.display(url,options);
  }
 else {
    action.setEnabled(false);
  }
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 */
public void run(IAction action){
  IFile file=getSelectedFile();
  if (file != null) {
    String url=file.getLocation().toString();
    Map options=new HashMap();
    options.put(WebViewer.FORMAT_KEY,WebViewer.HTML);
    options.put(WebViewer.RESOURCE_FOLDER_KEY,ReportPlugin.getDefault().getResourceFolder(file.getProject()));
    Map viewerOptions=getViewerOptions();
    if (viewerOptions != null) {
      options.putAll(viewerOptions);
    }
    WebViewer.display(url,options);
  }
 else {
    action.setEnabled(false);
  }
}
Program: 71997
Project: 71997
Buggy source:
public void testArchiveFile() throws IOException {
  ArchiveFile archive=new ArchiveFile(ARCHIVE_FILE,"String_Node_Str");
  archive.setCacheSize(64 * 1024);
  createArchive(archive);
  checkArchive(archive);
  assertTrue(archive.getUsedCache() > 0);
  assertTrue(archive.getUsedCache() <= 64 * 1024);
  archive.close();
  assertTrue(archive.getUsedCache() == 0);
  archive=new ArchiveFile(ARCHIVE_FILE,"String_Node_Str");
  checkArchive(archive);
  archive.close();
}

Fixed version (ground truth):
public void testArchiveFile() throws IOException {
  ArchiveFile archive=new ArchiveFile(ARCHIVE_FILE,"String_Node_Str");
  archive.setCacheSize(0);
  archive.setCacheSize(64 * 1024);
  createArchive(archive);
  checkArchive(archive);
  assertTrue(archive.getUsedCache() > 0);
  assertTrue(archive.getUsedCache() <= 64 * 1024);
  archive.close();
  assertTrue(archive.getUsedCache() == 0);
  archive=new ArchiveFile(ARCHIVE_FILE,"String_Node_Str");
  checkArchive(archive);
  archive.close();
}
Program: 71998
Project: 71998
Buggy source:
/** 
 * close the archive. all changed data will be flushed into disk if the file is opened for write. the file will be removed if it is opend as transient. after close, the instance can't be used any more.
 * @throws IOException
 */
public synchronized void close() throws IOException {
  if (isWritable) {
    head.setStatus(FILE_STATUS_FINISHED);
    if (!isTransient) {
      flush();
    }
  }
  if (rf != null) {
    rf.close();
    rf=null;
  }
  if (isTransient) {
    new File(archiveName).delete();
  }
  caches.reset();
  isClosed=true;
}

Fixed version (ground truth):
/** 
 * close the archive. all changed data will be flushed into disk if the file is opened for write. the file will be removed if it is opend as transient. after close, the instance can't be used any more.
 * @throws IOException
 */
public synchronized void close() throws IOException {
  if (isWritable) {
    head.setStatus(FILE_STATUS_FINISHED);
    if (!isTransient) {
      flush();
    }
  }
  if (rf != null) {
    rf.close();
    rf=null;
  }
  if (isTransient) {
    new File(archiveName).delete();
  }
  if (caches != null) {
    caches.reset();
  }
  isClosed=true;
}
Program: 71999
Project: 71999
Buggy source:
/** 
 * set up the cache size. the actually cache size is round to block size.
 * @param cacheSize cache size in bytes
 */
public void setCacheSize(int cacheSize){
  caches.setCacheSize(cacheSize);
}

Fixed version (ground truth):
/** 
 * set up the cache size. the actually cache size is round to block size.
 * @param cacheSize cache size in bytes
 */
public void setCacheSize(int cacheSize){
  if (cacheSize <= 0) {
    enableCache=false;
    caches=null;
  }
 else {
    enableCache=true;
    if (caches == null) {
      caches=new BlockManager(new CacheEventAdapter(),BLOCK_SIZE);
    }
    caches.setCacheSize(cacheSize);
  }
}
Program: 72000
Project: 72000
Buggy source:
/** 
 * open the archive file for read or rw.
 * @throws IOException
 */
private void openDocument() throws IOException {
  try {
    if (rf == null) {
      if (!isWritable && !useNativeLock) {
        rf=new RandomAccessFile(archiveName,"String_Node_Str");
      }
 else {
        rf=new RandomAccessFile(archiveName,"String_Node_Str");
      }
    }
    head=ArchiveHeader.read(rf);
    if (systemId == null) {
      systemId=head.systemId;
    }
    if (dependId == null) {
      dependId=head.dependId;
    }
    BLOCK_SIZE=head.blockSize;
    caches=new BlockManager(new CacheEventAdapter(),BLOCK_SIZE);
    totalBlocks=(int)((rf.length() + BLOCK_SIZE - 1) / BLOCK_SIZE);
    totalDiskBlocks=totalBlocks;
    allocTbl=AllocTable.loadTable(this);
    entryTbl=NameTable.loadTable(this);
    entries=new HashMap();
    Iterator iter=entryTbl.listEntries().iterator();
    while (iter.hasNext()) {
      NameEntry nameEnt=(NameEntry)iter.next();
      entries.put(nameEnt.getName(),new ArchiveEntryV2(this,nameEnt));
    }
  }
 catch (  IOException ex) {
    if (rf != null) {
      rf.close();
      rf=null;
    }
    throw ex;
  }
}

Fixed version (ground truth):
/** 
 * open the archive file for read or rw.
 * @throws IOException
 */
private void openDocument() throws IOException {
  try {
    if (rf == null) {
      if (!isWritable && !useNativeLock) {
        rf=new RandomAccessFile(archiveName,"String_Node_Str");
      }
 else {
        rf=new RandomAccessFile(archiveName,"String_Node_Str");
      }
    }
    head=ArchiveHeader.read(rf);
    if (systemId == null) {
      systemId=head.systemId;
    }
    if (dependId == null) {
      dependId=head.dependId;
    }
    BLOCK_SIZE=head.blockSize;
    if (enableCache) {
      caches=new BlockManager(new CacheEventAdapter(),BLOCK_SIZE);
    }
    totalBlocks=(int)((rf.length() + BLOCK_SIZE - 1) / BLOCK_SIZE);
    totalDiskBlocks=totalBlocks;
    allocTbl=AllocTable.loadTable(this);
    entryTbl=NameTable.loadTable(this);
    entries=new HashMap();
    Iterator iter=entryTbl.listEntries().iterator();
    while (iter.hasNext()) {
      NameEntry nameEnt=(NameEntry)iter.next();
      entries.put(nameEnt.getName(),new ArchiveEntryV2(this,nameEnt));
    }
  }
 catch (  IOException ex) {
    if (rf != null) {
      rf.close();
      rf=null;
    }
    throw ex;
  }
}
Program: 72001
Project: 72001
Buggy source:
/** 
 * create the document
 * @throws IOException
 */
private void createDocument() throws IOException {
  try {
    if (!isTransient) {
      if (rf == null) {
        File parentFile=new File(archiveName).getParentFile();
        if (parentFile != null && !parentFile.exists()) {
          parentFile.mkdirs();
        }
        rf=new RandomAccessFile(archiveName,"String_Node_Str");
      }
      rf.setLength(0);
    }
    BLOCK_SIZE=getDefaultBlockSize();
    caches=new BlockManager(new CacheEventAdapter(),BLOCK_SIZE);
    totalBlocks=3;
    totalDiskBlocks=0;
    head=new ArchiveHeader(BLOCK_SIZE);
    head.flush(this);
    allocTbl=AllocTable.createTable(this);
    entryTbl=NameTable.createTable(this);
    entries=new HashMap();
  }
 catch (  IOException ex) {
    if (rf != null) {
      rf.close();
      rf=null;
    }
    throw ex;
  }
}

Fixed version (ground truth):
/** 
 * create the document
 * @throws IOException
 */
private void createDocument() throws IOException {
  try {
    if (!isTransient) {
      if (rf == null) {
        File parentFile=new File(archiveName).getParentFile();
        if (parentFile != null && !parentFile.exists()) {
          parentFile.mkdirs();
        }
        rf=new RandomAccessFile(archiveName,"String_Node_Str");
      }
      rf.setLength(0);
    }
    BLOCK_SIZE=getDefaultBlockSize();
    if (enableCache) {
      caches=new BlockManager(new CacheEventAdapter(),BLOCK_SIZE);
    }
    totalBlocks=3;
    totalDiskBlocks=0;
    head=new ArchiveHeader(BLOCK_SIZE);
    head.flush(this);
    allocTbl=AllocTable.createTable(this);
    entryTbl=NameTable.createTable(this);
    entries=new HashMap();
  }
 catch (  IOException ex) {
    if (rf != null) {
      rf.close();
      rf=null;
    }
    throw ex;
  }
}
Program: 72002
Project: 72002
Buggy source:
public int getUsedCache(){
  return caches.getUsedCache();
}

Fixed version (ground truth):
public int getUsedCache(){
  if (caches != null) {
    return caches.getUsedCache();
  }
  return 0;
}
Program: 72003
Project: 72003
Buggy source:
/** 
 * load report item emitters extension definitions
 */
protected void loadEmitterExtensionDefns(){
  IExtension[] exts=getExtensions(EXTENSION_POINT_EMITTERS);
  if (exts == null) {
    return;
  }
  for (int i=0; i < exts.length; i++) {
    String namespace=exts[i].getNamespace();
    IConfigurationElement[] configs=exts[i].getConfigurationElements();
    for (int j=0; j < configs.length; j++) {
      String format=configs[j].getAttribute("String_Node_Str");
      String mimeType=configs[j].getAttribute("String_Node_Str");
      String id=configs[j].getAttribute("String_Node_Str");
      String pagination=configs[j].getAttribute("String_Node_Str");
      if (pagination == null) {
        pagination=PAGE_BREAK_PAGINATION;
      }
      String icon=configs[j].getAttribute("String_Node_Str");
      Boolean outDisplayNone=new Boolean(configs[j].getAttribute("String_Node_Str"));
      String fileExtension=configs[j].getAttribute("String_Node_Str");
      Boolean isHidden=new Boolean(configs[j].getAttribute("String_Node_Str"));
      EmitterInfo emitterInfo=new EmitterInfo(format,id,pagination,mimeType,icon,namespace,fileExtension,outDisplayNone,isHidden,configs[j]);
      emitterExtensions.add(emitterInfo);
      assert(format != null);
      formats.put(format.toLowerCase(Locale.ENGLISH),emitterInfo);
      emitters.put(id,emitterInfo);
      logger.log(Level.FINE,"String_Node_Str",new String[]{format,id});
    }
  }
}

Fixed version (ground truth):
/** 
 * load report item emitters extension definitions
 */
protected void loadEmitterExtensionDefns(){
  IExtension[] exts=getExtensions(EXTENSION_POINT_EMITTERS);
  if (exts == null) {
    return;
  }
  for (int i=0; i < exts.length; i++) {
    String namespace=exts[i].getNamespace();
    IConfigurationElement[] configs=exts[i].getConfigurationElements();
    for (int j=0; j < configs.length; j++) {
      String format=configs[j].getAttribute("String_Node_Str");
      String mimeType=configs[j].getAttribute("String_Node_Str");
      String id=configs[j].getAttribute("String_Node_Str");
      String pagination=configs[j].getAttribute("String_Node_Str");
      if (pagination == null) {
        pagination=PAGE_BREAK_PAGINATION;
      }
      String icon=configs[j].getAttribute("String_Node_Str");
      Boolean outDisplayNone=new Boolean(configs[j].getAttribute("String_Node_Str"));
      String fileExtension=configs[j].getAttribute("String_Node_Str");
      Boolean isHidden=new Boolean(configs[j].getAttribute("String_Node_Str"));
      EmitterInfo emitterInfo=new EmitterInfo(format,id,pagination,mimeType,icon,namespace,fileExtension,outDisplayNone,isHidden,configs[j]);
      emitterExtensions.add(emitterInfo);
      assert(format != null);
      formats.put(format,emitterInfo);
      emitters.put(id,emitterInfo);
      logger.log(Level.FINE,"String_Node_Str",new String[]{format,id});
    }
  }
}
Program: 72004
Project: 72004
Buggy source:
/** 
 * Return the URLs of Workspace projects.
 * @return
 */
private static List<URL> getWorkspaceProjectURLs(){
  List<URL> urls=new ArrayList<URL>();
  String classPath=System.getProperty("String_Node_Str");
  if (classPath == null || classPath.length() == 0)   return urls;
  String[] classPathArray=classPath.split(File.pathSeparator,-1);
  int count=classPathArray.length;
  for (int i=0; i < count; i++) {
    File file=new File(classPathArray[i]);
    try {
      urls.add(file.toURL());
    }
 catch (    MalformedURLException e) {
    }
  }
  return urls;
}

Fixed version (ground truth):
/** 
 * Return the URLs of Workspace projects.
 * @return
 */
private static List<URL> getWorkspaceProjectURLs(){
  List<URL> urls=new ArrayList<URL>();
  String classPath=DatasetClassPathHelper.getWorkspaceClassPath();
  if (classPath == null || classPath.length() == 0)   return urls;
  String[] classPathArray=classPath.split(File.pathSeparator,-1);
  int count=classPathArray.length;
  for (int i=0; i < count; i++) {
    File file=new File(classPathArray[i]);
    try {
      urls.add(file.toURL());
    }
 catch (    MalformedURLException e) {
    }
  }
  return urls;
}
Program: 72005
Project: 72005
Buggy source:
/** 
 * @return the user-defined font directory
 */
public String getFontDirectory();

Fixed version (ground truth):
/** 
 * @deprecated
 * @return the user-defined font directory
 */
public String getFontDirectory();
Program: 72006
Project: 72006
Buggy source:
/** 
 * @param fontDirectory the user-defined font directory
 */
public void setFontDirectory(String fontDirectory);

Fixed version (ground truth):
/** 
 * @deprecated
 * @param fontDirectory the user-defined font directory
 */
public void setFontDirectory(String fontDirectory);
Program: 72007
Project: 72007
Buggy source:
/** 
 * @return if font is embedded
 */
public boolean isEmbededFont();

Fixed version (ground truth):
/** 
 * @deprecated
 * @return if font is embedded
 */
public boolean isEmbededFont();
Program: 72008
Project: 72008
Buggy source:
/** 
 * @param isEmbededFont
 */
public void setEmbededFont(boolean isEmbededFont);

Fixed version (ground truth):
/** 
 * @deprecated
 * @param isEmbededFont
 */
public void setEmbededFont(boolean isEmbededFont);
Program: 72010
Project: 72010
Buggy source:
/** 
 * This method is used for back-forward compatible. For the new DTE api store the original ComputedColumnHandle expression as a parameter value now, we should retrive expression value from ComputedColumnHandle's expression(old) or argument value.
 * @param bindingColumn
 * @return
 */
public static String getAggregationExpression(ComputedColumnHandle bindingColumn){
  if (bindingColumn.getExpression() != null)   return bindingColumn.getExpression();
  String functionName=bindingColumn.getAggregateFunction();
  try {
    IAggrFunction function=getAggregationManager().getAggregation(functionName);
    for (    IParameterDefn param : function.getParameterDefn()) {
      if (param.isDataField()) {
        for (Iterator iterator=bindingColumn.argumentsIterator(); iterator.hasNext(); ) {
          AggregationArgumentHandle arg=(AggregationArgumentHandle)iterator.next();
          if (arg.getName().equals(param.getName())) {
            return arg.getValue();
          }
        }
      }
    }
  }
 catch (  BirtException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * This method is used for back-forward compatible. For the new DTE api store the original ComputedColumnHandle expression as a parameter value now, we should retrive expression value from ComputedColumnHandle's expression(old) or argument value.
 * @param bindingColumn
 * @return
 */
public static String getAggregationExpression(ComputedColumnHandle bindingColumn){
  if (bindingColumn.getExpression() != null)   return bindingColumn.getExpression();
  String functionName=bindingColumn.getAggregateFunction();
  try {
    IAggrFunction function=getAggregationManager().getAggregation(functionName);
    for (    IParameterDefn param : function.getParameterDefn()) {
      if (param.isDataField()) {
        for (Iterator iterator=bindingColumn.argumentsIterator(); iterator.hasNext(); ) {
          AggregationArgumentHandle arg=(AggregationArgumentHandle)iterator.next();
          if (DataAdapterUtil.adaptArgumentName(arg.getName()).equals(param.getName())) {
            return arg.getValue();
          }
        }
      }
    }
  }
 catch (  BirtException e) {
  }
  return null;
}
Program: 72011
Project: 72011
Buggy source:
private void initFunction(){
  cmbFunction.setItems(getFunctionDisplayNames());
  if (binding == null) {
    cmbFunction.select(0);
    handleFunctionSelectEvent();
    return;
  }
  try {
    String functionString=getFunctionDisplayName(DataAdapterUtil.adaptModelAggregationType(binding.getAggregateFunction()));
    int itemIndex=getItemIndex(getFunctionDisplayNames(),functionString);
    cmbFunction.select(itemIndex);
    handleFunctionSelectEvent();
  }
 catch (  AdapterException e) {
    ExceptionHandler.handle(e);
  }
  for (Iterator iterator=binding.argumentsIterator(); iterator.hasNext(); ) {
    AggregationArgumentHandle arg=(AggregationArgumentHandle)iterator.next();
    if (paramsMap.containsKey(arg.getName())) {
      if (arg.getValue() != null) {
        Control control=paramsMap.get(arg.getName());
        if (control instanceof Text) {
          ((Text)control).setText(arg.getValue());
        }
 else         if (control instanceof Combo) {
          ((Combo)control).setText(arg.getValue());
        }
      }
    }
  }
}

Fixed version (ground truth):
private void initFunction(){
  cmbFunction.setItems(getFunctionDisplayNames());
  if (binding == null) {
    cmbFunction.select(0);
    handleFunctionSelectEvent();
    return;
  }
  try {
    String functionString=getFunctionDisplayName(DataAdapterUtil.adaptModelAggregationType(binding.getAggregateFunction()));
    int itemIndex=getItemIndex(getFunctionDisplayNames(),functionString);
    cmbFunction.select(itemIndex);
    handleFunctionSelectEvent();
  }
 catch (  AdapterException e) {
    ExceptionHandler.handle(e);
  }
  for (Iterator iterator=binding.argumentsIterator(); iterator.hasNext(); ) {
    AggregationArgumentHandle arg=(AggregationArgumentHandle)iterator.next();
    String argName=DataAdapterUtil.adaptArgumentName(arg.getName());
    if (paramsMap.containsKey(argName)) {
      if (arg.getValue() != null) {
        Control control=paramsMap.get(argName);
        if (control instanceof Text) {
          ((Text)control).setText(arg.getValue());
        }
 else         if (control instanceof Combo) {
          ((Combo)control).setText(arg.getValue());
        }
      }
    }
  }
}