nus-yam/ex-repair huggingface dataset:
Program: 74067
Project: 74067
Buggy source:
/** 
 * Open the vertical-align box tag if the element needs implementing the vertical-align.
 */
public void handleVerticalAlignBegin(IContent element){
  IStyle style=element.getStyle();
  CSSValue vAlign=style.getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  CSSValue canShrink=style.getProperty(IStyle.STYLE_CAN_SHRINK);
  DimensionType height=element.getHeight();
  if (vAlign != null && vAlign != IStyle.BASELINE_VALUE && height != null && canShrink != IStyle.TRUE_VALUE) {
    writer.openTag(HTMLTags.TAG_TABLE);
    StringBuffer nestingTableStyleBuffer=new StringBuffer();
    nestingTableStyleBuffer.append("String_Node_Str");
    nestingTableStyleBuffer.append(height.toString());
    writer.attribute(HTMLTags.ATTR_STYLE,nestingTableStyleBuffer);
    writer.openTag(HTMLTags.TAG_TR);
    writer.openTag(HTMLTags.TAG_TD);
    StringBuffer textStyleBuffer=new StringBuffer();
    textStyleBuffer.append("String_Node_Str");
    textStyleBuffer.append(vAlign.getCssText());
    textStyleBuffer.append("String_Node_Str");
    writer.attribute(HTMLTags.ATTR_STYLE,textStyleBuffer);
  }
}

Fixed version (ground truth):
/** 
 * Open the vertical-align box tag if the element needs implementing the vertical-align.
 */
public void handleVerticalAlignBegin(IContent element){
  IStyle style=element.getStyle();
  CSSValue vAlign=style.getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  CSSValue canShrink=style.getProperty(IStyle.STYLE_CAN_SHRINK);
  DimensionType height=element.getHeight();
  if (vAlign != null && vAlign != IStyle.BASELINE_VALUE && height != null && canShrink != IStyle.TRUE_VALUE) {
    writer.openTag(HTMLTags.TAG_TABLE);
    StringBuffer nestingTableStyleBuffer=new StringBuffer();
    nestingTableStyleBuffer.append("String_Node_Str");
    nestingTableStyleBuffer.append(height.toString());
    writer.attribute(HTMLTags.ATTR_STYLE,nestingTableStyleBuffer.toString());
    writer.openTag(HTMLTags.TAG_TR);
    writer.openTag(HTMLTags.TAG_TD);
    StringBuffer textStyleBuffer=new StringBuffer();
    textStyleBuffer.append("String_Node_Str");
    textStyleBuffer.append(vAlign.getCssText());
    textStyleBuffer.append("String_Node_Str");
    writer.attribute(HTMLTags.ATTR_STYLE,textStyleBuffer.toString());
  }
}
Program: 74126
Project: 74126
Buggy source:
public CubeAggregationTest(){
  pathName=System.getProperty("String_Node_Str");
  try {
    documentManager=DocumentManagerFactory.createFileDocumentManager();
    createCube1();
    this.baseScope=new ImporterTopLevel();
  }
 catch (  DataException e) {
    fail();
  }
catch (  IOException e) {
    fail();
  }
catch (  BirtException e) {
    fail();
  }
}

Fixed version (ground truth):
public CubeAggregationTest(){
  pathName=System.getProperty("String_Node_Str");
  this.baseScope=new ImporterTopLevel();
}
Program: 74127
Project: 74127
Buggy source:
public void setUp() throws Exception {
  Context.enter();
  createCube1QueryDefn();
  super.setUp();
}

Fixed version (ground truth):
public void setUp() throws Exception {
  DataEngineImpl engine=(DataEngineImpl)DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null));
  materializer=new CubeMaterializer(engine);
  documentManager=materializer.getDocumentManager();
  createCube1(documentManager);
  Context.enter();
  createCube1QueryDefn();
  super.setUp();
}
Program: 74128
Project: 74128
Buggy source:
/** 
 * test aggregation using random access document manager. 
 * @throws IOException
 * @throws BirtException
 */
public void testRAAggregation1() throws IOException, BirtException {
  CubeMaterializer materializer=new CubeMaterializer(null);
  IDocumentManager localDocManager=materializer.getDocumentManager();
  IDocumentManager oldManager=documentManager;
  documentManager=localDocManager;
  createCube1();
  testCube1Aggregation();
  IDocArchiveWriter writer=createRAWriter();
  materializer.saveCubeToReportDocument("String_Node_Str",writer,new StopSign());
  writer.flush();
  writer.finish();
  documentManager=createRADocumentManager();
  testCube1Aggregation();
  documentManager.close();
  documentManager=oldManager;
}

Fixed version (ground truth):
/** 
 * test aggregation using random access document manager. 
 * @throws IOException
 * @throws BirtException
 */
public void testRAAggregation1() throws IOException, BirtException {
  IDocArchiveWriter writer=createRAWriter();
  materializer.saveCubeToReportDocument("String_Node_Str",writer,new StopSign());
  writer.flush();
  writer.finish();
  documentManager=createRADocumentManager();
  testCube1Aggregation();
  documentManager.close();
}
Program: 74129
Project: 74129
Buggy source:
protected void tearDown() throws Exception {
  Context.exit();
  super.tearDown();
}

Fixed version (ground truth):
protected void tearDown() throws Exception {
  Context.exit();
  documentManager.close();
  super.tearDown();
}
Program: 74130
Project: 74130
Buggy source:
/** 
 * @param initialCapacity
 */
public BasicCachedArray(int initialCapacity){
  if (initialCapacity < 0)   throw new IllegalArgumentException("String_Node_Str" + initialCapacity);
  this.cachedList=new BasicCachedList();
  this.initialCapacity=initialCapacity;
}

Fixed version (ground truth):
/** 
 * @param initialCapacity
 */
public BasicCachedArray(String tempDir,int initialCapacity){
  if (initialCapacity < 0)   throw new IllegalArgumentException("String_Node_Str" + initialCapacity);
  this.cachedList=new BasicCachedList(tempDir);
  this.initialCapacity=initialCapacity;
}
Program: 74131
Project: 74131
Buggy source:
/** 
 * @param list
 */
