nus-yam/ex-repair huggingface dataset:
Program: 68637
Project: 68637
Buggy source:
private void setQueryExpression(String expression){
  if (ChartUIConstants.QUERY_VALUE.equals(queryType)) {
    if (!(context.getChartType() instanceof GanttChart) && !context.getDataServiceProvider().checkState(IDataServiceProvider.SHARE_QUERY) && context.getDataServiceProvider().checkState(IDataServiceProvider.HAS_DATA_SET)) {
      if (context.getDataServiceProvider().getDataType(expression) == DataType.DATE_TIME_LITERAL) {
        ChartAdapter.beginIgnoreNotifications();
        if (query.getGrouping() == null) {
          query.setGrouping(DataFactoryImpl.init().createSeriesGrouping());
        }
        SeriesGrouping group=query.getGrouping();
        group.setEnabled(true);
        group.setAggregateExpression("String_Node_Str");
        ChartAdapter.endIgnoreNotifications();
      }
    }
  }
  if (query != null) {
    query.setDefinition(btnBuilder.getExpression());
  }
 else {
    query=QueryImpl.create(btnBuilder.getExpression());
    query.eAdapters().addAll(seriesdefinition.eAdapters());
    seriesdefinition.setQuery(query);
  }
}

Fixed version (ground truth):
private void setQueryExpression(String expression){
  if (ChartUIConstants.QUERY_VALUE.equals(queryType)) {
    if (!(context.getChartType() instanceof GanttChart) && !context.getDataServiceProvider().checkState(IDataServiceProvider.SHARE_QUERY) && context.getDataServiceProvider().checkState(IDataServiceProvider.HAS_DATA_SET)) {
      if (context.getDataServiceProvider().getDataType(expression) == DataType.DATE_TIME_LITERAL) {
        ChartAdapter.beginIgnoreNotifications();
        if (query.getGrouping() == null) {
          query.setGrouping(DataFactoryImpl.init().createSeriesGrouping());
        }
        SeriesGrouping group=query.getGrouping();
        group.setEnabled(true);
        group.setAggregateExpression("String_Node_Str");
        ChartAdapter.endIgnoreNotifications();
      }
    }
  }
  if (query != null) {
    query.setDefinition(btnBuilder.convertExpression(expression));
  }
 else {
    query=QueryImpl.create(btnBuilder.convertExpression(expression));
    query.eAdapters().addAll(seriesdefinition.eAdapters());
    seriesdefinition.setQuery(query);
  }
}
Program: 68638
Project: 68638
Buggy source:
public void updateText(Query query){
  if (query == null) {
    return;
  }
  Control text=findText(query);
  if (text != null) {
    IQueryExpressionManager queryManager=textCollection.get(text);
    queryManager.updateText(query.getDefinition());
    String displayExpr=queryManager.getDisplayExpression();
    updateControlBackground(text,displayExpr);
  }
}

Fixed version (ground truth):
public void updateText(Query query){
  if (query == null) {
    return;
  }
  Control text=findText(query);
  if (text != null) {
    IQueryExpressionManager queryManager=textCollection.get(text);
    String displayExpr=queryManager.getDisplayExpression();
    queryManager.updateText(displayExpr);
    updateControlBackground(text,displayExpr);
  }
}
Program: 68639
Project: 68639
Buggy source:
private void initOptions(){
  ConfigurableOption wrappingText=new ConfigurableOption(TEXT_WRAPPING);
  wrappingText.setDisplayName(Messages.getString("String_Node_Str"));
  wrappingText.setDataType(IConfigurableOption.DataType.BOOLEAN);
  wrappingText.setDisplayType(IConfigurableOption.DisplayType.CHECKBOX);
  wrappingText.setDefaultValue(Boolean.TRUE);
  wrappingText.setToolTip(null);
  wrappingText.setDescription(Messages.getString("String_Node_Str"));
  options=new IConfigurableOption[]{wrappingText};
}

Fixed version (ground truth):
private void initOptions(){
  ConfigurableOption wrappingText=initializeWrappingText();
  options=new IConfigurableOption[]{wrappingText};
}
Program: 68640
Project: 68640
Buggy source:
public void initialize(IEmitterServices service) throws EngineException {
  this.service=service;
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
  }
  context.setTempFileDir(service.getReportEngine().getConfig().getTempDir());
  IReportContext reportContext=service.getReportContext();
  if (reportContext != null) {
    Locale locale=reportContext.getLocale();
    if (locale != null) {
      context.setLocale(ULocale.forLocale(locale));
    }
 else     context.setLocale(ULocale.getDefault());
  }
}

Fixed version (ground truth):
public void initialize(IEmitterServices service) throws EngineException {
  this.context=createContext();
  this.service=service;
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
  }
  context.setTempFileDir(service.getReportEngine().getConfig().getTempDir());
  IReportContext reportContext=service.getReportContext();
  if (reportContext != null) {
    Locale locale=reportContext.getLocale();
    if (locale != null) {
      context.setLocale(ULocale.forLocale(locale));
    }
 else     context.setLocale(ULocale.getDefault());
  }
}
Program: 68642
Project: 68642
Buggy source:
private static void addLevelSorting(List<LevelViewHandle> levelViews,Map<LevelHandle,ILevelDefinition> levelMapping,ICubeQueryDefinition cubeQuery,IModelAdapter modelAdapter) throws BirtException {
  List<ILevelDefinition> levels=new ArrayList<ILevelDefinition>();
  List<Object> values=new ArrayList<Object>();
  for (Iterator<LevelViewHandle> itr=levelViews.iterator(); itr.hasNext(); ) {
    LevelViewHandle lv=itr.next();
    Iterator sortItr=lv.sortsIterator();
    if (sortItr != null) {
      while (sortItr.hasNext()) {
        SortElementHandle sortKey=(SortElementHandle)sortItr.next();
        levels.clear();
        values.clear();
        addMembers(levelMapping,levels,values,sortKey.getMember());
        ILevelDefinition[] qualifyLevels=null;
        Object[] qualifyValues=null;
        if (levels.size() > 0) {
          qualifyLevels=levels.toArray(new ILevelDefinition[levels.size()]);
          qualifyValues=values.toArray(new Object[values.size()]);
        }
        ICubeSortDefinition sortDef=getCubeElementFactory().createCubeSortDefinition(modelAdapter.adaptExpression((Expression)sortKey.getExpressionProperty(ISortElementModel.KEY_PROP).getValue(),ExpressionLocation.CUBE),levelMapping.get(lv.getCubeLevel()),qualifyLevels,qualifyValues,DataAdapterUtil.adaptModelSortDirection(sortKey.getDirection()));
        cubeQuery.addSort(sortDef);
      }
    }
  }
}

