nus-yam/ex-repair huggingface dataset:
Program: 77542
Project: 77542
Buggy source:
/** 
 * @param ri
 * @return
 * @throws DataException 
 */
public int getRowID(IResultIterator ri) throws DataException {
  if (mode == -1)   init(ri);
  if (mode == MODE_NORMAL) {
    return ri.getCurrentResultIndex();
  }
 else {
    IResultObject ob=ri.getCurrentResult();
    if (ob == null)     return -1;
 else     return ((Integer)ob.getFieldValue(rowIDPos)).intValue();
  }
}

Fixed version (ground truth):
/** 
 * @param ri
 * @return
 * @throws DataException 
 */
public int getRowID(IResultIterator ri,int currIndex) throws DataException {
  if (mode == -1)   init(ri);
  if (mode == MODE_NORMAL) {
    return currIndex;
  }
 else {
    IResultObject ob=ri.getCurrentResult();
    if (ob == null)     return -1;
 else     return ((Integer)ob.getFieldValue(rowIDPos)).intValue();
  }
}
Program: 77543
Project: 77543
Buggy source:
private void updateFormatField(){
  String displayFormat;
  IChoiceSet choiceSet=getFormatChoiceSet(getSelectedDataType());
  if (choiceSet == null) {
    displayFormat=DesignEngine.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_STRING_FORMAT_TYPE).findChoice(DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED).getDisplayName();
  }
 else {
    displayFormat=choiceSet.findChoice(formatCategroy).getDisplayName();
    if (formatCategroy != DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM) {
      displayFormat+="String_Node_Str" + formatPattern;
    }
  }
  formatField.setText("String_Node_Str" + displayFormat);
  changeFormat.setEnabled(choiceSet != null);
  if (selectedParameter != null) {
    doPreview(formatCategroy != DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM ? formatCategroy : formatPattern);
  }
}

Fixed version (ground truth):
private void updateFormatField(){
  String displayFormat;
  IChoiceSet choiceSet=getFormatChoiceSet(getSelectedDataType());
  if (choiceSet == null) {
    displayFormat=DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_STRING_FORMAT_TYPE).findChoice(DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED).getDisplayName();
  }
 else {
    displayFormat=choiceSet.findChoice(formatCategroy).getDisplayName();
    if (formatCategroy != DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM) {
      displayFormat+="String_Node_Str" + formatPattern;
    }
  }
  formatField.setText("String_Node_Str" + displayFormat);
  changeFormat.setEnabled(choiceSet != null);
  if (selectedParameter != null) {
    doPreview(formatCategroy != DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM ? formatCategroy : formatPattern);
  }
}
Program: 77544
Project: 77544
Buggy source:
private IChoiceSet getFormatChoiceSet(String type){
  IChoiceSet choiceSet=null;
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
    choiceSet=DesignEngine.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_STRING_FORMAT_TYPE);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    choiceSet=DesignEngine.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_DATETIME_FORMAT_TYPE);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type) || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
    choiceSet=DesignEngine.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_NUMBER_FORMAT_TYPE);
  }
  return choiceSet;
}

Fixed version (ground truth):
private IChoiceSet getFormatChoiceSet(String type){
  IChoiceSet choiceSet=null;
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
    choiceSet=DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_STRING_FORMAT_TYPE);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    choiceSet=DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_DATETIME_FORMAT_TYPE);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type) || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type) || DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type)) {
    choiceSet=DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_NUMBER_FORMAT_TYPE);
  }
  return choiceSet;
}
Program: 77545
Project: 77545
Buggy source:
public List getPropertyDefns(){
  if (provider != null)   return provider.getPropertyDefns();
  return super.getPropertyDefns();
}

Fixed version (ground truth):
public List getPropertyDefns(){
  if (provider != null && !(provider instanceof OdaDummyProvider))   return provider.getPropertyDefns();
  return super.getPropertyDefns();
}
Program: 77546
Project: 77546
Buggy source:
protected void setIntrinsicProperty(String propName,Object value){
  if (EXTENSION_ID_PROP.equals(propName)) {
    extensionID=(String)value;
    if (extensionID != null)     provider=ODAProviderFactory.getInstance().createODAProvider(this,extensionID);
 else     provider=null;
  }
 else {
    super.setIntrinsicProperty(propName,value);
  }
}

Fixed version (ground truth):
protected void setIntrinsicProperty(String propName,Object value){
  if (EXTENSION_ID_PROP.equals(propName)) {
    extensionID=(String)value;
    if (extensionID != null) {
      provider=ODAProviderFactory.getInstance().createODAProvider(this,extensionID);
      if (!provider.isValidODADataSetExtensionID(extensionID))       provider=new OdaDummyProvider(extensionID);
    }
 else     provider=null;
  }
 else {
    super.setIntrinsicProperty(propName,value);
  }
}
Program: 77547
Project: 77547
Buggy source:
public void checkExtends(DesignElement parent) throws ExtendsException {
  super.checkExtends(parent);
  if (provider != null)   provider.checkExtends(parent);
 else {
    OdaDataSet odaParent=(OdaDataSet)parent;
    if (odaParent.extensionID != null && !odaParent.extensionID.equals(extensionID))     throw new WrongTypeException(this,parent,WrongTypeException.DESIGN_EXCEPTION_WRONG_EXTENSION_TYPE);
    if (extensionID != null && !extensionID.equals(odaParent.extensionID))     throw new WrongTypeException(this,parent,WrongTypeException.DESIGN_EXCEPTION_WRONG_EXTENSION_TYPE);
  }
}

