nus-yam/ex-repair huggingface dataset:
Program: 67024
Project: 67024
Buggy source:
/** 
 * @param factTableJointColumnNames
 * @param DimJointColumnNames
 * @param dimension
 * @param iterator
 * @param measureColumnName
 * @param stopSign
 * @throws IOException
 * @throws BirtException
 */
public void create(String[][] factTableJointColumnNames,String[][] DimJointColumnNames,IDimension[] dimension,IDatasetIterator iterator,String[] measureColumnName,long cacheSize,StopSign stopSign,boolean suppressInvalidFacttableRow) throws IOException, BirtException {
  IDocumentObject documentObject=documentManager.createDocumentObject(NamingUtil.getCubeDocName(name));
  documentObject.writeString(name);
  documentObject.writeInt(dimension.length);
  for (int i=0; i < dimension.length; i++) {
    documentObject.writeString(dimension[i].getName());
  }
  this.dimension=dimension;
  Dimension[] tDimensions=new Dimension[dimension.length];
  for (int i=0; i < tDimensions.length; i++) {
    tDimensions[i]=(Dimension)dimension[i];
  }
  FactTableAccessor factTableConstructor=new FactTableAccessor(documentManager);
  factTableConstructor.setMemoryCacheSize(cacheSize);
  factTable=factTableConstructor.saveFactTable(name,factTableJointColumnNames,DimJointColumnNames,iterator,tDimensions,measureColumnName,stopSign,suppressInvalidFacttableRow);
  documentObject.close();
  documentManager.flush();
}

Fixed version (ground truth):
/** 
 * @param factTableJointColumnNames
 * @param DimJointColumnNames
 * @param dimension
 * @param iterator
 * @param measureColumnName
 * @param stopSign
 * @throws IOException
 * @throws BirtException
 */
public void create(String[][] factTableJointColumnNames,String[][] DimJointColumnNames,IDimension[] dimension,IDatasetIterator iterator,String[] measureColumnName,long cacheSize,StopSign stopSign) throws IOException, BirtException {
  IDocumentObject documentObject=documentManager.createDocumentObject(NamingUtil.getCubeDocName(name));
  documentObject.writeString(name);
  documentObject.writeInt(dimension.length);
  for (int i=0; i < dimension.length; i++) {
    documentObject.writeString(dimension[i].getName());
  }
  this.dimension=dimension;
  Dimension[] tDimensions=new Dimension[dimension.length];
  for (int i=0; i < tDimensions.length; i++) {
    tDimensions[i]=(Dimension)dimension[i];
  }
  FactTableAccessor factTableConstructor=new FactTableAccessor(documentManager);
  factTableConstructor.setMemoryCacheSize(cacheSize);
  factTable=factTableConstructor.saveFactTable(name,factTableJointColumnNames,DimJointColumnNames,iterator,tDimensions,measureColumnName,stopSign);
  documentObject.close();
  documentManager.flush();
}
Program: 67026
Project: 67026
Buggy source:
/** 
 * @param appContext
 * @param hierHandle
 * @return
 * @throws AdapterException
 * @throws BirtException
 */
private DataSetIterator createDataSetIterator(Map appContext,TabularHierarchyHandle hierHandle,String cubeName) throws AdapterException, BirtException {
  List<ColumnMeta> metaList=new ArrayList<ColumnMeta>();
  IQueryDefinition defn=sessionImpl.createQuery(sessionImpl,hierHandle,metaList,cubeName);
  return new DataSetIterator(this.sessionImpl,defn,metaList,appContext,null,null);
}

Fixed version (ground truth):
/** 
 * @param appContext
 * @param hierHandle
 * @return
 * @throws AdapterException
 * @throws BirtException
 */
private DataSetIterator createDataSetIterator(Map appContext,TabularHierarchyHandle hierHandle,String cubeName) throws AdapterException, BirtException {
  List<ColumnMeta> metaList=new ArrayList<ColumnMeta>();
  IQueryDefinition defn=sessionImpl.createQuery(sessionImpl,hierHandle,metaList,cubeName);
  return new DataSetIterator(this.sessionImpl,defn,metaList,appContext);
}
Program: 67027
Project: 67027
Buggy source:
public IBaseQueryResults execute(IBasePreparedQuery query,IBaseQueryResults outerResults,ScriptContext context) throws AdapterException {
  try {
    IDataScriptEngine engine=(IDataScriptEngine)context.getScriptEngine(IDataScriptEngine.ENGINE_NAME);
    Scriptable scope=engine.getJSScope(context);
    if (query instanceof IPreparedQuery) {
      return ((IPreparedQuery)query).execute(outerResults,scope);
    }
 else     if (query instanceof IPreparedCubeQuery) {
      String queryName=((IPreparedCubeQuery)query).getCubeQueryDefinition().getName();
      if (this.cubeHandleMap.get(queryName) != null) {
        this.materializeCube((CubeHandle)this.cubeHandleMap.get(queryName),this.sessionContext.getAppContext(),false);
        this.cubeHandleMap.remove(queryName);
      }
      return ((IPreparedCubeQuery)query).execute(outerResults,scope);
    }
    return null;
  }
 catch (  BirtException e) {
    throw new AdapterException(ResourceConstants.EXCEPTION_ERROR,e);
  }
}

Fixed version (ground truth):
public IBaseQueryResults execute(IBasePreparedQuery query,IBaseQueryResults outerResults,ScriptContext context) throws AdapterException {
  try {
    IDataScriptEngine engine=(IDataScriptEngine)context.getScriptEngine(IDataScriptEngine.ENGINE_NAME);
    Scriptable scope=engine.getJSScope(context);
    if (query instanceof IPreparedQuery) {
      return ((IPreparedQuery)query).execute(outerResults,scope);
    }
 else     if (query instanceof IPreparedCubeQuery) {
      String queryName=((IPreparedCubeQuery)query).getCubeQueryDefinition().getName();
      if (this.cubeHandleMap.get(queryName) != null) {
        this.materializeCube((CubeHandle)this.cubeHandleMap.get(queryName),this.sessionContext.getAppContext());
        this.cubeHandleMap.remove(queryName);
      }
      return ((IPreparedCubeQuery)query).execute(outerResults,scope);
    }
    return null;
  }
 catch (  BirtException e) {
    throw new AdapterException(ResourceConstants.EXCEPTION_ERROR,e);
  }
}
Program: 67028
Project: 67028
Buggy source:
/** 
 * @param cubeHandle
 * @param appContext
 * @param stopSign
 * @throws BirtException
 */