Fixed version (ground truth):
private static void addLevelSorting(List<LevelViewHandle> levelViews,Map<LevelHandle,ILevelDefinition> levelMapping,ICubeQueryDefinition cubeQuery,IModelAdapter modelAdapter) throws BirtException {
  List<ILevelDefinition> levels=new ArrayList<ILevelDefinition>();
  List<Object> values=new ArrayList<Object>();
  for (Iterator<LevelViewHandle> itr=levelViews.iterator(); itr.hasNext(); ) {
    LevelViewHandle lv=itr.next();
    Iterator sortItr=lv.sortsIterator();
    if (sortItr != null) {
      while (sortItr.hasNext()) {
        SortElementHandle sortKey=(SortElementHandle)sortItr.next();
        levels.clear();
        values.clear();
        addMembers(levelMapping,levels,values,sortKey.getMember());
        ILevelDefinition[] qualifyLevels=null;
        Object[] qualifyValues=null;
        if (levels.size() > 0) {
          qualifyLevels=levels.toArray(new ILevelDefinition[levels.size()]);
          qualifyValues=values.toArray(new Object[values.size()]);
        }
        ICubeSortDefinition sortDef=getCubeElementFactory().createCubeSortDefinition(modelAdapter.adaptExpression((Expression)sortKey.getExpressionProperty(ISortElementModel.KEY_PROP).getValue(),ExpressionLocation.CUBE),levelMapping.get(lv.getCubeLevel()),qualifyLevels,qualifyValues,DataAdapterUtil.adaptModelSortDirection(sortKey.getDirection()));
        sortDef.setSortLocale(sortKey.getLocale());
        sortDef.setSortStrength(sortKey.getStrength());
        cubeQuery.addSort(sortDef);
      }
    }
  }
}
Program: 68643
Project: 68643
Buggy source:
/** 
 * A convenience method provided to add a marker line instance to an axis
 * @param ax
 * @param de
 * @param lineColor
 */
public static final MarkerLine create(Axis ax,DataElement de,ColorDefinition lineColor){
  final MarkerLine ml=ComponentFactory.eINSTANCE.createMarkerLine();
  ml.setLineAttributes(LineAttributesImpl.create(lineColor,LineStyle.DASHED_LITERAL,1));
  ml.setValue(de);
  ml.setLabel(LabelImpl.create());
  ml.setLabelAnchor(ax.getOrientation().getValue() == Orientation.HORIZONTAL ? Anchor.NORTH_WEST_LITERAL : Anchor.NORTH_EAST_LITERAL);
  if (ax.getOrientation().getValue() == Orientation.HORIZONTAL) {
    ml.getLabel().getCaption().getFont().setRotation(90);
  }
  ax.getMarkerLines().add(ml);
  if (ax.getFormatSpecifier() != null) {
    ml.setFormatSpecifier(ax.getFormatSpecifier().copyInstance());
  }
  return ml;
}

Fixed version (ground truth):
/** 
 * A convenience method provided to add a marker line instance to an axis
 * @param ax
 * @param de
 * @param lineColor
 */
public static final MarkerLine create(Axis ax,DataElement de,ColorDefinition lineColor){
  final MarkerLine ml=ComponentFactory.eINSTANCE.createMarkerLine();
  ml.setLineAttributes(LineAttributesImpl.create(lineColor,LineStyle.DASHED_LITERAL,1));
  ml.setValue(de);
  ml.setLabel(LabelImpl.create());
  ml.setLabelAnchor(ax.getOrientation().getValue() == Orientation.HORIZONTAL ? Anchor.NORTH_WEST_LITERAL : Anchor.NORTH_EAST_LITERAL);
  if (ax.getOrientation().getValue() == Orientation.HORIZONTAL) {
    ml.getLabel().getCaption().getFont().setRotation(90);
  }
  ax.getMarkerLines().add(ml);
  if (ax.getFormatSpecifier() != null && !ax.isCategoryAxis()) {
    ml.setFormatSpecifier(ax.getFormatSpecifier().copyInstance());
  }
  return ml;
}
Program: 68644
Project: 68644
Buggy source:
/** 
 * A convenience method provided to add a marker range instance to an axis
 * @param ax the axis which the marker range will be created on.
 * @param deStart start range.
 * @param deEnd end range.
 * @param fillColor fill color.
 * @param outlineColor outline color.
 */
public static final MarkerRange create(Axis ax,DataElement deStart,DataElement deEnd,Fill fillColor,ColorDefinition outlineColor){
  final MarkerRange mr=ComponentFactory.eINSTANCE.createMarkerRange();
  final LineAttributes liaOutline=LineAttributesImpl.create(outlineColor,LineStyle.SOLID_LITERAL,1);
  mr.setOutline(liaOutline);
  mr.setFill(fillColor);
  mr.setStartValue(deStart);
  mr.setEndValue(deEnd);
  mr.setLabel(LabelImpl.create());
  mr.setLabelAnchor(ax.getOrientation().getValue() == Orientation.HORIZONTAL ? Anchor.NORTH_EAST_LITERAL : Anchor.NORTH_WEST_LITERAL);
  if (ax.getOrientation().getValue() == Orientation.VERTICAL) {
    mr.getLabel().getCaption().getFont().setRotation(90);
  }
  ax.getMarkerRanges().add(mr);
  if (ax.getFormatSpecifier() != null) {
    mr.setFormatSpecifier(ax.getFormatSpecifier().copyInstance());
  }
  return mr;
}

