nus-yam/ex-repair huggingface dataset:
Program: 75489
Project: 75489
Buggy source:
private String getTooltip(TreeItem item){
  if (item != null) {
    Object object=item.getData();
    if (object instanceof DataSourceHandle || object instanceof DataSetHandle) {
      return Messages.getString("String_Node_Str");
    }
 else     if (object instanceof ThemeHandle) {
      return Messages.getString("String_Node_Str");
    }
 else     if (object instanceof ParameterHandle || object instanceof ParameterGroupHandle || object instanceof EmbeddedImageHandle|| object instanceof ReportItemHandle) {
      return Messages.getString("String_Node_Str");
    }
 else     if (object instanceof LibraryHandle) {
      return ((LibraryHandle)object).getFileName();
    }
 else     if (object instanceof CssStyleSheetHandle) {
      CssStyleSheetHandle CssStyleSheetHandle=(CssStyleSheetHandle)object;
      if (CssStyleSheetHandle.getFileName().startsWith(BUNDLE_PROTOCOL)) {
        return CssStyleSheetHandle.getFileName();
      }
 else {
        ModuleHandle moudleHandle=CssStyleSheetHandle.getModule().getModuleHandle();
        URL url=moudleHandle.findResource(CssStyleSheetHandle.getFileName(),IResourceLocator.CASCADING_STYLE_SHEET);
        if (url != null) {
          return url.getFile();
        }
      }
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String getTooltip(TreeItem item){
  if (item != null) {
    Object object=item.getData();
    if (object instanceof DataSourceHandle || object instanceof DataSetHandle) {
      return Messages.getString("String_Node_Str");
    }
 else     if (object instanceof ThemeHandle) {
      return Messages.getString("String_Node_Str");
    }
 else     if (object instanceof ParameterHandle || object instanceof ParameterGroupHandle || object instanceof EmbeddedImageHandle|| object instanceof ReportItemHandle) {
      return Messages.getString("String_Node_Str");
    }
 else     if (object instanceof LibraryHandle) {
      return ((LibraryHandle)object).getFileName();
    }
 else     if (object instanceof CssStyleSheetHandle) {
      CssStyleSheetHandle CssStyleSheetHandle=(CssStyleSheetHandle)object;
      if (CssStyleSheetHandle.getFileName().startsWith(BUNDLE_PROTOCOL)) {
        return CssStyleSheetHandle.getFileName();
      }
 else {
        ModuleHandle moudleHandle=CssStyleSheetHandle.getModule().getModuleHandle();
        URL url=moudleHandle.findResource(CssStyleSheetHandle.getFileName(),IResourceLocator.CASCADING_STYLE_SHEET);
        if (url != null) {
          return url.getFile();
        }
      }
    }
 else     if (object instanceof PathResourceEntry) {
      return ((PathResourceEntry)object).getURL().getPath();
    }
  }
  return "String_Node_Str";
}
Program: 75490
Project: 75490
Buggy source:
protected void buildActions(){
  addRetargetAction(new UndoRetargetAction());
  addRetargetAction(new RedoRetargetAction());
  addRetargetAction(new DeleteRetargetAction());
  addRetargetAction(new ZoomInRetargetAction());
  addRetargetAction(new ZoomOutRetargetAction());
  addRetargetAction(new RetargetAction(ActionFactory.CUT.getId(),null));
  addRetargetAction(new RetargetAction(ActionFactory.COPY.getId(),null));
  addRetargetAction(new RetargetAction(ActionFactory.PASTE.getId(),null));
  addRetargetAction(new RetargetAction(ImportCSSStyleAction.ID,ImportCSSStyleAction.ACTION_TEXT));
  addRetargetAction(new RetargetAction(AddStyleAction.ID,Messages.getString("String_Node_Str")));
  addRetargetAction(new RetargetAction(ApplyStyleMenuAction.ID,null));
  addRetargetAction(new RetargetAction(EditStyleMenuAction.ID,null));
  addRetargetAction(new RetargetAction(EditGroupMenuAction.ID,null));
  addRetargetAction(new RetargetAction(InsertGroupMenuAction.ID,null));
  registerActions(new RegisterActions[]{new RegisterActions(GEFActionConstants.TOGGLE_RULER_VISIBILITY,Messages.getString("String_Node_Str"),IAction.AS_CHECK_BOX)});
  registerActions(new RegisterActions[]{new RegisterActions(ToggleMarginVisibilityAction.ID,ToggleMarginVisibilityAction.LABEL,IAction.AS_CHECK_BOX)});
  registerActions(getInsertElementActions());
  registerActions(elementActions);
  registerActions(dataActions);
  addRetargetAction(new RetargetAction(ImportLibraryAction.ID,ImportLibraryAction.ACTION_TEXT));
  registerActions(parameterActions);
}

Fixed version (ground truth):
protected void buildActions(){
  if (isBuilt)   return;
  isBuilt=true;
  addRetargetAction(new UndoRetargetAction());
  addRetargetAction(new RedoRetargetAction());
  addRetargetAction(new DeleteRetargetAction());
  addRetargetAction(new ZoomInRetargetAction());
  addRetargetAction(new ZoomOutRetargetAction());
  addRetargetAction(new RetargetAction(ActionFactory.CUT.getId(),null));
  addRetargetAction(new RetargetAction(ActionFactory.COPY.getId(),null));
  addRetargetAction(new RetargetAction(ActionFactory.PASTE.getId(),null));
  addRetargetAction(new RetargetAction(ImportCSSStyleAction.ID,ImportCSSStyleAction.ACTION_TEXT));
  addRetargetAction(new RetargetAction(AddStyleAction.ID,Messages.getString("String_Node_Str")));
  addRetargetAction(new RetargetAction(ApplyStyleMenuAction.ID,null));
  addRetargetAction(new RetargetAction(EditStyleMenuAction.ID,null));
  addRetargetAction(new RetargetAction(EditGroupMenuAction.ID,null));
  addRetargetAction(new RetargetAction(InsertGroupMenuAction.ID,null));
  registerActions(new RegisterActions[]{new RegisterActions(GEFActionConstants.TOGGLE_RULER_VISIBILITY,Messages.getString("String_Node_Str"),IAction.AS_CHECK_BOX)});
  registerActions(new RegisterActions[]{new RegisterActions(ToggleMarginVisibilityAction.ID,ToggleMarginVisibilityAction.LABEL,IAction.AS_CHECK_BOX)});
  registerActions(getInsertElementActions());
  registerActions(elementActions);
  registerActions(dataActions);
  addRetargetAction(new RetargetAction(ImportLibraryAction.ID,ImportLibraryAction.ACTION_TEXT));
  registerActions(parameterActions);
}
Program: 75491
Project: 75491
Buggy source:
/** 
 * generate level filters.
 * @param aggregations
 * @param resultSet
 * @return
 * @throws IOException
 * @throws DataException
 */
private List generateLevelFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet) throws IOException, DataException {
  List levelFilterList=new ArrayList();
  for (Iterator i=aggrFilters.iterator(); i.hasNext(); ) {
    AggrFilter filter=(AggrFilter)i.next();
    for (int j=0; !isEmptyXTab && j < aggregations.length; j++) {
      if (aggregations[j].getAggregationFunctions() != null && isEqualLevels(aggregations[j].getLevels(),filter.getAggrLevels())) {
        applyAggrFilter(aggregations,resultSet,j,filter,levelFilterList);
      }
    }
  }
  applyTopBottomFilters(aggregations,resultSet,levelFilterList);
  return levelFilterList;
}

Fixed version (ground truth):
/** 
 * generate level filters.
 * @param aggregations
 * @param resultSet
 * @return
 * @throws IOException
 * @throws DataException
 */
private List generateLevelFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet) throws IOException, DataException {
  List levelFilterList=new ArrayList();
  for (Iterator i=aggrFilters.iterator(); i.hasNext(); ) {
    AggrFilter filter=(AggrFilter)i.next();
    for (int j=0; j < aggregations.length; j++) {
      if (aggregations[j].getAggregationFunctions() != null && isEqualLevels(aggregations[j].getLevels(),filter.getAggrLevels())) {
        applyAggrFilter(aggregations,resultSet,j,filter,levelFilterList);
      }
    }
  }
  applyTopBottomFilters(aggregations,resultSet,levelFilterList);
  return levelFilterList;
}
Program: 75493
Project: 75493
Buggy source:
/** 
 * @param aggregations
 * @param resultSet
 * @param stopSign
 * @throws IOException
 * @throws DataException
 * @throws BirtException
 */
private void applyAggrFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet,StopSign stopSign) throws IOException, DataException, BirtException {
  if (aggrFilters.isEmpty() == false || topbottomFilters.isEmpty() == false) {
    List oldFilters=new ArrayList(filters);
    addLevelFilters(generateLevelFilters(aggregations,resultSet));
    if (isEmptyXTab) {
      for (int i=0; i < resultSet.length; i++) {
        resultSet[i].clear();
      }
    }
 else {
      resultSet=onePassExecute(aggregations,stopSign);
    }
    filters=oldFilters;
  }
}