void materializeCube(CubeHandle cubeHandle,Map appContext,boolean isTransient) throws BirtException {
  int mode=this.sessionContext.getDataEngineContext().getMode();
  try {
    if (appContext == null)     appContext=sessionContext.getAppContext();
    String memoryUsage=(String)(appContext.get(DataEngine.MEMORY_USAGE));
    MemoryUsageSetting.setMemoryUsage(memoryUsage);
    if (mode == DataEngineContext.DIRECT_PRESENTATION) {
      int size=0;
      if (appContext != null) {
        Integer value=DataTypeUtil.toInteger(appContext.get(DataEngine.IN_MEMORY_CUBE_SIZE));
        if (value != null && value.intValue() > 0) {
          size=value.intValue();
        }
      }
      CubeMaterializer cm=getCubeMaterializer(size);
      createCube((TabularCubeHandle)cubeHandle,cm,appContext,isTransient);
    }
 else     if (mode == DataEngineContext.MODE_GENERATION) {
      CubeMaterializer cm=getCubeMaterializer(0);
      createCube((TabularCubeHandle)cubeHandle,cm,appContext,isTransient);
      cm.saveCubeToReportDocument(cubeHandle.getQualifiedName(),this.sessionContext.getDocumentWriter(),this.dataEngine.getSession().getStopSign());
    }
  }
 catch (  Exception e) {
    throw new DataException(ResourceConstants.EXCEPTION_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * @param cubeHandle
 * @param appContext
 * @param stopSign
 * @throws BirtException
 */
void materializeCube(CubeHandle cubeHandle,Map appContext) throws BirtException {
  int mode=this.sessionContext.getDataEngineContext().getMode();
  try {
    if (appContext == null)     appContext=sessionContext.getAppContext();
    String memoryUsage=(String)(appContext.get(DataEngine.MEMORY_USAGE));
    MemoryUsageSetting.setMemoryUsage(memoryUsage);
    if (mode == DataEngineContext.DIRECT_PRESENTATION) {
      int size=0;
      if (appContext != null) {
        Integer value=DataTypeUtil.toInteger(appContext.get(DataEngine.IN_MEMORY_CUBE_SIZE));
        if (value != null && value.intValue() > 0) {
          size=value.intValue();
        }
      }
      CubeMaterializer cm=getCubeMaterializer(size);
      createCube((TabularCubeHandle)cubeHandle,cm,appContext);
    }
 else     if (mode == DataEngineContext.MODE_GENERATION) {
      CubeMaterializer cm=getCubeMaterializer(0);
      createCube((TabularCubeHandle)cubeHandle,cm,appContext);
      cm.saveCubeToReportDocument(cubeHandle.getQualifiedName(),this.sessionContext.getDocumentWriter(),this.dataEngine.getSession().getStopSign());
    }
  }
 catch (  Exception e) {
    throw new DataException(ResourceConstants.EXCEPTION_ERROR,e);
  }
}
Program: 67031
Project: 67031
Buggy source:
/** 
 * Create DataSetIterator for fact table.
 * @param session
 * @param cubeHandle
 * @throws BirtException
 */
public DataSetIterator(DataRequestSessionImpl session,IQueryDefinition query,List<ColumnMeta> meta,Map appContext,SecurityListener listener,String dimensionName) throws BirtException {
  this.defaultCalendar=Calendar.getInstance(session.getDataSessionContext().getDataEngineContext().getLocale());
  this.defaultCalendar.setTimeZone(TimeZone.getDefault());
  this.defaultCalendar.clear();
  this.calendar=Calendar.getInstance(session.getDataSessionContext().getDataEngineContext().getLocale());
  this.calendar.setTimeZone(session.getDataSessionContext().getDataEngineContext().getTimeZone());
  this.calendar.clear();
  this.calendar.set(0,0,1,0,0,0);
  this.nullTime=this.calendar.getTimeInMillis();
  this.calendar.clear();
  this.securityListener=listener;
  this.dimName=dimensionName;
  if (this.securityListener != null) {
    List<IFilterDefinition> additionalFilters4TransientProcessing=this.securityListener.populateSecurityFilter(this.dimName,appContext);
    if (additionalFilters4TransientProcessing != null)     query.getFilters().addAll(additionalFilters4TransientProcessing);
  }
  executeQuery(session,query,appContext);
  this.metadata=new ResultMeta(meta);
}

Fixed version (ground truth):
/** 
 * Create DataSetIterator for fact table.
 * @param session
 * @param cubeHandle
 * @throws BirtException
 */
public DataSetIterator(DataRequestSessionImpl session,IQueryDefinition query,List<ColumnMeta> meta,Map appContext) throws BirtException {
  this.defaultCalendar=Calendar.getInstance(session.getDataSessionContext().getDataEngineContext().getLocale());
  this.defaultCalendar.setTimeZone(TimeZone.getDefault());
  this.defaultCalendar.clear();
  this.calendar=Calendar.getInstance(session.getDataSessionContext().getDataEngineContext().getLocale());
  this.calendar.setTimeZone(session.getDataSessionContext().getDataEngineContext().getTimeZone());
  this.calendar.clear();
  this.calendar.set(0,0,1,0,0,0);
  this.nullTime=this.calendar.getTimeInMillis();
  this.calendar.clear();
  executeQuery(session,query,appContext);
  this.metadata=new ResultMeta(meta);
}
Program: 67032
Project: 67032
Buggy source:
public SecurityListener(DataRequestSessionImpl session,boolean isTransient){
}

Fixed version (ground truth):
public SecurityListener(DataRequestSessionImpl session){
}
Program: 67033
Project: 67033
Buggy source:
private int getSortTypeOnMirroredLevel(int level){
  AggrSortDefinition aggrSort=this.findAggregationSort(level);
  int sortType;
  if (aggrSort != null) {
    if (aggrSort.getAxisQualifierLevel().length == 0)     sortType=aggrSort.getSortDirection();
 else     sortType=IDimensionSortDefn.SORT_UNDEFINED;
  }
 else {
    sortType=this.rs.getSortType(level);
    if (sortType == IDimensionSortDefn.SORT_UNDEFINED)     sortType=IDimensionSortDefn.SORT_ASC;
  }
  return sortType;
}

Fixed version (ground truth):
private int getSortTypeOnMirroredLevel(int level){
  return this.findAggregationSort(level);
}
Program: 67034
Project: 67034
Buggy source:
/** 
 * @param levelIndex
 * @return
 */
private AggrSortDefinition findAggregationSort(int levelIndex){
  AggrSortDefinition aggrSortDefn=null;
  if (this.sortList != null) {
    DimLevel level=this.rs.getLevel(levelIndex);
    for (int i=0; i < this.sortList.size(); i++) {
      AggrSortDefinition defn=(AggrSortDefinition)sortList.get(i);
      if (level.equals(defn.getTargetLevel())) {
        aggrSortDefn=defn;
        break;
      }
    }
  }
  return aggrSortDefn;
}

Fixed version (ground truth):
/** 
 * @param levelIndex
 * @return
 */
private int findAggregationSort(int levelIndex){
  int sortType=IDimensionSortDefn.SORT_UNDEFINED;
  if (this.sortList != null) {
    DimLevel level=this.rs.getLevel(levelIndex);
    for (int i=0; i < this.sortList.size(); i++) {
      if (sortList.get(i) instanceof AggrSortDefinition) {
        AggrSortDefinition defn=(AggrSortDefinition)sortList.get(i);
        if (level.equals(defn.getTargetLevel())) {
          if (defn.getAxisQualifierLevel().length == 0)           sortType=defn.getSortDirection();
 else           sortType=IDimensionSortDefn.SORT_UNDEFINED;
          return sortType;
        }
      }
 else       if (sortList.get(i) instanceof DimensionSortEvalHelper) {
        DimensionSortEvalHelper dimSort=(DimensionSortEvalHelper)sortList.get(i);
        if (dimSort.getTargetLevel().equals(level)) {
          return IDimensionSortDefn.SORT_UNDEFINED;
        }
      }
    }
  }
  sortType=this.rs.getSortType(levelIndex);
  if (sortType == IDimensionSortDefn.SORT_UNDEFINED)   sortType=IDimensionSortDefn.SORT_ASC;
  return sortType;
}
Program: 67035
Project: 67035
Buggy source:
/** 
 * @throws IOException
 * @throws DataException 
 */
private void loadFromDisk() throws IOException, DataException {
  openReadDocumentObject();
  keyDataType=new int[documentObject.readInt()];
  for (int i=0; i < keyDataType.length; i++) {
    keyDataType[i]=documentObject.readInt();
  }
  keyCount=documentObject.readInt();
  degree=documentObject.readInt();
  if (degree > 10000) {
    this.currentVersion=degree / 10000;
  }
  rootNodeOffset=documentObject.readInt();
  numberOfLevel=documentObject.readShort();
  if (numberOfLevel < 1 || numberOfLevel > 1000 || Math.pow(degree,numberOfLevel) < keyCount) {
    throw new DataException(ResourceConstants.OLAPFILE_FORMAT_INVALID,name);
  }
}

Fixed version (ground truth):
/** 
 * @throws IOException
 * @throws DataException 
 */
private void loadFromDisk() throws IOException, DataException {
  openReadDocumentObject();
  keyDataType=new int[documentObject.readInt()];
  for (int i=0; i < keyDataType.length; i++) {
    keyDataType[i]=documentObject.readInt();
  }
  keyCount=documentObject.readInt();
  degree=documentObject.readInt();
  if (degree > 10000) {
    this.currentVersion=degree / 10000;
  }
 else {
    this.currentVersion=0;
  }
  rootNodeOffset=documentObject.readInt();
  numberOfLevel=documentObject.readShort();
  if (numberOfLevel < 1 || numberOfLevel > 1000 || Math.pow(degree,numberOfLevel) < keyCount) {
    throw new DataException(ResourceConstants.OLAPFILE_FORMAT_INVALID,name);
  }
}
Program: 67036
Project: 67036
Buggy source:
/** 
 * @param expr
 * @return
 * @throws DataException
 */
public static DimLevel getTargetDimLevel(String expr) throws DataException {
  if (expr != null && expr.matches("String_Node_Str")) {
    Set<DimLevel> s=OlapExpressionCompiler.getReferencedDimLevel(new ScriptExpression(expr),Collections.EMPTY_LIST);
    if (s != null && s.size() == 1) {
      return s.iterator().next();
    }
  }
  throw new DataException(ResourceConstants.LEVEL_NAME_NOT_FOUND,expr);
}

Fixed version (ground truth):
/** 
 * @param expr
 * @return
 * @throws DataException
 */
public static DimLevel getTargetDimLevel(String expr) throws DataException {
  if (expr != null && expr.trim().matches("String_Node_Str")) {
    Set<DimLevel> s=OlapExpressionCompiler.getReferencedDimLevel(new ScriptExpression(expr.trim()),Collections.EMPTY_LIST);
    if (s != null && s.size() == 1) {
      return s.iterator().next();
    }
  }
  throw new DataException(ResourceConstants.LEVEL_NAME_NOT_FOUND,expr);
}
Program: 67037
Project: 67037
Buggy source:
public void generatePageHints(IPageContent page) throws BirtException {
  PageArea pageArea=(PageArea)page.getExtension(IContent.LAYOUT_EXTENSION);
  if (pageArea != null) {
    reset();
    htmlUnresolvedRowHints=htmlLayoutContext.getPageHintManager().getUnresolvedRowHints();
    for (Iterator<IArea> i=pageArea.getBody().getChildren(); i.hasNext(); ) {
      IArea child=i.next();
      traverse(child);
    }
  }
  if (startContent != null) {
    if (currentContent != null) {
      fixedLayoutPageHints.add(new SizeBasedContent[]{startContent,currentContent});
    }
  }
}

Fixed version (ground truth):
public void generatePageHints(IPageContent page) throws BirtException {
  PageArea pageArea=(PageArea)page.getExtension(IContent.LAYOUT_EXTENSION);
  if (pageArea != null) {
    reset();
    for (Iterator<IArea> i=pageArea.getBody().getChildren(); i.hasNext(); ) {
      IArea child=i.next();
      traverse(child);
    }
    HTMLLayoutPageHintManager pm=htmlLayoutContext.getPageHintManager();
    pm.generatePageRowHints(getTableKeys());
    htmlUnresolvedRowHints=pm.getUnresolvedRowHints();
  }
  if (startContent != null) {
    if (currentContent != null) {
      fixedLayoutPageHints.add(new SizeBasedContent[]{startContent,currentContent});
    }
  }
}
Program: 67039
Project: 67039
Buggy source:
/** 
 * Add event handling to the hotspot
 */
private void addEventHandling(Element elm,StructureSource src,Trigger[] triggers,Cursor cursor){
  if (elm != null && triggers != null) {
    if (triggers != null && triggers.length > 0) {
      setCursorAttribute(elm,cursor,defaultCursor);
    }
    for (int x=0; x < triggers.length; x++) {
      Trigger tg=triggers[x];
    }
    Element aLink=svg_g2d.createElement("String_Node_Str");
    Element group=svg_g2d.createElement("String_Node_Str");
    group.appendChild(elm);
    aLink.setAttribute("String_Node_Str","String_Node_Str");
    aLink.appendChild(group);
    elm=group;
    hotspotLayer.appendChild(aLink);
    for (int x=0; x < triggers.length; x++) {
      Trigger tg=triggers[x];
      String scriptEvent=getJsScriptEvent(tg.getCondition().getValue());
      if (scriptEvent != null) {
        boolean bDblClick=false;
        if (scriptEvent.equals("String_Node_Str")) {
          scriptEvent="String_Node_Str";
          bDblClick=true;
        }
        Action action=tg.getAction();
        if (action instanceof MultipleActions) {
          addMultiActionsJSCode(elm,src,tg,scriptEvent,bDblClick,(MultipleActions)action);
        }
 else {
          addActionJSCode(elm,src,tg,scriptEvent,bDblClick,action);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Add event handling to the hotspot
 */
private void addEventHandling(Element elm,StructureSource src,Trigger[] triggers,Cursor cursor){
  if (elm != null && triggers != null) {
    if (triggers != null && triggers.length > 0) {
      setCursorAttribute(elm,cursor,defaultCursor);
    }
    Element aLink=svg_g2d.createElement("String_Node_Str");
    Element group=svg_g2d.createElement("String_Node_Str");
    group.appendChild(elm);
    aLink.setAttribute("String_Node_Str","String_Node_Str");
    aLink.appendChild(group);
    elm=group;
    hotspotLayer.appendChild(aLink);
    for (int x=0; x < triggers.length; x++) {
      Trigger tg=triggers[x];
      String scriptEvent=getJsScriptEvent(tg.getCondition().getValue());
      if (scriptEvent != null) {
        boolean bDblClick=false;
        if (scriptEvent.equals("String_Node_Str")) {
          scriptEvent="String_Node_Str";
          bDblClick=true;
        }
        Action action=tg.getAction();
        if (action instanceof MultipleActions) {
          addMultiActionsJSCode(elm,src,tg,scriptEvent,bDblClick,(MultipleActions)action);
        }
 else {
          addActionJSCode(elm,src,tg,scriptEvent,bDblClick,action);
        }
      }
    }
  }
}
Program: 67040
Project: 67040
Buggy source:
protected void performDefaults(){
  maxRowEditor.setStringValue(String.valueOf(DEFAULT_MAX_ROW));
  super.performDefaults();
}

Fixed version (ground truth):
protected void performDefaults(){
  maxRowEditor.setStringValue(String.valueOf(DEFAULT_MAX_ROW));
  promptButton.setSelection(false);
  super.performDefaults();
}
Program: 67041
Project: 67041
Buggy source:
protected void performDefaults(){
  maxDisplaySchemaEditor.setStringValue(String.valueOf(DEFAULT_MAX_NUM_OF_SCHEMA));
  maxDisplayTableEditor.setStringValue(String.valueOf(DEFAULT_MAX_NUM_OF_TABLE_EACH_SCHEMA));
  enableCodeAssistCheckbox.setSelection(true);
  timeOutLimitEditor.setStringValue(String.valueOf(DEFAULT_TIMEOUT_LIMIT));
  super.performDefaults();
}

Fixed version (ground truth):
protected void performDefaults(){
  maxDisplaySchemaEditor.setStringValue(String.valueOf(DEFAULT_MAX_NUM_OF_SCHEMA));
  maxDisplayTableEditor.setStringValue(String.valueOf(DEFAULT_MAX_NUM_OF_TABLE_EACH_SCHEMA));
  enableCodeAssistCheckbox.setSelection(true);
  schemasPrefetchConfigCheckbox.setSelection(true);
  timeOutLimitEditor.setStringValue(String.valueOf(DEFAULT_TIMEOUT_LIMIT));
  super.performDefaults();
}
Program: 67043
Project: 67043
Buggy source:
private static void getBindings(Set<String> visited,Set<IDimLevel> aggOn,IBinding binding,List<IBinding> bindings) throws DataException, CoreException {
  if (binding == null || visited.contains(binding.getBindingName())) {
    return;
  }
  List<String> currentVisitBindings=ExpressionCompilerUtil.extractColumnExpression(binding.getExpression(),ExpressionUtil.DATA_INDICATOR);
  currentVisitBindings.removeAll(visited);
  for (  String expr : ((List<String>)binding.getAggregatOns())) {
    aggOn.addAll(ExpressionUtil.getReferencedDimLevel(expr));
  }
  aggOn.addAll(ExpressionUtil.getReferencedDimLevel(((IScriptExpression)binding.getExpression()).getText()));
  visited.add(binding.getBindingName());
  for (  String bindingName : currentVisitBindings) {
    getBindings(visited,aggOn,getBinding(bindingName,bindings),bindings);
  }
}

Fixed version (ground truth):
private static void getBindings(Set<String> visited,Set<IDimLevel> aggOn,IBinding binding,List<IBinding> bindings,Set<IDimLevel> mostDetailed) throws DataException, CoreException {
  if (binding == null || visited.contains(binding.getBindingName())) {
    return;
  }
  List<String> currentVisitBindings=ExpressionCompilerUtil.extractColumnExpression(binding.getExpression(),ExpressionUtil.DATA_INDICATOR);
  currentVisitBindings.removeAll(visited);
  for (  String expr : ((List<String>)binding.getAggregatOns())) {
    aggOn.addAll(ExpressionUtil.getReferencedDimLevel(expr));
  }
  String text=((IScriptExpression)binding.getExpression()).getText();
  aggOn.addAll(ExpressionUtil.getReferencedDimLevel(text));
  if (binding.getAggregatOns().isEmpty() && binding.getAggrFunction() == null) {
    List<String> result=ExpressionCompilerUtil.extractColumnExpression(binding.getExpression(),"String_Node_Str");
    if (result != null && result.size() > 0) {
      aggOn.addAll(mostDetailed);
    }
  }
  visited.add(binding.getBindingName());
  for (  String bindingName : currentVisitBindings) {
    getBindings(visited,aggOn,getBinding(bindingName,bindings),bindings,mostDetailed);
  }
}
Program: 67044
Project: 67044
Buggy source:
public static Set<IDimLevel> getAggregateOnLevel(IBaseExpression expr,List<IBinding> bindings) throws DataException {
  Set<String> visited=new HashSet<String>();
  Set<IDimLevel> valid=new HashSet<IDimLevel>();
  try {
    getBindings(visited,valid,expr,bindings);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  return valid;
}

Fixed version (ground truth):
public static Set<IDimLevel> getAggregateOnLevel(IBaseExpression expr,List<IBinding> bindings,Set<IDimLevel> mostDetailed) throws DataException {
  Set<String> visited=new HashSet<String>();
  Set<IDimLevel> valid=new HashSet<IDimLevel>();
  try {
    getBindings(visited,valid,expr,bindings,mostDetailed);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  return valid;
}
Program: 67045
Project: 67045
Buggy source:
/** 
 * to check whether the expression directly reference to a dimension or measure
 * @param expression
 * @param bindings
 * @return
 * @throws DataException
 */
public static boolean isDirectRerenrence(IBaseExpression expression,List<IBinding> bindings) throws DataException {
  if (!(expression instanceof IScriptExpression))   return false;
  String expr=((IScriptExpression)expression).getText();
  if (expr == null)   return false;
  if (expr.matches("String_Node_Str") || expr.matches("String_Node_Str"))   return true;
 else   if (expr.matches("String_Node_Str"))   return true;
 else   if (expr.matches("String_Node_Str")) {
    String bindingName=getBindingName(expr);
    for (    IBinding binding : bindings) {
      if (binding.getBindingName().equals(bindingName)) {
        return isDirectRerenrence(binding.getExpression(),bindings);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * to check whether the expression directly reference to a dimension or measure
 * @param expression
 * @param bindings
 * @return
 * @throws DataException
 */
public static boolean isDirectRerenrence(IBaseExpression expression,List<IBinding> bindings) throws DataException {
  if (!(expression instanceof IScriptExpression))   return false;
  String expr=((IScriptExpression)expression).getText();
  if (expr == null)   return false;
  if (expr.matches("String_Node_Str") || expr.matches("String_Node_Str"))   return true;
 else   if (findMeasure(expr) != null)   return true;
 else   if (expr.matches("String_Node_Str")) {
    String bindingName=getBindingName(expr);
    for (    IBinding binding : bindings) {
      if (binding.getBindingName().equals(bindingName)) {
        return isDirectRerenrence(binding.getExpression(),bindings);
      }
    }
  }
  return false;
}
Program: 67046
Project: 67046
Buggy source:
/** 
 * Add event handling to the hotspot
 */
private void addEventHandling(Element elm,StructureSource src,Trigger[] triggers,Cursor cursor){
  if (elm != null && triggers != null) {
    if (triggers != null && triggers.length > 0) {
      setCursorAttribute(elm,cursor,defaultCursor);
    }
    boolean redirect=false;
    for (int x=0; x < triggers.length; x++) {
      Trigger tg=triggers[x];
      redirect=MultiActionValuesScriptGenerator.containsRedirection(tg.getAction());
    }
    if (redirect) {
      Element aLink=svg_g2d.createElement("String_Node_Str");
      Element group=svg_g2d.createElement("String_Node_Str");
      group.appendChild(elm);
      aLink.setAttribute("String_Node_Str","String_Node_Str");
      aLink.appendChild(group);
      elm=group;
      hotspotLayer.appendChild(aLink);
    }
 else     hotspotLayer.appendChild(elm);
    for (int x=0; x < triggers.length; x++) {
      Trigger tg=triggers[x];
      String scriptEvent=getJsScriptEvent(tg.getCondition().getValue());
      if (scriptEvent != null) {
        boolean bDblClick=false;
        if (scriptEvent.equals("String_Node_Str")) {
          scriptEvent="String_Node_Str";
          bDblClick=true;
        }
        Action action=tg.getAction();
        if (action instanceof MultipleActions) {
          addMultiActionsJSCode(elm,src,tg,scriptEvent,bDblClick,(MultipleActions)action);
        }
 else {
          addActionJSCode(elm,src,tg,scriptEvent,bDblClick,action);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Add event handling to the hotspot
 */
private void addEventHandling(Element elm,StructureSource src,Trigger[] triggers,Cursor cursor){
  if (elm != null && triggers != null) {
    if (triggers != null && triggers.length > 0) {
      setCursorAttribute(elm,cursor,defaultCursor);
    }
    for (int x=0; x < triggers.length; x++) {
      Trigger tg=triggers[x];
    }
    Element aLink=svg_g2d.createElement("String_Node_Str");
    Element group=svg_g2d.createElement("String_Node_Str");
    group.appendChild(elm);
    aLink.setAttribute("String_Node_Str","String_Node_Str");
    aLink.appendChild(group);
    elm=group;
    hotspotLayer.appendChild(aLink);
    for (int x=0; x < triggers.length; x++) {
      Trigger tg=triggers[x];
      String scriptEvent=getJsScriptEvent(tg.getCondition().getValue());
      if (scriptEvent != null) {
        boolean bDblClick=false;
        if (scriptEvent.equals("String_Node_Str")) {
          scriptEvent="String_Node_Str";
          bDblClick=true;
        }
        Action action=tg.getAction();
        if (action instanceof MultipleActions) {
          addMultiActionsJSCode(elm,src,tg,scriptEvent,bDblClick,(MultipleActions)action);
        }
 else {
          addActionJSCode(elm,src,tg,scriptEvent,bDblClick,action);
        }
      }
    }
  }
}
Program: 67047
Project: 67047
Buggy source:
/** 
 * @throws IOException
 * @throws DataException 
 */
private void loadFromDisk() throws IOException, DataException {
  openReadDocumentObject();
  keyDataType=new int[documentObject.readInt()];
  for (int i=0; i < keyDataType.length; i++) {
    keyDataType[i]=documentObject.readInt();
  }
  keyCount=documentObject.readInt();
  degree=documentObject.readInt();
  rootNodeOffset=documentObject.readInt();
  numberOfLevel=documentObject.readShort();
  if (numberOfLevel < 1 || numberOfLevel > 1000 || Math.pow(degree,numberOfLevel) < keyCount) {
    throw new DataException(ResourceConstants.OLAPFILE_FORMAT_INVALID,name);
  }
}

Fixed version (ground truth):
/** 
 * @throws IOException
 * @throws DataException 
 */
private void loadFromDisk() throws IOException, DataException {
  openReadDocumentObject();
  keyDataType=new int[documentObject.readInt()];
  for (int i=0; i < keyDataType.length; i++) {
    keyDataType[i]=documentObject.readInt();
  }
  keyCount=documentObject.readInt();
  degree=documentObject.readInt();
  if (degree > 10000) {
    this.currentVersion=degree / 10000;
  }
  rootNodeOffset=documentObject.readInt();
  numberOfLevel=documentObject.readShort();
  if (numberOfLevel < 1 || numberOfLevel > 1000 || Math.pow(degree,numberOfLevel) < keyCount) {
    throw new DataException(ResourceConstants.OLAPFILE_FORMAT_INVALID,name);
  }
}
Program: 67048
Project: 67048
Buggy source:
/** 
 * @return
 * @throws IOException
 */
private IndexKey readKeyObject() throws IOException {
  IndexKey keyObject=new IndexKey();
  int[] dimensionPos=new int[documentObject.readInt()];
  for (int i=0; i < dimensionPos.length; i++) {
    dimensionPos[i]=documentObject.readInt();
  }
  keyObject.setDimensionPos(dimensionPos);
  keyObject.setKey(DocumentObjectUtil.readValue(documentObject,keyDataType));
  int[] offset=new int[documentObject.readInt()];
  for (int i=0; i < offset.length; i++) {
    offset[i]=documentObject.readInt();
  }
  keyObject.setOffset(offset);
  return keyObject;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws IOException
 */
private IndexKey readKeyObject() throws IOException {
  IndexKey keyObject=new IndexKey();
  int[] dimensionPos=null;
  if (currentVersion > 0) {
    dimensionPos=new int[documentObject.readInt()];
    for (int i=0; i < dimensionPos.length; i++) {
      dimensionPos[i]=documentObject.readInt();
    }
    keyObject.setDimensionPos(dimensionPos);
  }
 else {
    dimensionPos=new int[1];
    dimensionPos[0]=documentObject.readInt();
    keyObject.setDimensionPos(dimensionPos);
  }
  keyObject.setKey(DocumentObjectUtil.readValue(documentObject,keyDataType));
  int[] offset=null;
  if (currentVersion > 0) {
    offset=new int[documentObject.readInt()];
    for (int i=0; i < offset.length; i++) {
      offset[i]=documentObject.readInt();
    }
    keyObject.setOffset(offset);
  }
 else {
    offset=new int[1];
    offset[0]=documentObject.readInt();
    keyObject.setOffset(offset);
  }
  return keyObject;
}
Program: 67049
Project: 67049
Buggy source:
/** 
 * @return
 * @throws IOException
 */
private int saveIndexHeader() throws IOException {
  documentObject.writeInt(keyDataType.length);
  for (int i=0; i < keyDataType.length; i++) {
    documentObject.writeInt(keyDataType[i]);
  }
  documentObject.writeInt(keyCount);
  documentObject.writeInt(degree);
  byte[] b=new byte[6];
  documentObject.write(b,0,6);
  return (int)(documentObject.getFilePointer());
}

Fixed version (ground truth):
/** 
 * @return
 * @throws IOException
 */
private int saveIndexHeader() throws IOException {
  documentObject.writeInt(keyDataType.length);
  for (int i=0; i < keyDataType.length; i++) {
    documentObject.writeInt(keyDataType[i]);
  }
  documentObject.writeInt(keyCount);
  documentObject.writeInt(degree + VERSION);
  byte[] b=new byte[6];
  documentObject.write(b,0,6);
  return (int)(documentObject.getFilePointer());
}
Program: 67050
Project: 67050
Buggy source:
protected Object readObject() throws IOException {
  short fieldCount=randomAccessFile.readShort();
  if (fieldCount == NULL_VALUE) {
    return null;
  }
  Object[] objects=new Object[fieldCount];
  for (int i=0; i < objects.length; i++) {
    if (fieldReaders[i].getDataType() != fieldWriters[i].getDataType())     fieldReaders[i].setDataType(fieldWriters[i].getDataType());
    if (i >= fieldReaders.length) {
      objects[i]=fieldReaders[fieldReaders.length - 1].read(randomAccessFile);
    }
 else {
      objects[i]=fieldReaders[i].read(randomAccessFile);
    }
  }
  return creator.createInstance(objects);
}

Fixed version (ground truth):
protected Object readObject() throws IOException {
  short fieldCount=randomAccessFile.readShort();
  if (fieldCount == NULL_VALUE) {
    return null;
  }
  Object[] objects=new Object[fieldCount];
  for (int i=0; i < objects.length; i++) {
    if (i < fieldReaders.length && fieldReaders[i].getDataType() != fieldWriters[i].getDataType())     fieldReaders[i].setDataType(fieldWriters[i].getDataType());
    if (i >= fieldReaders.length) {
      objects[i]=fieldReaders[fieldReaders.length - 1].read(randomAccessFile);
    }
 else {
      objects[i]=fieldReaders[i].read(randomAccessFile);
    }
  }
  return creator.createInstance(objects);
}
Program: 67051
Project: 67051
Buggy source:
public boolean canLeave(){
  if (propertyPage instanceof DataSetEditorPage) {
    boolean okToLeave=((DataSetEditorPage)propertyPage).okToLeave();
    if (okToLeave) {
      try {
        DataSetDesign requestDesign=null;
        DesignSessionResponse response=null;
        if (dataSetSession != null) {
          requestDesign=dataSetSession.getRequest().getDataSetDesign();
          response=dataSetSession.flush().getResponse();
        }
 else         response=((DataSetEditorPage)propertyPage).collectPageResponse();
        DTPUtil.getInstance().updateDataSetHandle(response,requestDesign,(OdaDataSetHandle)((DataSetEditor)getContainer()).getModel(),false);
      }
 catch (      OdaException e) {
        ExceptionHandler.handle(e);
      }
    }
    return okToLeave;
  }
  if (propertyPage instanceof DataSourceEditorPage) {
    if (propertyPage.okToLeave()) {
      try {
        DataSourceDesign requestDesign=null;
        if (this.dataSourceSession != null)         requestDesign=this.dataSourceSession.getRequest().getDataSourceDesign();
        DTPUtil.getInstance().updateDataSourceHandle(((DataSourceEditorPage)propertyPage).getEditSessionResponse().getResponse(),requestDesign,(OdaDataSourceHandle)(getContainer()).getModel());
        ((DataSourceEditor)this.getContainer()).updateDesignSession();
      }
 catch (      OdaException e) {
        ExceptionHandler.handle(e);
      }
    }
    return propertyPage.okToLeave();
  }
  return super.canLeave();
}

Fixed version (ground truth):
public boolean canLeave(){
  if (propertyPage instanceof DataSetEditorPage) {
    boolean okToLeave=((DataSetEditorPage)propertyPage).okToLeave();
    if (okToLeave) {
      try {
        DataSetDesign requestDesign=null;
        DesignSessionResponse response=null;
        if (dataSetSession != null) {
          requestDesign=dataSetSession.getRequest().getDataSetDesign();
          response=dataSetSession.flush().getResponse();
        }
 else         response=((DataSetEditorPage)propertyPage).collectPageResponse();
        DTPUtil.getInstance().updateDataSetHandle(response,requestDesign,(OdaDataSetHandle)((DataSetEditor)getContainer()).getModel(),false);
      }
 catch (      OdaException e) {
        ExceptionHandler.handle(e);
      }
    }
    return true;
  }
  if (propertyPage instanceof DataSourceEditorPage) {
    if (propertyPage.okToLeave()) {
      try {
        DataSourceDesign requestDesign=null;
        if (this.dataSourceSession != null)         requestDesign=this.dataSourceSession.getRequest().getDataSourceDesign();
        DTPUtil.getInstance().updateDataSourceHandle(((DataSourceEditorPage)propertyPage).getEditSessionResponse().getResponse(),requestDesign,(OdaDataSourceHandle)(getContainer()).getModel());
        ((DataSourceEditor)this.getContainer()).updateDesignSession();
      }
 catch (      OdaException e) {
        ExceptionHandler.handle(e);
      }
    }
    return propertyPage.okToLeave();
  }
  return super.canLeave();
}
Program: 67055
Project: 67055
Buggy source:
/** 
 * Add listener to a column
 * @param column
 * @param n
 */
private void addColumnSortListener(TableColumn column,final int index){
  column.addSelectionListener(new SelectionListener(){
    private boolean asc=false;
    public void widgetSelected(    SelectionEvent e){
      sort(index,asc);
      asc=!asc;
    }
    public void widgetDefaultSelected(    SelectionEvent e){
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Add listener to a column
 * @param column
 * @param n
 */
private void addColumnSortListener(TableColumn column,final int index){
}
Program: 67056
Project: 67056
Buggy source:
/** 
 * @param dataEngine
 * @param queryDefns
 * @throws DataException
 */
void populateCachedDataSets(DataEngineImpl dataEngine,IDataQueryDefinition[] queryDefns) throws DataException {
  if (queryDefns != null) {
    List temp=new ArrayList();
    for (int i=0; i < queryDefns.length; i++) {
      if (queryDefns[i] instanceof IQueryDefinition) {
        IQueryDefinition qd=(IQueryDefinition)queryDefns[i];
        String dataSetName=qd.getDataSetName();
        if (dataSetName != null) {
          IBaseDataSetDesign design=dataEngine.getDataSetDesign(dataSetName);
          if (design instanceof IOdaDataSetDesign || design instanceof IScriptDataSetDesign)           this.populateDataSetNames(dataEngine.getDataSetDesign(dataSetName),dataEngine,temp);
        }
      }
    }
    Set tempSet=new HashSet();
    for (int i=0; i < temp.size(); i++) {
      if (tempSet.contains(temp.get(i)))       this.cachedDataSetNames.add(temp.get(i));
 else       tempSet.add(temp.get(i));
    }
  }
}

Fixed version (ground truth):
/** 
 * @param dataEngine
 * @param queryDefns
 * @throws DataException
 */
void populateCachedDataSets(DataEngineImpl dataEngine,IDataQueryDefinition[] qds) throws DataException {
  if (qds != null) {
    queryDefns.addAll(Arrays.asList(qds));
    List temp=new ArrayList();
    for (    IDataQueryDefinition query : queryDefns) {
      if (query instanceof IQueryDefinition) {
        IQueryDefinition qd=(IQueryDefinition)query;
        String dataSetName=qd.getDataSetName();
        if (dataSetName != null) {
          IBaseDataSetDesign design=dataEngine.getDataSetDesign(dataSetName);
          if (design instanceof IOdaDataSetDesign || design instanceof IScriptDataSetDesign)           this.populateDataSetNames(dataEngine.getDataSetDesign(dataSetName),dataEngine,temp);
        }
      }
    }
    this.cachedDataSetNames.clear();
    Set tempSet=new HashSet();
    for (int i=0; i < temp.size(); i++) {
      if (tempSet.contains(temp.get(i)))       this.cachedDataSetNames.add(temp.get(i));
 else       tempSet.add(temp.get(i));
    }
  }
}
Program: 67057
Project: 67057
Buggy source:
String getMemberProperty(Module module,StructureHandle handle,String name){
  MemberHandle prop=handle.getMember(name);
  if (prop != null) {
    Object value=prop.getContext().getLocalValue(module);
    if (value == null) {
      return null;
    }
    return prop.getStringValue();
  }
  return null;
}

Fixed version (ground truth):
String getMemberProperty(Module module,StructureHandle handle,String name){
  MemberHandle prop=handle.getMember(name);
  if (prop != null) {
    Object value=prop.getContext().getLocalValue(module);
    if (value != null)     return prop.getStringValue();
    if (handle instanceof HighlightRuleHandle) {
      StyleHandle styleHandle=((HighlightRuleHandle)handle).getStyle();
      if (styleHandle == null)       return null;
      FactoryPropertyHandle propHandle=styleHandle.getFactoryPropertyHandle(name);
      if (propHandle == null)       return null;
      return propHandle.getStringValue();
    }
 else {
      return null;
    }
  }
  return null;
}
Program: 67058
Project: 67058
Buggy source:
protected void _splitSpanCell(int height,boolean force) throws BirtException {
  if (cells.length != children.size()) {
    for (int i=0; i < cells.length; i++) {
      if (cells[i] instanceof DummyCell) {
        int oh=((DummyCell)cells[i]).getCell().getHeight();
        int ch=((DummyCell)cells[i]).getDelta();
        int rowSpan=((DummyCell)cells[i]).getRowSpan();
        if (ch >= oh) {
          CellArea cell=cells[i].cloneArea();
          cell.setHeight(0);
          cell.setRowSpan(rowSpan);
          cell.setParent(this);
          cell.isDummy=true;
          addChildByColumnId(cell);
        }
 else {
          SplitResult splitCell=cells[i].split(height,force);
          CellArea cell=(CellArea)splitCell.getResult();
          if (cell != null) {
            CellArea oc=((DummyCell)cells[i]).getCell();
            ArrayList temp=cell.children;
            cell.children=oc.children;
            oc.children=temp;
            oc.updateChildrenPosition();
            cell.updateChildrenPosition();
            cell.setRowSpan(rowSpan);
            cell.setParent(this);
            addChildByColumnId(cell);
          }
 else {
            cell=cells[i].cloneArea();
            cell.setHeight(0);
            cell.setRowSpan(rowSpan);
            cell.setParent(this);
            addChildByColumnId(cell);
          }
        }
        i=i + cells[i].getColSpan() - 1;
      }
    }
  }
}

Fixed version (ground truth):
protected void _splitSpanCell(int height,boolean force) throws BirtException {
  if (cells.length != children.size()) {
    for (int i=0; i < cells.length; i++) {
      if (cells[i] instanceof DummyCell) {
        int oh=((DummyCell)cells[i]).getCell().getHeight();
        int ch=((DummyCell)cells[i]).getDelta();
        int rowSpan=((DummyCell)cells[i]).getRowSpan();
        if (ch >= oh) {
          CellArea cell=cells[i].cloneArea();
          cell.setHeight(0);
          cell.setRowSpan(rowSpan);
          cell.setParent(this);
          cell.isDummy=true;
          addChildByColumnId(cell);
        }
 else {
          SplitResult splitCell=cells[i].split(height,force);
          CellArea cell=(CellArea)splitCell.getResult();
          if (cell != null) {
            CellArea oc=((DummyCell)cells[i]).getCell();
            ArrayList temp=cell.children;
            cell.children=oc.children;
            oc.children=temp;
            oc.updateChildrenPosition();
            cell.updateChildrenPosition();
            cell.setRowSpan(rowSpan);
            cell.setParent(this);
            cell.isDummy=true;
            addChildByColumnId(cell);
          }
 else {
            cell=cells[i].cloneArea();
            cell.setHeight(0);
            cell.setRowSpan(rowSpan);
            cell.setParent(this);
            addChildByColumnId(cell);
          }
        }
        i=i + cells[i].getColSpan() - 1;
      }
    }
  }
}
Program: 67059
Project: 67059
Buggy source:
protected Map<String,String> getValidFilterExpressions(ExtendedItemHandle handle) throws ExtendedElementException {
  Map<String,String> exprMap=new LinkedHashMap<String,String>();
  for (  LevelHandle lh : ChartCubeUtil.getAllLevels(handle.getCube())) {
    exprCodec.setBindingName(ChartCubeUtil.createLevelBindingName(lh),true);
    String expr=adaptExpr(exprCodec);
    exprMap.put(exprCodec.getBindingName(),expr);
  }
  for (  MeasureHandle mh : ChartCubeUtil.getAllMeasures(handle.getCube())) {
    exprCodec.setBindingName(ChartCubeUtil.createMeasureBindingName(mh),true);
    String expr=adaptExpr(exprCodec);
    exprMap.put(exprCodec.getBindingName(),expr);
  }
  return exprMap;
}

Fixed version (ground truth):
protected Map<String,String> getValidFilterExpressions(ExtendedItemHandle handle) throws ExtendedElementException {
  Map<String,String> exprMap=new LinkedHashMap<String,String>();
  measureList=new ArrayList<String>();
  for (  LevelHandle lh : ChartCubeUtil.getAllLevels(handle.getCube())) {
    exprCodec.setBindingName(ChartCubeUtil.createLevelBindingName(lh),true);
    String expr=adaptExpr(exprCodec);
    exprMap.put(exprCodec.getBindingName(),expr);
  }
  for (  MeasureHandle mh : ChartCubeUtil.getAllMeasures(handle.getCube())) {
    exprCodec.setBindingName(ChartCubeUtil.createMeasureBindingName(mh),true);
    String expr=adaptExpr(exprCodec);
    exprMap.put(exprCodec.getBindingName(),expr);
    measureList.add(exprCodec.getBindingName());
  }
  return exprMap;
}
Program: 67060
Project: 67060
Buggy source:
private Combo createExpressionValue(Composite parent){
  Combo expressionValue=new Combo(parent,SWT.None);
  expressionValue.add(CHOICE_SELECT_VALUE);
  expressionValue.addListener(SWT.Verify,expValueVerifyListener);
  expressionValue.addListener(SWT.Selection,expValueSelectionListener);
  Listener listener=new Listener(){
    public void handleEvent(    Event event){
      updateButtons();
    }
  }
;
  expressionValue.addListener(SWT.Modify,listener);
  IExpressionButton ceb=ChartExpressionButtonUtil.createExpressionButton(parent,expressionValue,(ExtendedItemHandle)designHandle,expressionProvider);
  ceb.addListener(listener);
  return expressionValue;
}

Fixed version (ground truth):
private CCombo createExpressionValue(Composite parent){
  final CCombo expressionValue=new CCombo(parent,SWT.BORDER);
  expressionValue.add(CHOICE_SELECT_VALUE);
  expressionValue.addListener(SWT.Verify,expValueVerifyListener);
  expressionValue.addListener(SWT.Selection,expValueSelectionListener);
  Listener listener=new Listener(){
    public void handleEvent(    Event event){
      updateButtons();
    }
  }
;
  expressionValue.addListener(SWT.Modify,listener);
  expressionValue.addListener(SWT.MouseDown,new Listener(){
    public void handleEvent(    Event arg0){
      if (isMeasureSelected()) {
        if (expressionValue.getItemCount() > 0) {
          expressionValue.remove(0);
        }
        expressionValue.setVisibleItemCount(0);
      }
 else {
        if (expressionValue.getItemCount() == 0) {
          expressionValue.add(CHOICE_SELECT_VALUE);
        }
        expressionValue.setVisibleItemCount(1);
      }
    }
  }
);
  IExpressionButton ceb=ChartExpressionButtonUtil.createExpressionButton(parent,expressionValue,(ExtendedItemHandle)designHandle,expressionProvider);
  ceb.addListener(listener);
  return expressionValue;
}