Fixed version (ground truth):
/** 
 * A convenience method provided to add a marker range instance to an axis
 * @param ax the axis which the marker range will be created on.
 * @param deStart start range.
 * @param deEnd end range.
 * @param fillColor fill color.
 * @param outlineColor outline color.
 */
public static final MarkerRange create(Axis ax,DataElement deStart,DataElement deEnd,Fill fillColor,ColorDefinition outlineColor){
  final MarkerRange mr=ComponentFactory.eINSTANCE.createMarkerRange();
  final LineAttributes liaOutline=LineAttributesImpl.create(outlineColor,LineStyle.SOLID_LITERAL,1);
  mr.setOutline(liaOutline);
  mr.setFill(fillColor);
  mr.setStartValue(deStart);
  mr.setEndValue(deEnd);
  mr.setLabel(LabelImpl.create());
  mr.setLabelAnchor(ax.getOrientation().getValue() == Orientation.HORIZONTAL ? Anchor.NORTH_EAST_LITERAL : Anchor.NORTH_WEST_LITERAL);
  if (ax.getOrientation().getValue() == Orientation.VERTICAL) {
    mr.getLabel().getCaption().getFont().setRotation(90);
  }
  ax.getMarkerRanges().add(mr);
  if (ax.getFormatSpecifier() != null && !ax.isCategoryAxis()) {
    mr.setFormatSpecifier(ax.getFormatSpecifier().copyInstance());
  }
  return mr;
}
Program: 68646
Project: 68646
Buggy source:
public void doSave(IProgressMonitor progressMonitor){
  reportXMLEditor.doSave(progressMonitor);
  UIUtil.doFinishSava(getModel());
}

Fixed version (ground truth):
public void doSave(IProgressMonitor progressMonitor){
  reportXMLEditor.doSave(progressMonitor);
  UIUtil.doFinishSave(getModel());
}
Program: 68647
Project: 68647
Buggy source:
/** 
 * Clears the dirty flag.
 */
private void clearDirtyFlag(){
  IReportProvider provider=getProvider();
  if (provider != null && getErrorLIine(false) == -1) {
    ModuleHandle oldModel=getModel();
    unhookModelEventManager(oldModel);
    getCommandStack(oldModel).removeCommandStackListener(getCommandStackListener());
    SessionHandleAdapter.getInstance().getMediator(oldModel).removeColleague(this);
    ModuleHandle newModel=provider.getReportModuleHandle(getEditorInput(),true);
    SessionHandleAdapter.getInstance().setReportDesignHandle(newModel);
    UIUtil.processSessionResourceFolder(getEditorInput(),UIUtil.getProjectFromInput(getEditorInput()),newModel);
    SessionHandleAdapter.getInstance().getMediator(newModel).addColleague(this);
    hookModelEventManager(getModel());
    getCommandStack(newModel).addCommandStackListener(getCommandStackListener());
    setIsModified(false);
    getEditor().editorDirtyStateChanged();
    if (isActive() && !isLeaving) {
      getReportEditor().reloadOutlinePage();
    }
  }
}

Fixed version (ground truth):
/** 
 * Clears the dirty flag.
 */
private void clearDirtyFlag(){
  IReportProvider provider=getProvider();
  if (provider != null && getErrorLIine(false) == -1) {
    ModuleHandle oldModel=getModel();
    unhookModelEventManager(oldModel);
    getCommandStack(oldModel).removeCommandStackListener(getCommandStackListener());
    SessionHandleAdapter.getInstance().getMediator(oldModel).removeColleague(this);
    ModuleHandle newModel=provider.getReportModuleHandle(getEditorInput(),true);
    SessionHandleAdapter.getInstance().setReportDesignHandle(newModel);
    UIUtil.processSessionResourceFolder(getEditorInput(),UIUtil.getProjectFromInput(getEditorInput()),newModel);
    SessionHandleAdapter.getInstance().getMediator(newModel).addColleague(this);
    hookModelEventManager(newModel);
    getCommandStack(newModel).addCommandStackListener(getCommandStackListener());
    setIsModified(false);
    getEditor().editorDirtyStateChanged();
    if (isActive() && !isLeaving) {
      getReportEditor().reloadOutlinePage();
    }
  }
}
Program: 68648
Project: 68648
Buggy source:
protected void hookModelEventManager(Object model){
  getModelEventManager().hookRoot(model);
  getModelEventManager().hookCommandStack(getCommandStack(getModel()));
}

Fixed version (ground truth):
protected void hookModelEventManager(ModuleHandle model){
  getModelEventManager().hookRoot(model);
  getModelEventManager().hookCommandStack(getCommandStack(model));
}
Program: 68649
Project: 68649
Buggy source:
protected void unhookModelEventManager(Object model){
  getModelEventManager().unhookRoot(model);
}