Fixed version (ground truth):
/** 
 * @param aggregations
 * @param resultSet
 * @param stopSign
 * @throws IOException
 * @throws DataException
 * @throws BirtException
 */
private void applyAggrFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet,StopSign stopSign) throws IOException, DataException, BirtException {
  if (aggrFilters.isEmpty() == false || topbottomFilters.isEmpty() == false) {
    List oldFilters=new ArrayList(filters);
    addLevelFilters(generateLevelFilters(aggregations,resultSet));
    if (isEmptyXTab) {
      for (int i=0; i < resultSet.length; i++) {
        resultSet[i].clear();
      }
    }
 else {
      for (int i=0; i < resultSet.length; i++) {
        resultSet[i].close();
        resultSet[i]=null;
      }
      IAggregationResultSet[] temp=onePassExecute(aggregations,stopSign);
      System.arraycopy(temp,0,resultSet,0,resultSet.length);
    }
    filters=oldFilters;
  }
}
Program: 75494
Project: 75494
Buggy source:
/** 
 * generate level filters.
 * @param aggregations
 * @param resultSet
 * @return
 * @throws IOException
 * @throws DataException
 */
private List generateLevelFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet) throws IOException, DataException {
  List levelFilterList=new ArrayList();
  for (Iterator i=aggrFilters.iterator(); i.hasNext(); ) {
    AggrFilter filter=(AggrFilter)i.next();
    for (int j=0; j < aggregations.length; j++) {
      if (aggregations[j].getAggregationFunctions() != null && isEqualLevels(aggregations[j].getLevels(),filter.getAggrLevels())) {
        applyAxisFilter(filter,levelFilterList);
        applyAggrFilter(aggregations,resultSet,j,filter,levelFilterList);
      }
    }
  }
  applyTopBottomFilters(aggregations,resultSet,levelFilterList);
  return levelFilterList;
}

Fixed version (ground truth):
/** 
 * generate level filters.
 * @param aggregations
 * @param resultSet
 * @return
 * @throws IOException
 * @throws DataException
 */
private List generateLevelFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet) throws IOException, DataException {
  List levelFilterList=new ArrayList();
  for (Iterator i=aggrFilters.iterator(); i.hasNext(); ) {
    AggrFilter filter=(AggrFilter)i.next();
    for (int j=0; j < aggregations.length; j++) {
      if (aggregations[j].getAggregationFunctions() != null && isEqualLevels(aggregations[j].getLevels(),filter.getAggrLevels())) {
        applyAggrFilter(aggregations,resultSet,j,filter,levelFilterList);
      }
    }
  }
  applyTopBottomFilters(aggregations,resultSet,levelFilterList);
  return levelFilterList;
}
Program: 75495
Project: 75495
Buggy source:
public IAggregationResultSet[] execute(AggregationDefinition[] aggregations,StopSign stopSign) throws IOException, BirtException {
  IAggregationResultSet[] resultSet=onePassExecute(aggregations,stopSign);
  applyAggrFilter(aggregations,resultSet,stopSign);
  applyAggrSort(resultSet);
  return resultSet;
}