Fixed version (ground truth):
public void checkExtends(DesignElement parent) throws ExtendsException {
  super.checkExtends(parent);
  if (provider != null && !(provider instanceof OdaDummyProvider))   provider.checkExtends(parent);
 else {
    OdaDataSet odaParent=(OdaDataSet)parent;
    if (odaParent.extensionID != null && !odaParent.extensionID.equals(extensionID))     throw new WrongTypeException(this,parent,WrongTypeException.DESIGN_EXCEPTION_WRONG_EXTENSION_TYPE);
    if (extensionID != null && !extensionID.equals(odaParent.extensionID))     throw new WrongTypeException(this,parent,WrongTypeException.DESIGN_EXCEPTION_WRONG_EXTENSION_TYPE);
  }
}
Program: 77548
Project: 77548
Buggy source:
public List getPropertyDefns(){
  if (provider != null)   return provider.getPropertyDefns();
  return super.getPropertyDefns();
}

Fixed version (ground truth):
public List getPropertyDefns(){
  if (provider != null && !(provider instanceof OdaDummyProvider))   return provider.getPropertyDefns();
  return super.getPropertyDefns();
}
Program: 77549
Project: 77549
Buggy source:
protected void setIntrinsicProperty(String propName,Object value){
  if (EXTENSION_ID_PROP.equals(propName)) {
    extensionID=(String)value;
    if (extensionID != null)     provider=ODAProviderFactory.getInstance().createODAProvider(this,extensionID);
 else     provider=null;
  }
 else {
    super.setIntrinsicProperty(propName,value);
  }
}

Fixed version (ground truth):
protected void setIntrinsicProperty(String propName,Object value){
  if (EXTENSION_ID_PROP.equals(propName)) {
    extensionID=(String)value;
    if (extensionID != null) {
      provider=ODAProviderFactory.getInstance().createODAProvider(this,extensionID);
      if (!provider.isValidODADataSourceExtensionID(extensionID))       provider=new OdaDummyProvider(extensionID);
    }
 else     provider=null;
  }
 else {
    super.setIntrinsicProperty(propName,value);
  }
}
Program: 77550
Project: 77550
Buggy source:
public void checkExtends(DesignElement parent) throws ExtendsException {
  super.checkExtends(parent);
  if (provider != null)   provider.checkExtends(parent);
 else {
    OdaDataSource odaParent=(OdaDataSource)parent;
    if (odaParent.extensionID != null && !odaParent.extensionID.equals(extensionID))     throw new WrongTypeException(this,parent,WrongTypeException.DESIGN_EXCEPTION_WRONG_EXTENSION_TYPE);
    if (extensionID != null && !extensionID.equals(odaParent.extensionID))     throw new WrongTypeException(this,parent,WrongTypeException.DESIGN_EXCEPTION_WRONG_EXTENSION_TYPE);
  }
}

Fixed version (ground truth):
public void checkExtends(DesignElement parent) throws ExtendsException {
  super.checkExtends(parent);
  if (provider != null && !(provider instanceof OdaDummyProvider))   provider.checkExtends(parent);
 else {
    OdaDataSource odaParent=(OdaDataSource)parent;
    if (odaParent.extensionID != null && !odaParent.extensionID.equals(extensionID))     throw new WrongTypeException(this,parent,WrongTypeException.DESIGN_EXCEPTION_WRONG_EXTENSION_TYPE);
    if (extensionID != null && !extensionID.equals(odaParent.extensionID))     throw new WrongTypeException(this,parent,WrongTypeException.DESIGN_EXCEPTION_WRONG_EXTENSION_TYPE);
  }
}
Program: 77551
Project: 77551
Buggy source:
/** 
 * @param dataEngine
 * @param queryDefn
 * @param dataSetDesign
 * @throws DataException
 */
PreparedOdaDSQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn,IBaseDataSetDesign dataSetDesign,Map appContext) throws DataException {
  super(dataEngine,queryDefn,dataSetDesign,appContext);
}

Fixed version (ground truth):
/** 
 * @param dataEngine
 * @param queryDefn
 * @param dataSetDesign
 * @throws DataException
 */
PreparedOdaDSQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn,IBaseDataSetDesign dataSetDesign,Map appContext) throws DataException {
  super(dataEngine,queryDefn,dataSetDesign,appContext != null ? appContext : new HashMap());
}
Program: 77552
Project: 77552
Buggy source:
public IParameterMetaData getParameterMetaData() throws OdaException {
  assertNotNull(callStat);
  return new SPParameterMetaData(getCallableParamMetaData());
}

Fixed version (ground truth):
public IParameterMetaData getParameterMetaData() throws OdaException {
  assertNotNull(callStat);
  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));
  }
  return new SPParameterMetaData(paramMetaList2);
}
Program: 77553
Project: 77553
Buggy source:
public void setAppContext(Object context) throws OdaException {
}

Fixed version (ground truth):
public void setAppContext(Object context) throws OdaException {
  if (context instanceof Map) {
    parameterDefn=(IParameterMetaData)(((Map)context).get("String_Node_Str"));
  }
}
Program: 77554
Project: 77554
Buggy source:
/** 
 * get paremeter metadata for callableStatement, if metadata is null or data mode is unknown or SQLException is thrown, register output parameter on DatabaseMetadata, else register output paremeter on statement's metadata.
 * @throws OdaException
 */