Fixed version (ground truth):
protected void unhookModelEventManager(ModuleHandle model){
  getModelEventManager().unhookRoot(model);
}
Program: 68650
Project: 68650
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    reloadEditorInput();
    doSave(null);
  }
 else   if (prePage != this && (prePage.isDirty() || prePage.getStaleType() != IPageStaleType.NONE)) {
    ModuleHandle model=getProvider().getReportModuleHandle(getEditorInput(),false);
    if (ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),model.getVersion()) > 0) {
      if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
        return false;
      }
    }
    prePage.doSave(null);
    UIUtil.doFinishSava(getModel());
    prePage.markPageStale(IPageStaleType.NONE);
    refreshDocument();
    markPageStale(IPageStaleType.NONE);
  }
  ModuleHandle model=getModel();
  hookModelEventManager(model);
  SessionHandleAdapter.getInstance().getMediator(model).addColleague(this);
  ReportMediator mediator=SessionHandleAdapter.getInstance().getMediator(model);
  ReportRequest request=new ReportRequest(ReportXMLSourceEditorFormPage.this);
  List list=new ArrayList(mediator.getCurrentState().getSelectionObject());
  if (list.isEmpty()) {
    list.add(new Object());
  }
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  mediator.notifyRequest(request);
  reportXMLEditor.setFocus();
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    reloadEditorInput();
    doSave(null);
  }
 else   if (prePage != this && (prePage.isDirty() || prePage.getStaleType() != IPageStaleType.NONE)) {
    ModuleHandle model=getModel();
    if (model != null && ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),model.getVersion()) > 0) {
      if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
        return false;
      }
    }
    prePage.doSave(null);
    UIUtil.doFinishSave(getModel());
    prePage.markPageStale(IPageStaleType.NONE);
    refreshDocument();
    markPageStale(IPageStaleType.NONE);
  }
  ModuleHandle model=getModel();
  hookModelEventManager(model);
  SessionHandleAdapter.getInstance().getMediator(model).addColleague(this);
  ReportMediator mediator=SessionHandleAdapter.getInstance().getMediator(model);
  ReportRequest request=new ReportRequest(ReportXMLSourceEditorFormPage.this);
  List list=new ArrayList(mediator.getCurrentState().getSelectionObject());
  if (list.isEmpty()) {
    list.add(new Object());
  }
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  mediator.notifyRequest(request);
  reportXMLEditor.setFocus();
  return true;
}
Program: 68651
Project: 68651
Buggy source:
public boolean isDirty(){
  if (getProvider().getReportModuleHandle(getEditorInput()) != model && getProvider().getReportModuleHandle(getEditorInput()) != null) {
    return getProvider().getReportModuleHandle(getEditorInput()).needsSave();
  }
  if (getModel() == null) {
    return false;
  }
  return getModel().needsSave();
}

Fixed version (ground truth):
public boolean isDirty(){
  ModuleHandle newModel=getProvider().queryReportModuleHandle();
  if (newModel != null && newModel != model) {
    return newModel.needsSave();
  }
  if (model == null) {
    return false;
  }
  return model.needsSave();
}
Program: 68652
Project: 68652
Buggy source:
protected IReportProvider getProvider(){
  if (provider == null) {
    provider=new FileReportProvider();
  }
  return provider;
}

Fixed version (ground truth):
protected abstract IReportProvider getProvider();
Program: 68653
Project: 68653
Buggy source:
/** 
 * Get report modulehandle. if model havn't been set, get the editor input modulehandle.
 * @return
 */
protected ModuleHandle getModel(){
  if (model == null) {
    IReportProvider reportProvider=getProvider();
    model=reportProvider.getReportModuleHandle(getEditorInput());
  }
  return model;
}

Fixed version (ground truth):
/** 
 * Get internal report modulehandle cached by current page. if model havn't been set, get the editor input modulehandle.
 * @return
 */
final protected ModuleHandle getModel(){
  if (model == null) {
    IReportProvider reportProvider=getProvider();
    model=reportProvider.queryReportModuleHandle();
  }
  return model;
}
Program: 68654
Project: 68654
Buggy source:
protected IReportProvider getProvider(){
  if (provider == null) {
    provider=new FileReportProvider();
  }
  return provider;
}

Fixed version (ground truth):
protected abstract IReportProvider getProvider();
Program: 68655
Project: 68655
Buggy source:
private WrapperCommandStack getCommandStack(){
  return new WrapperCommandStack(getModel().getCommandStack());
}

Fixed version (ground truth):
private WrapperCommandStack getCommandStack(){
  if (getModel() != null) {
    return new WrapperCommandStack(getModel().getCommandStack());
  }
  return null;
}
Program: 68656
Project: 68656
Buggy source:
/** 
 * Convert input element to ModuleHandle.
 * @param element
 * @return
 */
ModuleHandle getReportModuleHandle(Object element,boolean reset);

Fixed version (ground truth):
/** 
 * Convert input element to ModuleHandle. This will trigger the actual loading if necessary.
 * @param element The input element
 * @param reset Indicate if it enforces the loading.
 * @return
 */
ModuleHandle getReportModuleHandle(Object element,boolean reset);
Program: 68657
Project: 68657
Buggy source:
public void doSave(IProgressMonitor monitor){
  boolean isReselect=false;
  if (ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),getModel().getVersion()) > 0) {
    if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
      return;
    }
 else {
      isReselect=true;
    }
  }
  getCurrentPageInstance().doSave(monitor);
  fireDesignFileChangeEvent();
  if (isReselect) {
    Display.getCurrent().asyncExec(new Runnable(){
      public void run(){
        if (getActivePageInstance() instanceof GraphicalEditorWithFlyoutPalette) {
          if (((GraphicalEditorWithFlyoutPalette)getActivePageInstance()).getGraphicalViewer() != null) {
            GraphicalEditorWithFlyoutPalette editor=(GraphicalEditorWithFlyoutPalette)getActivePageInstance();
            GraphicalViewer view=editor.getGraphicalViewer();
            UIUtil.resetViewSelection(view,true);
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
public void doSave(IProgressMonitor monitor){
  boolean isReselect=false;
  if (getModel() != null && ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),getModel().getVersion()) > 0) {
    if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
      return;
    }
 else {
      isReselect=true;
    }
  }
  getCurrentPageInstance().doSave(monitor);
  fireDesignFileChangeEvent();
  if (isReselect) {
    Display.getCurrent().asyncExec(new Runnable(){
      public void run(){
        if (getActivePageInstance() instanceof GraphicalEditorWithFlyoutPalette) {
          if (((GraphicalEditorWithFlyoutPalette)getActivePageInstance()).getGraphicalViewer() != null) {
            GraphicalEditorWithFlyoutPalette editor=(GraphicalEditorWithFlyoutPalette)getActivePageInstance();
            GraphicalViewer view=editor.getGraphicalViewer();
            UIUtil.resetViewSelection(view,true);
          }
        }
      }
    }
);
  }
}
Program: 68658
Project: 68658
Buggy source:
protected void addPages(){
  List formPageList=EditorContributorManager.getInstance().getEditorContributor(getEditorSite().getId()).formPageList;
  boolean error=false;
  String fileName=getProvider().getInputPath(getEditorInput()).toOSString();
  List message=ModuleUtil.checkVersion(fileName);
  if (message.size() > 0) {
    IVersionInfo info=(IVersionInfo)message.get(0);
    if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),info.getLocalizedMessage())) {
      for (Iterator iter=formPageList.iterator(); iter.hasNext(); ) {
        FormPageDef pagedef=(FormPageDef)iter.next();
        if (XMLSourcePage_ID.equals(pagedef.id)) {
          try {
            addPage(pagedef.createPage(),pagedef.displayName);
          }
 catch (          Exception e) {
          }
        }
      }
      return;
    }
  }
  for (Iterator iter=formPageList.iterator(); iter.hasNext(); ) {
    FormPageDef pagedef=(FormPageDef)iter.next();
    try {
      addPage(pagedef.createPage(),pagedef.displayName);
    }
 catch (    Exception e) {
      error=true;
    }
  }
  if (error) {
    setActivePage(XMLSourcePage_ID);
  }
}

