nus-yam/ex-repair huggingface dataset:
Program: 66455
Project: 66455
Buggy source:
private void createExpressionCell(Composite parent,String label){
  ControlProvider.createLabel(parent,label);
  defaultValueComposite=ControlProvider.getDefaultComposite(parent);
  defaultValueString=Utility.getNonNullString(structureHandle.getDefaultValue());
  defaultValueText=ControlProvider.createText(defaultValueComposite,defaultValueString);
  defaultValueText.setLayoutData(ControlProvider.getGridDataWithHSpan(1));
  defaultValueText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (defaultValueText.isEnabled()) {
        validateSyntax();
      }
    }
  }
);
  SelectionAdapter listener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      ExpressionBuilder expressionBuilder=new ExpressionBuilder(defaultValueText.getText());
      expressionBuilder.setExpressionProvier(null);
      if (expressionBuilder.open() == OK) {
        defaultValueText.setText(expressionBuilder.getResult().trim());
      }
    }
  }
;
  ExpressionProvider provider=new ExpressionProvider((DataSetHandle)getContainer().getModel());
  ExpressionButtonUtil.createExpressionButton(defaultValueComposite,defaultValueText,provider,(DataSetHandle)getContainer().getModel(),true,SWT.PUSH);
  ExpressionButtonUtil.initExpressionButtonControl(defaultValueText,structureHandle,DataSetParameter.DEFAULT_VALUE_MEMBER);
}

Fixed version (ground truth):
private void createExpressionCell(Composite parent,String label){
  ControlProvider.createLabel(parent,label);
  defaultValueComposite=ControlProvider.getDefaultComposite(parent);
  defaultValueString=Utility.getNonNullString(structureHandle.getDefaultValue());
  defaultValueText=ControlProvider.createText(defaultValueComposite,defaultValueString);
  defaultValueText.setLayoutData(ControlProvider.getGridDataWithHSpan(1));
  defaultValueText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (defaultValueText.isEnabled()) {
        defaultValueString=defaultValueText.getText();
        validateSyntax();
      }
    }
  }
);
  SelectionAdapter listener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      ExpressionBuilder expressionBuilder=new ExpressionBuilder(defaultValueText.getText());
      expressionBuilder.setExpressionProvier(null);
      if (expressionBuilder.open() == OK) {
        defaultValueText.setText(expressionBuilder.getResult().trim());
      }
    }
  }