private void registerOutputParameter() throws OdaException {
  ParameterMetaData metaData=null;
  try {
    metaData=this.callStat.getParameterMetaData();
  }
 catch (  SQLException e) {
    metaData=null;
  }
  try {
    if (metaData != null) {
      for (int index=1; index <= metaData.getParameterCount(); index++) {
        if (metaData.getParameterMode(index) == ParameterMetaData.parameterModeUnknown) {
          registerOnDbMetaData();
          break;
        }
 else         if (metaData.getParameterMode(index) == java.sql.ParameterMetaData.parameterModeOut || metaData.getParameterMode(index) == java.sql.ParameterMetaData.parameterModeInOut)         registerOutParameter(index,metaData.getParameterType(index));
      }
    }
 else     registerOnDbMetaData();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.QUERY_EXECUTE_FAIL,e);
  }
}

Fixed version (ground truth):
/** 
 * get paremeter metadata for callableStatement, if metadata is null or data mode is unknown or SQLException is thrown, register output parameter on DatabaseMetadata, else register output paremeter on statement's metadata.
 * @throws OdaException
 */
private void registerOutputParameter() throws OdaException {
  if (parameterDefn != null) {
    for (int i=0; i < parameterDefn.getParameterCount(); i++) {
      if (parameterDefn.getParameterMode(i) == IParameterMetaData.parameterModeOut || parameterDefn.getParameterMode(i) == IParameterMetaData.parameterModeInOut) {
        registerOutParameter(i + 1,parameterDefn.getParameterType(i));
      }
    }
  }
}
Program: 77555
Project: 77555
Buggy source:
private void refreshDataSets(){
  String selectedDataSetName=dataSetChooser.getText();
  String[] oldList=dataSetChooser.getItems();
  List dataSetList=new ArrayList();
  for (Iterator iterator=inputParameter.getModuleHandle().getVisibleDataSets().iterator(); iterator.hasNext(); ) {
    DataSetHandle DataSetHandle=(DataSetHandle)iterator.next();
    dataSetList.add(DataSetHandle.getQualifiedName());
  }
  if (!dataSetList.contains(inputParameter.getDataSetName())) {
    dataSetList.add(0,inputParameter.getDataSetName());
  }
  if (oldList.length != dataSetList.size()) {
    dataSetChooser.setItems((String[])dataSetList.toArray(new String[]{}));
    if (StringUtil.isBlank(selectedDataSetName)) {
      dataSetChooser.select(0);
      refreshColumns(false);
    }
 else {
      dataSetChooser.setText(selectedDataSetName);
    }
  }
}

Fixed version (ground truth):
private void refreshDataSets(){
  String selectedDataSetName=dataSetChooser.getText();
  String[] oldList=dataSetChooser.getItems();
  List dataSetList=new ArrayList();
  for (Iterator iterator=inputParameter.getModuleHandle().getVisibleDataSets().iterator(); iterator.hasNext(); ) {
    DataSetHandle DataSetHandle=(DataSetHandle)iterator.next();
    dataSetList.add(DataSetHandle.getQualifiedName());
  }
  if (inputParameter.getDataSetName() != null && !dataSetList.contains(inputParameter.getDataSetName())) {
    dataSetList.add(0,inputParameter.getDataSetName());
  }
  if (oldList.length != dataSetList.size()) {
    dataSetChooser.setItems((String[])dataSetList.toArray(new String[]{}));
    if (StringUtil.isBlank(selectedDataSetName)) {
      dataSetChooser.select(0);
      refreshColumns(false);
    }
 else {
      dataSetChooser.setText(selectedDataSetName);
    }
  }
}
Program: 77556
Project: 77556
Buggy source:
/** 
 * Constructs a new instance of the dialog
 */
public ImportValueDialog(String style){
  super(DLG_TITLE);
  Assert.isTrue(DesignEngine.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_PARAM_TYPE).contains(style));
  this.style=style;
}

Fixed version (ground truth):
/** 
 * Constructs a new instance of the dialog
 */
public ImportValueDialog(String style){
  super(DLG_TITLE);
  Assert.isTrue(DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_PARAM_TYPE).contains(style));
  this.style=style;
}
Program: 77557
Project: 77557
Buggy source:
private void createColumnSelectionArea(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout(2,true));
  composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  Composite selectionArea=new Composite(composite,SWT.NONE);
  selectionArea.setLayout(UIUtil.createGridLayoutWithoutMargin(2,false));
  selectionArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  new Label(composite,SWT.NONE);
  new Label(selectionArea,SWT.NONE).setText(LABEL_SELECT_DATASET);
  dataSetChooser=new Combo(selectionArea,SWT.DROP_DOWN | SWT.READ_ONLY);
  dataSetChooser.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  dataSetChooser.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      String newSelection=dataSetChooser.getText();
      if (!currentDataSetName.equals(newSelection)) {
        currentDataSetName=newSelection;
        refreshColumns();
      }
    }
  }
);
  new Label(selectionArea,SWT.NONE).setText(LABEL_SELECT_COLUMN);
  columnChooser=new Combo(selectionArea,SWT.DROP_DOWN | SWT.READ_ONLY);
  columnChooser.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  columnChooser.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      int newSelectedIndex=columnChooser.getSelectionIndex();
      if (selectedColumnIndex != newSelectedIndex) {
        selectedColumnIndex=newSelectedIndex;
        refreshValues();
      }
    }
  }
);
}