Fixed version (ground truth):
protected void addPages(){
  List formPageList=EditorContributorManager.getInstance().getEditorContributor(getEditorSite().getId()).formPageList;
  boolean error=false;
  String fileName=getProvider().getInputPath(getEditorInput()).toOSString();
  List message=ModuleUtil.checkVersion(fileName);
  if (message.size() > 0) {
    IVersionInfo info=(IVersionInfo)message.get(0);
    if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),info.getLocalizedMessage())) {
      for (Iterator iter=formPageList.iterator(); iter.hasNext(); ) {
        FormPageDef pagedef=(FormPageDef)iter.next();
        if (XMLSourcePage_ID.equals(pagedef.id)) {
          try {
            addPage(pagedef.createPage(),pagedef.displayName);
            break;
          }
 catch (          Exception e) {
          }
        }
      }
      return;
    }
  }
  for (Iterator iter=formPageList.iterator(); iter.hasNext(); ) {
    FormPageDef pagedef=(FormPageDef)iter.next();
    try {
      addPage(pagedef.createPage(),pagedef.displayName);
    }
 catch (    Exception e) {
      error=true;
    }
  }
  if (error) {
    setActivePage(XMLSourcePage_ID);
  }
}
Program: 68659
Project: 68659
Buggy source:
/** 
 * Unhook the root.
 * @param stack
 */
public void unhookCommandStack(WrapperCommandStack stack){
  stack.removeCommandStackListener(commandStackListener);
}

Fixed version (ground truth):
/** 
 * Unhook the root.
 * @param stack
 */
public void unhookCommandStack(WrapperCommandStack stack){
  if (stack != null) {
    stack.removeCommandStackListener(commandStackListener);
  }
}
Program: 68660
Project: 68660
Buggy source:
/** 
 * Hook the command stack, to add the command stack listener to the stack.
 * @param stack
 */
public void hookCommandStack(WrapperCommandStack stack){
  stack.addCommandStackListener(commandStackListener);
}

Fixed version (ground truth):
/** 
 * Hook the command stack, to add the command stack listener to the stack.
 * @param stack
 */
public void hookCommandStack(WrapperCommandStack stack){
  if (stack != null) {
    stack.addCommandStackListener(commandStackListener);
  }
}
Program: 68661
Project: 68661
Buggy source:
void setTitleCoordinate(double _dTitleRenderingCoordinate){
  dTitleRenderingCoordinate=_dTitleRenderingCoordinate;
}

Fixed version (ground truth):
public void setTitleCoordinate(double _dTitleRenderingCoordinate){
  dTitleRenderingCoordinate=_dTitleRenderingCoordinate;
}
Program: 68663
Project: 68663
Buggy source:
/** 
 * The axes correspond to the lines/planes being rendered within the plot block. This is rendered with Z-order=2
 */
private final void renderAxesStructure(IPrimitiveRenderer ipr,Plot p) throws ChartException {
  final PlotWithAxes pwa=(PlotWithAxes)getComputations();
  final AllAxes aax=pwa.getAxes();
  if (pwa.getDimension() == IConstants.THREE_D) {
    renderEachAxis(ipr,p,aax.getPrimaryBase(),IConstants.BASE_AXIS);
    renderEachAxis(ipr,p,aax.getAncillaryBase(),IConstants.ANCILLARY_AXIS);
    renderEachAxis(ipr,p,aax.getPrimaryOrthogonal(),IConstants.ORTHOGONAL_AXIS);
  }
 else {
    final int iCount=aax.getOverlayCount() + 2;
    final OneAxis[] oaxa=new OneAxis[iCount];
    oaxa[0]=aax.getPrimaryBase();
    oaxa[1]=aax.getPrimaryOrthogonal();
    for (int i=0; i < iCount - 2; i++) {
      oaxa[i + 2]=aax.getOverlay(i);
      IntersectionValue iv=oaxa[i + 2].getIntersectionValue();
      if (iv.getType() == IConstants.VALUE) {
        oaxa[i + 2].setAxisCoordinate(Methods.getLocation(aax.getPrimaryBase().getScale(),iv.getValue()));
      }
    }
    for (int i=0; i < iCount; i++) {
      renderEachAxis(ipr,p,oaxa[i],IConstants.AXIS);
    }
  }
}

Fixed version (ground truth):
/** 
 * The axes correspond to the lines/planes being rendered within the plot block. This is rendered with Z-order=2
 */
