nus-yam/ex-repair huggingface dataset:
Program: 74189
Project: 74189
Buggy source:
/** 
 * Tests extension allowed units.
 * @throws Exception
 */
public void testExtensionAllowedUnits() throws Exception {
  MetaDataDictionary dd=MetaDataDictionary.getInstance();
  ExtensionElementDefn extDefn=(ExtensionElementDefn)dd.getExtension(TESTING_TABLE);
  IPropertyDefn defn=extDefn.getProperty("String_Node_Str");
  IChoiceSet set=defn.getAllowedChoices();
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNull(set.findChoice("String_Node_Str"));
  assertNull(set.findChoice("String_Node_Str"));
  set=dd.getElement(TABLE).findProperty("String_Node_Str").getAllowedChoices();
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNotNull(set.findChoice("String_Node_Str"));
  openDesign(FILE_NAME_4);
  ExtendedItemHandle extendedItem=(ExtendedItemHandle)designHandle.findElement("String_Node_Str");
  defn=extendedItem.getPropertyDefn("String_Node_Str");
  set=defn.getAllowedChoices();
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNull(set.findChoice("String_Node_Str"));
  assertNull(set.findChoice("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Tests extension allowed units.
 * @throws Exception
 */
public void testExtensionAllowedUnits() throws Exception {
  MetaDataDictionary dd=MetaDataDictionary.getInstance();
  ExtensionElementDefn extDefn=(ExtensionElementDefn)dd.getExtension(TESTING_TABLE);
  IPropertyDefn defn=extDefn.getProperty("String_Node_Str");
  IChoiceSet set=defn.getAllowedUnits();
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNull(set.findChoice("String_Node_Str"));
  assertNull(set.findChoice("String_Node_Str"));
  set=dd.getElement(TABLE).findProperty("String_Node_Str").getAllowedUnits();
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNotNull(set.findChoice("String_Node_Str"));
  openDesign(FILE_NAME_4);
  ExtendedItemHandle extendedItem=(ExtendedItemHandle)designHandle.findElement("String_Node_Str");
  defn=extendedItem.getPropertyDefn("String_Node_Str");
  set=defn.getAllowedUnits();
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNotNull(set.findChoice("String_Node_Str"));
  assertNull(set.findChoice("String_Node_Str"));
  assertNull(set.findChoice("String_Node_Str"));
}
Program: 74190
Project: 74190
Buggy source:
/** 
 * Tests getting allowed units.
 * @throws MetaDataParserException if any exception
 */
public void testGetAllowedUnits() throws MetaDataParserException {
  loadMetaData(this.getClass().getResourceAsStream("String_Node_Str"));
  IElementDefn styleDefn=MetaDataDictionary.getInstance().getElement(ReportDesignConstants.STYLE_ELEMENT);
  PropertyDefn propDefn=(ElementPropertyDefn)styleDefn.getProperty(Style.FONT_STYLE_PROP);
  IChoiceSet choices=propDefn.getAllowedChoices();
  assertEquals(2,choices.getChoices().length);
  assertEquals("String_Node_Str",choices.getChoices()[0].getName());
  assertEquals("String_Node_Str",choices.getChoices()[1].getName());
  propDefn=(ElementPropertyDefn)styleDefn.getProperty(Style.FONT_SIZE_PROP);
  choices=propDefn.getAllowedChoices();
  assertEquals(2,choices.getChoices().length);
  assertEquals("String_Node_Str",choices.getChoices()[0].getName());
  assertEquals("String_Node_Str",choices.getChoices()[1].getName());
  propDefn=(ElementPropertyDefn)styleDefn.getProperty(Style.BACKGROUND_POSITION_X_PROP);
  choices=propDefn.getAllowedChoices();
  assertEquals(9,choices.getChoices().length);
}

Fixed version (ground truth):
/** 
 * Tests getting allowed units.
 * @throws MetaDataParserException if any exception
 */
public void testGetAllowedUnits() throws MetaDataParserException {
  loadMetaData(this.getClass().getResourceAsStream("String_Node_Str"));
  IElementDefn styleDefn=MetaDataDictionary.getInstance().getElement(ReportDesignConstants.STYLE_ELEMENT);
  PropertyDefn propDefn=(ElementPropertyDefn)styleDefn.getProperty(Style.FONT_STYLE_PROP);
  IChoiceSet choices=propDefn.getAllowedChoices();
  assertEquals(2,choices.getChoices().length);
  assertEquals("String_Node_Str",choices.getChoices()[0].getName());
  assertEquals("String_Node_Str",choices.getChoices()[1].getName());
  propDefn=(ElementPropertyDefn)styleDefn.getProperty(Style.FONT_SIZE_PROP);
  choices=propDefn.getAllowedUnits();
  assertEquals(2,choices.getChoices().length);
  assertEquals("String_Node_Str",choices.getChoices()[0].getName());
  assertEquals("String_Node_Str",choices.getChoices()[1].getName());
  propDefn=(ElementPropertyDefn)styleDefn.getProperty(Style.BACKGROUND_POSITION_X_PROP);
  choices=propDefn.getAllowedUnits();
  assertEquals(9,choices.getChoices().length);
}
Program: 74191
Project: 74191
Buggy source:
/** 
 * Constructor of MetaDataRetriever
 * @param metaDataProvider
 * @param queryText
 * @throws OdaException
 */
MetaDataRetriever(IMetaDataProvider metaDataProvider,String queryText){
  this.metaDataProvider=metaDataProvider;
  if (this.metaDataProvider != null) {
    try {
      statement=this.metaDataProvider.getConnection().prepareStatement(queryText);
    }
 catch (    SQLException e) {
      logger.log(Level.INFO,e.getMessage(),e);
      return;
    }
    if (statement != null) {
      try {
        this.paramMeta=new ParameterMetaData(statement.getParameterMetaData());
      }
 catch (      SQLException e) {
        try {
          resultset=statement.executeQuery();
        }
 catch (        SQLException e2) {
          logger.log(Level.INFO,e2.getMessage(),e2);
          return;
        }
        try {
          this.paramMeta=new ParameterMetaData(statement.getParameterMetaData());
        }
 catch (        OdaException e2) {
        }
catch (        SQLException e2) {
          logger.log(Level.INFO,e2.getMessage(),e2);
          this.paramMeta=null;
        }
        try {
          this.resultMeta=new ResultSetMetaData(resultset.getMetaData());
        }
 catch (        SQLException e1) {
          logger.log(Level.INFO,e1.getMessage(),e1);
          return;
        }
catch (        OdaException e3) {
        }
      }
catch (      OdaException e) {
      }
      if (this.resultMeta == null) {
        try {
          resultset=statement.executeQuery();
        }
 catch (        SQLException e1) {
          logger.log(Level.INFO,e1.getMessage(),e1);
          return;
        }
        try {
          this.resultMeta=new ResultSetMetaData(resultset.getMetaData());
        }
 catch (        SQLException e) {
          logger.log(Level.INFO,e.getMessage(),e);
          return;
        }
catch (        OdaException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @param odaMetaDataProvider
 * @param queryText
 * @param dataSetType
 */
MetaDataRetriever(OdaConnectionProvider odaMetaDataProvider,String queryText,String dataSetType){
  if (odaMetaDataProvider != null) {
    try {
      IConnection con=odaMetaDataProvider.getConnection();
      if (con != null && con.isOpen()) {
        query=con.newQuery(dataSetType);
        try {
          query.prepare(queryText);
          this.paramMeta=query.getParameterMetaData();
        }
 catch (        OdaException ex) {
          this.paramMeta=null;
        }
        this.resultMeta=query.getMetaData();
      }
    }
 catch (    OdaException e) {
      this.resultMeta=null;
      logger.log(Level.INFO,e.getMessage(),e);
      return;
    }
  }
}
Program: 74192
Project: 74192
Buggy source:
/** 
 * Release all the connection resources
 */
void close(){
  if (this.resultset != null) {
    try {
      this.resultset.close();
    }
 catch (    SQLException e) {
      logger.log(Level.FINER,e.getMessage(),e);
      this.resultset=null;
    }
  }
  if (this.statement != null) {
    try {
      this.statement.close();
    }
 catch (    SQLException e) {
      logger.log(Level.FINER,e.getMessage(),e);
      this.statement=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Release IQuery object
 */
void close(){
  if (query != null) {
    try {
      query.close();
      query=null;
    }
 catch (    OdaException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
}
Program: 74193
Project: 74193
Buggy source:
/** 
 * Create Metadata Provider
 */
protected void createMetaDataProvider(){
  if (metaDataProvider == null) {
    metaDataProvider=new JdbcMetaDataProvider(null);
  }
}

Fixed version (ground truth):
/** 
 * Create Metadata Provider
 */
protected void createMetaDataProvider(){
  if (metaDataProvider == null) {
    metaDataProvider=new JdbcMetaDataProvider(null);
  }
  if (this.odaConnectionProvider == null) {
    this.odaConnectionProvider=new OdaConnectionProvider(this.getInitializationDesign().getDataSourceDesign());
  }
}
Program: 74194
Project: 74194
Buggy source:
protected void cleanup(){
  if (metaDataProvider != null) {
    metaDataProvider.closeConnection();
  }
}

Fixed version (ground truth):
protected void cleanup(){
  if (metaDataProvider != null) {
    metaDataProvider.closeConnection();
  }
  if (this.odaConnectionProvider != null) {
    this.odaConnectionProvider.closeConnection();
  }
}
Program: 74196
Project: 74196
Buggy source:
/** 
 * Initializes the Jdbc related information , used  by this page ( such as the Jdbc Connection , Catalog Name etc )
 * @param curDataSourceHandle
 */
protected void resetJdbcInfo(DataSourceDesign curDataSourceDesign){
  try {
    if (metaDataProvider != null) {
      metaDataProvider.closeConnection();
      metaDataProvider=null;
      createMetaDataProvider();
      if (jdbcConnection != null) {
        jdbcConnection.close();
        jdbcConnection=null;
      }
      jdbcConnection=connectMetadataProvider(metaDataProvider,curDataSourceDesign);
      tableList=null;
      schemaList=null;
      schemaCombo.removeAll();
    }
    if (jdbcConnection != null) {
      isSchemaSupported=metaDataProvider.isSchemaSupported();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.showException(this.getShell(),JdbcPlugin.getResourceString("String_Node_Str"),e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Initializes the Jdbc related information , used  by this page ( such as the Jdbc Connection , Catalog Name etc )
 * @param curDataSourceHandle
 */
protected void resetJdbcInfo(DataSourceDesign curDataSourceDesign){
  try {
    if (metaDataProvider != null) {
      metaDataProvider.closeConnection();
      metaDataProvider=null;
      createMetaDataProvider();
      if (jdbcConnection != null) {
        jdbcConnection.close();
        jdbcConnection=null;
      }
      jdbcConnection=connectMetadataProvider(metaDataProvider,curDataSourceDesign);
      tableList=null;
      schemaList=null;
      schemaCombo.removeAll();
    }
    if (this.odaConnectionProvider != null) {
      odaConnectionProvider.closeConnection();
      odaConnectionProvider=new OdaConnectionProvider(curDataSourceDesign);
      odaConnectionProvider.connect();
    }
    if (jdbcConnection != null) {
      isSchemaSupported=metaDataProvider.isSchemaSupported();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.showException(this.getShell(),JdbcPlugin.getResourceString("String_Node_Str"),e.getLocalizedMessage(),e);
  }
}
Program: 74197
Project: 74197
Buggy source:
protected DataSetDesign collectDataSetDesign(DataSetDesign design){
  if (this.getControl() == null || this.getControl().isDisposed())   return design;
  if (design != null && doc != null)   design.setQueryText(doc.get());
  if (this.shouldUpdateDataSetDesign || !formerQueryTxt.equals(design.getQueryText())) {
    MetaDataRetriever retriever=new MetaDataRetriever(this.metaDataProvider,design.getQueryText());
    IResultSetMetaData resultsetMeta=retriever.getResultSetMetaData();
    IParameterMetaData paramMeta=retriever.getParameterMetaData();
    SQLUtility.saveDataSetDesign(design,resultsetMeta,paramMeta);
    formerQueryTxt=design.getQueryText();
    this.shouldUpdateDataSetDesign=false;
    retriever.close();
  }
  return design;
}

Fixed version (ground truth):
protected DataSetDesign collectDataSetDesign(DataSetDesign design){
  if (this.getControl() == null || this.getControl().isDisposed())   return design;
  if (design != null && doc != null)   design.setQueryText(doc.get());
  if (this.shouldUpdateDataSetDesign || !formerQueryTxt.equals(design.getQueryText())) {
    MetaDataRetriever retriever=new MetaDataRetriever(this.odaConnectionProvider,design.getQueryText(),design.getOdaExtensionDataSetId());
    IResultSetMetaData resultsetMeta=retriever.getResultSetMetaData();
    IParameterMetaData paramMeta=retriever.getParameterMetaData();
    SQLUtility.saveDataSetDesign(design,resultsetMeta,paramMeta);
    formerQueryTxt=design.getQueryText();
    this.shouldUpdateDataSetDesign=false;
    retriever.close();
  }
  return design;
}
Program: 74198
Project: 74198
Buggy source:
/** 
 * Initializes the Jdbc related information , used  by this page ( such as the Jdbc Connection , Catalog Name etc )
 */
protected void initialJdbcInfo(){
  createMetaDataProvider();
  jdbcConnection=connectMetadataProvider(metaDataProvider,this.getDataSetDesign().getDataSourceDesign());
  try {
    if (jdbcConnection != null) {
      isSchemaSupported=metaDataProvider.isSchemaSupported();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.showException(this.getShell(),JdbcPlugin.getResourceString("String_Node_Str"),e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Initializes the Jdbc related information , used  by this page ( such as the Jdbc Connection , Catalog Name etc )
 */
protected void initialJdbcInfo(){
  createMetaDataProvider();
  jdbcConnection=connectMetadataProvider(metaDataProvider,this.getDataSetDesign().getDataSourceDesign());
  this.odaConnectionProvider.connect();
  try {
    if (jdbcConnection != null) {
      isSchemaSupported=metaDataProvider.isSchemaSupported();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.showException(this.getShell(),JdbcPlugin.getResourceString("String_Node_Str"),e.getLocalizedMessage(),e);
  }
}
Program: 74199
Project: 74199
Buggy source:
public IParameterMetaData getParameterMetaData() throws OdaException {
  assertNotNull(callStat);
  if (this.cachedParameterMetaData != null)   return this.cachedParameterMetaData;
  int[] positionArray=paramUtil.getParameterPositions();
  List paramMetaList1=this.getCallableParamMetaData();
  List paramMetaList2=new ArrayList();
  for (int i=0; i < positionArray.length; i++) {
    int index=positionArray[i];
    paramMetaList2.add(paramMetaList1.get(index - 1));
  }
  cachedParameterMetaData=new SPParameterMetaData(paramMetaList2);
  return cachedParameterMetaData;
}

Fixed version (ground truth):
public IParameterMetaData getParameterMetaData() throws OdaException {
  assertNotNull(callStat);
  if (this.cachedParameterMetaData != null)   return this.cachedParameterMetaData;
  int[] positionArray=paramUtil.getParameterPositions();
  List paramMetaList1=this.getCallableParamMetaData();
  List paramMetaList2=new ArrayList();
  for (int i=0; i < positionArray.length; i++) {
    int index=positionArray[i];
    if (paramMetaList1.size() >= index)     paramMetaList2.add(paramMetaList1.get(index - 1));
  }
  cachedParameterMetaData=new SPParameterMetaData(paramMetaList2);
  return cachedParameterMetaData;
}
Program: 74204
Project: 74204
Buggy source:
public String getUnitName(String key){
  IChoice choice=ChoiceSetFactory.getElementChoiceSet(getElement(),getProperty()).findChoiceByDisplayName(key);
  if (choice == null) {
    return null;
  }
  return choice.getName();
}

Fixed version (ground truth):
public String getUnitName(String key){
  IChoice choice=ChoiceSetFactory.getDimensionChoiceSet(getElement(),getProperty()).findChoiceByDisplayName(key);
  if (choice == null) {
    return null;
  }
  return choice.getName();
}
Program: 74205
Project: 74205
Buggy source:
public boolean validateDimensionValue(String value,String unit){
  String unitValue=ChoiceSetFactory.getElementChoiceSet(getElement(),getProperty()).findChoiceByDisplayName(unit).getName();
  boolean val=true;
  try {
    DimensionValue dimensionValue=DimensionValue.parse(value + unitValue);
    if (dimensionValue == null) {
      return true;
    }
    int size=DEUtil.getFontSizeIntValue((DesignElementHandle)DEUtil.getInputFirstElement(input));
    double pointValue=CSSUtil.convertToPoint(dimensionValue,size);
    return pointValue < 1000000;
  }
 catch (  PropertyValueException e1) {
  }
  return val;
}

Fixed version (ground truth):
public boolean validateDimensionValue(String value,String unit){
  String unitValue=ChoiceSetFactory.getDimensionChoiceSet(getElement(),getProperty()).findChoiceByDisplayName(unit).getName();
  boolean val=true;
  try {
    DimensionValue dimensionValue=DimensionValue.parse(value + unitValue);
    if (dimensionValue == null) {
      return true;
    }
    int size=DEUtil.getFontSizeIntValue((DesignElementHandle)DEUtil.getInputFirstElement(input));
    double pointValue=CSSUtil.convertToPoint(dimensionValue,size);
    return pointValue < 1000000;
  }
 catch (  PropertyValueException e1) {
  }
  return val;
}
Program: 74206
Project: 74206
Buggy source:
public String getDefaultUnit(){
  if (DEUtil.getInputElements(input) == null || DEUtil.getInputSize(input) == 0) {
    return null;
  }
  String unit=null;
  if (!DEUtil.getGroupElementHandle(DEUtil.getInputElements(input)).isSameType()) {
    return null;
  }
  DesignElementHandle handle=(DesignElementHandle)DEUtil.getInputFirstElement(input);
  unit=handle.getPropertyHandle(getProperty()).getDefaultUnit();
  if (unit != null) {
    if (!StringUtil.isBlank(unit)) {
      unit=ChoiceSetFactory.getElementChoiceSet(getElement(),getProperty()).findChoice(unit).getDisplayName();
    }
    return unit;
  }
  return null;
}

Fixed version (ground truth):
public String getDefaultUnit(){
  if (DEUtil.getInputElements(input) == null || DEUtil.getInputSize(input) == 0) {
    return null;
  }
  String unit=null;
  if (!DEUtil.getGroupElementHandle(DEUtil.getInputElements(input)).isSameType()) {
    return null;
  }
  DesignElementHandle handle=(DesignElementHandle)DEUtil.getInputFirstElement(input);
  unit=handle.getPropertyHandle(getProperty()).getDefaultUnit();
  if (unit != null) {
    if (!StringUtil.isBlank(unit)) {
      unit=ChoiceSetFactory.getDimensionChoiceSet(getElement(),getProperty()).findChoice(unit).getDisplayName();
    }
    return unit;
  }
  return null;
}
Program: 74207
Project: 74207
Buggy source:
public String[] getUnitItems(){
  return ChoiceSetFactory.getDisplayNamefromChoiceSet(ChoiceSetFactory.getElementChoiceSet(getElement(),getProperty()));
}

Fixed version (ground truth):
public String[] getUnitItems(){
  return ChoiceSetFactory.getDisplayNamefromChoiceSet(ChoiceSetFactory.getDimensionChoiceSet(getElement(),getProperty()));
}
Program: 74208
Project: 74208
Buggy source:
public String getUnitDisplayName(String key){
  IChoice choice=ChoiceSetFactory.getElementChoiceSet(getElement(),getProperty()).findChoice(key);
  if (choice == null) {
    return null;
  }
  return choice.getDisplayName();
}

Fixed version (ground truth):
public String getUnitDisplayName(String key){
  IChoice choice=ChoiceSetFactory.getDimensionChoiceSet(getElement(),getProperty()).findChoice(key);
  if (choice == null) {
    return null;
  }
  return choice.getDisplayName();
}
Program: 74209
Project: 74209
Buggy source:
/** 
 * Gets the dimension collection that given property value can selected from them.
 * @param elementName The name of the element.
 * @param property DE Property key.
 * @return The ChoiceSet instance contains all the allowed values.
 */
public static IChoiceSet getDimensionChoiceSet(String elementName,String property){
  IElementPropertyDefn propertyDefn=DEUtil.getMetaDataDictionary().getElement(elementName).getProperty(property);
  if (propertyDefn.getTypeCode() == IPropertyType.DIMENSION_TYPE) {
    return propertyDefn.getAllowedChoices();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the dimension collection that given property value can selected from them.
 * @param elementName The name of the element.
 * @param property DE Property key.
 * @return The ChoiceSet instance contains all the allowed values.
 */
public static IChoiceSet getDimensionChoiceSet(String elementName,String property){
  IElementPropertyDefn propertyDefn=DEUtil.getMetaDataDictionary().getElement(elementName).getProperty(property);
  if (propertyDefn.getTypeCode() == IPropertyType.DIMENSION_TYPE) {
    return propertyDefn.getAllowedUnits();
  }
  return null;
}
Program: 74210
Project: 74210
Buggy source:
/** 
 * execute the query in the parent result
 * @param parent parent result set.
 * @param query query to be executed
 * @return result.
 */
IBaseResultSet execute(IBaseResultSet parent,IDataQueryDefinition query,boolean useCache);

Fixed version (ground truth):
/** 
 * execute the query in the parent result
 * @param parent parent result set.
 * @param query query to be executed
 * @return result.
 */
IBaseResultSet execute(IBaseResultSet parent,IDataQueryDefinition query,boolean useCache) throws BirtException ;
Program: 74211
Project: 74211
Buggy source:
/** 
 * get the sub query result from the current query.
 * @param query
 * @return
 */
protected IBaseResultSet doExecuteSubQuery(IQueryResultSet parent,ISubqueryDefinition subQuery){
}

Fixed version (ground truth):
/** 
 * get the sub query result from the current query.
 * @param query
 * @return
 */
protected IBaseResultSet doExecuteSubQuery(IQueryResultSet parent,ISubqueryDefinition subQuery) throws BirtException {
}
Program: 74212
Project: 74212
Buggy source:
public IBaseResultSet execute(IBaseResultSet parent,IDataQueryDefinition query,boolean useCache){
  if (query instanceof ISubqueryDefinition) {
    if (parent == null) {
      return null;
    }
 else     if (parent instanceof ICubeResultSet) {
      context.addException(new EngineException("String_Node_Str" + ((ISubqueryDefinition)query).getName()));
    }
    return doExecuteSubQuery((IQueryResultSet)parent,(ISubqueryDefinition)query);
  }
 else   if (query instanceof IQueryDefinition) {
    return doExecuteQuery(parent,(IQueryDefinition)query,useCache);
  }
 else   if (query instanceof ICubeQueryDefinition) {
    return doExecuteCube(parent,(ICubeQueryDefinition)query,useCache);
  }
  return null;
}

Fixed version (ground truth):
public IBaseResultSet execute(IBaseResultSet parent,IDataQueryDefinition query,boolean useCache) throws BirtException {
  if (query instanceof ISubqueryDefinition) {
    if (parent == null) {
      return null;
    }
 else     if (parent instanceof ICubeResultSet) {
      context.addException(new EngineException("String_Node_Str" + ((ISubqueryDefinition)query).getName()));
    }
    return doExecuteSubQuery((IQueryResultSet)parent,(ISubqueryDefinition)query);
  }
 else   if (query instanceof IQueryDefinition) {
    return doExecuteQuery(parent,(IQueryDefinition)query,useCache);
  }
 else   if (query instanceof ICubeQueryDefinition) {
    return doExecuteCube(parent,(ICubeQueryDefinition)query,useCache);
  }
  throw new EngineException("String_Node_Str" + query.getClass().getName());
}
Program: 74213
Project: 74213
Buggy source:
public IBaseResultSet executeQuery(IBaseResultSet parent,IDataQueryDefinition query,Object handle){
  IDataEngine dataEngine=context.getDataEngine();
  if (query != null) {
    boolean useCache=false;
    if (handle instanceof ReportItemHandle) {
      ReportItemHandle referenceHandle=((ReportItemHandle)handle).getDataBindingReference();
      if (referenceHandle != null) {
        useCache=true;
      }
    }
    IBaseResultSet rset=dataEngine.execute(parent,query,useCache);
    context.setResultSet(rset);
    return rset;
  }
  return null;
}

Fixed version (ground truth):
public IBaseResultSet executeQuery(IBaseResultSet parent,IDataQueryDefinition query,Object handle){
  IDataEngine dataEngine=context.getDataEngine();
  if (query != null) {
    boolean useCache=false;
    if (handle instanceof ReportItemHandle) {
      ReportItemHandle referenceHandle=((ReportItemHandle)handle).getDataBindingReference();
      if (referenceHandle != null) {
        useCache=true;
      }
    }
    try {
      IBaseResultSet rset=dataEngine.execute(parent,query,useCache);
      context.setResultSet(rset);
      return rset;
    }
 catch (    BirtException ex) {
      log.log(Level.SEVERE,ex.getMessage(),ex);
      context.addException(new EngineException(ex.getLocalizedMessage(),ex));
      return null;
    }
  }
  return null;
}
Program: 74214
Project: 74214
Buggy source:
protected void executeQueries(){
  ExtendedItemDesign extItem=(ExtendedItemDesign)design;
  IDataEngine dataEngine=context.getDataEngine();
  boolean useCache=extItem.useCachedResult();
  IDataQueryDefinition[] queries=extItem.getQueries();
  if (queries != null) {
    IBaseResultSet parent=getParentResultSet();
    rsets=new IBaseResultSet[queries.length];
    for (int i=0; i < rsets.length; i++) {
      rsets[i]=dataEngine.execute(parent,queries[i],useCache);
    }
    context.setResultSets(rsets);
  }
}

Fixed version (ground truth):
protected void executeQueries() throws BirtException {
  ExtendedItemDesign extItem=(ExtendedItemDesign)design;
  IDataEngine dataEngine=context.getDataEngine();
  boolean useCache=extItem.useCachedResult();
  IDataQueryDefinition[] queries=extItem.getQueries();
  if (queries != null) {
    IBaseResultSet parent=getParentResultSet();
    rsets=new IBaseResultSet[queries.length];
    for (int i=0; i < rsets.length; i++) {
      rsets[i]=dataEngine.execute(parent,queries[i],useCache);
    }
    context.setResultSets(rsets);
  }
}
Program: 74215
Project: 74215
Buggy source:
public IContent execute(){
  ExtendedItemDesign extDesign=(ExtendedItemDesign)design;
  IForeignContent extContent=report.createForeignContent();
  setContent(extContent);
  executeQueries();
  initializeContent(extDesign,extContent);
  processAction(extDesign,extContent);
  processBookmark(extDesign,extContent);
  processStyle(extDesign,extContent);
  processVisibility(extDesign,extContent);
  generateContent(extDesign,extContent);
  return extContent;
}

Fixed version (ground truth):
public IContent execute(){
  ExtendedItemDesign extDesign=(ExtendedItemDesign)design;
  IForeignContent extContent=report.createForeignContent();
  setContent(extContent);
  try {
    executeQueries();
  }
 catch (  BirtException ex) {
    logger.log(Level.SEVERE,ex.getMessage(),ex);
    context.addException(design.getHandle(),new EngineException(ex.getLocalizedMessage(),ex));
    return null;
  }
  initializeContent(extDesign,extContent);
  processAction(extDesign,extContent);
  processBookmark(extDesign,extContent);
  processStyle(extDesign,extContent);
  processVisibility(extDesign,extContent);
  generateContent(extDesign,extContent);
  return extContent;
}
Program: 74218
Project: 74218
Buggy source:
public void execute(final IProgressMonitor monitor) throws CoreException, IOException {
  if (file.exists() || file.createNewFile()) {
    FileOutputStream out=new FileOutputStream(file);
    moduleHandle.serialize(out);
    out.close();
  }
}

Fixed version (ground truth):
public void execute(final IProgressMonitor monitor) throws CoreException, IOException {
  if (file.exists() || file.createNewFile()) {
    String oldConfigName=moduleHandle.getStringProperty(IReportGraphicConstants.REPORT_CONFIG_FILE_NAME);
    String newConfigName=getConfigFileName(file.getAbsolutePath());
    File oldConfigFile=oldConfigName == null ? null : new File(oldConfigName);
    if (newConfigName != null && oldConfigFile != null && oldConfigFile.exists()) {
      copyFile(oldConfigFile,new File(newConfigName));
      try {
        moduleHandle.setStringProperty(IReportGraphicConstants.REPORT_CONFIG_FILE_NAME,newConfigName);
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e,true);
      }
    }
    FileOutputStream out=new FileOutputStream(file);
    moduleHandle.serialize(out);
    out.close();
  }
}
Program: 74219
Project: 74219
Buggy source:
public boolean performFinish(){
  saveAsPath=saveAsPage.getResult();
  if (saveAsPath != null && model instanceof ReportDesignHandle) {
    ReportDesignHandle reportHandle=(ReportDesignHandle)model;
    try {
      reportHandle.setDisplayName(settingPage.getDisplayName());
      reportHandle.setDescription(settingPage.getDescription());
      reportHandle.setIconFile(settingPage.getPreviewImagePath());
      reportHandle.setFileName(saveAsPath.toOSString());
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean performFinish(){
  saveAsPath=saveAsPage.getResult();
  if (saveAsPath != null && model instanceof ReportDesignHandle) {
    ReportDesignHandle reportHandle=(ReportDesignHandle)model;
    try {
      String configFileName=FileReportProvider.getConfigFileName(reportHandle.getFileName());
      if (configFileName != null && new File(configFileName).exists()) {
        reportHandle.setStringProperty(IReportGraphicConstants.REPORT_CONFIG_FILE_NAME,configFileName);
      }
      reportHandle.setDisplayName(settingPage.getDisplayName());
      reportHandle.setDescription(settingPage.getDescription());
      reportHandle.setIconFile(settingPage.getPreviewImagePath());
      reportHandle.setFileName(saveAsPath.toOSString());
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
  return true;
}
Program: 74220
Project: 74220
Buggy source:
/** 
 * To get all the sub expressions' text list of the given expression
 * @param queryDefn, expression
 * @return List
 */
private static List getExprTextList(IBaseExpression expression){
  List textList=new ArrayList();
  if (expression instanceof IScriptExpression) {
    textList.add(((IScriptExpression)expression).getText());
  }
 else   if (expression instanceof IExpressionCollection) {
    List exprList=(List)((IExpressionCollection)expression).getExpressions();
    for (int i=0; i < exprList.size(); i++) {
      IBaseExpression baseExpr=(IBaseExpression)exprList.get(i);
      textList.addAll(getExprTextList(expression));
    }
  }
 else   if (expression instanceof IConditionalExpression) {
    textList.add(((IScriptExpression)((IConditionalExpression)expression).getExpression()).getText());
    textList.addAll(getExprTextList(((IConditionalExpression)expression).getOperand1()));
    textList.addAll(getExprTextList(((IConditionalExpression)expression).getOperand2()));
  }
  return textList;
}

Fixed version (ground truth):
/** 
 * To get all the sub expressions' text list of the given expression
 * @param queryDefn, expression
 * @return List
 */
private static List getExprTextList(IBaseExpression expression){
  List textList=new ArrayList();
  if (expression instanceof IScriptExpression) {
    textList.add(((IScriptExpression)expression).getText());
  }
 else   if (expression instanceof IExpressionCollection) {
    List exprList=(List)((IExpressionCollection)expression).getExpressions();
    for (int i=0; i < exprList.size(); i++) {
      IBaseExpression baseExpr=(IBaseExpression)exprList.get(i);
      textList.addAll(getExprTextList(baseExpr));
    }
  }
 else   if (expression instanceof IConditionalExpression) {
    textList.add(((IScriptExpression)((IConditionalExpression)expression).getExpression()).getText());
    textList.addAll(getExprTextList(((IConditionalExpression)expression).getOperand1()));
    textList.addAll(getExprTextList(((IConditionalExpression)expression).getOperand2()));
  }
  return textList;
}
Program: 74221
Project: 74221
Buggy source:
/** 
 * Searches extension registry for connection factory defined for driverClass. Returns an  instance of the factory if there is a connection factory for the driver class. Returns null otherwise.
 */
private IConnectionFactory getDriverConnectionFactory(String driverClass) throws OdaException {
}

Fixed version (ground truth):
/** 
 * Searches extension registry for connection factory defined for driverClass. Returns an  instance of the factory if there is a connection factory for the driver class. Returns null otherwise.
 */
public IConnectionFactory getDriverConnectionFactory(String driverClass) throws OdaException {
}
Program: 74222
Project: 74222
Buggy source:
private void cleanUp() throws Exception {
  shutDownDatabase();
  removeDatabase();
  dbDir=null;
}

Fixed version (ground truth):
private void cleanUp() throws Exception {
  shutdownDerby();
  removeDatabase();
  dbDir=null;
}
Program: 74223
Project: 74223
Buggy source:
/** 
 * Gets Derby connection URL
 * @param shutdown if true, generate a URL for shutting down DB
 */
public static String getDBUrl(boolean shutdown){
  String url="String_Node_Str" + dbDir + "String_Node_Str"+ SAMPLE_DB_NAME;
  if (shutdown)   url+="String_Node_Str";
  return url;
}

Fixed version (ground truth):
/** 
 * Gets Derby connection URL
 */
public static String getDBUrl(){
  return "String_Node_Str" + dbDir + "String_Node_Str"+ SAMPLE_DB_NAME;
}
Program: 74224
Project: 74224
Buggy source:
protected DataID getDataID(){
  if (parent != null) {
    IQueryResultSet prset=parent.rset;
    if (prset != null) {
      DataSetID dataSetID=prset.getID();
      long position=prset.getRowIndex();
      return new DataID(dataSetID,position);
    }
    IBaseResultSet[] rsets=parent.getQueryResults();
    if ((rsets != null) && (rsets.length > 0) && (rsets[0] != null)) {
      if (rsets[0] instanceof IQueryResultSet) {
        IQueryResultSet rset=(IQueryResultSet)rsets[0];
        DataSetID dataSetID=rset.getID();
        long position=rset.getRowIndex();
        return new DataID(dataSetID,position);
      }
      if (rsets[0] instanceof ICubeResultSet) {
        ICubeResultSet rset=(ICubeResultSet)rsets[0];
        DataSetID dataSetID=rset.getID();
        String cellId=rset.getCellIndex();
        return new DataID(dataSetID,cellId);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
protected DataID getDataID(){
  if (parent != null) {
    IQueryResultSet prset=parent.rset;
    if (prset != null) {
      DataSetID dataSetID=prset.getID();
      long position=prset.getRowIndex();
      if (dataSetID == null) {
        return null;
      }
      return new DataID(dataSetID,position);
    }
    IBaseResultSet[] rsets=parent.getQueryResults();
    if ((rsets != null) && (rsets.length > 0) && (rsets[0] != null)) {
      if (rsets[0] instanceof IQueryResultSet) {
        IQueryResultSet rset=(IQueryResultSet)rsets[0];
        DataSetID dataSetID=rset.getID();
        long position=rset.getRowIndex();
        return new DataID(dataSetID,position);
      }
      if (rsets[0] instanceof ICubeResultSet) {
        ICubeResultSet rset=(ICubeResultSet)rsets[0];
        DataSetID dataSetID=rset.getID();
        String cellId=rset.getCellIndex();
        return new DataID(dataSetID,cellId);
      }
    }
  }
  return null;
}
Program: 74226
Project: 74226
Buggy source:
/** 
 * pass the prepared query definition to extended item implementation, so that it can access data.
 */
public void setReportQueries(IBaseQueryDefinition[] queries);

Fixed version (ground truth):
/** 
 * pass the prepared query definition to extended item implementation, so that it can access data.
 * @deprecated implement #init(IReportItemGenerationInfo) instead
 */
public void setReportQueries(IBaseQueryDefinition[] queries);
Program: 74227
Project: 74227
Buggy source:
/** 
 * passes the class loader used to load user defined classes.
 * @param loader class loader used to load the classes
 */
public abstract void setApplicationClassLoader(ClassLoader loader);

Fixed version (ground truth):
/** 
 * passes the class loader used to load user defined classes.
 * @deprecated implement #init(IReportItemGenerationInfo) instead
 * @param loader class loader used to load the classes
 */
public abstract void setApplicationClassLoader(ClassLoader loader);
Program: 74228
Project: 74228
Buggy source:
/** 
 * pass the script context to the report item.
 * @param context report context used by java-based script
 */
public abstract void setScriptContext(IReportContext context);

Fixed version (ground truth):
/** 
 * pass the script context to the report item.
 * @deprecated implement #init(IReportItemGenerationInfo) instead
 * @param context report context used by java-based script
 */
public abstract void setScriptContext(IReportContext context);
Program: 74229
Project: 74229
Buggy source:
/** 
 * Set the content which is transformed from extended item. Extended item can process some properties itself, such as bookmark, style etc.
 * @param content content which is transformed from extended item.
 */
public void setExtendedItemContent(IContent content);

Fixed version (ground truth):
/** 
 * Set the content which is transformed from extended item. Extended item can process some properties itself, such as bookmark, style etc.
 * @deprecated implement #init(IReportItemGenerationInfo) instead
 * @param content content which is transformed from extended item.
 */
public void setExtendedItemContent(IContent content);
Program: 74230
Project: 74230
Buggy source:
/** 
 * passes a handle to the extended report item model to the extension
 * @param modelHandle a handle to the extended item model object
 */
public abstract void setModelObject(ExtendedItemHandle modelHandle);

Fixed version (ground truth):
/** 
 * passes a handle to the extended report item model to the extension
 * @deprecated implement #init(IReportItemGenerationInfo) instead
 * @param modelHandle a handle to the extended item model object
 */
public abstract void setModelObject(ExtendedItemHandle modelHandle);
Program: 74231
Project: 74231
Buggy source:
/** 
 * pass the prepared query definition to extended item implementation, so that it can access data.
 */
public void setReportQueries(IBaseQueryDefinition[] queries);

Fixed version (ground truth):
/** 
 * @deprecated implement #init(IReportItemPresentationInfo) instead.pass the prepared query definition to extended item implementation, so that it can access data.
 */
public void setReportQueries(IBaseQueryDefinition[] queries);
Program: 74232
Project: 74232
Buggy source:
/** 
 * passes the class loader used to load user defined classes.
 * @param loader class loader used to load the classes
 */
public abstract void setApplicationClassLoader(ClassLoader loader);

Fixed version (ground truth):
/** 
 * passes the class loader used to load user defined classes.
 * @deprecated implement #init(IReportItemPresentationInfo) instead.
 * @param loader class loader used to load the classes
 */
public abstract void setApplicationClassLoader(ClassLoader loader);
Program: 74233
Project: 74233
Buggy source:
/** 
 * pass the script context to the report item.
 * @param context report context used by java-based script
 */
public abstract void setScriptContext(IReportContext context);

Fixed version (ground truth):
/** 
 * pass the script context to the report item.
 * @deprecated implement #init(IReportItemPresentationInfo) instead.
 * @param context report context used by java-based script
 */
public abstract void setScriptContext(IReportContext context);
Program: 74234
Project: 74234
Buggy source:
/** 
 * passes the dpi (dot per inch) from the rendering environment to the extension. Mostly used for printing.
 * @param dpi the dpi of the rendering environment
 */
public abstract void setResolution(int dpi);

Fixed version (ground truth):
/** 
 * passes the dpi (dot per inch) from the rendering environment to the extension. Mostly used for printing.
 * @deprecated implement #init(IReportItemPresentationInfo) instead.
 * @param dpi the dpi of the rendering environment
 */
public abstract void setResolution(int dpi);
Program: 74235
Project: 74235
Buggy source:
/** 
 * Set the content which is transformed from extended item. Extended item can process some properties itself, such as bookmark, style etc.
 * @param content content which is transformed from extended item.
 */
public void setExtendedItemContent(IContent content);

Fixed version (ground truth):
/** 
 * Set the content which is transformed from extended item. Extended item can process some properties itself, such as bookmark, style etc.
 * @deprecated implement #init(IReportItemPresentationInfo) instead.
 * @param content content which is transformed from extended item.
 */
public void setExtendedItemContent(IContent content);
Program: 74236
Project: 74236
Buggy source:
/** 
 * passes a handle to the extended report item model to the extension
 * @param modelHandle a handle to the extended item model object
 */
public abstract void setModelObject(ExtendedItemHandle modelHandle);

Fixed version (ground truth):
/** 
 * passes a handle to the extended report item model to the extension
 * @deprecated implement #init(IReportItemPresentationInfo) instead
 * @param modelHandle a handle to the extended item model object
 */
public abstract void setModelObject(ExtendedItemHandle modelHandle);
Program: 74237
Project: 74237
Buggy source:
/** 
 * Set dynamic style.
 */
public void setDynamicStyle(IStyle style);

Fixed version (ground truth):
/** 
 * @deprecated implement #init(IReportItemPresentationInfo) instead.Set dynamic style.
 */
public void setDynamicStyle(IStyle style);
Program: 74238
Project: 74238
Buggy source:
/** 
 * @param ah the HTML action handler used to create a URL based on an action
 */
public abstract void setActionHandler(IHTMLActionHandler ah);

Fixed version (ground truth):
/** 
 * @deprecated implement #init(IReportItemPresentationInfo) instead.
 * @param ah the HTML action handler used to create a URL based on an action
 */
public abstract void setActionHandler(IHTMLActionHandler ah);
Program: 74239
Project: 74239
Buggy source:
/** 
 * sets the output format, i.e., HTML, PDF, etc.
 * @param outputFormat the output format, i.e., html, pdf, etc.
 */
public abstract void setOutputFormat(String outputFormat);

Fixed version (ground truth):
/** 
 * sets the output format, i.e., HTML, PDF, etc.
 * @deprecated implement #init(IReportItemPresentationInfo) instead.
 * @param outputFormat the output format, i.e., html, pdf, etc.
 */
public abstract void setOutputFormat(String outputFormat);
Program: 74240
Project: 74240
Buggy source:
/** 
 * passes the locale used in the presentation.
 * @param locale locale
 */
public void setLocale(Locale locale);

Fixed version (ground truth):
/** 
 * passes the locale used in the presentation.
 * @deprecated implement #init(IReportItemPresentationInfo) instead.
 * @param locale locale
 */
public void setLocale(Locale locale);
Program: 74241
Project: 74241
Buggy source:
/** 
 * sets the image formats that are supported for this output format. Formats are separated by semi-colon. For example, the argument could be JPG;PNG;BMP;SVG
 * @param supportedImageFormats the image formats that the presentation engine could support.
 */
public abstract void setSupportedImageFormats(String supportedImageFormats);

Fixed version (ground truth):
/** 
 * sets the image formats that are supported for this output format. Formats are separated by semi-colon. For example, the argument could be JPG;PNG;BMP;SVG
 * @deprecated implement #init(IReportItemPresentationInfo) instead.
 * @param supportedImageFormats the image formats that the presentation engine could support.
 */
public abstract void setSupportedImageFormats(String supportedImageFormats);
Program: 74242
Project: 74242
Buggy source:
public void setReportQueries(IBaseQueryDefinition[] queries){
}

Fixed version (ground truth):
public void setReportQueries(IDataQueryDefinition[] queries){
}
Program: 74243
Project: 74243
Buggy source:
public void setReportQueries(IBaseQueryDefinition[] queries){
}

Fixed version (ground truth):
public void setReportQueries(IDataQueryDefinition[] queries){
}
Program: 74245
Project: 74245
Buggy source:
/** 
 * pass the prepared query definition to extended item implementation, so that it can access data.
 * @deprecated implement #init(IReportItemGenerationInfo) instead
 */
public void setReportQueries(IBaseQueryDefinition[] queries);

Fixed version (ground truth):
/** 
 * pass the prepared query definition to extended item implementation, so that it can access data.
 * @deprecated implement #init(IReportItemGenerationInfo) instead
 */
public void setReportQueries(IDataQueryDefinition[] queries);
Program: 74246
Project: 74246
Buggy source:
public IBaseQueryDefinition[] getReportQueries();

Fixed version (ground truth):
public IDataQueryDefinition[] getReportQueries();
Program: 74247
Project: 74247
Buggy source:
/** 
 * @deprecated implement #init(IReportItemPresentationInfo) instead.pass the prepared query definition to extended item implementation, so that it can access data.
 */
public void setReportQueries(IBaseQueryDefinition[] queries);

Fixed version (ground truth):
/** 
 * @deprecated implement #init(IReportItemPresentationInfo) instead.pass the prepared query definition to extended item implementation, so that it can access data.
 */
public void setReportQueries(IDataQueryDefinition[] queries);
Program: 74248
Project: 74248
Buggy source:
public IBaseQueryDefinition[] getReportQueries();

Fixed version (ground truth):
public IDataQueryDefinition[] getReportQueries();
Program: 74249
Project: 74249
Buggy source:
public void setReportQueries(IBaseQueryDefinition[] queries){
  this.queries=queries;
}

Fixed version (ground truth):
public void setReportQueries(IDataQueryDefinition[] queries){
  this.queries=queries;
}
Program: 74250
Project: 74250
Buggy source:
public void setReportQueries(IBaseQueryDefinition[] queries){
  this.queries=queries;
}

Fixed version (ground truth):
public void setReportQueries(IDataQueryDefinition[] queries){
  this.queries=queries;
}
Program: 74251
Project: 74251
Buggy source:
public void setReportQueries(IBaseQueryDefinition[] queries){
  this.queries=queries;
}

Fixed version (ground truth):
public void setReportQueries(IDataQueryDefinition[] queries){
  this.queries=queries;
}
Program: 74252
Project: 74252
Buggy source:
public IBaseQueryDefinition[] getReportQueries(){
  return queries;
}

Fixed version (ground truth):
public IDataQueryDefinition[] getReportQueries(){
  return queries;
}
Program: 74253
Project: 74253
Buggy source:
public void setReportQueries(IBaseQueryDefinition[] queries){
  this.queries=queries;
}

Fixed version (ground truth):
public void setReportQueries(IDataQueryDefinition[] queries){
  this.queries=queries;
}
Program: 74254
Project: 74254
Buggy source:
public IBaseQueryDefinition[] getReportQueries(){
  return queries;
}

Fixed version (ground truth):
public IDataQueryDefinition[] getReportQueries(){
  return queries;
}
Program: 74258
Project: 74258
Buggy source:
/** 
 * Constructor. This is for runAndRender task.
 * @param locale
 * @param isEmbeddable
 * @param isRtl
 * @param isMasterPageContent
 * @param format
 * @param svg
 */
public ViewerHTMLActionHandler(Locale locale,boolean isRtl,boolean isMasterPageContent,String format,Boolean svg){
  this.locale=locale;
  this.isRtl=isRtl;
  this.isMasterPageContent=isMasterPageContent;
  this.hostFormat=format;
  this.svg=svg;
}

Fixed version (ground truth):
/** 
 * Constructor. This is for runAndRender task.
 * @param locale
 * @param isEmbeddable
 * @param isRtl
 * @param isMasterPageContent
 * @param format
 * @param svg
 * @param isDesigner
 */
public ViewerHTMLActionHandler(Locale locale,boolean isRtl,boolean isMasterPageContent,String format,Boolean svg,String isDesigner){
  this.locale=locale;
  this.isRtl=isRtl;
  this.isMasterPageContent=isMasterPageContent;
  this.hostFormat=format;
  this.svg=svg;
  this.isDesigner=isDesigner;
}