Fixed version (ground truth):
public IAggregationResultSet[] execute(AggregationDefinition[] aggregations,StopSign stopSign) throws IOException, BirtException {
  IAggregationResultSet[] resultSet=onePassExecute(aggregations,stopSign);
  applyAggrFilters(aggregations,resultSet,stopSign);
  applyAggrSort(resultSet);
  return resultSet;
}
Program: 75500
Project: 75500
Buggy source:
public void makeUniqueName(DesignElement element){
  if (element == null)   return;
  ElementDefn eDefn=(ElementDefn)element.getDefn();
  if (!getElement().getDefn().isKindOf(eDefn.getNameConfig().getNameContainer())) {
    INameHelper nameHelper=new NameExecutor(element).getNameHelper(getElement().getRoot());
    if (nameHelper != null)     nameHelper.makeUniqueName(element);
    return;
  }
  String name=getUniqueName(element);
  if (name == null)   return;
  NameSpace nameSpace=getCachedNameSpace(eDefn.getNameSpaceID());
  if (nameSpace.getElement(name) == element) {
    nameSpace.rename(element,element.getName(),name);
    return;
  }
  element.setName(name.trim());
  nameSpace.insert(element);
}

Fixed version (ground truth):
public void makeUniqueName(DesignElement element){
  if (element == null)   return;
  ElementDefn eDefn=(ElementDefn)element.getDefn();
  if (!getElement().getDefn().isKindOf(eDefn.getNameConfig().getNameContainer())) {
    INameHelper nameHelper=new NameExecutor(element).getNameHelper(getElement().getRoot());
    if (nameHelper != null)     nameHelper.makeUniqueName(element);
    return;
  }
  String name=getUniqueName(element);
  if (name == null)   return;
  NameSpace nameSpace=getCachedNameSpace(eDefn.getNameSpaceID());
  DesignElement cachedElement=nameSpace.getElement(name);
  if (cachedElement == null) {
    element.setName(name.trim());
    nameSpace.insert(element);
  }
}
Program: 75502
Project: 75502
Buggy source:
/** 
 * generate level filters.
 * @param aggregations
 * @param resultSet
 * @return
 * @throws IOException
 * @throws DataException
 */
private List generateLevelFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet) throws IOException, DataException {
  List levelFilterList=new ArrayList();
  for (Iterator i=aggrFilters.iterator(); i.hasNext(); ) {
    AggrFilter filter=(AggrFilter)i.next();
    for (int j=0; j < aggregations.length; j++) {
      if (aggregations[j].getAggregationFunctions() != null && isEqualLevels(aggregations[j].getLevels(),filter.getAggrLevels())) {
        applyAggrFilter(aggregations,resultSet,j,filter,levelFilterList);
      }
    }
  }
  applyTopBottomFilters(aggregations,resultSet,levelFilterList);
  return levelFilterList;
}

Fixed version (ground truth):
/** 
 * generate level filters.
 * @param aggregations
 * @param resultSet
 * @return
 * @throws IOException
 * @throws DataException
 */
private List generateLevelFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet) throws IOException, DataException {
  List levelFilterList=new ArrayList();
  for (Iterator i=aggrFilters.iterator(); i.hasNext(); ) {
    AggrFilter filter=(AggrFilter)i.next();
    for (int j=0; !isEmptyXTab && j < aggregations.length; j++) {
      if (aggregations[j].getAggregationFunctions() != null && isEqualLevels(aggregations[j].getLevels(),filter.getAggrLevels())) {
        applyAggrFilter(aggregations,resultSet,j,filter,levelFilterList);
      }
    }
  }
  applyTopBottomFilters(aggregations,resultSet,levelFilterList);
  return levelFilterList;
}
Program: 75504
Project: 75504
Buggy source:
/** 
 * @param aggregations
 * @param resultSet
 * @param stopSign
 * @throws IOException
 * @throws DataException
 * @throws BirtException
 */
private void applyAggrFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet,StopSign stopSign) throws IOException, DataException, BirtException {
  skip=new boolean[aggregations.length];
  if (aggrFilters.isEmpty() == false || topbottomFilters.isEmpty() == false) {
    List oldFilters=new ArrayList(filters);
    addLevelFilters(generateLevelFilters(aggregations,resultSet));
    List aggrList=new ArrayList();
    for (int i=0; i < skip.length; i++) {
      if (skip[i] == false) {
        aggrList.add(aggregations[i]);
        resultSet[i].close();
        resultSet[i]=null;
      }
 else {
        resultSet[i].clear();
      }
    }
    if (aggrList.size() > 0) {
      AggregationDefinition[] recalAggrs=new AggregationDefinition[aggrList.size()];
      aggrList.toArray(recalAggrs);
      IAggregationResultSet[] recalResultSet=onePassExecute(recalAggrs,stopSign);
      for (int i=0, index=0; i < skip.length; i++) {
        if (skip[i] == false) {
          resultSet[i]=recalResultSet[index++];
        }
      }
    }
    filters=oldFilters;
  }
}

Fixed version (ground truth):
/** 
 * @param aggregations
 * @param resultSet
 * @param stopSign
 * @throws IOException
 * @throws DataException
 * @throws BirtException
 */
private void applyAggrFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet,StopSign stopSign) throws IOException, DataException, BirtException {
  if (aggrFilters.isEmpty() == false || topbottomFilters.isEmpty() == false) {
    List oldFilters=new ArrayList(filters);
    addLevelFilters(generateLevelFilters(aggregations,resultSet));
    if (isEmptyXTab) {
      for (int i=0; i < resultSet.length; i++) {
        resultSet[i].clear();
      }
    }
 else {
      resultSet=onePassExecute(aggregations,stopSign);
    }
    filters=oldFilters;
  }
}
Program: 75505
Project: 75505
Buggy source:
/** 
 * Returns a <code>List</code> containing the currently selected objects.
 * @return A List containing the currently selected objects.
 */
protected IStructuredSelection getSelection(){
  IEvaluationContext context=(IEvaluationContext)event.getApplicationContext();
  Object selectVariable=context.getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME);
  if (selectVariable instanceof IStructuredSelection) {
    return (IStructuredSelection)selectVariable;
  }
 else {
    return new StructuredSelection(selectVariable);
  }
}

Fixed version (ground truth):
/** 
 * Returns a <code>List</code> containing the currently selected objects.
 * @return A List containing the currently selected objects.
 */