private final void renderAxesStructure(IPrimitiveRenderer ipr,Plot p) throws ChartException {
  final PlotWithAxes pwa=(PlotWithAxes)getComputations();
  final AllAxes aax=pwa.getAxes();
  if (pwa.getDimension() == IConstants.THREE_D) {
    renderEachAxis(ipr,p,aax.getPrimaryBase(),IConstants.BASE_AXIS);
    renderEachAxis(ipr,p,aax.getAncillaryBase(),IConstants.ANCILLARY_AXIS);
    renderEachAxis(ipr,p,aax.getPrimaryOrthogonal(),IConstants.ORTHOGONAL_AXIS);
  }
 else {
    final int iCount=aax.getOverlayCount() + 2;
    final OneAxis[] oaxa=new OneAxis[iCount];
    oaxa[0]=aax.getPrimaryBase();
    oaxa[1]=aax.getPrimaryOrthogonal();
    for (int i=0; i < iCount - 2; i++) {
      oaxa[i + 2]=aax.getOverlay(i);
      IntersectionValue iv=oaxa[i + 2].getIntersectionValue();
      if (iv.getType() == IConstants.VALUE) {
        double dOrigin=Methods.getLocation(aax.getPrimaryBase().getScale(),iv.getValue());
        oaxa[i + 2].setAxisCoordinate(dOrigin);
        oaxa[i + 2].setTitleCoordinate(dOrigin + oaxa[i + 2].getTitleCoordinate());
      }
    }
    for (int i=0; i < iCount; i++) {
      renderEachAxis(ipr,p,oaxa[i],IConstants.AXIS);
    }
  }
}
Program: 68665
Project: 68665
Buggy source:
public void adaptExpressions(IChartObject cm){
  expAdaptHelper.adapt(cm);
}

Fixed version (ground truth):
public void adaptExpressions(IChartObject cm){
  boolean bCube=checkState(IDataServiceProvider.HAS_CUBE) || checkState(IDataServiceProvider.SHARE_CROSSTAB_QUERY);
  expAdaptHelper.adapt(cm,bCube);
}
Program: 68667
Project: 68667
Buggy source:
public void adapt(IChartObject ico){
  if (adapter == null) {
    return;
  }
  if (ico instanceof ChartWithAxes) {
    adaptChartWithAxes((ChartWithAxes)ico);
  }
 else   if (ico instanceof ChartWithoutAxes) {
    daptChartWithoutAxes((ChartWithoutAxes)ico);
  }
}

Fixed version (ground truth):
public void adapt(IChartObject ico,boolean bCube){
  if (adapter == null) {
    return;
  }
  this.bCube=bCube;
  if (ico instanceof ChartWithAxes) {
    adaptChartWithAxes((ChartWithAxes)ico);
  }
 else   if (ico instanceof ChartWithoutAxes) {
    daptChartWithoutAxes((ChartWithoutAxes)ico);
  }
}
Program: 68668
Project: 68668
Buggy source:
private static String checkGroupTypeOnYGrouping(ChartWizardContext context,Chart chart){
  String isConsistent="String_Node_Str";
  SeriesDefinition seriesdefinition=ChartUIUtil.getOrthogonalSeriesDefinitions(chart,0).get(0);
  if (seriesdefinition.getQuery() != null) {
    DataType queryDataType=context.getDataServiceProvider().getDataType(seriesdefinition.getQuery().getDefinition());
    if (queryDataType != null && seriesdefinition.getQuery().getGrouping() != null) {
      DataType groupDataType=seriesdefinition.getGrouping().getGroupType();
      if (queryDataType == DataType.NUMERIC_LITERAL && groupDataType == DataType.DATE_TIME_LITERAL) {
        return groupDataType.getName();
      }
 else       if (queryDataType == DataType.TEXT_LITERAL && groupDataType != DataType.TEXT_LITERAL) {
        return groupDataType.getName();
      }
    }
  }
  return isConsistent;
}

Fixed version (ground truth):
private static String checkGroupTypeOnYGrouping(ChartWizardContext context,Chart chart){
  String isConsistent="String_Node_Str";
  SeriesDefinition seriesdefinition=ChartUIUtil.getOrthogonalSeriesDefinitions(chart,0).get(0);
  if (seriesdefinition.getQuery() != null) {
    DataType queryDataType=context.getDataServiceProvider().getDataType(seriesdefinition.getQuery().getDefinition());
    if (queryDataType != null && seriesdefinition.getQuery().getGrouping() != null) {
      DataType groupDataType=seriesdefinition.getQuery().getGrouping().getGroupType();
      if (queryDataType == DataType.NUMERIC_LITERAL && groupDataType == DataType.DATE_TIME_LITERAL) {
        return groupDataType.getName();
      }
 else       if (queryDataType == DataType.TEXT_LITERAL && groupDataType != DataType.TEXT_LITERAL) {
        return groupDataType.getName();
      }
    }
  }
  return isConsistent;
}
Program: 68669
Project: 68669
Buggy source:
public String getBinding(String expression){
  try {
    return ExpressionUtil.getColumnBindingName(expression);
  }
 catch (  BirtException e) {
    ExceptionHandler.handle(e);
  }
  return null;
}

Fixed version (ground truth):
@Override public String getBinding(String expression){
  try {
    return ExpressionUtil.getColumnBindingName(expression);
  }
 catch (  BirtException e) {
    ExceptionHandler.handle(e);
  }
  return null;
}
Program: 68670
Project: 68670
Buggy source:
public String getResultSetColumnExpression(String columnName){
  return ExpressionUtil.createJSDataSetRowExpression(columnName);
}

Fixed version (ground truth):
@Override public String getResultSetColumnExpression(String columnName){
  return ExpressionUtil.createJSDataSetRowExpression(columnName);
}
Program: 68671
Project: 68671
Buggy source:
public String getBindingExpression(String bindingName){
  return ExpressionUtil.createJSRowExpression(bindingName);
}

Fixed version (ground truth):
@Override public String getBindingExpression(String bindingName){
  return ExpressionUtil.createJSRowExpression(bindingName);
}
Program: 68672
Project: 68672
Buggy source:
public String getParameterExpression(String paramName){
  return ExpressionUtil.createJSParameterExpression(paramName);
}

Fixed version (ground truth):
@Override public String getParameterExpression(String paramName){
  return ExpressionUtil.createJSParameterExpression(paramName);
}
Program: 68673
Project: 68673
Buggy source:
public String getDimensionExpression(String dimensionName,String levelName,String attributeName){
  if (attributeName == null) {
    return ExpressionUtil.createJSDimensionExpression(dimensionName,levelName);
  }
  return ExpressionUtil.createJSDimensionExpression(dimensionName,levelName,attributeName);
}