public BasicCachedList(List list){
  this();
  if (list == null)   return;
  for (int i=0; i < list.size(); i++) {
    this.add(list.get(i));
  }
}

Fixed version (ground truth):
/** 
 * @param list
 */
public BasicCachedList(String tempDir,List list){
  this(tempDir);
  if (list == null)   return;
  for (int i=0; i < list.size(); i++) {
    this.add(list.get(i));
  }
}
Program: 74132
Project: 74132
Buggy source:
/** 
 * Create a file for caching objects.
 * @param cacheIndex
 * @return
 */
private File getCacheFile(int cacheIndex){
  String tempDirStr=DataEngineContextExt.getInstance().getTmpdir() + File.separatorChar + this.fileNamePrefix;
  if (dir == null) {
    dir=new File(tempDirStr);
    dir.mkdir();
  }
  return new File(tempDirStr + File.separatorChar + cacheIndex+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Create a file for caching objects.
 * @param cacheIndex
 * @return
 */
private File getCacheFile(int cacheIndex){
  String tempDirStr=tempDir + this.fileNamePrefix;
  if (dir == null) {
    dir=new File(tempDirStr);
    dir.mkdir();
  }
  return new File(tempDirStr + File.separatorChar + cacheIndex+ "String_Node_Str");
}
Program: 74133
Project: 74133
Buggy source:
/** 
 * @param list
 */
public CachedList(ICachedObjectCreator creator,List list){
  super(list);
  this.creator=creator;
}

Fixed version (ground truth):
/** 
 * @param list
 */
public CachedList(String tempDir,ICachedObjectCreator creator,List list){
  super(tempDir,list);
  this.creator=creator;
}
Program: 74134
Project: 74134
Buggy source:
/** 
 * @param columnName
 * @return
 * @throws DataException
 */
private Object getValue(String columnName) throws DataException {
  return ri.getCurrentResult().getFieldValue(columnName);
}

Fixed version (ground truth):
/** 
 * @param columnName
 * @return
 * @throws DataException
 */
private Object getValue(String columnName) throws DataException {
  if (ri.getCurrentResult() == null)   return null;
  return ri.getCurrentResult().getFieldValue(columnName);
}
Program: 74135
Project: 74135
Buggy source:
public boolean next() throws BirtException {
  checkStarted();
  clear();
  boolean hasNext=false;
  if (state == BEFORE_FIRST_ROW) {
    state=ON_ROW;
    hasNext=odiResult.getCurrentResult() != null;
  }
 else {
    hasNext=hasNextRow();
  }
  if (hasNext)   this.prepareCurrentRow();
  if (!hasNext)   state=AFTER_LAST_ROW;
  return hasNext;
}

Fixed version (ground truth):
public boolean next() throws BirtException {
  checkStarted();
  clear();
  if (this.isEmpty()) {
    if (this.isFirstRowPepared) {
      this.lastRowIndex=odiResult.getCurrentResultIndex() - 1;
      this.prepareCurrentRow();
      this.isFirstRowPepared=false;
    }
    return false;
  }
  boolean hasNext=false;
  if (state == BEFORE_FIRST_ROW) {
    state=ON_ROW;
    hasNext=odiResult.getCurrentResult() != null;
  }
 else {
    hasNext=hasNextRow();
  }
  if (hasNext)   this.prepareCurrentRow();
  if (!hasNext)   state=AFTER_LAST_ROW;
  return hasNext;
}
Program: 74136
Project: 74136
Buggy source:
public void close() throws BirtException {
  if (state == CLOSED)   return;
  if (this.getRdSaveHelper().needsSaveToDoc()) {
    if (this.isEmpty()) {
      lastRowIndex=odiResult.getCurrentResultIndex() - 1;
      this.prepareCurrentRow();
    }
 else {
      while (this.next())       ;
    }
    this.getRdSaveHelper().doSaveFinish();
  }
  if (needCache()) {
    while (this.next()) {
    }
    closeCacheOutputStream();
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  state=CLOSED;
  logger.logp(Level.FINE,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void close() throws BirtException {
  if (state == CLOSED)   return;
  if (this.getRdSaveHelper().needsSaveToDoc()) {
    while (this.next())     ;
    this.getRdSaveHelper().doSaveFinish();
  }
  if (needCache()) {
    while (this.next()) {
    }
    closeCacheOutputStream();
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  state=CLOSED;
  logger.logp(Level.FINE,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}
Program: 74137
Project: 74137
Buggy source:
public void close() throws BirtException {
  if (state == CLOSED)   return;
  if (this.getRdSaveHelper().needsSaveToDoc()) {
    if (this.isEmpty()) {
      lastRowIndex=-1;
      this.prepareCurrentRow();
    }
 else {
      while (this.next())       ;
    }
    this.getRdSaveHelper().doSaveFinish();
  }
  if (needCache()) {
    while (this.next()) {
    }
    closeCacheOutputStream();
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  state=CLOSED;
  logger.logp(Level.FINE,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void close() throws BirtException {
  if (state == CLOSED)   return;
  if (this.getRdSaveHelper().needsSaveToDoc()) {
    if (this.isEmpty()) {
      lastRowIndex=odiResult.getCurrentResultIndex() - 1;
      this.prepareCurrentRow();
    }
 else {
      while (this.next())       ;
    }
    this.getRdSaveHelper().doSaveFinish();
  }
  if (needCache()) {
    while (this.next()) {
    }
    closeCacheOutputStream();
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  state=CLOSED;
  logger.logp(Level.FINE,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}
Program: 74139
Project: 74139
Buggy source:
public void prepare(String command) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str" + command + "String_Node_Str");
  try {
    if (command == null) {
      logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
      throw new OdaException("String_Node_Str");
    }
    procedureName=getProcedureName(command);
    this.callStat=conn.prepareCall(command);
    this.cachedResultMetaData=null;
    this.cachedResultSet=null;
    this.cachedParameterMetaData=null;
    paramUtil=new SPParameterPositionUtil(command,'@');
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.STATEMENT_CANNOT_PREPARE,e);
  }
}

Fixed version (ground truth):
public void prepare(String command) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str" + command + "String_Node_Str");
  try {
    if (command == null) {
      logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
      throw new OdaException("String_Node_Str");
    }
    paramUtil=new SPParameterPositionUtil(command,'@');
    this.callStat=conn.prepareCall(command);
    this.cachedResultMetaData=null;
    this.cachedResultSet=null;
    this.cachedParameterMetaData=null;
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.STATEMENT_CANNOT_PREPARE,e);
  }
}
Program: 74141
Project: 74141
Buggy source:
/** 
 * put sqlText to char array
 * @param sqlTxt
 * @param escaper
 * @return
 * @throws OdaException
 */
private String getParameterDefinitionChars(String sqlTxt) throws OdaException {
  char[] temp=sqlTxt.toCharArray();
  int startPoint=-1;
  int endPoint=-1;
  boolean validBracket=true;
  for (int i=0; i < temp.length; i++) {
    if (i > 0 && temp[i - 1] == escaper)     continue;
    if (validBracket) {
      if ('(' == temp[i]) {
        startPoint=i;
        break;
      }
    }
    if ('"' == temp[i]) {
      validBracket=!validBracket;
    }
  }
  for (int i=temp.length - 1; i >= 0; i--) {
    if (i > 0 && temp[i - 1] == escaper)     continue;
    if (validBracket) {
      if (')' == temp[i]) {
        endPoint=i;
        break;
      }
    }
    if ('"' == temp[i]) {
      validBracket=!validBracket;
    }
  }
  if (startPoint == -1 && endPoint == -1)   return "String_Node_Str";
 else   if (startPoint >= endPoint || startPoint == -1)   throw new JDBCException(ResourceConstants.INVALID_STORED_PRECEDURE,ResourceConstants.ERROR_INVALID_STATEMENT);
  return sqlTxt.substring(startPoint + 1,endPoint);
}

Fixed version (ground truth):
/** 
 * put sqlText to char array
 * @param sqlTxt
 * @param escaper
 * @return
 * @throws OdaException
 */
private String getParameterDefinitionChars(String sqlTxt,int[] point) throws OdaException {
  int startPoint=point[0];
  int endPoint=point[1];
  if (startPoint == -1 && endPoint == -1)   return "String_Node_Str";
 else   if (startPoint >= endPoint || startPoint == -1)   throw new JDBCException(ResourceConstants.INVALID_STORED_PRECEDURE,ResourceConstants.ERROR_INVALID_STATEMENT);
  return sqlTxt.substring(startPoint + 1,endPoint);
}
Program: 74142
Project: 74142
Buggy source:
/** 
 * @param sqlTxt
 * @param escaper
 * @throws OdaException
 */
public SPParameterPositionUtil(String sqlTxt,char escaper) throws OdaException {
  try {
    this.escaper=escaper;
    String paramTxt=getParameterDefinitionChars(sqlTxt);
    parseQueryText(paramTxt);
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * @param sqlTxt
 * @param escaper
 * @throws OdaException
 */
public SPParameterPositionUtil(String sqlTxt,char escaper) throws OdaException {
}
Program: 74143
Project: 74143
Buggy source:
public boolean test(Object receiver,String property,Object[] args,Object expectedValue){
  if ("String_Node_Str".equals(property)) {
    if (receiver instanceof ExtendedItemHandle) {
      String extensionName=expectedValue.toString();
      return extensionName.equals(((ExtendedItemHandle)receiver).getExtensionName());
    }
  }
 else   if ("String_Node_Str".equals(property)) {
    if (receiver instanceof ExtendedItemHandle) {
      DesignElementHandle container=((ExtendedItemHandle)receiver).getContainer();
      String containerName=expectedValue.toString();
      return container.getDefn().getName().equals(containerName);
    }
  }
 else   if ("String_Node_Str".equals(property)) {
    if (receiver instanceof ExtendedItemHandle) {
      PropertyHandle container=((ExtendedItemHandle)receiver).getContainerPropertyHandle();
      if (container == null)       return false;
      String containerName=expectedValue.toString();
      return container.getDefn().getName().equals(containerName);
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean test(Object receiver,String property,Object[] args,Object expectedValue){
  if ("String_Node_Str".equals(property)) {
    if (receiver instanceof ExtendedItemHandle) {
      String extensionName=expectedValue.toString();
      return extensionName.equals(((ExtendedItemHandle)receiver).getExtensionName());
    }
  }
 else   if ("String_Node_Str".equals(property)) {
    if (receiver instanceof ExtendedItemHandle) {
      DesignElementHandle container=((ExtendedItemHandle)receiver).getContainer();
      if (container == null)       return false;
      String containerName=expectedValue.toString();
      return container.getDefn().getName().equals(containerName);
    }
  }
 else   if ("String_Node_Str".equals(property)) {
    if (receiver instanceof ExtendedItemHandle) {
      PropertyHandle container=((ExtendedItemHandle)receiver).getContainerPropertyHandle();
      if (container == null)       return false;
      String containerName=expectedValue.toString();
      return container.getDefn().getName().equals(containerName);
    }
  }
  return false;
}
Program: 74144
Project: 74144
Buggy source:
public BlankResultSet(){
}

Fixed version (ground truth):
public BlankResultSet(IQueryResultSet rset){
  this.rset=rset;
}
Program: 74145
Project: 74145
Buggy source:
public void close(){
}

Fixed version (ground truth):
public void close(){
  if (rset != null) {
    rset.close();
  }
}
Program: 74146
Project: 74146
Buggy source:
/** 
 * Execute a listint and create the contents. List create a serials of contents. The execution process is: <li> create an container which will contain all the contents it creates. <li> push it into the stack <li> open query <li> process action, bookmark, style and visibility <li> call the onCreate if necessary <li> call emitter to start the list <li> access the query <li> call emitter to end the list <li> close the query. <li> pop up the container.
 * @see org.eclipse.birt.report.engine.executor.ReportItemExecutor#load(org.eclipse.birt.report.engine.ir.ReportItemDesign,org.eclipse.birt.report.engine.emitter.IReportEmitter)
 */
public IContent execute(){
  ListItemDesign listDesign=(ListItemDesign)getDesign();
  IListContent listContent=report.createListContent();
  setContent(listContent);
  executeQuery();
  initializeContent(listDesign,listContent);
  processAction(listDesign,listContent);
  processBookmark(listDesign,listContent);
  processStyle(listDesign,listContent);
  processVisibility(listDesign,listContent);
  if (context.isInFactory()) {
    handleOnCreate(listContent);
  }
  startTOCEntry(listContent);
  if (rsetEmpty) {
    processEmptyQuery();
  }
  prepareToExecuteChildren();
  return listContent;
}

Fixed version (ground truth):
/** 
 * Execute a listint and create the contents. List create a serials of contents. The execution process is: <li> create an container which will contain all the contents it creates. <li> push it into the stack <li> open query <li> process action, bookmark, style and visibility <li> call the onCreate if necessary <li> call emitter to start the list <li> access the query <li> call emitter to end the list <li> close the query. <li> pop up the container.
 * @see org.eclipse.birt.report.engine.executor.ReportItemExecutor#load(org.eclipse.birt.report.engine.ir.ReportItemDesign,org.eclipse.birt.report.engine.emitter.IReportEmitter)
 */
public IContent execute(){
  ListItemDesign listDesign=(ListItemDesign)getDesign();
  IListContent listContent=report.createListContent();
  setContent(listContent);
  executeQuery();
  initializeContent(listDesign,listContent);
  processAction(listDesign,listContent);
  processBookmark(listDesign,listContent);
  processStyle(listDesign,listContent);
  processVisibility(listDesign,listContent);
  if (context.isInFactory()) {
    handleOnCreate(listContent);
  }
  startTOCEntry(listContent);
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
  prepareToExecuteChildren();
  return listContent;
}
Program: 74147
Project: 74147
Buggy source:
protected void createQueryForShowIfBlank(){
  IQueryResultSet blankRset=new BlankResultSet();
  rset=blankRset;
  context.setResultSet(rset);
  rsetEmpty=false;
}

Fixed version (ground truth):
protected void createQueryForShowIfBlank(){
  IQueryResultSet blankRset=new BlankResultSet(rset);
  rset=blankRset;
  context.setResultSet(rset);
  rsetEmpty=false;
}
Program: 74148
Project: 74148
Buggy source:
public IContent execute(){
  TableItemDesign tableDesign=(TableItemDesign)getDesign();
  ITableContent tableContent=report.createTableContent();
  setContent(tableContent);
  executeQuery();
  initializeContent(tableDesign,tableContent);
  processStyle(tableDesign,tableContent);
  processVisibility(tableDesign,tableContent);
  processBookmark(tableDesign,tableContent);
  processAction(tableDesign,tableContent);
  for (int i=0; i < tableDesign.getColumnCount(); i++) {
    ColumnDesign columnDesign=tableDesign.getColumn(i);
    Column column=new Column(report);
    column.setGenerateBy(columnDesign);
    InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
    column.setInstanceID(iid);
    processColumnVisibility(columnDesign,column);
    tableContent.addColumn(column);
  }
  if (context.isInFactory()) {
    handleOnCreate(tableContent);
  }
  startTOCEntry(tableContent);
  if (rsetEmpty) {
    processEmptyQuery();
  }
  prepareToExecuteChildren();
  return tableContent;
}

Fixed version (ground truth):
public IContent execute(){
  TableItemDesign tableDesign=(TableItemDesign)getDesign();
  ITableContent tableContent=report.createTableContent();
  setContent(tableContent);
  executeQuery();
  initializeContent(tableDesign,tableContent);
  processStyle(tableDesign,tableContent);
  processVisibility(tableDesign,tableContent);
  processBookmark(tableDesign,tableContent);
  processAction(tableDesign,tableContent);
  for (int i=0; i < tableDesign.getColumnCount(); i++) {
    ColumnDesign columnDesign=tableDesign.getColumn(i);
    Column column=new Column(report);
    column.setGenerateBy(columnDesign);
    InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
    column.setInstanceID(iid);
    processColumnVisibility(columnDesign,column);
    tableContent.addColumn(column);
  }
  if (context.isInFactory()) {
    handleOnCreate(tableContent);
  }
  startTOCEntry(tableContent);
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
  prepareToExecuteChildren();
  return tableContent;
}
Program: 74149
Project: 74149
Buggy source:
protected void doExecute() throws Exception {
  executeQuery();
  if (rsetEmpty) {
    processEmptyQuery();
  }
}

Fixed version (ground truth):
protected void doExecute() throws Exception {
  executeQuery();
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
}
Program: 74150
Project: 74150
Buggy source:
protected void createQueryForShowIfBlank(){
  IBaseResultSet[] blankRsets=new IBaseResultSet[1];
  blankRsets[0]=new BlankResultSet();
  rsets=blankRsets;
  context.setResultSets(rsets);
  rsetEmpty=false;
}

Fixed version (ground truth):
protected void createQueryForShowIfBlank(){
  IBaseResultSet[] blankRsets=new IBaseResultSet[1];
  blankRsets[0]=new BlankResultSet((IQueryResultSet)rsets[0]);
  rsets=blankRsets;
  context.setResultSets(rsets);
  rsetEmpty=false;
}
Program: 74151
Project: 74151
Buggy source:
protected void doExecute() throws Exception {
  TableItemDesign tableDesign=(TableItemDesign)design;
  ITableContent tableContent=(ITableContent)content;
  executeQuery();
  if (tableContent.getColumnCount() == 0) {
    for (int i=0; i < tableDesign.getColumnCount(); i++) {
      ColumnDesign columnDesign=tableDesign.getColumn(i);
      Column column=new Column(report);
      column.setGenerateBy(columnDesign);
      InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
      column.setInstanceID(iid);
      tableContent.addColumn(column);
    }
  }
 else {
    int columnCount=tableContent.getColumnCount();
    for (int i=0; i < columnCount; i++) {
      Column column=(Column)tableContent.getColumn(i);
      InstanceID iid=column.getInstanceID();
      if (iid != null) {
        long componentId=iid.getComponentID();
        ReportElementDesign element=report.getDesign().getReportItemByID(componentId);
        column.setGenerateBy(element);
      }
    }
  }
  if (rsetEmpty) {
    processEmptyQuery();
  }
}

Fixed version (ground truth):
protected void doExecute() throws Exception {
  TableItemDesign tableDesign=(TableItemDesign)design;
  ITableContent tableContent=(ITableContent)content;
  executeQuery();
  if (tableContent.getColumnCount() == 0) {
    for (int i=0; i < tableDesign.getColumnCount(); i++) {
      ColumnDesign columnDesign=tableDesign.getColumn(i);
      Column column=new Column(report);
      column.setGenerateBy(columnDesign);
      InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
      column.setInstanceID(iid);
      tableContent.addColumn(column);
    }
  }
 else {
    int columnCount=tableContent.getColumnCount();
    for (int i=0; i < columnCount; i++) {
      Column column=(Column)tableContent.getColumn(i);
      InstanceID iid=column.getInstanceID();
      if (iid != null) {
        long componentId=iid.getComponentID();
        ReportElementDesign element=report.getDesign().getReportItemByID(componentId);
        column.setGenerateBy(element);
      }
    }
  }
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
}
Program: 74152
Project: 74152
Buggy source:
/** 
 * Only check the result of the expectedValue of the result set
 * @param it
 * @param ri
 * @throws DataException
 * @throws BirtException
 */
private void checkResult(IResultIterator ri) throws BirtException {
  Iterator it=this.expectedValue.iterator();
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < rowBeArray.length; i++) {
      Object ob1=it.next();
      Object ob2=ri.getValue(rowBeNames[i]);
      assertEquals(ob1,ob2);
      str+="String_Node_Str" + ob2.toString();
    }
    if (totalBeArray != null) {
      for (int i=0; i < totalBeArray.length; i++) {
        Object ob1=it.next();
        Object ob2=ri.getValue(totalBeNames[i]);
        assertEquals(ob1,ob2);
        str+="String_Node_Str" + ob2.toString();
      }
    }
    System.out.println("String_Node_Str" + str);
  }
}

Fixed version (ground truth):
/** 
 * Only check the result of the expectedValue of the result set
 * @param data.it
 * @param ri
 * @throws DataException
 * @throws BirtException
 */
private void checkResult(IResultIterator ri) throws BirtException {
  Iterator it=this.expectedValue.iterator();
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < rowBeArray.length; i++) {
      Object ob1=it.next();
      Object ob2=ri.getValue(rowBeNames[i]);
      assertEquals(ob1,ob2);
      str+="String_Node_Str" + ob2.toString();
    }
    if (totalBeArray != null) {
      for (int i=0; i < totalBeArray.length; i++) {
        Object ob1=it.next();
        Object ob2=ri.getValue(totalBeNames[i]);
        assertEquals(ob1,ob2);
        str+="String_Node_Str" + ob2.toString();
      }
    }
    System.out.println("String_Node_Str" + str);
  }
}
Program: 74153
Project: 74153
Buggy source:
/** 
 * Only check the result of the expectedValue of the result set
 * @param it
 * @param ri
 * @throws DataException
 * @throws BirtException
 */
private void checkResult1(IResultIterator ri) throws BirtException {
  Iterator it=this.expectedValue.iterator();
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++) {
      Object ob1=it.next();
      Object ob2=ri.getValue(this.rowExprName[i]);
      assertEquals(ob1,ob2);
      str+="String_Node_Str" + ob2.toString();
    }
    if (totalExprName != null) {
      for (int i=0; i < totalExprName.length; i++) {
        Object ob1=it.next();
        Object ob2=ri.getValue(this.totalExprName[i]);
        assertEquals(ob1,ob2);
        str+="String_Node_Str" + ob2.toString();
      }
    }
    System.out.println("String_Node_Str" + str);
  }
}

Fixed version (ground truth):
/** 
 * Only check the result of the expectedValue of the result set
 * @param data.it
 * @param ri
 * @throws DataException
 * @throws BirtException
 */
private void checkResult1(IResultIterator ri) throws BirtException {
  Iterator it=this.expectedValue.iterator();
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++) {
      Object ob1=it.next();
      Object ob2=ri.getValue(this.rowExprName[i]);
      assertEquals(ob1,ob2);
      str+="String_Node_Str" + ob2.toString();
    }
    if (totalExprName != null) {
      for (int i=0; i < totalExprName.length; i++) {
        Object ob1=it.next();
        Object ob2=ri.getValue(this.totalExprName[i]);
        assertEquals(ob1,ob2);
        str+="String_Node_Str" + ob2.toString();
      }
    }
    System.out.println("String_Node_Str" + str);
  }
}
Program: 74154
Project: 74154
Buggy source:
/** 
 * Only check the result of the expectedValue of the result set
 * @param it
 * @param ri
 * @throws DataException
 * @throws BirtException
 */
private void checkResult(IResultIterator ri) throws BirtException {
  Iterator it=this.expectedValue.iterator();
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < bindingNameRow.length; i++) {
      Object ob1=it.next();
      Object ob2=ri.getValue(bindingNameRow[i]);
      assertEquals(ob1,ob2);
      str+="String_Node_Str" + ob2.toString();
    }
    if (totalBeArray != null) {
      for (int i=0; i < bindingExprRow.length; i++) {
        Object ob1=it.next();
        Object ob2=ri.getValue(bindingExprRow[i]);
        assertEquals(ob1,ob2);
        str+="String_Node_Str" + ob2.toString();
      }
    }
    System.out.println("String_Node_Str" + str);
  }
}

Fixed version (ground truth):
/** 
 * Only check the result of the expectedValue of the result set
 * @param data.it
 * @param ri
 * @throws DataException
 * @throws BirtException
 */
private void checkResult(IResultIterator ri) throws BirtException {
  Iterator it=this.expectedValue.iterator();
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < bindingNameRow.length; i++) {
      Object ob1=it.next();
      Object ob2=ri.getValue(bindingNameRow[i]);
      assertEquals(ob1,ob2);
      str+="String_Node_Str" + ob2.toString();
    }
    if (totalBeArray != null) {
      for (int i=0; i < bindingExprRow.length; i++) {
        Object ob1=it.next();
        Object ob2=ri.getValue(bindingExprRow[i]);
        assertEquals(ob1,ob2);
        str+="String_Node_Str" + ob2.toString();
      }
    }
    System.out.println("String_Node_Str" + str);
  }
}
Program: 74155
Project: 74155
Buggy source:
/** 
 * Only check the result of the expectedValue of the result set
 * @param it
 * @param ri
 * @throws DataException
 * @throws BirtException
 */
private void checkResult1(IResultIterator ri) throws BirtException {
  Iterator it=this.expectedValue.iterator();
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++) {
      Object ob1=it.next();
      Object ob2=ri.getValue(this.rowExprName[i]);
      assertEquals(ob1,ob2);
      str+="String_Node_Str" + ob2.toString();
    }
    if (totalExprName != null) {
      for (int i=0; i < totalExprName.length; i++) {
        Object ob1=it.next();
        Object ob2=ri.getValue(this.totalExprName[i]);
        assertEquals(ob1,ob2);
        str+="String_Node_Str" + ob2.toString();
      }
    }
    System.out.println("String_Node_Str" + str);
  }
}