protected IStructuredSelection getSelection(){
  IEvaluationContext context=(IEvaluationContext)event.getApplicationContext();
  Object selectVariable=context.getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME);
  if (selectVariable != null) {
    if (selectVariable instanceof IStructuredSelection) {
      return (IStructuredSelection)selectVariable;
    }
 else {
      return new StructuredSelection(selectVariable);
    }
  }
  return null;
}
Program: 75506
Project: 75506
Buggy source:
/** 
 * Gets models of selected elements
 * @return
 */
protected List getElementHandles(){
  boolean isEditPart=false;
  List selList=null;
  IEvaluationContext context=(IEvaluationContext)event.getApplicationContext();
  Object obj=context.getVariable(ICommandParameterNameContants.SELECTION);
  if (obj != null) {
    selList=new ArrayList();
    selList.add(obj);
  }
  if (selList == null || selList.size() < 1) {
    return Collections.EMPTY_LIST;
  }
  for (int i=0; i < selList.size(); i++) {
    if (selList.get(i) instanceof ReportElementEditPart) {
      isEditPart=true;
    }
  }
  if (isEditPart) {
    selList=InsertInLayoutUtil.editPart2Model(TableUtil.filletCellInSelectionEditorpart(getSelection())).toList();
  }
  return selList;
}

Fixed version (ground truth):
/** 
 * Gets models of selected elements
 * @return
 */
protected List getElementHandles(){
  boolean isEditPart=false;
  List selList=null;
  IEvaluationContext context=(IEvaluationContext)event.getApplicationContext();
  Object obj=context.getVariable(ICommandParameterNameContants.SELECTION);
  if (obj != null) {
    selList=new ArrayList();
    selList.add(obj);
  }
  if (selList == null || selList.size() < 1) {
    selList=getSelectedObjects();
  }
  for (int i=0; i < selList.size(); i++) {
    if (selList.get(i) instanceof ReportElementEditPart) {
      isEditPart=true;
    }
  }
  if (isEditPart) {
    selList=InsertInLayoutUtil.editPart2Model(TableUtil.filletCellInSelectionEditorpart(getSelection())).toList();
  }
  return selList;
}
Program: 75507
Project: 75507
Buggy source:
/** 
 * Returns a <code>List</code> containing the currently selected objects.
 * @return A List containing the currently selected objects.
 */
protected List getSelectedObjects(){
  Object selectVariable=getSelection();
  if (!(selectVariable instanceof IStructuredSelection))   return Collections.EMPTY_LIST;
  return ((IStructuredSelection)selectVariable).toList();
}

Fixed version (ground truth):
/** 
 * Returns a <code>List</code> containing the currently selected objects.
 * @return A List containing the currently selected objects.
 */
protected List getSelectedObjects(){
  Object selectVariable=getSelection();
  if (selectVariable == null || !(selectVariable instanceof IStructuredSelection))   return Collections.EMPTY_LIST;
  return ((IStructuredSelection)selectVariable).toList();
}
Program: 75508
Project: 75508
Buggy source:
public void run(){
  TreeItem item=(TreeItem)composite.getSelectedElement();
  Object selectedElement=item.getData();
  if (selectedElement == null || !(selectedElement instanceof ReportDesignHandle)) {
    return;
  }
  PlaceResources.copy(composite.getShell(),getDefaultLocation(),item.getText(),((ReportDesignHandle)selectedElement).getFileName());
  if (item.getParentItem().getText().equals(DRILL_TO_DETAILS_CATEGORY)) {
    PlaceResources.copyDrillThroughReport(composite.getShell(),reportProject.getLocation().toOSString(),item.getText());
  }
  if (item.getParentItem().getText().equals("String_Node_Str")) {
    PlaceResources.copyIncludedLibraries(composite.getShell(),getDefaultLocation());
  }
  if (item.getParentItem().getText().equals("String_Node_Str")) {
    PlaceResources.copyIncludedPng(composite.getShell(),getDefaultLocation());
  }
}

Fixed version (ground truth):
public void run(){
  TreeItem item=(TreeItem)composite.getSelectedElement();
  Object selectedElement=item.getData();
  if (selectedElement == null || !(selectedElement instanceof ReportDesignHandle)) {
    return;
  }
  PlaceResources.copy(composite.getShell(),getDefaultLocation(),item.getText(),((ReportDesignHandle)selectedElement).getFileName());
  if (item.getParentItem().getText().equals(DRILL_TO_DETAILS_CATEGORY)) {
    PlaceResources.copyDrillThroughReport(composite.getShell(),getDefaultLocation(),item.getText());
  }
  if (item.getParentItem().getText().equals("String_Node_Str")) {
    PlaceResources.copyIncludedLibraries(composite.getShell(),getDefaultLocation());
  }
  if (item.getParentItem().getText().equals("String_Node_Str")) {
    PlaceResources.copyIncludedPng(composite.getShell(),getDefaultLocation());
  }
}
Program: 75509
Project: 75509
Buggy source:
/** 
 * @param name
 * @param expression
 * @deprecated
 */
public void addResultSetExpression(String name,IBaseExpression expression){
  Binding binding=new Binding(name);
  binding.setExpression(expression);
  this.bindingMap.put(name,binding);
}

Fixed version (ground truth):
/** 
 * @param name
 * @param expression
 * @deprecated
 */
public void addResultSetExpression(String name,IBaseExpression expression){
  Binding binding=new Binding(name);
  binding.setExpression(expression);
  if (expression != null)   binding.setDataType(expression.getDataType());
  this.bindingMap.put(name,binding);
}
Program: 75510
Project: 75510
Buggy source:
public Binding(String name,IBaseExpression expr){
  this.name=name;
  this.expr=expr;
  this.aggregateOn=new ArrayList();
  this.argument=new ArrayList();
  this.dataType=DataType.ANY_TYPE;
}

Fixed version (ground truth):
public Binding(String name,IBaseExpression expr){
  this.name=name;
  this.expr=expr;
  this.aggregateOn=new ArrayList();
  this.argument=new ArrayList();
  if (expr != null)   this.dataType=expr.getDataType();
 else   this.dataType=DataType.ANY_TYPE;
}
Program: 75511
Project: 75511
Buggy source:
/** 
 * Pass the oda result set.
 * @param odaResultSet
 * @throws DataException
 */