Fixed version (ground truth):
@Override public String getDimensionExpression(String dimensionName,String levelName,String attributeName){
  if (attributeName == null) {
    return ExpressionUtil.createJSDimensionExpression(dimensionName,levelName);
  }
  return ExpressionUtil.createJSDimensionExpression(dimensionName,levelName,attributeName);
}
Program: 68674
Project: 68674
Buggy source:
public String getCubeBindingExpression(String bindingName){
  return ExpressionUtil.createJSDataExpression(bindingName);
}

Fixed version (ground truth):
@Override public String getCubeBindingExpression(String bindingName){
  return ExpressionUtil.createJSDataExpression(bindingName);
}
Program: 68675
Project: 68675
Buggy source:
public String getMeasureExpression(String measureName){
  return ExpressionUtil.createJSMeasureExpression(measureName);
}

Fixed version (ground truth):
@Override public String getMeasureExpression(String measureName){
  return ExpressionUtil.createJSMeasureExpression(measureName);
}
Program: 68676
Project: 68676
Buggy source:
public int getDataType(){
  return DataType.ANY_TYPE;
}

Fixed version (ground truth):
public int getDataType(){
  return DataType.BOOLEAN_TYPE;
}
Program: 68677
Project: 68677
Buggy source:
private void createParameters(){
  if (contentPane != null && !contentPane.isDisposed()) {
    contentPane.dispose();
  }
  contentPane=new Composite(scrollPane,SWT.NONE);
  scrollPane.setContent(contentPane);
  contentPane.setLayoutData(new GridData(GridData.FILL_BOTH));
  contentPane.setLayout(new GridLayout());
  createParametersSection(params,contentPane);
  contentPane.setSize(contentPane.computeSize(SWT.DEFAULT,SWT.DEFAULT));
  scrollPane.setMinSize(contentPane.computeSize(SWT.DEFAULT,SWT.DEFAULT));
}

Fixed version (ground truth):
private void createParameters(){
  if (contentPane != null && !contentPane.isDisposed()) {
    contentPane.dispose();
  }
  contentPane=new Composite(scrollPane,SWT.NONE);
  scrollPane.setContent(contentPane);
  contentPane.setLayoutData(new GridData(GridData.FILL_BOTH));
  contentPane.setLayout(new GridLayout());
  createParametersSection(params,contentPane);
  scrollPane.setMinSize(contentPane.computeSize(400,SWT.DEFAULT));
}
Program: 68678
Project: 68678
Buggy source:
public InputParameterDialog(Shell parentShell,List params,Map paramValues){
  super(parentShell);
  this.params=params;
  if (paramValues != null) {
    this.paramValues.putAll(paramValues);
  }
}

Fixed version (ground truth):
public InputParameterDialog(Shell parentShell,List params,Map paramValues){
  super(parentShell,Messages.getString("String_Node_Str"));
  this.params=params;
  if (paramValues != null) {
    this.paramValues.putAll(paramValues);
  }
}
Program: 68679
Project: 68679
Buggy source:
protected Control createDialogArea(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
  layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
  layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
  layout.horizontalSpacing=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
  composite.setLayout(layout);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  applyDialogFont(composite);
  new Label(composite,SWT.NONE).setText(Messages.getString("String_Node_Str"));
  scrollPane=new ScrolledComposite(composite,SWT.H_SCROLL | SWT.V_SCROLL);
  scrollPane.setExpandHorizontal(true);
  scrollPane.setExpandVertical(true);
  scrollPane.setLayoutData(new GridData(GridData.FILL_BOTH));
  createParameters();
  performed=true;
  return composite;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
  layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
  layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
  layout.horizontalSpacing=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
  composite.setLayout(layout);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  applyDialogFont(composite);
  new Label(composite,SWT.NONE).setText(Messages.getString("String_Node_Str"));
  scrollPane=new ScrolledComposite(composite,SWT.H_SCROLL | SWT.V_SCROLL);
  scrollPane.setExpandHorizontal(true);
  scrollPane.setExpandVertical(true);
  GridData gd=new GridData(GridData.FILL_BOTH);
  gd.widthHint=400;
  gd.heightHint=400;
  scrollPane.setLayoutData(gd);
  createParameters();
  performed=true;
  return composite;
}
Program: 68681
Project: 68681
Buggy source:
public void updateText(String expression){
  if (btnBuilder != null) {
    btnBuilder.setExpression(expression);
  }
}

Fixed version (ground truth):
public void updateText(String expression){
  if (btnBuilder != null) {
    if (cmbDefinition != null) {
      cmbDefinition.removeModifyListener(this);
    }
 else     if (txtDefinition != null) {
      txtDefinition.removeModifyListener(this);
    }
    btnBuilder.setExpression(expression);
    if (cmbDefinition != null) {
      cmbDefinition.addModifyListener(this);
    }
 else     if (txtDefinition != null) {
      txtDefinition.addModifyListener(this);
    }
  }
}
Program: 68684
Project: 68684
Buggy source:
/** 
 * Returns the medium font size.
 */
public float getMediumFontSize(){
  return 9f * 1000.0f;
}

Fixed version (ground truth):
/** 
 * Returns the medium font size.
 */
public float getMediumFontSize(){
  return 9f;
}
Program: 68686
Project: 68686
Buggy source:
public int getLineHeight(){
  if (content != null) {
    IStyle contentStyle=content.getComputedStyle();
    return PropertyUtil.getLineHeight(contentStyle.getLineHeight());
  }
  return 0;
}

Fixed version (ground truth):
public int getLineHeight(){
  if (content != null) {
    IStyle contentStyle=content.getComputedStyle();
    return PropertyUtil.getDimensionValueConsiderDpi(contentStyle.getProperty(IStyle.STYLE_LINE_HEIGHT),content);
  }
  return 0;
}
Program: 68688
Project: 68688
Buggy source:
/** 
 * Used in filter select value dialog in layout.
 * @param expression
 * @param dataSetHandle
 * @param binding
 * @param useDataSetFilter
 * @return
 * @throws BirtException
 */