Fixed version (ground truth):
/** 
 * Only check the result of the expectedValue of the result set
 * @param data.it
 * @param ri
 * @throws DataException
 * @throws BirtException
 */
private void checkResult1(IResultIterator ri) throws BirtException {
  Iterator it=this.expectedValue.iterator();
  while (ri.next()) {
    String str="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++) {
      Object ob1=it.next();
      Object ob2=ri.getValue(this.rowExprName[i]);
      assertEquals(ob1,ob2);
      str+="String_Node_Str" + ob2.toString();
    }
    if (totalExprName != null) {
      for (int i=0; i < totalExprName.length; i++) {
        Object ob1=it.next();
        Object ob2=ri.getValue(this.totalExprName[i]);
        assertEquals(ob1,ob2);
        str+="String_Node_Str" + ob2.toString();
      }
    }
    System.out.println("String_Node_Str" + str);
  }
}
Program: 74156
Project: 74156
Buggy source:
public void close() throws BirtException {
  if (state == NOT_STARTED || state == CLOSED)   return;
  if (this.getRdSaveHelper().needsSaveToDoc()) {
    while (this.next())     ;
    this.getRdSaveHelper().doSaveFinish();
  }
  if (needCache()) {
    while (this.next()) {
    }
    closeCacheOutputStream();
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  state=CLOSED;
  logger.logp(Level.FINE,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void close() throws BirtException {
  if (state == CLOSED)   return;
  if (this.getRdSaveHelper().needsSaveToDoc()) {
    if (this.isEmpty()) {
      lastRowIndex=-1;
      this.prepareCurrentRow();
    }
 else {
      while (this.next())       ;
    }
    this.getRdSaveHelper().doSaveFinish();
  }
  if (needCache()) {
    while (this.next()) {
    }
    closeCacheOutputStream();
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  state=CLOSED;
  logger.logp(Level.FINE,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}
Program: 74157
Project: 74157
Buggy source:
private QueryDefinition createQueryDefinition(DataSetHandle dataSet){
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(dataSet.getName());
  queryDefn.setAutoBinding(true);
  return queryDefn;
}

Fixed version (ground truth):
private QueryDefinition createQueryDefinition(DataSetHandle dataSet){
  QueryDefinition queryDefn=new QueryDefinition();
  queryDefn.setDataSetName(dataSet.getQualifiedName());
  queryDefn.setAutoBinding(true);
  return queryDefn;
}
Program: 74160
Project: 74160
Buggy source:
/** 
 * @param schemaName
 */
private void getSpecificSchema(String schemaName){
  if (!isPageInitialization) {
    if (schemaName.equals(JdbcPlugin.getResourceString("String_Node_Str")) || schemaName.trim().length() == 0) {
      getAvailableSchema();
      setMessage(DEFAULT_MESSAGE);
      return;
    }
    if (containsTableInSchema(schemaName)) {
      schemaList=new ArrayList();
      schemaList.add(schemaName);
      setMessage(DEFAULT_MESSAGE);
    }
 else {
      schemaList=null;
      setMessage(JdbcPlugin.getResourceString("String_Node_Str"),WARNING);
    }
  }
 else {
    isPageInitialization=!isPageInitialization;
  }
}

Fixed version (ground truth):
/** 
 * @param schemaName
 */
private void getSpecificSchema(String schemaName){
  if (!isPageInitialization) {
    if (schemaName.equals(JdbcPlugin.getResourceString("String_Node_Str")) || schemaName.trim().length() == 0) {
      getAvailableSchema();
      setMessage(DEFAULT_MESSAGE);
      return;
    }
    if (containsTableInSchema(schemaName,false)) {
      schemaList=new ArrayList();
      schemaList.add(schemaName);
      setMessage(DEFAULT_MESSAGE);
    }
 else {
      schemaList=null;
      setMessage(JdbcPlugin.getResourceString("String_Node_Str"),WARNING);
    }
  }
 else {
    isPageInitialization=!isPageInitialization;
  }
}
Program: 74161
Project: 74161
Buggy source:
/** 
 * @param schemaName
 * @return
 */
private boolean containsTableInSchema(String schemaName){
  ResultSet rs=metaDataProvider.getAlltables(metaDataProvider.getCatalog(),schemaName,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"});
  boolean hasNonSystemTable=false;
  if (rs != null) {
    try {
      while (rs.next()) {
        if (!"String_Node_Str".equalsIgnoreCase(rs.getString("String_Node_Str"))) {
          hasNonSystemTable=true;
          break;
        }
      }
    }
 catch (    SQLException e) {
      logger.log(Level.FINE,e.getMessage(),e);
    }
  }
  if (hasNonSystemTable) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * @param schemaName
 * @return
 */
private boolean containsTableInSchema(String schemaName,boolean showSystemTable){
  String[] tableTypes=showSystemTable ? new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"} : new String[]{"String_Node_Str","String_Node_Str"};
  ResultSet rs=metaDataProvider.getAlltables(metaDataProvider.getCatalog(),schemaName,"String_Node_Str",tableTypes);
  if (rs != null) {
    try {
      while (rs.next()) {
        return true;
      }
    }
 catch (    SQLException e) {
      logger.log(Level.FINE,e.getMessage(),e);
    }
  }
  return false;
}
Program: 74163
Project: 74163
Buggy source:
public void widgetSelected(SelectionEvent event){
  PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
    public void run(){
      populateAvailableDbObjects();
    }
  }
);
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  if (getSelectedDbType().equals(DbType.ALL_STRING) || getSelectedDbType().equals(DbType.TABLE_STRING)) {
    showSystemTableCheckBox.setEnabled(true);
  }
 else {
    showSystemTableCheckBox.setEnabled(false);
  }
}
Program: 74165
Project: 74165
Buggy source:
private List getPages(boolean fitToPage,boolean pagebreakPaginationOnly) throws EngineException {
  String designFile="String_Node_Str";
  IReportRunnable report=openReportDesign(designFile);
  List pageAreas=new ArrayList();
  IEmitterMonitor monitor=new PageMonitor(pageAreas);
  IRunAndRenderTask runAndRenderTask=new TestRunAndRenderTask(engine,report,monitor);
  PDFRenderOption options=createRenderOption();
  options.setOption(IPDFRenderOption.FIT_TO_PAGE,new Boolean(fitToPage));
  options.setOption(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY,new Boolean(pagebreakPaginationOnly));
  runAndRenderTask.setRenderOption(options);
  runAndRenderTask.run();
  runAndRenderTask.close();
  return pageAreas;
}

Fixed version (ground truth):
private List getPages(boolean fitToPage,boolean pagebreakPaginationOnly) throws EngineException {
  String designFile="String_Node_Str";
  IReportRunnable report=openReportDesign(designFile);
  List pageAreas=new ArrayList();
  IEmitterMonitor monitor=new PageMonitor(pageAreas);
  IRunAndRenderTask runAndRenderTask=new TestRunAndRenderTask(engine,report,monitor);
  PDFRenderOption options=createRenderOption();
  if (fitToPage) {
    options.setOption(IPDFRenderOption.PAGE_OVERFLOW,new Integer(IPDFRenderOption.FIT_TO_PAGE_SIZE));
  }
  options.setOption(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY,new Boolean(pagebreakPaginationOnly));
  runAndRenderTask.setRenderOption(options);
  runAndRenderTask.run();
  runAndRenderTask.close();
  return pageAreas;
}
Program: 74166
Project: 74166
Buggy source:
/** 
 * @return if font is embeded
 */
public boolean isEmbededFont(){
  return isEmbededFont;
}

Fixed version (ground truth):
/** 
 * @return true if font is embedded
 */
public boolean isEmbededFont(){
  return isEmbededFont;
}
Program: 74167
Project: 74167
Buggy source:
/** 
 * sets the base url for action handling
 * @param baseURL sets the base URL used for action handling
 */
public void setBaseURL(String baseURL){
  this.baseURL=baseURL;
}

Fixed version (ground truth):
/** 
 * sets the base URL for action handling
 * @param baseURL sets the base URL used for action handling
 */
public void setBaseURL(String baseURL){
  this.baseURL=baseURL;
}
Program: 74168
Project: 74168
Buggy source:
/** 
 * dummy constrictor 
 */
public PDFRenderContext(){
}

Fixed version (ground truth):
/** 
 * dummy constructor 
 */
public PDFRenderContext(){
}
Program: 74169
Project: 74169
Buggy source:
/** 
 * @return if font is embeded
 */
public boolean isEmbededFont(){
  return getBooleanOption(IS_EMBEDDED_FONT,false);
}

Fixed version (ground truth):
/** 
 * @return true if font is embedded
 */
public boolean isEmbededFont(){
  return getBooleanOption(IS_EMBEDDED_FONT,false);
}
Program: 74171
Project: 74171
Buggy source:
int getX();

Fixed version (ground truth):
/** 
 * Gets the x coordinate of the area's top-left border corner.
 * @return the x coordinate.
 */
int getX();
Program: 74172
Project: 74172
Buggy source:
int getHeight();

Fixed version (ground truth):
/** 
 * Gets the height of the area, ignoring margin.
 * @return the height of the area without margin.
 */
int getHeight();
Program: 74173
Project: 74173
Buggy source:
IStyle getStyle();

Fixed version (ground truth):
/** 
 * Gets the content's computed style.
 * @return the computed style.
 */
IStyle getStyle();
Program: 74174
Project: 74174
Buggy source:
int getY();

Fixed version (ground truth):
/** 
 * Gets the y coordinate of the area's top-left border corner.
 * @return the y coordinate.
 */
int getY();
Program: 74175
Project: 74175
Buggy source:
float getScale();

Fixed version (ground truth):
/** 
 * Gets the scale of the area. The <i>scale</i> property is normally used  in render time to determine the zoom ratio of the content in this area.
 * @return the scale.
 */
float getScale();
Program: 74176
Project: 74176
Buggy source:
/** 
 * get content object.
 * @return
 */
IContent getContent();

Fixed version (ground truth):
/** 
 * Gets the content object of the area.
 * @return the content object.
 */
IContent getContent();
Program: 74177
Project: 74177
Buggy source:
int getWidth();

Fixed version (ground truth):
/** 
 * Gets the width of the area, ignoring margin.
 * @return the width of the area without margin.
 */
int getWidth();
Program: 74178
Project: 74178
Buggy source:
boolean needClip();

Fixed version (ground truth):
public boolean needClip();
Program: 74179
Project: 74179
Buggy source:
/** 
 * get X possition of this area
 */
public int getX(){
  return x;
}

Fixed version (ground truth):
/** 
 * get X position of this area
 */
public int getX(){
  return x;
}
Program: 74180
Project: 74180
Buggy source:
public static IContainerArea createInlineContainer(IContent content){
  return new InlineContainerArea(content);
}

Fixed version (ground truth):
/** 
 * create inline container area by content
 * @param content the content object
 * @param isFirst if this area is the first area of the content
 * @param isLast if this area is the last area of the content
 * @return
 */
public static IContainerArea createInlineContainer(IContent content,boolean isFirst,boolean isLast){
  IContainerArea containerArea=AreaFactory.createInlineContainer(content);
  IStyle style=containerArea.getStyle();
  if (!isFirst) {
    style.setProperty(IStyle.STYLE_BORDER_LEFT_WIDTH,IStyle.NUMBER_0);
    style.setProperty(IStyle.STYLE_PADDING_LEFT,IStyle.NUMBER_0);
    style.setProperty(IStyle.STYLE_MARGIN_LEFT,IStyle.NUMBER_0);
  }
  if (!isLast) {
    style.setProperty(IStyle.STYLE_BORDER_RIGHT_WIDTH,IStyle.NUMBER_0);
    style.setProperty(IStyle.STYLE_PADDING_RIGHT,IStyle.NUMBER_0);
    style.setProperty(IStyle.STYLE_MARGIN_RIGHT,IStyle.NUMBER_0);
  }
  return containerArea;
}
Program: 74181
Project: 74181
Buggy source:
CellArea(ICellContent cell){
  super(cell);
  removeBorder();
  setDefaultPadding();
  isClippingContainer=true;
}

Fixed version (ground truth):
CellArea(ICellContent cell){
  super(cell);
  removeBorder();
  setDefaultPadding();
}
Program: 74182
Project: 74182
Buggy source:
public boolean needClip(){
  return isClippingContainer && needClip;
}

Fixed version (ground truth):
public boolean needClip(){
  return needClip;
}
Program: 74183
Project: 74183
Buggy source:
public void addChild(IArea area){
  if (area.getX() < 0 || area.getX() + area.getWidth() > width || area.getY() < 0 || area.getY() + area.getHeight() > height) {
    needClip=true;
  }
  children.add(area);
}

Fixed version (ground truth):
public void addChild(IArea area){
  children.add(area);
}
Program: 74184
Project: 74184
Buggy source:
InlineContainerArea(IContent content){
  super(content);
  needClip=true;
  isClippingContainer=true;
}

Fixed version (ground truth):
InlineContainerArea(IContent content){
  super(content);
}
Program: 74186
Project: 74186
Buggy source:
private Object[] getAccumulatorParameter(Row4Aggregation row,int funcIndex){
  Object[] parameters=null;
  if (parameterColIndex[funcIndex] == -1) {
    parameters=new Object[1];
    parameters[0]=row.getMeasures()[measureIndex[funcIndex]];
  }
 else {
    parameters=new Object[2];
    parameters[0]=row.getMeasures()[measureIndex[funcIndex]];
    parameters[1]=row.getParameterValues()[parameterColIndex[funcIndex]];
  }
  return parameters;
}

Fixed version (ground truth):
private Object[] getAccumulatorParameter(Row4Aggregation row,int funcIndex){
  Object[] parameters=null;
  if (parameterColIndex[funcIndex] == -1) {
    parameters=new Object[1];
    if (measureIndex[funcIndex] < 0) {
      parameters[0]=null;
    }
 else {
      parameters[0]=row.getMeasures()[measureIndex[funcIndex]];
    }
  }
 else {
    parameters=new Object[2];
    if (measureIndex[funcIndex] < 0) {
      parameters[0]=null;
    }
 else {
      parameters[0]=row.getMeasures()[measureIndex[funcIndex]];
    }
    parameters[1]=row.getParameterValues()[parameterColIndex[funcIndex]];
  }
  return parameters;
}
Program: 74187
Project: 74187
Buggy source:
/** 
 * validate on calculated member to verify whether the measure reference exist.
 * @param cube
 * @param measureDefn
 * @throws DataException
 */
static void validateCalculatedMember(ICubeQueryDefinition defn,ICube cube,CalculatedMember[] calculatedMember) throws DataException {
  boolean findMeasure=false;
  for (int i=0; i < calculatedMember.length; i++) {
    findMeasure=false;
    String measureName=calculatedMember[i].getMeasureName();
    String[] names=cube.getMeasureNames();
    if (names != null && names.length > 0) {
      for (int k=0; k < names.length; k++) {
        if (names[k].equals(measureName)) {
          findMeasure=true;
          break;
        }
      }
    }
    if (!findMeasure) {
      List computedMeasures=defn.getComputedMeasures();
      for (int k=0; k < computedMeasures.size(); k++) {
        if (((ComputedMeasureDefinition)computedMeasures.get(k)).getName().equals(measureName)) {
          findMeasure=true;
          break;
        }
      }
      if (!findMeasure)       throw new DataException(ResourceConstants.MEASURE_NAME_NOT_FOUND,new Object[]{measureName});
    }
  }
}

Fixed version (ground truth):
/** 
 * validate on calculated member to verify whether the measure reference exist.
 * @param cube
 * @param measureDefn
 * @throws DataException
 */
static void validateCalculatedMember(ICubeQueryDefinition defn,ICube cube,CalculatedMember[] calculatedMember) throws DataException {
  boolean findMeasure=false;
  for (int i=0; i < calculatedMember.length; i++) {
    findMeasure=false;
    String measureName=calculatedMember[i].getMeasureName();
    String[] names=cube.getMeasureNames();
    if (names != null && names.length > 0) {
      for (int k=0; k < names.length; k++) {
        if (names[k].equals(measureName)) {
          findMeasure=true;
          break;
        }
      }
    }
    if (!findMeasure) {
      List computedMeasures=defn.getComputedMeasures();
      for (int k=0; k < computedMeasures.size(); k++) {
        if (((ComputedMeasureDefinition)computedMeasures.get(k)).getName().equals(measureName)) {
          findMeasure=true;
          break;
        }
      }
      if (!findMeasure && (AggregationFactory.getInstance().getAggrInfo(calculatedMember[i].getAggrFunction()) != null && AggregationFactory.getInstance().getAggrInfo(calculatedMember[i].getAggrFunction()).needDataField()))       throw new DataException(ResourceConstants.MEASURE_NAME_NOT_FOUND,new Object[]{measureName});
    }
  }
}