private void pass(OdiResultSetWrapper odaResultSet) throws DataException {
  prepareFetchEventList();
  PassStatusController psController=new PassStatusController(populator,filterByRow,computedColumnHelper);
  if (!psController.needMultipassProcessing()) {
    doSinglePass(odaResultSet);
  }
 else {
    doMultiPass(odaResultSet,psController);
  }
  calculateAggregationsInColumnBinding();
  try {
    Context cx=Context.enter();
    ExpressionCompiler compiler=new ExpressionCompiler();
    compiler.setDataSetMode(false);
    for (Iterator it=this.populator.getEventHandler().getColumnBindings().values().iterator(); it.hasNext(); ) {
      IBinding binding=(IBinding)it.next();
      if (binding.getExpression() != null && binding.getExpression().getGroupName() == null && binding.getAggrFunction() != null) {
        compiler.compile(binding.getExpression(),cx);
      }
    }
  }
  finally {
    Context.exit();
  }
  populateAggregationInBinding();
}

Fixed version (ground truth):
/** 
 * Pass the oda result set.
 * @param odaResultSet
 * @throws DataException
 */
private void pass(OdiResultSetWrapper odaResultSet) throws DataException {
  prepareFetchEventList();
  PassStatusController psController=new PassStatusController(populator,filterByRow,computedColumnHelper);
  if (!psController.needMultipassProcessing()) {
    doSinglePass(odaResultSet);
  }
 else {
    doMultiPass(odaResultSet,psController);
  }
  calculateAggregationsInColumnBinding();
  try {
    Context cx=Context.enter();
    ExpressionCompiler compiler=new ExpressionCompiler();
    compiler.setDataSetMode(false);
    for (Iterator it=this.populator.getEventHandler().getColumnBindings().values().iterator(); it.hasNext(); ) {
      try {
        IBinding binding=(IBinding)it.next();
        compiler.compile(binding.getExpression(),cx);
      }
 catch (      DataException e) {
      }
    }
  }
  finally {
    Context.exit();
  }
  populateAggregationInBinding();
}
Program: 75512
Project: 75512
Buggy source:
private BindingColumn(String columnName,IBaseExpression baseExpr,boolean isAggregation,int type){
  this.columnName=columnName;
  this.baseExpr=baseExpr;
  this.isAggregation=isAggregation;
  this.type=type;
}

Fixed version (ground truth):
private BindingColumn(String columnName,IBaseExpression baseExpr,boolean isAggregation,int type){
  this.columnName=columnName;
  this.baseExpr=baseExpr;
  this.isAggregation=isAggregation;
  this.type=type;
  if (this.baseExpr instanceof ScriptExpression) {
    ((ScriptExpression)this.baseExpr).setDataType(type);
  }
}
Program: 75514
Project: 75514
Buggy source:
private static List populateArgument(ComputedColumnHandle modelCmptdColumn){
  List argument=new ArrayList();
  Iterator it=modelCmptdColumn.argumentsIterator();
  while (it != null && it.hasNext()) {
    AggregationArgumentHandle arg=(AggregationArgumentHandle)it.next();
    argument.add(arg.getValue());
  }
  return argument;
}

Fixed version (ground truth):
private static List populateArgument(ComputedColumnHandle modelCmptdColumn){
  List argument=new ArrayList();
  Iterator it=modelCmptdColumn.argumentsIterator();
  while (it != null && it.hasNext()) {
    AggregationArgumentHandle arg=(AggregationArgumentHandle)it.next();
    argument.add(new ScriptExpression(arg.getValue()));
  }
  return argument;
}
Program: 75515
Project: 75515
Buggy source:
/** 
 * save the design into the stream.
 * @param design design handler
 */
public void saveDesign(ReportRunnable runnable){
  RAOutputStream out=null;
  try {
    ReportDesignHandle design=runnable.getReport();
    out=archive.createRandomAccessStream(DESIGN_STREAM);
    DocumentUtil.serialize(design,out);
    designName=design.getFileName();
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
      }
    }
    out=null;
  }
  try {
    Report reportIR=runnable.getReportIR();
    out=archive.createRandomAccessStream(DESIGN_IR_STREAM);
    new EngineIRWriter().write(out,reportIR);
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * save the design into the stream.
 * @param design design handler
 */
public void saveDesign(ReportRunnable runnable){
  RAOutputStream out=null;
  try {
    ReportDesignHandle design=runnable.getReport();
    out=archive.createRandomAccessStream(DESIGN_STREAM);
    ReportDesignHandle newDesign=DocumentUtil.serialize(design,out);
    designName=design.getFileName();
    runnable.setDesignHandle(newDesign);
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
      }
    }
    out=null;
  }
  try {
    Report reportIR=runnable.getReportIR();
    out=archive.createRandomAccessStream(DESIGN_IR_STREAM);
    new EngineIRWriter().write(out,reportIR);
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
      }
    }
  }
}
Program: 75516
Project: 75516
Buggy source:
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display,String url){
  IStyle style=text.getStyle();
  handleShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  buildStyle(text,styleBuffer);
}

Fixed version (ground truth):
/** 
 * Build the style of text content.
 */
public void buildTextStyle(ITextContent text,StringBuffer styleBuffer,int display,String url){
  IStyle style=text.getStyle();
  handleShrink(display,style,text.getHeight(),text.getWidth(),styleBuffer);
  buildStyle(text,styleBuffer);
  String value=style.getDisplay();
  if (null == value) {
    styleBuffer.append("String_Node_Str");
  }
}
Program: 75517
Project: 75517
Buggy source:
/** 
 * Calculate the left or right border's style.
 * @param content
 */
private void startCase(IContent content){
  Span span=(Span)design2ExcelSpan.get(content.getGenerateBy());
  engine.addContainerStyle(content.getComputedStyle(),span,lb.getListSize(span.getCol()));
}

Fixed version (ground truth):
/** 
 * Calculate the left or right border's style.
 * @param content
 */
private void startCase(IContent content){
  Span span=(Span)design2ExcelSpan.get(content.getGenerateBy());
  engine.addContainerStyle(content.getComputedStyle(),span,lb.getListSize(span.getCol()) - 1);
}
Program: 75519
Project: 75519
Buggy source:
public void run(){
  TreeItem item=(TreeItem)composite.getSelectedElement();
  Object selectedElement=item.getData();
  if (selectedElement == null || !(selectedElement instanceof ReportDesignHandle)) {
    return;
  }
  PlaceResources.copy(composite.getShell(),getDefaultLocation(),item.getText(),((ReportDesignHandle)selectedElement).getFileName());
  if (item.getParentItem().getText().equals("String_Node_Str")) {
    PlaceResources.copyIncludedLibraries(composite.getShell(),getDefaultLocation());
  }
  if (item.getParentItem().getText().equals("String_Node_Str")) {
    PlaceResources.copyIncludedPng(composite.getShell(),getDefaultLocation());
  }
}