Fixed version (ground truth):
private void createColumnSelectionArea(Composite parent){
  Composite selectionArea=new Composite(parent,SWT.NONE);
  selectionArea.setLayout(UIUtil.createGridLayoutWithoutMargin(2,false));
  selectionArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  new Label(selectionArea,SWT.NONE).setText(LABEL_SELECT_DATASET);
  dataSetChooser=new Combo(selectionArea,SWT.DROP_DOWN | SWT.READ_ONLY);
  dataSetChooser.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  dataSetChooser.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      String newSelection=dataSetChooser.getText();
      if (!currentDataSetName.equals(newSelection)) {
        currentDataSetName=newSelection;
        refreshColumns();
      }
    }
  }
);
  new Label(selectionArea,SWT.NONE).setText(LABEL_SELECT_COLUMN);
  columnChooser=new Combo(selectionArea,SWT.DROP_DOWN | SWT.READ_ONLY);
  columnChooser.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  columnChooser.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      int newSelectedIndex=columnChooser.getSelectionIndex();
      if (selectedColumnIndex != newSelectedIndex) {
        selectedColumnIndex=newSelectedIndex;
        refreshValues();
      }
    }
  }
);
}
Program: 77558
Project: 77558
Buggy source:
protected IContentEmitter createContentEmitter() throws EngineException {
  String format=executionContext.getOutputFormat();
  if ("String_Node_Str".equalsIgnoreCase(format)) {
    bodyOnly=false;
  }
 else {
    bodyOnly=true;
  }
  ExtensionManager extManager=ExtensionManager.getInstance();
  boolean supported=false;
  Collection supportedFormats=extManager.getSupportedFormat();
  Iterator iter=supportedFormats.iterator();
  while (iter.hasNext()) {
    String supportedFormat=(String)iter.next();
    if (supportedFormat != null && supportedFormat.equalsIgnoreCase(format)) {
      supported=true;
      break;
    }
  }
  if (!supported) {
    log.log(Level.SEVERE,MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
    throw new EngineException(MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
  }
  IContentEmitter emitter=extManager.createEmitter(format,emitterID);
  if (emitter == null) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION);
  }
  if (!bodyOnly) {
    emitter=new HTMLTableLayoutEmitter(emitter,true);
  }
  return emitter;
}

Fixed version (ground truth):
protected IContentEmitter createContentEmitter() throws EngineException {
  String format=executionContext.getOutputFormat();
  if ("String_Node_Str".equalsIgnoreCase(format)) {
    bodyOnly=false;
  }
 else {
    bodyOnly=true;
  }
  ExtensionManager extManager=ExtensionManager.getInstance();
  boolean supported=false;
  Collection supportedFormats=extManager.getSupportedFormat();
  Iterator iter=supportedFormats.iterator();
  while (iter.hasNext()) {
    String supportedFormat=(String)iter.next();
    if (supportedFormat != null && supportedFormat.equalsIgnoreCase(format)) {
      supported=true;
      break;
    }
  }
  if (!supported) {
    log.log(Level.SEVERE,MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
    throw new UnsupportedFormatException(MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
  }
  IContentEmitter emitter=extManager.createEmitter(format,emitterID);
  if (emitter == null) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION);
  }
  if (!bodyOnly) {
    emitter=new HTMLTableLayoutEmitter(emitter,true);
  }
  return emitter;
}
Program: 77561
Project: 77561
Buggy source:
public int getParameterCount() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    return paraMetadata.getParameterCount();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_COUNT_CANNOT_GET,e);
  }
}

Fixed version (ground truth):
public int getParameterCount() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    return paraMetadata.getParameterCount();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_COUNT_CANNOT_GET,e);
  }
catch (  Exception e) {
    throw new JDBCException(ResourceConstants.PARAMETER_COUNT_CANNOT_GET,new SQLException(e.getMessage()));
  }
}
Program: 77562
Project: 77562
Buggy source:
public int getScale(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    return paraMetadata.getScale(param);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_SCALE_CANNOT_GET,e);
  }
}

Fixed version (ground truth):
public int getScale(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    return paraMetadata.getScale(param);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_SCALE_CANNOT_GET,e);
  }
catch (  Exception e) {
    throw new JDBCException(ResourceConstants.PARAMETER_SCALE_CANNOT_GET,new SQLException(e.getMessage()));
  }
}
Program: 77563
Project: 77563
Buggy source:
public int isNullable(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    int result=IParameterMetaData.parameterNullableUnknown;
    if (paraMetadata.isNullable(param) == java.sql.ParameterMetaData.parameterNullable)     result=IParameterMetaData.parameterNullable;
 else     if (paraMetadata.isNullable(param) == java.sql.ParameterMetaData.parameterNoNulls)     result=IParameterMetaData.parameterNoNulls;
    return result;
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_NULLABILITY_CANNOT_DETERMINE,e);
  }
}

Fixed version (ground truth):
public int isNullable(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    int result=IParameterMetaData.parameterNullableUnknown;
    if (paraMetadata.isNullable(param) == java.sql.ParameterMetaData.parameterNullable)     result=IParameterMetaData.parameterNullable;
 else     if (paraMetadata.isNullable(param) == java.sql.ParameterMetaData.parameterNoNulls)     result=IParameterMetaData.parameterNoNulls;
    return result;
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_NULLABILITY_CANNOT_DETERMINE,e);
  }
catch (  Exception e) {
    throw new JDBCException(ResourceConstants.PARAMETER_NULLABILITY_CANNOT_DETERMINE,new SQLException(e.getMessage()));
  }
}
Program: 77564
Project: 77564
Buggy source:
public int getParameterMode(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    int result=IParameterMetaData.parameterModeUnknown;
    if (paraMetadata.getParameterMode(param) == java.sql.ParameterMetaData.parameterModeIn)     result=IParameterMetaData.parameterModeIn;
 else     if (paraMetadata.getParameterMode(param) == java.sql.ParameterMetaData.parameterModeOut)     result=IParameterMetaData.parameterModeOut;
 else     if (paraMetadata.getParameterMode(param) == java.sql.ParameterMetaData.parameterModeInOut)     result=IParameterMetaData.parameterModeInOut;
    return result;
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_MODE_CANNOT_GET,e);
  }
}