public static List getSelectValueFromBinding(Expression expression,DataSetHandle dataSetHandle,Iterator binding,boolean useDataSetFilter) throws BirtException {
}

Fixed version (ground truth):
/** 
 * Used in filter select value dialog in layout with group definition.
 * @param expression
 * @param dataSetHandle
 * @param binding The iterator of ComputedColumnHandle
 * @param groupIterator The iterator of GroupHandle
 * @param useDataSetFilter
 * @return
 * @throws BirtException
 */
public static List getSelectValueFromBinding(Expression expression,DataSetHandle dataSetHandle,Iterator binding,Iterator groupIterator,boolean useDataSetFilter) throws BirtException {
}
Program: 68689
Project: 68689
Buggy source:
private void addMenu(IMenuManager manager,Object item){
  if (item instanceof IAction) {
    manager.add((IAction)item);
  }
 else   if (item instanceof IContributionItem) {
    manager.add((IContributionItem)item);
  }
  if (getDataServiceProvider().isPartChart()) {
    if (item instanceof IAction) {
      ((IAction)item).setEnabled(false);
    }
  }
}

Fixed version (ground truth):
private void addMenu(IMenuManager manager,Object item){
  if (item instanceof IAction) {
    manager.add((IAction)item);
  }
 else   if (item instanceof IContributionItem) {
    manager.add((IContributionItem)item);
  }
 else   if (item instanceof List<?>) {
    for (    Object o : (List<?>)item) {
      addMenu(manager,o);
    }
  }
  if (getDataServiceProvider().isPartChart()) {
    if (item instanceof IAction) {
      ((IAction)item).setEnabled(false);
    }
  }
}
Program: 68690
Project: 68690
Buggy source:
protected Object getMenuForDimension(Chart chart,String expr){
  if (((Boolean)dataProvider.checkData(ChartUIConstants.QUERY_CATEGORY,expr)).booleanValue()) {
    return getBaseSeriesMenu(getChartModel(),expr);
  }
  if (dataProvider.checkState(IDataServiceProvider.MULTI_CUBE_DIMENSIONS) && ((Boolean)dataProvider.checkData(ChartUIConstants.QUERY_OPTIONAL,expr)).booleanValue()) {
    return getGroupSeriesMenu(getChartModel(),expr);
  }
  return null;
}

Fixed version (ground truth):
protected Object getMenuForDimension(Chart chart,String expr){
  List<Object> menus=new ArrayList<Object>(2);
  if (((Boolean)dataProvider.checkData(ChartUIConstants.QUERY_CATEGORY,expr)).booleanValue()) {
    menus.add(getBaseSeriesMenu(getChartModel(),expr));
  }
  if (dataProvider.checkState(IDataServiceProvider.MULTI_CUBE_DIMENSIONS) && ((Boolean)dataProvider.checkData(ChartUIConstants.QUERY_OPTIONAL,expr)).booleanValue()) {
    menus.add(getGroupSeriesMenu(getChartModel(),expr));
  }
  return menus;
}
Program: 68702
Project: 68702
Buggy source:
/** 
 * Swaps the crosstab row area and column area. Note this call is not equivalent to calling <code>pivotDimension</code> to interchange dimensions from row area to column area. Specifically this call will retain all the original subtotal and grandtotal info in both area after the swapping, while <code>pivotDimension</code> may remove the grandtotal or recreate some cells during the processing.
 * @throws SemanticException
 */
public void pivotCrosstab() throws SemanticException {
  CommandStack stack=crosstab.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  try {
    int transfered=transferDimensions(ROW_AXIS_TYPE,0);
    transferDimensions(COLUMN_AXIS_TYPE,transfered);
    CrosstabCellHandle replaced=transferGrandTotal(ROW_AXIS_TYPE,null);
    transferGrandTotal(COLUMN_AXIS_TYPE,replaced);
    for (int i=0; i < crosstab.getMeasureCount(); i++) {
      MeasureViewHandle mv=crosstab.getMeasure(i);
      swapAggregateOn(mv.getCell());
      for (int j=0; j < mv.getAggregationCount(); j++) {
        swapAggregateOn(mv.getAggregationCell(j));
      }
    }
    String oldDirction=crosstab.getMeasureDirection();
    String newDirection=MEASURE_DIRECTION_HORIZONTAL.equals(oldDirction) ? MEASURE_DIRECTION_VERTICAL : MEASURE_DIRECTION_HORIZONTAL;
    crosstab.getModelHandle().setStringProperty(MEASURE_DIRECTION_PROP,newDirection);
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
}

Fixed version (ground truth):
/** 
 * Swaps the crosstab row area and column area. Note this call is not equivalent to calling <code>pivotDimension</code> to interchange dimensions from row area to column area. Specifically this call will retain all the original subtotal and grandtotal info in both area after the swapping, while <code>pivotDimension</code> may remove the grandtotal or recreate some cells during the processing.
 * @throws SemanticException
 */
public void pivotCrosstab() throws SemanticException {
  CommandStack stack=crosstab.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  try {
    int transfered=transferDimensions(ROW_AXIS_TYPE,0);
    transferDimensions(COLUMN_AXIS_TYPE,transfered);
    CrosstabCellHandle replaced=transferGrandTotal(ROW_AXIS_TYPE,null,true);
    transferGrandTotal(COLUMN_AXIS_TYPE,replaced,false);
    for (int i=0; i < crosstab.getMeasureCount(); i++) {
      MeasureViewHandle mv=crosstab.getMeasure(i);
      swapAggregateOn(mv.getCell());
      for (int j=0; j < mv.getAggregationCount(); j++) {
        swapAggregateOn(mv.getAggregationCell(j));
      }
    }
    String oldDirction=crosstab.getMeasureDirection();
    String newDirection=MEASURE_DIRECTION_HORIZONTAL.equals(oldDirction) ? MEASURE_DIRECTION_VERTICAL : MEASURE_DIRECTION_HORIZONTAL;
    crosstab.getModelHandle().setStringProperty(MEASURE_DIRECTION_PROP,newDirection);
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
}