Fixed version (ground truth):
public void run(){
  TreeItem item=(TreeItem)composite.getSelectedElement();
  Object selectedElement=item.getData();
  if (selectedElement == null || !(selectedElement instanceof ReportDesignHandle)) {
    return;
  }
  PlaceResources.copy(composite.getShell(),getDefaultLocation(),item.getText(),((ReportDesignHandle)selectedElement).getFileName());
  if (item.getParentItem().getText().equals(DRILL_TO_DETAILS_CATEGORY)) {
    PlaceResources.copyDrillThroughReport(composite.getShell(),reportProject.getLocation().toOSString(),item.getText());
  }
  if (item.getParentItem().getText().equals("String_Node_Str")) {
    PlaceResources.copyIncludedLibraries(composite.getShell(),getDefaultLocation());
  }
  if (item.getParentItem().getText().equals("String_Node_Str")) {
    PlaceResources.copyIncludedPng(composite.getShell(),getDefaultLocation());
  }
}
Program: 75520
Project: 75520
Buggy source:
protected void updateLine(){
  if (root == null) {
    return;
  }
  Iterator iter=root.getChildren();
  int height=root.getHeight();
  int lineHeight=((PDFBlockStackingLM)parent).getLineHeight();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    int childHeight=child.getAllocatedHeight();
    height=Math.max(height,childHeight);
  }
  height=Math.max(height,lineHeight);
  root.setContentHeight(height);
}

Fixed version (ground truth):
protected void updateLine(){
  if (root == null) {
    return;
  }
  Iterator iter=root.getChildren();
  int height=root.getHeight();
  int lineHeight=((PDFBlockStackingLM)parent).getLineHeight();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    int childHeight=child.getAllocatedHeight();
    height=Math.max(height,childHeight);
  }
  if (parent.isPageEmpty() && lineHeight > maxAvaHeight) {
    height=Math.max(height,maxAvaHeight);
  }
 else {
    height=Math.max(height,lineHeight);
  }
  root.setContentHeight(height);
}
Program: 75522
Project: 75522
Buggy source:
public IContent execute(){
  if (executor != null) {
    if (executor instanceof ExtendedGenerateExecutor) {
      ExtendedGenerateExecutor gExecutor=(ExtendedGenerateExecutor)executor;
      gExecutor.parent=parent;
      gExecutor.context=context;
      gExecutor.report=report;
      gExecutor.design=design;
    }
    content=executor.execute();
    if (content != null) {
      InstanceID iid=content.getInstanceID();
      if (iid != null) {
        long uid=iid.getUniqueID();
        if (uid == -1) {
          uid=generateUniqueID();
          iid=new InstanceID(iid.getParentID(),uid,iid.getComponentID(),iid.getDataID());
          content.setInstanceID(iid);
        }
      }
 else {
        iid=getInstanceID();
        content.setInstanceID(iid);
      }
      if (content.getParent() == null) {
        content.setParent(getParentContent());
      }
      if (context.isInFactory()) {
        handleOnCreate(content);
      }
      startTOCEntry(content);
    }
  }
  return content;
}