Fixed version (ground truth):
public int getParameterMode(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    int result=IParameterMetaData.parameterModeUnknown;
    if (paraMetadata.getParameterMode(param) == java.sql.ParameterMetaData.parameterModeIn)     result=IParameterMetaData.parameterModeIn;
 else     if (paraMetadata.getParameterMode(param) == java.sql.ParameterMetaData.parameterModeOut)     result=IParameterMetaData.parameterModeOut;
 else     if (paraMetadata.getParameterMode(param) == java.sql.ParameterMetaData.parameterModeInOut)     result=IParameterMetaData.parameterModeInOut;
    return result;
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_MODE_CANNOT_GET,e);
  }
catch (  Exception e) {
    throw new JDBCException(ResourceConstants.PARAMETER_MODE_CANNOT_GET,new SQLException(e.getMessage()));
  }
}
Program: 77565
Project: 77565
Buggy source:
public String getParameterTypeName(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    return paraMetadata.getParameterTypeName(param);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_TYPE_NAME_CANNOT_GET,e);
  }
}

Fixed version (ground truth):
public String getParameterTypeName(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    return paraMetadata.getParameterTypeName(param);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_TYPE_NAME_CANNOT_GET,e);
  }
catch (  Exception e) {
    throw new JDBCException(ResourceConstants.PARAMETER_TYPE_NAME_CANNOT_GET,new SQLException(e.getMessage()));
  }
}
Program: 77566
Project: 77566
Buggy source:
public int getPrecision(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    return paraMetadata.getPrecision(param);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_PRECISION_CANNOT_GET,e);
  }
}

Fixed version (ground truth):
public int getPrecision(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    return paraMetadata.getPrecision(param);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_PRECISION_CANNOT_GET,e);
  }
catch (  Exception e) {
    throw new JDBCException(ResourceConstants.PARAMETER_PRECISION_CANNOT_GET,new SQLException(e.getMessage()));
  }
}
Program: 77567
Project: 77567
Buggy source:
public int getParameterType(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    return paraMetadata.getParameterType(param);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_TYPE_CANNOT_GET,e);
  }
}

Fixed version (ground truth):
public int getParameterType(int param) throws OdaException {
  logger.logp(java.util.logging.Level.FINE,ParameterMetaData.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(paraMetadata);
  try {
    return paraMetadata.getParameterType(param);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PARAMETER_TYPE_CANNOT_GET,e);
  }
catch (  Exception e) {
    throw new JDBCException(ResourceConstants.PARAMETER_TYPE_CANNOT_GET,new SQLException(e.getMessage()));
  }
}
Program: 77568
Project: 77568
Buggy source:
/** 
 * Add this method according to GUI's requirement.This method is only for temporarily usage.
 * @param dataSetHandle
 * @return
 * @throws SemanticException
 * @deprecated
 */
public static CachedMetaDataHandle getCachedMetaDataHandle(DataSetHandle dataSetHandle) throws SemanticException {
  if (dataSetHandle.getCachedMetaDataHandle() == null) {
    updateColumnCache(dataSetHandle);
  }
  return dataSetHandle.getCachedMetaDataHandle();
}

Fixed version (ground truth):
/** 
 * Add this method according to GUI's requirement.This method is only for temporarily usage.
 * @param dataSetHandle
 * @return
 * @throws SemanticException
 * @deprecated
 */
public static CachedMetaDataHandle getCachedMetaDataHandle(DataSetHandle dataSetHandle) throws SemanticException {
  if (dataSetHandle.getCachedMetaDataHandle() == null) {
    updateColumnCache(dataSetHandle,true);
  }
  return dataSetHandle.getCachedMetaDataHandle();
}
Program: 77569
Project: 77569
Buggy source:
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param items
 * @throws SemanticException
 */
public static void updateColumnCache(DataSetHandle dataSetHandle) throws SemanticException {
  DataSessionContext context=null;
  try {
    context=new DataSessionContext(DataEngineContext.DIRECT_PRESENTATION,dataSetHandle.getRoot(),null);
    DataRequestSession drSession=DataRequestSession.newSession(context);
    drSession.refreshMetaData(dataSetHandle);
  }
 catch (  BirtException e) {
    logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{e});
  }
}

Fixed version (ground truth):
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param items
 * @throws SemanticException
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent) throws SemanticException {
  DataSessionContext context=null;
  try {
    context=new DataSessionContext(DataEngineContext.DIRECT_PRESENTATION,dataSetHandle.getRoot(),null);
    DataRequestSession drSession=DataRequestSession.newSession(context);
    drSession.refreshMetaData(dataSetHandle,holdEvent);
  }
 catch (  BirtException e) {
    logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{e});
  }
}
Program: 77570
Project: 77570
Buggy source:
/** 
 * Get the metadata information from the specified DataSetHandle. It will execute a query, force the cached metadata stored in the report design to be updated with the latest data set metadata read from out source. When there is any error in this action, an empty cached metadata will be inserted and an exception will be thrown out. Since This method will change the data of model and it does not process any model change event, it is the responsible of the caller to make sure these events will be properly handled.
 * @param dataSetHandle
 * @return the result metadata of specfied dataSetHandle
 * @throws BirtException
 */