;
  ExpressionProvider provider=new ExpressionProvider((DataSetHandle)getContainer().getModel());
  ExpressionButtonUtil.createExpressionButton(defaultValueComposite,defaultValueText,provider,(DataSetHandle)getContainer().getModel(),true,SWT.PUSH);
  ExpressionButtonUtil.initExpressionButtonControl(defaultValueText,structureHandle,DataSetParameter.DEFAULT_VALUE_MEMBER);
}
Program: 66456
Project: 66456
Buggy source:
MetaDataRetriever(OdaConnectionProvider odaConnectionProvider,DataSetDesign dataSetDesign){
  try {
    IConnection connection=odaConnectionProvider.openConnection();
    query=connection.newQuery(dataSetDesign.getOdaExtensionDataSetId());
    QuerySpecification querySpec=new QuerySpecificationHelper((String)null).createQuerySpecification();
    Properties properties=dataSetDesign.getPublicProperties();
    if (properties != null) {
      for (      Property prop : properties.getProperties()) {
        querySpec.setProperty(prop.getName(),prop.getValue());
      }
    }
    query.setSpecification(querySpec);
    query.prepare(dataSetDesign.getQueryText());
    try {
      paramMeta=query.getParameterMetaData();
    }
 catch (    OdaException e) {
      logger.log(Level.WARNING,e.getLocalizedMessage(),e);
    }
    if (!(query instanceof IAdvancedQuery)) {
      resultMeta=query.getMetaData();
    }
  }
 catch (  OdaException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
MetaDataRetriever(OdaConnectionProvider odaConnectionProvider,DataSetDesign dataSetDesign){
  try {
    IConnection connection=odaConnectionProvider.openConnection();
    query=connection.newQuery(dataSetDesign.getOdaExtensionDataSetId());
    QuerySpecification querySpec=new QuerySpecificationHelper((String)null).createQuerySpecification();
    Properties properties=dataSetDesign.getPublicProperties();
    if (properties != null) {
      for (      Property prop : properties.getProperties()) {
        querySpec.setProperty(prop.getName(),prop.getValue());
      }
    }
    try {
      query.setSpecification(querySpec);
    }
 catch (    UnsupportedOperationException ue) {
    }
    query.prepare(dataSetDesign.getQueryText());
    try {
      paramMeta=query.getParameterMetaData();
    }
 catch (    OdaException e) {
      logger.log(Level.WARNING,e.getLocalizedMessage(),e);
    }
    if (!(query instanceof IAdvancedQuery)) {
      resultMeta=query.getMetaData();
    }
  }
 catch (  OdaException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage(),e);
  }
}
Program: 66460
Project: 66460
Buggy source:
protected void endCell(ICellContent cell){
  currentCell=cell;
  for (int i=cell.getColumn(); i < cell.getColumn() + cell.getColSpan(); i++) {
    cells[i]+=cell.getRowSpan();
  }
  for (int i=0; i < cells.length; i++)   System.out.print(cells[i]);
  System.out.println();
}

Fixed version (ground truth):
protected void endCell(ICellContent cell){
  currentCell=cell;
  for (int i=cell.getColumn(); i < cell.getColumn() + cell.getColSpan(); i++) {
    cells[i]+=cell.getRowSpan();
  }
}
Program: 66461
Project: 66461
Buggy source:
public void endTable(ITableContent table){
  if (cachedStartTable != null) {
    cachedStartTable=null;
    return;
  }
  if (enableMetadata) {
    metadataEmitter.endTable(table);
  }
  writer.closeTag(HTMLTags.TAG_TABLE);
  if (enableMetadata) {
    metadataEmitter.endWrapTable(table);
  }
  boolean DIVWrap=((Boolean)tableDIVWrapedFlagStack.pop()).booleanValue();
  if (DIVWrap) {
    writer.closeTag(HTMLTags.TAG_DIV);
  }
  logger.log(Level.FINE,"String_Node_Str");
}

Fixed version (ground truth):
protected void endTable(ITableContent tableContent){
  layoutStack.pop();
  columnCountStack.pop();
  if (!layoutStack.isEmpty()) {
    cells=layoutStack.peek();
  }
  if (!columnCountStack.isEmpty()) {
    columnCount=columnCountStack.peek();
  }
}
Program: 66462
Project: 66462
Buggy source:
public void startTable(ITableContent table){
  cachedStartTable=table;
}

Fixed version (ground truth):
protected void startTable(ITableContent tableContent){
  int columnCount=tableContent.getColumnCount();
  cells=new int[columnCount];
  this.columnCount=columnCount;
  layoutStack.push(cells);
  columnCountStack.push(columnCount);
}
Program: 66463
Project: 66463
Buggy source:
public void startRow(IRowContent row){
}

Fixed version (ground truth):
protected void startRow(){
}
Program: 66464
Project: 66464
Buggy source:
public void endRow(IRowContent row){
  if (enableMetadata) {
    metadataEmitter.endRow(row);
  }
  writer.closeTag(HTMLTags.TAG_TR);
}

Fixed version (ground truth):
protected void endRow(){
  currentCell=null;
  for (int i=0; i < columnCount; i++) {
    cells[i]--;
  }
}
Program: 66465
Project: 66465
Buggy source:
public void startCell(ICellContent cell){
  logger.log(Level.FINE,"String_Node_Str");
  String tagName=null;
  boolean isHead=isCellInHead(cell);
  if (isHead) {
    tagName=HTMLTags.TAG_TH;
  }
 else {
    tagName=HTMLTags.TAG_TD;
  }
  writer.openTag(tagName);
  writer.attribute("String_Node_Str",cell.getScope());
  writer.attribute("String_Node_Str",cell.getBookmark());
  writer.attribute("String_Node_Str",cell.getHeaders());
  String styleClass=cell.getStyleClass();
  setStyleName(styleClass,cell);
  int colSpan=cell.getColSpan();
  if (colSpan > 1) {
    writer.attribute(HTMLTags.ATTR_COLSPAN,colSpan);
  }
  int rowSpan=cell.getRowSpan();
  if (rowSpan > 1) {
    writer.attribute(HTMLTags.ATTR_ROWSPAN,rowSpan);
  }
  StringBuffer styleBuffer=new StringBuffer();
  htmlEmitter.buildCellStyle(cell,styleBuffer,isHead);
  writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
  htmlEmitter.handleCellAlign(cell);
  htmlEmitter.handleCellVAlign(cell);
  boolean bookmarkOutput=false;
  if (metadataFilter != null) {
    bookmarkOutput=metadataEmitter.outputMetadataProperty(metadataFilter.needMetaData(HTMLEmitterUtil.getElementHandle(cell)),cell,tagName);
  }
  if (!startedGroups.isEmpty()) {
    if (!bookmarkOutput) {
      IGroupContent group=(IGroupContent)startedGroups.firstElement();
      String bookmark=group.getBookmark();
      if (bookmark == null) {
        bookmark=idGenerator.generateUniqueID();
        group.setBookmark(bookmark);
      }
      outputBookmark(group,null);
      startedGroups.remove(group);
    }
    Iterator iter=startedGroups.iterator();
    while (iter.hasNext()) {
      IGroupContent group=(IGroupContent)iter.next();
      outputBookmark(group);
    }
    startedGroups.clear();
  }
  if (cell.hasDiagonalLine()) {
    DimensionType cellHeight=getCellHeight(cell);
    if (cellHeight != null && !"String_Node_Str".equals(cellHeight.getUnits())) {
      writer.openTag(HTMLTags.TAG_DIV);
      writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str");
      outputDiagonalImage(cell,cellHeight);
    }
  }
  if (enableMetadata) {
    metadataEmitter.startCell(cell);
  }
}

Fixed version (ground truth):
protected void startCell(ICellContent cell){
  if (needAddEmptyCell(cell)) {
    addEmptyCell(cell);
  }
}
Program: 66466
Project: 66466
Buggy source:
public void endCell(ICellContent cell){
  logger.log(Level.FINE,"String_Node_Str");
  if (enableMetadata) {
    metadataEmitter.endCell(cell);
  }
  if (cell.hasDiagonalLine()) {
    DimensionType cellHeight=getCellHeight(cell);
    if (cellHeight != null && !"String_Node_Str".equals(cellHeight.getUnits())) {
      writer.closeTag(HTMLTags.TAG_DIV);
    }
  }
  if (isCellInHead(cell)) {
    writer.closeTag(HTMLTags.TAG_TH);
  }
 else {
    writer.closeTag(HTMLTags.TAG_TD);
  }
}

Fixed version (ground truth):
protected void endCell(ICellContent cell){
  currentCell=cell;
  for (int i=cell.getColumn(); i < cell.getColumn() + cell.getColSpan(); i++) {
    cells[i]+=cell.getRowSpan();
  }
  for (int i=0; i < cells.length; i++)   System.out.print(cells[i]);
  System.out.println();
}
Program: 66467
Project: 66467
Buggy source:
public SimpleResultSet(CandidateQuery dataSourceQuery,final ICustomDataSet customDataSet,IResultClass resultMetadata,IEventHandler handler,GroupSpec[] groupSpecs,DataEngineSession session,boolean forceLookingForward) throws DataException {
  SmartCacheRequest scRequest=new SmartCacheRequest(dataSourceQuery.getMaxRows(),dataSourceQuery.getFetchEvents(),new OdiAdapter(customDataSet),resultMetadata,false);
  this.closeable=new ICloseable(){
    public void close() throws DataException {
      customDataSet.close();
    }
  }
;
  this.handler=handler;
  this.initialize(dataSourceQuery,handler,scRequest,resultClass,groupSpecs,session,forceLookingForward);
}

Fixed version (ground truth):
public SimpleResultSet(CandidateQuery dataSourceQuery,final ICustomDataSet customDataSet,IResultClass resultClass,IEventHandler handler,GroupSpec[] groupSpecs,DataEngineSession session,boolean forceLookingForward) throws DataException {
  SmartCacheRequest scRequest=new SmartCacheRequest(dataSourceQuery.getMaxRows(),dataSourceQuery.getFetchEvents(),new OdiAdapter(customDataSet),resultClass,false);
  this.closeable=new ICloseable(){
    public void close() throws DataException {
      customDataSet.close();
    }
  }
;
  this.handler=handler;
  this.initialize(dataSourceQuery,handler,scRequest,resultClass,groupSpecs,session,forceLookingForward);
}
Program: 66468
Project: 66468
Buggy source:
/** 
 * Make a multi-pass to a filter that needs multipass, meanly TopN and BottomN.The pass actually contains two steps. 1.FIRST PASS: in this step we just go through all result rows and make preparation work for the second step 2.SECOND PASS: in this step the rows that are not qualified is filtered out
 * @param filterPass
 * @param stopSign
 * @throws DataException
 */
protected void makeMultiPassToFilter(FilterPassController filterPass) throws DataException {
  int max=populator.getQuery().getMaxRows();
  populator.getQuery().setMaxRows(0);
  ResultSetCache sCache=populator.getCache();
  makeFirstPassToMultiPassFilter(filterPass);
  populator.setCache(sCache);
  sCache.reset();
  sCache.next();
  populator.getGroupProcessorManager().getGroupCalculationUtil().getGroupInformationUtil().setLeaveGroupIndex(0);
  populator.getGroupProcessorManager().getGroupCalculationUtil().setResultSetCache(sCache);
  populator.getQuery().setMaxRows(max);
  makeSecondPassToMultiPassFilter(filterPass);
  Iterator filterIt=filterByRow.getFilterList().iterator();
  while (filterIt.hasNext()) {
    IFilterDefinition fd=(IFilterDefinition)filterIt.next();
    if (FilterUtil.isFilterNeedMultiPass(fd)) {
      fd.getExpression().setHandle(null);
    }
  }
  filterPass.setSecondPassRowCount(0);
}

Fixed version (ground truth):
/** 
 * Make a multi-pass to a filter that needs multipass, meanly TopN and BottomN.The pass actually contains two steps. 1.FIRST PASS: in this step we just go through all result rows and make preparation work for the second step 2.SECOND PASS: in this step the rows that are not qualified is filtered out
 * @param filterPass
 * @param stopSign
 * @throws DataException
 */
protected void makeMultiPassToFilter(FilterPassController filterPass) throws DataException {
  int max=populator.getQuery().getMaxRows();
  populator.getQuery().setMaxRows(0);
  ResultSetCache sCache=populator.getCache();
  populator.setClearCacheResultSet(false);
  makeFirstPassToMultiPassFilter(filterPass);
  populator.setCache(sCache);
  sCache.reset();
  sCache.next();
  populator.setClearCacheResultSet(true);
  populator.getGroupProcessorManager().getGroupCalculationUtil().getGroupInformationUtil().setLeaveGroupIndex(0);
  populator.getGroupProcessorManager().getGroupCalculationUtil().setResultSetCache(sCache);
  populator.getQuery().setMaxRows(max);
  makeSecondPassToMultiPassFilter(filterPass);
  Iterator filterIt=filterByRow.getFilterList().iterator();
  while (filterIt.hasNext()) {
    IFilterDefinition fd=(IFilterDefinition)filterIt.next();
    if (FilterUtil.isFilterNeedMultiPass(fd)) {
      fd.getExpression().setHandle(null);
    }
  }
  filterPass.setSecondPassRowCount(0);
}
Program: 66469
Project: 66469
Buggy source:
private void setMeasureDataTypeForCubeQuery(ICubeQueryDefinition query){
  List measures=query.getMeasures();
  if (this.cubeMetaDataHandleMap != null && this.cubeMetaDataHandleMap.containsKey(query.getName())) {
    CubeHandle cubeHandle=(CubeHandle)this.cubeMetaDataHandleMap.get(query.getName());
    for (int i=0; i < measures.size(); i++) {
      IMeasureDefinition measureDef=(IMeasureDefinition)measures.get(i);
      MeasureHandle measureHandle=cubeHandle.getMeasure(measureDef.getName());
      if (measureHandle != null)       measureDef.setDataType(DataAdapterUtil.adaptModelDataType(measureHandle.getDataType()));
      if (cubeHandle instanceof TabularCubeHandle && ((TabularCubeHandle)cubeHandle).autoPrimaryKey()) {
        measureDef.setAggrFunction(null);
      }
    }
  }
}

Fixed version (ground truth):
private void setMeasureDataTypeForCubeQuery(ICubeQueryDefinition query){
  List measures=query.getMeasures();
  if (this.cubeMetaDataHandleMap != null && this.cubeMetaDataHandleMap.containsKey(query.getName())) {
    CubeHandle cubeHandle=(CubeHandle)this.cubeMetaDataHandleMap.get(query.getName());
    for (int i=0; i < measures.size(); i++) {
      IMeasureDefinition measureDef=(IMeasureDefinition)measures.get(i);
      MeasureHandle measureHandle=cubeHandle.getMeasure(measureDef.getName());
      if (measureHandle != null)       measureDef.setDataType(DataAdapterUtil.adaptModelDataType(measureHandle.getDataType()));
      if (cubeHandle.getBooleanProperty(ITabularCubeModel.AUTO_KEY_PROP)) {
        measureDef.setAggrFunction(null);
      }
    }
  }
}
Program: 66470
Project: 66470
Buggy source:
/** 
 * Create shell images
 */
private static Image[] createImages(){
  String[] productImageURLs=getProductImageURLs();
  if (productImageURLs != null) {
    ArrayList shellImgs=new ArrayList();
    for (int i=0; i < productImageURLs.length; i++) {
      if ("String_Node_Str".equals(productImageURLs[i])) {
        continue;
      }
      URL imageURL=null;
      try {
        imageURL=new URL(productImageURLs[i]);
      }
 catch (      MalformedURLException mue) {
        IProduct product=Platform.getProduct();
        if (product != null) {
          Bundle productBundle=product.getDefiningBundle();
          if (productBundle != null) {
            imageURL=Platform.find(productBundle,new Path(productImageURLs[i]));
          }
        }
      }
      Image image=null;
      String key=imageURL.toString();
      if (imageURL != null) {
        if (CorePlugin.getDefault().getImageRegistry().get(key) != null) {
          image=CorePlugin.getDefault().getImageRegistry().get(key);
        }
 else {
          image=ImageDescriptor.createFromURL(imageURL).createImage();
          CorePlugin.getDefault().getImageRegistry().put(key,image);
        }
      }
      if (image != null) {
        shellImgs.add(image);
      }
    }
    return (Image[])shellImgs.toArray(new Image[shellImgs.size()]);
  }
  return new Image[0];
}

Fixed version (ground truth):
/** 
 * Create shell images
 */
private static Image[] createImages(){
  String[] productImageURLs=getProductImageURLs();
  if (productImageURLs != null) {
    ArrayList shellImgs=new ArrayList();
    for (int i=0; i < productImageURLs.length; i++) {
      if ("String_Node_Str".equals(productImageURLs[i])) {
        continue;
      }
      URL imageURL=null;
      try {
        imageURL=new URL(productImageURLs[i]);
      }
 catch (      MalformedURLException mue) {
        IProduct product=Platform.getProduct();
        if (product != null) {
          Bundle productBundle=product.getDefiningBundle();
          if (productBundle != null) {
            imageURL=Platform.find(productBundle,new Path(productImageURLs[i]));
          }
        }
      }
      Image image=null;
      if (imageURL != null) {
        String key=imageURL.toString();
        if (CorePlugin.getDefault().getImageRegistry().get(key) != null) {
          image=CorePlugin.getDefault().getImageRegistry().get(key);
        }
 else {
          image=ImageDescriptor.createFromURL(imageURL).createImage();
          CorePlugin.getDefault().getImageRegistry().put(key,image);
        }
      }
      if (image != null) {
        shellImgs.add(image);
      }
    }
    return (Image[])shellImgs.toArray(new Image[shellImgs.size()]);
  }
  return new Image[0];
}
Program: 66471
Project: 66471
Buggy source:
/** 
 * @param context
 * @throws DataException 
 */
public StreamManager(DataEngineContext context,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.rootQueryResultID=queryResultInfo.getRootQueryResultID();
  this.parentQueryResultID=queryResultInfo.getParentQueryResultID();
  this.selfQueryResultID=queryResultInfo.getSelfQueryResultID();
  this.subQueryName=queryResultInfo.getSubQueryName();
  this.subQueryID=subQueryName == null ? null : QueryResultIDUtil.buildSubQueryID(subQueryName,queryResultInfo.getIndex());
  this.cachedStreamManagers=new HashMap();
  this.metaManagers=new HashMap();
  this.dataMetaManagers=new HashMap();
  VersionManager vm=new VersionManager(context);
  if (context.getMode() == DataEngineContext.MODE_GENERATION) {
    this.version=vm.getVersion(this.getQueryResultUID());
    if (this.version == VersionManager.VERSION_2_0) {
      this.version=VersionManager.getLatestVersion();
    }
    vm.setVersion(version,this.getQueryResultUID());
    vm.setVersion(VersionManager.getLatestVersion(),null);
  }
 else {
    String queryResultId=this.getQueryResultUID();
    this.version=vm.getVersion(queryResultId);
    if (this.version == 0 && queryResultId != null) {
      this.version=vm.getLatestVersion();
      vm.setVersion(this.version,queryResultId);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param context
 * @throws DataException 
 */
public StreamManager(DataEngineContext context,QueryResultInfo queryResultInfo) throws DataException {
  this.context=context;
  this.rootQueryResultID=queryResultInfo.getRootQueryResultID();
  this.parentQueryResultID=queryResultInfo.getParentQueryResultID();
  this.selfQueryResultID=queryResultInfo.getSelfQueryResultID();
  this.subQueryName=queryResultInfo.getSubQueryName();
  this.subQueryID=subQueryName == null ? null : QueryResultIDUtil.buildSubQueryID(subQueryName,queryResultInfo.getIndex());
  this.cachedStreamManagers=new HashMap();
  this.metaManagers=new HashMap();
  this.dataMetaManagers=new HashMap();
  VersionManager vm=new VersionManager(context);
  if (context.getMode() == DataEngineContext.MODE_GENERATION) {
    this.version=vm.getVersion(this.getQueryResultUID());
    if (this.version == VersionManager.VERSION_2_0) {
      this.version=VersionManager.getLatestVersion();
    }
    vm.setVersion(version,this.getQueryResultUID());
    vm.setVersion(VersionManager.getLatestVersion(),null);
  }
 else {
    String queryResultId=this.getQueryResultUID();
    this.version=vm.getVersion(queryResultId);
    if (this.version == 0 && queryResultId != null) {
      this.version=vm.getLatestVersion();
      if (this.context.getDocWriter() != null)       vm.setVersion(this.version,queryResultId);
    }
  }
}
Program: 66474
Project: 66474
Buggy source:
/** 
 * @param queryDefn
 * @param measureList
 * @param measureMapping 
 * @param measureAggrOns 
 * @return
 * @throws DataException 
 */
private static List getUnreferencedMeasures(ICubeQueryDefinition queryDefn,List measureList,Map measureMapping,List measureAggrOns) throws DataException {
  List result=new ArrayList();
  List bindings=queryDefn.getBindings();
  for (Iterator i=measureList.iterator(); i.hasNext(); ) {
    MeasureDefinition measure=(MeasureDefinition)i.next();
    IBinding referenceBinding=getMeasureDirectReferenceBinding(measure,bindings,measureAggrOns);
    if (referenceBinding != null) {
      measureMapping.put(measure.getName(),referenceBinding.getBindingName());
    }
 else {
      result.add(measure);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param queryDefn
 * @param measureList
 * @param measureMapping 
 * @param measureAggrOns 
 * @return
 * @throws DataException 
 */
private static List getUnreferencedMeasures(ICubeQueryDefinition queryDefn,List measureList,Map measureMapping,List measureAggrOns) throws DataException {
  List result=new ArrayList();
  List bindings=queryDefn.getBindings();
  for (Iterator i=measureList.iterator(); i.hasNext(); ) {
    MeasureDefinition measure=(MeasureDefinition)i.next();
    if (measure.getAggrFunction() == null || measure.getAggrFunction().trim().length() == 0) {
      continue;
    }
    IBinding referenceBinding=getMeasureDirectReferenceBinding(measure,bindings,measureAggrOns);
    if (referenceBinding != null) {
      measureMapping.put(measure.getName(),referenceBinding.getBindingName());
    }
 else {
      result.add(measure);
    }
  }
  return result;
}
Program: 66475
Project: 66475
Buggy source:
private void setMeasureDataTypeForCubeQuery(ICubeQueryDefinition query){
  List measures=query.getMeasures();
  if (this.cubeMetaDataHandleMap != null && this.cubeMetaDataHandleMap.containsKey(query.getName())) {
    CubeHandle cubeHandle=(CubeHandle)this.cubeMetaDataHandleMap.get(query.getName());
    for (int i=0; i < measures.size(); i++) {
      IMeasureDefinition measureDef=(IMeasureDefinition)measures.get(i);
      MeasureHandle measureHandle=cubeHandle.getMeasure(measureDef.getName());
      if (measureHandle != null)       measureDef.setDataType(DataAdapterUtil.adaptModelDataType(measureHandle.getDataType()));
    }
  }
}

Fixed version (ground truth):
private void setMeasureDataTypeForCubeQuery(ICubeQueryDefinition query){
  List measures=query.getMeasures();
  if (this.cubeMetaDataHandleMap != null && this.cubeMetaDataHandleMap.containsKey(query.getName())) {
    CubeHandle cubeHandle=(CubeHandle)this.cubeMetaDataHandleMap.get(query.getName());
    for (int i=0; i < measures.size(); i++) {
      IMeasureDefinition measureDef=(IMeasureDefinition)measures.get(i);
      MeasureHandle measureHandle=cubeHandle.getMeasure(measureDef.getName());
      if (measureHandle != null)       measureDef.setDataType(DataAdapterUtil.adaptModelDataType(measureHandle.getDataType()));
      if (cubeHandle instanceof TabularCubeHandle && ((TabularCubeHandle)cubeHandle).autoPrimaryKey()) {
        measureDef.setAggrFunction(null);
      }
    }
  }
}
Program: 66476
Project: 66476
Buggy source:
private void adaptDTE(org.eclipse.birt.data.engine.api.IResultMetaData dteMeta){
  int count=dteMeta.getColumnCount();
  for (int index=0; index < count; index++) {
    try {
      metaEntries.add(new MetaDataEntry(dteMeta.getColumnName(index + 1),dteMeta.getColumnLabel(index + 1),dteMeta.getColumnType(index + 1)));
    }
 catch (    BirtException ex) {
    }
  }
}

Fixed version (ground truth):
private void adaptDTE(org.eclipse.birt.data.engine.api.IResultMetaData dteMeta){
  if (dteMeta == null)   return;
  int count=dteMeta.getColumnCount();
  for (int index=0; index < count; index++) {
    try {
      metaEntries.add(new MetaDataEntry(dteMeta.getColumnName(index + 1),dteMeta.getColumnLabel(index + 1),dteMeta.getColumnType(index + 1)));
    }
 catch (    BirtException ex) {
    }
  }
}
Program: 66477
Project: 66477
Buggy source:
/** 
 * For the given odi resultset, calcaulate the value of aggregate from aggregateTable
 * @param aggrTable
 * @param odiResult
 * @throws DataException 
 */
public ProgressiveAggregationHelper(IAggrDefnManager manager,String tempDir,Scriptable currentScope,ScriptContext sc) throws DataException {
  this.manager=manager;
  this.currentRoundAggrValue=new List[0];
  this.accumulators=new ArrayList<Accumulator>();
  this.sc=sc;
  try {
    this.currentScope=((IDataScriptEngine)this.sc.getScriptEngine(IDataScriptEngine.ENGINE_NAME)).getJSContext(sc).initStandardObjects();
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  this.currentScope.setParentScope(currentScope);
  this.jsRow=new DummyJSResultSetRow();
  this.currentScope.put("String_Node_Str",this.currentScope,this.jsRow);
  this.populateAggregations(tempDir);
}

Fixed version (ground truth):
/** 
 * For the given odi resultset, calcaulate the value of aggregate from aggregateTable
 * @param aggrTable
 * @param odiResult
 * @throws DataException 
 */
public ProgressiveAggregationHelper(IAggrDefnManager manager,String tempDir,Scriptable currentScope,ScriptContext sc) throws DataException {
  this.manager=manager;
  this.currentRoundAggrValue=new List[0];
  this.accumulators=new ArrayList<Accumulator>();
  this.sc=sc;
  try {
    this.currentScope=((IDataScriptEngine)this.sc.getScriptEngine(IDataScriptEngine.ENGINE_NAME)).getJSContext(sc).initStandardObjects();
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  this.currentScope.setParentScope(currentScope);
  this.jsRow=new DummyJSResultSetRow();
  this.currentScope.put("String_Node_Str",this.currentScope,this.jsRow);
  this.currentScope.put("String_Node_Str",this.currentScope,this.jsRow);
  this.populateAggregations(tempDir);
}
Program: 66478
Project: 66478
Buggy source:
protected void okPressed(){
  CommandStack stack=getActionStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  if (input == null) {
    List measureList=new ArrayList();
    List functionList=new ArrayList();
    measureList.addAll(getLevel().getAggregationMeasures());
    functionList.add(getFunctionNames()[0]);
    for (int i=0; i < measureList.size(); i++) {
      functionList.add(getLevel().getAggregationFunction((MeasureViewHandle)measureList.get(i)));
    }
    measureList.add(getMeasure());
    try {
      getLevel().removeSubTotal();
      CrosstabCellHandle cellHandle=getLevel().addSubTotal(measureList,functionList);
      if (cellHandle != null)       CrosstabUIHelper.createSubTotalLabel(getLevel(),cellHandle);
      stack.commit();
    }
 catch (    SemanticException e) {
      stack.rollback();
    }
  }
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  CommandStack stack=getActionStack();
  if (input == null) {
    stack.startTrans(Messages.getString("String_Node_Str"));
    List measureList=new ArrayList();
    List functionList=new ArrayList();
    measureList.addAll(getLevel().getAggregationMeasures());
    functionList.add(getFunctionNames()[0]);
    for (int i=0; i < measureList.size(); i++) {
      functionList.add(getLevel().getAggregationFunction((MeasureViewHandle)measureList.get(i)));
    }
    measureList.add(getMeasure());
    try {
      getLevel().removeSubTotal();
      CrosstabCellHandle cellHandle=getLevel().addSubTotal(measureList,functionList);
      if (cellHandle != null)       CrosstabUIHelper.createSubTotalLabel(getLevel(),cellHandle);
      stack.commit();
    }
 catch (    SemanticException e) {
      stack.rollback();
    }
  }
  super.okPressed();
}
Program: 66479
Project: 66479
Buggy source:
/** 
 * Make a multi-pass to a filter that needs multipass, meanly TopN and BottomN.The pass actually contains two steps. 1.FIRST PASS: in this step we just go through all result rows and make preparation work for the second step 2.SECOND PASS: in this step the rows that are not qualified is filtered out
 * @param filterPass
 * @param stopSign
 * @throws DataException
 */
protected void makeMultiPassToFilter(FilterPassController filterPass) throws DataException {
  int max=populator.getQuery().getMaxRows();
  populator.getQuery().setMaxRows(0);
  ResultSetCache sCache=populator.getCache();
  makeFirstPassToMultiPassFilter(filterPass);
  populator.setCache(sCache);
  sCache.reset();
  sCache.next();
  populator.getGroupProcessorManager().getGroupCalculationUtil().getGroupInformationUtil().setLeaveGroupIndex(0);
  populator.getGroupProcessorManager().getGroupCalculationUtil().setResultSetCache(sCache);
  populator.getQuery().setMaxRows(max);
  makeSecondPassToMultiPassFilter(filterPass);
  Iterator filterIt=filterByRow.getFilterList().iterator();
  while (filterIt.hasNext()) {
    IFilterDefinition fd=(IFilterDefinition)filterIt.next();
    if (FilterUtil.isFilterNeedMultiPass(fd)) {
      fd.getExpression().setHandle(null);
    }
  }
  filterPass.setSecondPassRowCount(0);
}

Fixed version (ground truth):
/** 
 * Make a multi-pass to a filter that needs multipass, meanly TopN and BottomN.The pass actually contains two steps. 1.FIRST PASS: in this step we just go through all result rows and make preparation work for the second step 2.SECOND PASS: in this step the rows that are not qualified is filtered out
 * @param filterPass
 * @param stopSign
 * @throws DataException
 */
protected void makeMultiPassToFilter(FilterPassController filterPass) throws DataException {
  int max=populator.getQuery().getMaxRows();
  populator.getQuery().setMaxRows(0);
  ResultSetCache sCache=populator.getCache();
  populator.setClearCacheResultSet(false);
  makeFirstPassToMultiPassFilter(filterPass);
  populator.setCache(sCache);
  sCache.reset();
  sCache.next();
  populator.setClearCacheResultSet(true);
  populator.getGroupProcessorManager().getGroupCalculationUtil().getGroupInformationUtil().setLeaveGroupIndex(0);
  populator.getGroupProcessorManager().getGroupCalculationUtil().setResultSetCache(sCache);
  populator.getQuery().setMaxRows(max);
  makeSecondPassToMultiPassFilter(filterPass);
  Iterator filterIt=filterByRow.getFilterList().iterator();
  while (filterIt.hasNext()) {
    IFilterDefinition fd=(IFilterDefinition)filterIt.next();
    if (FilterUtil.isFilterNeedMultiPass(fd)) {
      fd.getExpression().setHandle(null);
    }
  }
  filterPass.setSecondPassRowCount(0);
}
Program: 66480
Project: 66480
Buggy source:
/** 
 * Removes a measure view in the given position.
 * @param index the position index of the measure view to remove, 0-based integer
 * @throws SemanticException
 */
public void removeMeasure(int index) throws SemanticException {
  getMeasuresProperty().drop(index);
  CrosstabModelUtil.updateHeaderCell(this,-1,-1);
}

Fixed version (ground truth):
/** 
 * Removes a measure view in the given position.
 * @param index the position index of the measure view to remove, 0-based integer
 * @throws SemanticException
 */
public void removeMeasure(int index) throws SemanticException {
  getMeasuresProperty().drop(index);
  int targetAxis=MEASURE_DIRECTION_VERTICAL.equals(getMeasureDirection()) ? ROW_AXIS_TYPE : COLUMN_AXIS_TYPE;
  List<LevelViewHandle> levels=CrosstabModelUtil.getAllAggregationLevels(this,targetAxis);
  for (  LevelViewHandle lv : levels) {
    if (lv.isInnerMost() || lv.getAggregationHeader() == null) {
      continue;
    }
    if (lv.getAggregationMeasures().size() == 0) {
      lv.getAggregationHeaderProperty().drop(0);
    }
  }
  CrosstabCellHandle grandtotalCell=getGrandTotal(targetAxis);
  if (grandtotalCell != null && getAggregationMeasures(targetAxis).size() == 0) {
    grandtotalCell.getModelHandle().drop();
  }
  CrosstabModelUtil.updateHeaderCell(this,-1,-1);
}
Program: 66481
Project: 66481
Buggy source:
public boolean next() throws DataException {
  return this.exprResultSet.next();
}

Fixed version (ground truth):
public boolean next() throws DataException {
  if (!this.isFirstNext) {
    return this.doNext();
  }
 else {
    this.isFirstNext=false;
    return this.hasFirstNext;
  }
}
Program: 66482
Project: 66482
Buggy source:
public void moveTo(int rowIndex) throws BirtException {
  this.exprResultSet.moveTo(rowIndex);
}

Fixed version (ground truth):
public void moveTo(int rowIndex) throws BirtException {
  if (rowIndex >= 0) {
    this.isFirstNext=false;
  }
  this.exprResultSet.moveTo(rowIndex);
}
Program: 66483
Project: 66483
Buggy source:
public ResultIterator2(String tempDir,DataEngineContext context,QueryResults queryResults,String queryResultID,String subQueryName,int currParentIndex,int lowestGroupLevel,IBaseQueryDefinition qd) throws DataException {
  super(tempDir,context,queryResults,queryResultID,subQueryName,currParentIndex,qd);
  this.lowestGroupLevel=lowestGroupLevel;
  this.currRowIndex=-1;
}

Fixed version (ground truth):
public ResultIterator2(String tempDir,DataEngineContext context,QueryResults queryResults,String queryResultID,String subQueryName,int currParentIndex,int lowestGroupLevel,IBaseQueryDefinition qd) throws DataException {
  super(tempDir,context,queryResults,queryResultID,subQueryName,currParentIndex,qd);
  this.lowestGroupLevel=lowestGroupLevel;
  if (this.hasFirstNext)   this.currRowIndex=0;
 else   this.currRowIndex=-1;
}
Program: 66484
Project: 66484
Buggy source:
public void moveTo(int rowIndex) throws BirtException {
  if (rowIndex < 0 || rowIndex < this.currRowIndex)   throw new DataException(ResourceConstants.INVALID_ROW_INDEX,Integer.valueOf(rowIndex));
 else   if (rowIndex == currRowIndex)   return;
  int gapRows=rowIndex - currRowIndex;
  for (int i=0; i < gapRows; i++) {
    if (this.next() == false)     throw new DataException(ResourceConstants.INVALID_ROW_INDEX,Integer.valueOf(rowIndex));
  }
}

Fixed version (ground truth):
public void moveTo(int rowIndex) throws BirtException {
  if (rowIndex >= 0) {
    this.isFirstNext=false;
  }
  if (rowIndex < 0 || rowIndex < this.currRowIndex)   throw new DataException(ResourceConstants.INVALID_ROW_INDEX,Integer.valueOf(rowIndex));
 else   if (rowIndex == currRowIndex)   return;
  int gapRows=rowIndex - currRowIndex;
  for (int i=0; i < gapRows; i++) {
    if (this.next() == false)     throw new DataException(ResourceConstants.INVALID_ROW_INDEX,Integer.valueOf(rowIndex));
  }
}
Program: 66486
Project: 66486
Buggy source:
/** 
 * @param level
 * @param filter
 * @return
 * @throws IOException
 * @throws DataException
 */
private static BaseDiskSortedStack find(Level level,ISelection[] filter) throws IOException, DataException {
  IDiskArray indexKeyArray=level.getDiskIndex().find(filter);
  if (indexKeyArray != null) {
    int len=0;
    for (int i=0; i < indexKeyArray.size(); i++) {
      IndexKey key=(IndexKey)indexKeyArray.get(i);
      len+=key.getDimensionPos().length;
    }
    PrimitiveDiskSortedStack resultStack=new PrimitiveDiskSortedStack(len,true,true);
    for (int i=0; i < indexKeyArray.size(); i++) {
      IndexKey key=(IndexKey)indexKeyArray.get(i);
      int[] pos=key.getDimensionPos();
      for (int j=0; j < pos.length; j++) {
        resultStack.push(Integer.valueOf(pos[j]));
      }
    }
    return resultStack;
  }
 else {
    return new PrimitiveDiskSortedStack(1,true,true);
  }
}

Fixed version (ground truth):
/** 
 * @param level
 * @param filter
 * @return
 * @throws IOException
 * @throws DataException
 */
private static BaseDiskSortedStack find(Level level,ISelection[] filter) throws IOException, DataException {
  IDiskArray indexKeyArray=null;
  if (level.getDiskIndex() != null)   indexKeyArray=level.getDiskIndex().find(filter);
  if (indexKeyArray != null) {
    int len=0;
    for (int i=0; i < indexKeyArray.size(); i++) {
      IndexKey key=(IndexKey)indexKeyArray.get(i);
      len+=key.getDimensionPos().length;
    }
    PrimitiveDiskSortedStack resultStack=new PrimitiveDiskSortedStack(len,true,true);
    for (int i=0; i < indexKeyArray.size(); i++) {
      IndexKey key=(IndexKey)indexKeyArray.get(i);
      int[] pos=key.getDimensionPos();
      for (int j=0; j < pos.length; j++) {
        resultStack.push(Integer.valueOf(pos[j]));
      }
    }
    return resultStack;
  }
 else {
    return new PrimitiveDiskSortedStack(1,true,true);
  }
}
Program: 66487
Project: 66487
Buggy source:
public void create(){
  super.create();
  Point pt=getShell().computeSize(-1,-1);
  pt.x=Math.max(pt.x,400);
  pt.y=Math.max(pt.y,200);
  getShell().setSize(pt);
  getShell().setText(getTitle());
}

Fixed version (ground truth):
public void create(){
  super.create();
  Point pt=getShell().computeSize(-1,-1);
  pt.x=Math.max(pt.x,520);
  pt.y=Math.max(pt.y,250);
  getShell().setSize(pt);
  getShell().setText(getTitle());
}
Program: 66488
Project: 66488
Buggy source:
public AdapterException(String errorCode,Throwable cause,Object argv[]){
  super(_pluginId,errorCode,argv,resourceBundle,cause);
}

Fixed version (ground truth):
public AdapterException(String errorCode,Throwable cause,Object argv[]){
  super(_pluginId,errorCode,argv,getResourceBundle(),cause);
}
Program: 66489
Project: 66489
Buggy source:
/** 
 * @param locale
 */
private AdapterResourceHandle(ULocale locale){
  super(locale);
}

Fixed version (ground truth):
/** 
 * @param locale
 */
public AdapterResourceHandle(ULocale locale){
  super(locale);
}
Program: 66490
Project: 66490
Buggy source:
protected boolean updateResultSetSetting() throws SemanticException {
  if (selectResultSetCheckBox == null)   return false;
  if (selectResultSetCheckBox.getSelection()) {
    if (resultSetNumber.getSelection()) {
      ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setResultSetNumber(new Integer(this.numberText));
    }
 else     if (resultSetName.getSelection()) {
      ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setResultSetName(this.nameText);
    }
  }
  if (changed) {
    Iterator it=((DataSetEditor)getContainer()).getHandle().resultSetIterator();
    while (it.hasNext()) {
      it.remove();
    }
  }
  changed=false;
  return true;
}

Fixed version (ground truth):
protected boolean updateResultSetSetting() throws SemanticException {
  if (selectResultSetCheckBox == null)   return false;
  if (selectResultSetCheckBox.getSelection()) {
    if (resultSetNumber.getSelection()) {
      ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setResultSetNumber(new Integer(this.numberText));
    }
 else     if (resultSetName.getSelection()) {
      ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setResultSetName(this.nameText);
    }
  }
  if (changed) {
    Iterator it=((DataSetEditor)getContainer()).getHandle().resultSetIterator();
    while (it.hasNext()) {
      it.next();
      it.remove();
    }
  }
  changed=false;
  return true;
}
Program: 66491
Project: 66491
Buggy source:
public void endNormalContainer(){
  XlsContainer container=getCurrentContainer();
  if (container != null) {
    if (container.isEmpty()) {
      Data data=page.createEmptyData(container.getStyle());
      ContainerSizeInfo containerSize=container.getSizeInfo();
      data.setStartX(containerSize.getStartCoordinate());
      data.setEndX(containerSize.getEndCoordinate());
      addData(data,container);
    }
    engine.applyContainerBottomStyle(container,page);
  }
  containers.pop();
}

Fixed version (ground truth):
public void endNormalContainer(){
  XlsContainer container=getCurrentContainer();
  if (container != null) {
    if (container.isEmpty()) {
      Data data=page.createEmptyData(container.getStyle());
      ContainerSizeInfo containerSize=container.getSizeInfo();
      data.setStartX(containerSize.getStartCoordinate());
      data.setEndX(containerSize.getEndCoordinate());
      addData(data,container);
      if (!(container instanceof XlsCell)) {
        setParentContainerIndex();
      }
    }
    engine.applyContainerBottomStyle(container,page);
  }
  containers.pop();
}
Program: 66492
Project: 66492
Buggy source:
protected static void processForeignData(IForeignContent foreign){
  if (foreign.getChildren() != null && foreign.getChildren().size() > 0) {
    return;
  }
  HashMap styleMap=new HashMap();
  ReportDesignHandle reportDesign=foreign.getReportContent().getDesign().getReportDesign();
  HTMLStyleProcessor htmlProcessor=new HTMLStyleProcessor(reportDesign);
  Object rawValue=foreign.getRawValue();
  Document doc=null;
  if (null != rawValue) {
    doc=new TextParser().parse(foreign.getRawValue().toString(),(String)textTypeMapping.get(foreign.getRawType()));
  }
  Element body=null;
  if (doc != null) {
    Node node=doc.getFirstChild();
    if (node instanceof Element) {
      body=(Element)node;
    }
  }
  if (body != null) {
    htmlProcessor.execute(body,styleMap,foreign.getReportContent().getReportContext() == null ? null : foreign.getReportContent().getReportContext().getAppContext());
    IContainerContent container=foreign.getReportContent().createContainerContent();
    IStyle parentStyle=foreign.getStyle();
    if (CSSValueConstants.INLINE_VALUE.equals(parentStyle.getProperty(IStyle.STYLE_DISPLAY))) {
      container.getStyle().setProperty(IStyle.STYLE_DISPLAY,CSSValueConstants.INLINE_VALUE);
    }
    addChild(foreign,container);
    processNodes(body,styleMap,container,null);
  }
}

Fixed version (ground truth):
protected static void processForeignData(IForeignContent foreign){
  if (foreign.getChildren() != null && foreign.getChildren().size() > 0) {
    return;
  }
  HashMap styleMap=new HashMap();
  ReportDesignHandle reportDesign=foreign.getReportContent().getDesign().getReportDesign();
  HTMLStyleProcessor htmlProcessor=new HTMLStyleProcessor(reportDesign);
  Object rawValue=foreign.getRawValue();
  Document doc=null;
  if (null != rawValue) {
    doc=new TextParser().parse(foreign.getRawValue().toString(),(String)textTypeMapping.get(foreign.getRawType()));
  }
  Element body=null;
  if (doc != null) {
    Node node=doc.getFirstChild();
    if (node instanceof Element) {
      body=(Element)node;
    }
  }
  if (body != null) {
    htmlProcessor.execute(body,styleMap,foreign.getReportContent().getReportContext() == null ? null : foreign.getReportContent().getReportContext().getAppContext());
    IContainerContent container=foreign.getReportContent().createContainerContent();
    IStyle parentStyle=foreign.getStyle();
    if (CSSValueConstants.INLINE_VALUE.equals(parentStyle.getProperty(IStyle.STYLE_DISPLAY))) {
      container.getStyle().setProperty(IStyle.STYLE_DISPLAY,CSSValueConstants.INLINE_VALUE);
    }
    addChild(foreign,container);
    processNodes(body,styleMap,container,null,0);
  }
}
Program: 66494
Project: 66494
Buggy source:
/** 
 * Visits the children nodes of the specific node
 * @param ele the specific node
 * @param needEscape the flag indicating the content needs escaping
 * @param cssStyles
 * @param content the parent content of the element
 */
static void processNodes(Element ele,Map cssStyles,IContent content,ActionContent action){
  int level=0;
  for (Node node=ele.getFirstChild(); node != null; node=node.getNextSibling()) {
    if (node.getNodeName().equals(TAG_VALUEOF)) {
      if (node.getFirstChild() instanceof Element) {
        processNodes((Element)node.getFirstChild(),cssStyles,content,action);
      }
    }
 else     if (node.getNodeName().equals(TAG_IMAGE)) {
      if (node.getFirstChild() instanceof Element) {
        processNodes((Element)node.getFirstChild(),cssStyles,content,action);
      }
    }
 else     if (node.getNodeName().equals(TAG_SCRIPT)) {
      continue;
    }
 else     if (node.getNodeType() == Node.TEXT_NODE) {
      ILabelContent label=createLabel(node.getNodeValue(),content);
      if (action != null) {
        label.setHyperlinkAction(action);
      }
    }
 else     if (node.getNodeType() == Node.ELEMENT_NODE) {
      handleElement((Element)node,cssStyles,content,action,++level);
    }
  }
}

Fixed version (ground truth):
/** 
 * Visits the children nodes of the specific node
 * @param ele the specific node
 * @param needEscape the flag indicating the content needs escaping
 * @param cssStyles
 * @param content the parent content of the element
 */
static void processNodes(Element ele,Map cssStyles,IContent content,ActionContent action,int nestCount){
  int level=0;
  for (Node node=ele.getFirstChild(); node != null; node=node.getNextSibling()) {
    if (node.getNodeName().equals(TAG_VALUEOF)) {
      if (node.getFirstChild() instanceof Element) {
        processNodes((Element)node.getFirstChild(),cssStyles,content,action,nestCount);
      }
    }
 else     if (node.getNodeName().equals(TAG_IMAGE)) {
      if (node.getFirstChild() instanceof Element) {
        processNodes((Element)node.getFirstChild(),cssStyles,content,action,nestCount);
      }
    }
 else     if (node.getNodeName().equals(TAG_SCRIPT)) {
      continue;
    }
 else     if (node.getNodeType() == Node.TEXT_NODE) {
      ILabelContent label=createLabel(node.getNodeValue(),content);
      if (action != null) {
        label.setHyperlinkAction(action);
      }
    }
 else     if (node.getNodeType() == Node.ELEMENT_NODE) {
      handleElement((Element)node,cssStyles,content,action,++level,nestCount);
    }
  }
}
Program: 66495
Project: 66495
Buggy source:
public void processNodes(){
  HTML2Content.processNodes(element,cssStyles,content,action);
}

Fixed version (ground truth):
public void processNodes(){
  HTML2Content.processNodes(element,cssStyles,content,action,0);
}
Program: 66496
Project: 66496
Buggy source:
public ModelDteApiAdapter(ExecutionContext context) throws BirtException {
  this.context=context;
  scriptContext=context.getScriptContext();
  this.jsScope=((IDataScriptEngine)scriptContext.getScriptEngine(IDataScriptEngine.ENGINE_NAME)).getJSScope(scriptContext);
}

Fixed version (ground truth):
public ModelDteApiAdapter(ExecutionContext context) throws BirtException {
  this.context=context;
  this.jsScope=((IDataScriptEngine)context.getScriptContext().getScriptEngine(IDataScriptEngine.ENGINE_NAME)).getJSScope(context.getScriptContext());
}