Fixed version (ground truth):
public IContent execute(){
  if (executor != null) {
    if (executor instanceof ExtendedGenerateExecutor) {
      ExtendedGenerateExecutor gExecutor=(ExtendedGenerateExecutor)executor;
      gExecutor.parent=parent;
      gExecutor.context=context;
      gExecutor.report=report;
      gExecutor.design=design;
    }
    content=executor.execute();
    if (content != null) {
      IContent pContent=(IContent)content.getParent();
      if (pContent == null) {
        pContent=getParentContent();
        content.setParent(pContent);
      }
      InstanceID iid=content.getInstanceID();
      if (iid != null) {
        InstanceID pid=iid.getParentID();
        if (pid == null && pContent != null) {
          pid=pContent.getInstanceID();
        }
        long uid=iid.getUniqueID();
        if (uid == -1) {
          uid=generateUniqueID();
        }
        iid=new InstanceID(pid,uid,iid.getComponentID(),iid.getDataID());
        content.setInstanceID(iid);
      }
 else {
        iid=getInstanceID();
        content.setInstanceID(iid);
      }
      if (context.isInFactory()) {
        handleOnCreate(content);
      }
      startTOCEntry(content);
    }
  }
  return content;
}
Program: 75523
Project: 75523
Buggy source:
public IContent execute(){
  if (!executed) {
    executed=true;
    try {
      if (offset != -1) {
        generateUniqueID();
        content=reader.loadContent(offset);
        content.setGenerateBy(design);
        instanceId=content.getInstanceID();
        IContent pContent=getParentContent();
        if (pContent != null) {
          content.setParent(pContent);
        }
        doExecute();
      }
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  return content;
}

Fixed version (ground truth):
public IContent execute(){
  if (!executed) {
    executed=true;
    try {
      if (offset != -1) {
        generateUniqueID();
        content=reader.loadContent(offset);
        content.setGenerateBy(design);
        instanceId=content.getInstanceID();
        IContent pContent=getParentContent();
        if (pContent != null) {
          content.setParent(pContent);
          instanceId=new InstanceID(pContent.getInstanceID(),instanceId.getUniqueID(),instanceId.getComponentID(),instanceId.getDataID());
          content.setInstanceID(instanceId);
        }
        doExecute();
      }
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  return content;
}
Program: 75524
Project: 75524
Buggy source:
public void endContainer(IContainerContent container){
  endCase();
}

Fixed version (ground truth):
public void endContainer(IContainerContent container){
}
Program: 75527
Project: 75527
Buggy source:
/** 
 * Find all matched AggrRows and populate the aggregation value to a list.
 * @param base
 * @param sortKeys
 * @param filteredAggrResultSet
 * @return
 * @throws IOException
 */
private static List createMatchedAggrRow(IAggregationResultSet base,SortKey[] sortKeys,AggregationResultRowNavigator[] filteredAggrResultSet) throws IOException {
  List keyValues=new ArrayList();
  for (int x=0; x < filteredAggrResultSet.length; x++) {
    SortKey key=sortKeys[x];
    Object[] values=new Object[key.getLevelKeyIndex() + 1 - key.getLevelKeyOffset()];
    boolean[] direction=new boolean[key.getLevelKeyIndex() + 1 - key.getLevelKeyOffset()];
    for (int y=key.getLevelKeyOffset(); y < key.getLevelKeyIndex() + 1; y++) {
      DimLevel level=sortKeys[x].getTargetResultSet().getLevel(y);
      values[y - key.getLevelKeyOffset()]=base.getLevelKeyValue(base.getLevelIndex(level))[0];
      direction[y - key.getLevelKeyOffset()]=base.getSortType(base.getLevelIndex(level)) == 1 ? false : true;
    }
    IAggregationResultRow row=getNextMatchRow(filteredAggrResultSet[x],values,direction,key);
    if (row == null)     continue;
    for (int j=0; j < key.getAggrKeys().length; j++) {
      keyValues.add(row.getAggregationValues()[j]);
    }
  }
  return keyValues;
}

Fixed version (ground truth):
/** 
 * Find all matched AggrRows and populate the aggregation value to a list.
 * @param base
 * @param sortKeys
 * @param filteredAggrResultSet
 * @return
 * @throws IOException
 */
private static List createMatchedAggrRow(IAggregationResultSet base,SortKey[] sortKeys,AggregationResultRowNavigator[] filteredAggrResultSet) throws IOException {
  List keyValues=new ArrayList();
  for (int x=0; x < filteredAggrResultSet.length; x++) {
    SortKey key=sortKeys[x];
    Object[] values=new Object[key.getLevelKeyIndex() + 1 - key.getLevelKeyOffset()];
    boolean[] direction=new boolean[key.getLevelKeyIndex() + 1 - key.getLevelKeyOffset()];
    for (int y=key.getLevelKeyOffset(); y < key.getLevelKeyIndex() + 1; y++) {
      DimLevel level=sortKeys[x].getTargetResultSet().getLevel(y);
      values[y - key.getLevelKeyOffset()]=base.getLevelKeyValue(base.getLevelIndex(level))[0];
      direction[y - key.getLevelKeyOffset()]=base.getSortType(base.getLevelIndex(level)) == 1 ? false : true;
    }
    IAggregationResultRow row=getNextMatchRow(filteredAggrResultSet[x],values,direction,key);
    for (int j=0; j < key.getAggrKeys().length; j++) {
      keyValues.add(row == null ? null : row.getAggregationValues()[j]);
    }
  }
  return keyValues;
}
Program: 75528
Project: 75528
Buggy source:
public Iterator getMemberValueIterator(TabularCubeHandle cubeHandle,String targetLevel,ILevelDefinition[] higherLevelDefns,Object[] values) throws AdapterException {
  try {
    if ((higherLevelDefns == null && values != null) || (higherLevelDefns != null && values == null) || (higherLevelDefns.length != values.length)|| cubeHandle == null || targetLevel == null)     return null;
    DimLevel target=OlapExpressionUtil.getTargetDimLevel(targetLevel);
    TabularHierarchyHandle hierHandle=(TabularHierarchyHandle)(cubeHandle.getDimension(target.getDimensionName()).getContent(TabularDimensionHandle.HIERARCHIES_PROP,0));
    Map levelValueMap=new HashMap();
    for (int i=0; i < higherLevelDefns.length; i++) {
      if (target.getDimensionName().equals(higherLevelDefns[i].getHierarchy().getDimension().getName())) {
        levelValueMap.put(higherLevelDefns[i].getName(),values[i]);
      }
    }
    DataSetIterator it=new DataSetIterator(this.session,hierHandle);
    return new MemberValueIterator(it,levelValueMap,target.getLevelName());
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public Iterator getMemberValueIterator(TabularCubeHandle cubeHandle,String targetLevel,ILevelDefinition[] higherLevelDefns,Object[] values) throws AdapterException {
  try {
    if ((higherLevelDefns == null && values != null) || (higherLevelDefns != null && values == null) || cubeHandle == null || targetLevel == null)     return null;
    DimLevel target=OlapExpressionUtil.getTargetDimLevel(targetLevel);
    TabularHierarchyHandle hierHandle=(TabularHierarchyHandle)(cubeHandle.getDimension(target.getDimensionName()).getContent(TabularDimensionHandle.HIERARCHIES_PROP,0));
    this.session.defineDataSource(this.session.getModelAdaptor().adaptDataSource(hierHandle.getDataSet().getDataSource()));
    this.session.defineDataSet(this.session.getModelAdaptor().adaptDataSet(hierHandle.getDataSet()));
    Map levelValueMap=new HashMap();
    if (higherLevelDefns != null) {
      for (int i=0; i < higherLevelDefns.length; i++) {
        if (target.getDimensionName().equals(higherLevelDefns[i].getHierarchy().getDimension().getName())) {
          levelValueMap.put(higherLevelDefns[i].getName(),values[i]);
        }
      }
    }
    DataSetIterator it=new DataSetIterator(this.session,hierHandle);
    return new MemberValueIterator(it,levelValueMap,target.getLevelName());
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}
Program: 75529
Project: 75529
Buggy source:
public Object next(){
  try {
    if (!this.hasNext)     return null;
    Object result=this.currentValue;
    boolean accept=false;
    while (this.dataSetIterator.next()) {
      accept=true;
      Iterator it=this.levelValueMap.keySet().iterator();
      while (it.hasNext()) {
        String key=it.next().toString();
        Object value=this.levelValueMap.get(key);
        if (ScriptEvalUtil.compare(value,this.dataSetIterator.getValue(this.dataSetIterator.getFieldIndex(key))) != 0) {
          accept=false;
          break;
        }
      }
      if (accept) {
        this.currentValue=this.dataSetIterator.getValue(this.dataSetIterator.getFieldIndex(this.targetLevelName));
      }
    }
    this.hasNext=accept;
    return result;
  }
 catch (  BirtException e) {
    return null;
  }
}

Fixed version (ground truth):
public Object next(){
  try {
    if (!this.hasNext)     return null;
    Object result=this.currentValue;
    boolean accept=false;
    while (this.dataSetIterator.next()) {
      accept=true;
      Iterator it=this.levelValueMap.keySet().iterator();
      while (it.hasNext()) {
        String key=it.next().toString();
        Object value=this.levelValueMap.get(key);
        if (ScriptEvalUtil.compare(value,this.dataSetIterator.getValue(this.dataSetIterator.getFieldIndex(key))) != 0) {
          accept=false;
          break;
        }
      }
      if (accept) {
        this.currentValue=this.dataSetIterator.getValue(this.dataSetIterator.getFieldIndex(this.targetLevelName));
        break;
      }
    }
    this.hasNext=accept;
    return result;
  }
 catch (  BirtException e) {
    return null;
  }
}
Program: 75531
Project: 75531
Buggy source:
public List getReferencedLevels(String targetLevel,String bindingExpr,ICubeQueryDefinition queryDefn) throws AdapterException {
  try {
    List result=new ArrayList();
    DimLevel target=OlapExpressionUtil.getTargetDimLevel(targetLevel);
    String bindingName=OlapExpressionCompiler.getReferencedScriptObject(bindingExpr,"String_Node_Str");
    if (bindingName == null)     return result;
    IBinding binding=null;
    List bindings=queryDefn.getBindings();
    for (int i=0; i < bindings.size(); i++) {
      IBinding bd=(IBinding)bindings.get(i);
      if (bd.getBindingName().equals(bindingName)) {
        binding=bd;
        break;
      }
    }
    if (binding == null) {
      return result;
    }
    List aggrOns=binding.getAggregatOns();
    IEdgeDefinition axisQualifierEdge=queryDefn.getEdge(this.getAxisQualifierEdgeType(target,queryDefn));
    for (int i=0; i < aggrOns.size(); i++) {
      DimLevel dimLevel=OlapExpressionUtil.getTargetDimLevel(aggrOns.get(i).toString());
      ILevelDefinition lvl=getAxisQualifierLevel(dimLevel,axisQualifierEdge);
      if (lvl != null)       result.add(lvl);
    }
    return result;
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public List getReferencedLevels(String targetLevel,String bindingExpr,ICubeQueryDefinition queryDefn) throws AdapterException {
  try {
    List result=new ArrayList();
    DimLevel target=OlapExpressionUtil.getTargetDimLevel(targetLevel);
    String bindingName=OlapExpressionCompiler.getReferencedScriptObject(bindingExpr,"String_Node_Str");
    if (bindingName == null)     return result;
    IBinding binding=null;
    List bindings=queryDefn.getBindings();
    for (int i=0; i < bindings.size(); i++) {
      IBinding bd=(IBinding)bindings.get(i);
      if (bd.getBindingName().equals(bindingName)) {
        binding=bd;
        break;
      }
    }
    if (binding == null) {
      return result;
    }
    List aggrOns=binding.getAggregatOns();
    boolean isMeasure=false;
    if (aggrOns.size() == 0) {
      isMeasure=this.getReferencedMeasureName(binding.getExpression()) != null;
    }
    IEdgeDefinition axisQualifierEdge=queryDefn.getEdge(this.getAxisQualifierEdgeType(target,queryDefn));
    if (isMeasure) {
      for (int i=0; i < axisQualifierEdge.getDimensions().size(); i++) {
        IHierarchyDefinition hier=(IHierarchyDefinition)((IDimensionDefinition)axisQualifierEdge.getDimensions().get(i)).getHierarchy().get(0);
        result.addAll(hier.getLevels());
      }
    }
 else {
      for (int i=0; i < aggrOns.size(); i++) {
        DimLevel dimLevel=OlapExpressionUtil.getTargetDimLevel(aggrOns.get(i).toString());
        ILevelDefinition lvl=getAxisQualifierLevel(dimLevel,axisQualifierEdge);
        if (lvl != null)         result.add(lvl);
      }
    }
    return result;
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}
Program: 75532
Project: 75532
Buggy source:
/** 
 * @param expr
 * @return
 */
public String getReferencedMeasureName(String expr){
  return OlapExpressionCompiler.getReferencedScriptObject(expr,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param expr
 * @return
 */
private String getReferencedMeasureName(IBaseExpression expr){
  return OlapExpressionCompiler.getReferencedScriptObject(expr,"String_Node_Str");
}
Program: 75533
Project: 75533
Buggy source:
public void visitDesignElement(DesignElementHandle elementHandle){
  List scriptMethods=elementHandle.getMethods();
  for (Iterator ite=scriptMethods.iterator(); ite.hasNext(); ) {
    IElementPropertyDefn elementPropDefn=(IElementPropertyDefn)ite.next();
    String methodName=elementPropDefn.getMethodInfo().getName();
    if (elementHandle.getStringProperty(methodName) != null) {
      ScriptElementNode scriptElementNode=new ScriptElementNode(elementHandle);
      scriptNodes.add(scriptElementNode);
      break;
    }
  }
  for (int i=0; i < elementHandle.getDefn().getSlotCount(); i++) {
    visitContents(elementHandle.getSlot(i));
  }
  for (int i=0; i < elementHandle.getDefn().getContents().size(); i++) {
    visitContents(elementHandle,((PropertyDefn)elementHandle.getDefn().getContents().get(i)).getName());
  }
}

Fixed version (ground truth):
public void visitDesignElement(DesignElementHandle elementHandle){
  List scriptMethods=elementHandle.getMethods();
  if (scriptMethods != null) {
    for (Iterator ite=scriptMethods.iterator(); ite.hasNext(); ) {
      IElementPropertyDefn elementPropDefn=(IElementPropertyDefn)ite.next();
      String methodName=elementPropDefn.getMethodInfo().getName();
      if (elementHandle.getStringProperty(methodName) != null) {
        ScriptElementNode scriptElementNode=new ScriptElementNode(elementHandle);
        scriptNodes.add(scriptElementNode);
        break;
      }
    }
  }
  for (int i=0; i < elementHandle.getDefn().getSlotCount(); i++) {
    visitContents(elementHandle.getSlot(i));
  }
  for (int i=0; i < elementHandle.getDefn().getContents().size(); i++) {
    visitContents(elementHandle,((PropertyDefn)elementHandle.getDefn().getContents().get(i)).getName());
  }
}