public abstract IResultMetaData refreshMetaData(DataSetHandle dataSetHandle) throws BirtException ;

Fixed version (ground truth):
/** 
 * This method basically shares the same function as <code> refreshMetaData( DataSetHandle dataSetHandle )</code>, the only difference is the caller of this method will have the control over whether to hold the event or not. It is added largely for the backward compatibility
 * @param dataSetHandle
 * @param holdEvent true if holdEvent, false otherwise
 * @return
 * @throws BirtException
 */
public abstract IResultMetaData refreshMetaData(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException ;
Program: 77571
Project: 77571
Buggy source:
public IResultMetaData refreshMetaData(DataSetHandle dataSetHandle) throws BirtException {
  return new DataSetMetaDataHelper(this.dataEngine,this.modelAdaptor,this.sessionContext).refreshMetaData(dataSetHandle);
}

Fixed version (ground truth):
public IResultMetaData refreshMetaData(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  return new DataSetMetaDataHelper(this.dataEngine,this.modelAdaptor,this.sessionContext).refreshMetaData(dataSetHandle,holdEvent);
}
Program: 77572
Project: 77572
Buggy source:
/** 
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
IResultMetaData refreshMetaData(DataSetHandle dataSetHandle) throws BirtException {
  IResultMetaData rsMeta=null;
  BirtException e=null;
  try {
    rsMeta=this.getDataSetMetaData(dataSetHandle,false);
  }
 catch (  BirtException e1) {
    e=e1;
  }
  if (needsSetCachedMetaData(dataSetHandle,rsMeta)) {
    dataSetHandle.setCachedMetaData(StructureFactory.createCachedMetaData());
    if (rsMeta != null && rsMeta.getColumnCount() != 0) {
      for (int i=1; i <= rsMeta.getColumnCount(); i++) {
        ResultSetColumn rsc=StructureFactory.createResultSetColumn();
        rsc.setColumnName(getColumnName(rsMeta,i));
        rsc.setDataType(toModelDataType(rsMeta.getColumnType(i)));
        rsc.setPosition(new Integer(i));
        dataSetHandle.getCachedMetaDataHandle().getResultSet().addItem(rsc);
      }
    }
  }
  if (e != null)   throw e;
  return rsMeta;
}

Fixed version (ground truth):
/** 
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
IResultMetaData refreshMetaData(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  IResultMetaData rsMeta=null;
  BirtException e=null;
  try {
    rsMeta=this.getDataSetMetaData(dataSetHandle,false);
  }
 catch (  BirtException e1) {
    e=e1;
  }
  if (needsSetCachedMetaData(dataSetHandle,rsMeta)) {
    List columnList=new ArrayList();
    if (rsMeta != null && rsMeta.getColumnCount() != 0) {
      for (int i=1; i <= rsMeta.getColumnCount(); i++) {
        ResultSetColumn rsc=StructureFactory.createResultSetColumn();
        rsc.setColumnName(getColumnName(rsMeta,i));
        rsc.setDataType(toModelDataType(rsMeta.getColumnType(i)));
        rsc.setPosition(new Integer(i));
        columnList.add(rsc);
      }
    }
    if (holdEvent) {
      CompaibilityUtil.updateResultSetinCachedMetaData(dataSetHandle,columnList);
    }
 else {
      dataSetHandle.setCachedMetaData(StructureFactory.createCachedMetaData());
      for (int i=0; i < columnList.size(); i++) {
        dataSetHandle.getCachedMetaDataHandle().getResultSet().addItem((ResultSetColumn)columnList.get(i));
      }
    }
  }
  if (e != null)   throw e;
  return rsMeta;
}
Program: 77573
Project: 77573
Buggy source:
protected void __initParameters(HttpServletRequest request) throws Exception {
  this.reportDesignHandle=getDesignHandle(request);
  InputOptions options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,request);
  options.setOption(InputOptions.OPT_LOCALE,locale);
  options.setOption(InputOptions.OPT_RTL,new Boolean(rtl));
  Collection parameterList=getParameterList();
  if (this.isDesigner && !IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath()))   parseConfigVars(request,parameterList);
  this.parametersAsString=getParsedParametersAsString(parameterList,request,options);
  this.parameterDefList=getReportService().getParameterDefinitions(this.reportDesignHandle,options,false);
  if (documentInUrl)   this.missingParameter=false;
 else   this.missingParameter=validateParameters(parameterDefList,this.parametersAsString);
  this.parametersAsString=getParsedParametersAsStringWithDefaultValue(this.parametersAsString,request,options);
  this.parameters=(HashMap)getParsedParameters(this.reportDesignHandle,parameterList,request,options);
}

Fixed version (ground truth):
protected void __initParameters(HttpServletRequest request) throws Exception {
  this.reportDesignHandle=getDesignHandle(request);
  InputOptions options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,request);
  options.setOption(InputOptions.OPT_LOCALE,locale);
  options.setOption(InputOptions.OPT_RTL,new Boolean(rtl));
  Collection parameterList=getParameterList();
  if (this.isDesigner && !IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath()))   parseConfigVars(request,parameterList);
  this.parametersAsString=getParsedParametersAsString(parameterList,request,options);
  this.parameterDefList=getReportService().getParameterDefinitions(this.reportDesignHandle,options,false);
  if (documentInUrl)   this.missingParameter=false;
 else   this.missingParameter=validateParameters(parameterDefList,this.parametersAsString);
  this.parametersAsString=getParsedParametersAsStringWithDefaultValue(this.parametersAsString,request,options);
  this.parameters=(HashMap)getParsedParameters(this.reportDesignHandle,parameterList,request,options);
  this.displayTexts=getDisplayTexts(this.displayTexts,request);
}
Program: 77575
Project: 77575
Buggy source:
public String runReport(IViewerReportDesignHandle design,String outputDocName,InputOptions runOptions,Map parameters) throws ReportServiceException {
  IReportRunnable runnable;
  HttpServletRequest request=(HttpServletRequest)runOptions.getOption(InputOptions.OPT_REQUEST);
  Locale locale=(Locale)runOptions.getOption(InputOptions.OPT_LOCALE);
  ViewerAttributeBean attrBean=(ViewerAttributeBean)request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
  Map parsedParams=attrBean.getParameters();
  if (parameters != null) {
    parsedParams.putAll(parameters);
  }
  runnable=(IReportRunnable)design.getDesignObject();
  try {
    ReportEngineService.getInstance().runReport(request,runnable,outputDocName,locale,(HashMap)parsedParams);
  }
 catch (  RemoteException e) {
    e.printStackTrace();
    throw new ReportServiceException(e.getLocalizedMessage());
  }
  return outputDocName;
}

Fixed version (ground truth):
public String runReport(IViewerReportDesignHandle design,String outputDocName,InputOptions runOptions,Map parameters,Map displayTexts) throws ReportServiceException {
  IReportRunnable runnable;
  HttpServletRequest request=(HttpServletRequest)runOptions.getOption(InputOptions.OPT_REQUEST);
  Locale locale=(Locale)runOptions.getOption(InputOptions.OPT_LOCALE);
  ViewerAttributeBean attrBean=(ViewerAttributeBean)request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
  Map parsedParams=attrBean.getParameters();
  if (parameters != null) {
    parsedParams.putAll(parameters);
  }
  Map displayTextMap=attrBean.getDisplayTexts();
  if (displayTexts != null) {
    displayTextMap.putAll(displayTexts);
  }
  runnable=(IReportRunnable)design.getDesignObject();
  try {
    ReportEngineService.getInstance().runReport(request,runnable,outputDocName,locale,parsedParams,displayTextMap);
  }
 catch (  RemoteException e) {
    e.printStackTrace();
    throw new ReportServiceException(e.getLocalizedMessage());
  }
  return outputDocName;
}
Program: 77576
Project: 77576
Buggy source:
public void runAndRenderReport(IViewerReportDesignHandle design,String outputDocName,InputOptions options,Map parameters,OutputStream out,List activeIds) throws ReportServiceException {
  HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
  Locale locale=(Locale)options.getOption(InputOptions.OPT_LOCALE);
  Boolean isMasterPageContent=(Boolean)options.getOption(InputOptions.OPT_IS_MASTER_PAGE_CONTENT);
  Boolean svgFlag=(Boolean)options.getOption(InputOptions.OPT_SVG_FLAG);
  String format=(String)options.getOption(InputOptions.OPT_RENDER_FORMAT);
  Boolean isRtl=(Boolean)options.getOption(InputOptions.OPT_RTL);
  try {
    IReportRunnable runnable=(IReportRunnable)design.getDesignObject();
    ReportEngineService.getInstance().runAndRenderReport(request,runnable,out,format,locale,isRtl.booleanValue(),parameters,isMasterPageContent.booleanValue(),svgFlag.booleanValue());
  }
 catch (  RemoteException e) {
    throw new ReportServiceException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void runAndRenderReport(IViewerReportDesignHandle design,String outputDocName,InputOptions options,Map parameters,OutputStream out,List activeIds,Map displayTexts) throws ReportServiceException {
  HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
  Locale locale=(Locale)options.getOption(InputOptions.OPT_LOCALE);
  Boolean isMasterPageContent=(Boolean)options.getOption(InputOptions.OPT_IS_MASTER_PAGE_CONTENT);
  Boolean svgFlag=(Boolean)options.getOption(InputOptions.OPT_SVG_FLAG);
  String format=(String)options.getOption(InputOptions.OPT_RENDER_FORMAT);
  Boolean isRtl=(Boolean)options.getOption(InputOptions.OPT_RTL);
  try {
    IReportRunnable runnable=(IReportRunnable)design.getDesignObject();
    ReportEngineService.getInstance().runAndRenderReport(request,runnable,out,format,locale,isRtl.booleanValue(),parameters,isMasterPageContent.booleanValue(),svgFlag.booleanValue(),displayTexts);
  }
 catch (  RemoteException e) {
    throw new ReportServiceException(e.getLocalizedMessage());
  }
}
Program: 77577
Project: 77577
Buggy source:
/** 
 * Run report.
 * @param request
 * @param runnable
 * @param archive
 * @param documentName
 * @param locale
 * @param parameters
 * @throws RemoteException
 */
public void runReport(HttpServletRequest request,IReportRunnable runnable,String documentName,Locale locale,HashMap parameters) throws RemoteException {
}

Fixed version (ground truth):
/** 
 * Run report.
 * @param request
 * @param runnable
 * @param archive
 * @param documentName
 * @param locale
 * @param parameters
 * @param displayTexts
 * @throws RemoteException
 */
public void runReport(HttpServletRequest request,IReportRunnable runnable,String documentName,Locale locale,Map parameters,Map displayTexts) throws RemoteException {
}
Program: 77578
Project: 77578
Buggy source:
private void runAndRenderReport(HttpServletRequest request,IReportRunnable runnable,OutputStream outputStream,String format,Locale locale,boolean rtl,Map parameters,boolean masterPage,boolean svgFlag,Boolean embeddable,List activeIds,HTMLRenderContext htmlRenderContext) throws RemoteException {
}

Fixed version (ground truth):
/** 
 * Run and render a report,
 * @param request
 * @param runnable
 * @param outputStream
 * @param locale
 * @param rtl
 * @param parameters
 * @param masterPage
 * @param svgFlag
 * @param activeIds
 * @param htmlRenderContext
 * @param displayTexts
 * @throws RemoteException
 * @throws IOException
 */
private void runAndRenderReport(HttpServletRequest request,IReportRunnable runnable,OutputStream outputStream,String format,Locale locale,boolean rtl,Map parameters,boolean masterPage,boolean svgFlag,Boolean embeddable,List activeIds,HTMLRenderContext htmlRenderContext,Map displayTexts) throws RemoteException {
}
Program: 77579
Project: 77579
Buggy source:
public static void shutdown(){
  instance=null;
}

Fixed version (ground truth):
/** 
 * Shutdown ReportEngineService, set instance as null
 */
public static void shutdown(){
  instance=null;
}
Program: 77580
Project: 77580
Buggy source:
/** 
 * Returns the library handle with the given namespace.
 * @param namespace the library namespace
 * @return the library handle with the given namespace
 */
public LibraryHandle getLibrary(String namespace){
  Module library=module.getLibraryWithNamespace(namespace,IModuleNameSpace.DIRECTLY_INCLUDED_LEVEL);
  if (library == null)   return null;
  return (LibraryHandle)library.getHandle(library);
}

Fixed version (ground truth):
/** 
 * Returns the library handle with the given namespace.
 * @param namespace the library namespace
 * @return the library handle with the given namespace
 */
public LibraryHandle getLibrary(String namespace){
  Module library=module.getLibraryWithNamespace(namespace,IModuleNameScope.DIRECTLY_INCLUDED_LEVEL);
  if (library == null)   return null;
  return (LibraryHandle)library.getHandle(library);
}
Program: 77581
Project: 77581
Buggy source:
/** 
 * Returns all data source handles that this modules and the included modules contain.
 * @return all data source handles that this modules and the includedmodules contain.
 */
public List getAllDataSources(){
  IModuleNameSpace namescope=module.getModuleNameSpace(Module.DATA_SOURCE_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameSpace.ARBITARY_LEVEL);
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns all data source handles that this modules and the included modules contain.
 * @return all data source handles that this modules and the includedmodules contain.
 */
public List getAllDataSources(){
  IModuleNameScope namescope=module.getModuleNameSpace(Module.DATA_SOURCE_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameScope.ARBITARY_LEVEL);
  return generateHandleList(elementList);
}
Program: 77582
Project: 77582
Buggy source:
/** 
 * Returns the libraries this report design includes directly. Each in the returned list is the instance of <code>LibraryHandle</code>.
 * @return the libraries this report design includes directly.
 */
public List getLibraries(){
  return getLibraries(IModuleNameSpace.DIRECTLY_INCLUDED_LEVEL);
}

Fixed version (ground truth):
/** 
 * Returns the libraries this report design includes directly. Each in the returned list is the instance of <code>LibraryHandle</code>.
 * @return the libraries this report design includes directly.
 */
public List getLibraries(){
  return getLibraries(IModuleNameScope.DIRECTLY_INCLUDED_LEVEL);
}
Program: 77583
Project: 77583
Buggy source:
/** 
 * Returns all template parameter definition handles that this modules and the included modules contain.
 * @return all template parameter definition handles that this modules andthe included modules contain.
 */
List getAllTemplateParameterDefinitions(){
  List elementList=module.getModuleNameSpace(Module.TEMPLATE_PARAMETER_NAME_SPACE).getElements(IModuleNameSpace.NATIVE_LEVEL);
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns all template parameter definition handles that this modules and the included modules contain.
 * @return all template parameter definition handles that this modules andthe included modules contain.
 */
List getAllTemplateParameterDefinitions(){
  List elementList=module.getModuleNameSpace(Module.TEMPLATE_PARAMETER_NAME_SPACE).getElements(IModuleNameScope.NATIVE_LEVEL);
  return generateHandleList(elementList);
}
Program: 77584
Project: 77584
Buggy source:
/** 
 * Returns data set handles that are visible to this modules.
 * @return data set handles that are visible to this modules.
 */
public List getVisibleDataSets(){
  IModuleNameSpace namescope=module.getModuleNameSpace(Module.DATA_SET_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameSpace.NATIVE_LEVEL);
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns data set handles that are visible to this modules.
 * @return data set handles that are visible to this modules.
 */
public List getVisibleDataSets(){
  IModuleNameScope namescope=module.getModuleNameSpace(Module.DATA_SET_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameScope.NATIVE_LEVEL);
  return generateHandleList(elementList);
}
Program: 77585
Project: 77585
Buggy source:
/** 
 * Returns all data set handles that this modules and the included modules contain.
 * @return all data set handles that this modules and the included modulescontain.
 */
public List getAllDataSets(){
  IModuleNameSpace namescope=module.getModuleNameSpace(Module.DATA_SET_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameSpace.ARBITARY_LEVEL);
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns all data set handles that this modules and the included modules contain.
 * @return all data set handles that this modules and the included modulescontain.
 */
public List getAllDataSets(){
  IModuleNameScope namescope=module.getModuleNameSpace(Module.DATA_SET_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameScope.ARBITARY_LEVEL);
  return generateHandleList(elementList);
}