nus-yam/ex-repair huggingface dataset:
Program: 65217
Project: 65217
Buggy source:
/** 
 * Attempts to connect to the Jdbc Data Source using the properties ( username, password, driver class ) specified.
 * @param : showErrorMessage is set to true , and error dialog box will be displayed if the connection fails.
 * @return Returns true if the connection is OK,and false otherwise
 * @throws OdaException
 */
private boolean testConnection() throws OdaException {
  if (!isValidDataSource()) {
    return false;
  }
  String url=jdbcUrl.getText().trim();
  String userid=userName.getText().trim();
  String passwd=password.getText();
  String driverName=getSelectedDriverClassName();
  String jndiNameValue=getODAJndiName();
  if (jndiNameValue.length() == 0)   jndiNameValue=null;
  if (bidiSupportObj == null) {
    if (m_wizardPage instanceof JDBCSelectionWizardPage) {
      bidiSupportObj=((JDBCSelectionWizardPage)m_wizardPage).getBidiSupport();
    }
 else     if (m_propertyPage instanceof JDBCPropertyPage) {
      bidiSupportObj=((JDBCPropertyPage)m_propertyPage).getBidiSupport();
    }
  }
  if (bidiSupportObj != null) {
    return DriverLoader.testConnection(driverName,url,jndiNameValue,userid,passwd,bidiSupportObj.getMetadataBidiFormat().toString(),collectSpecifiedProperties());
  }
  return DriverLoader.testConnection(driverName,url,jndiNameValue,userid,passwd,collectSpecifiedProperties());
}

Fixed version (ground truth):
/** 
 * Attempts to connect to the Jdbc Data Source using the properties ( username, password, driver class ) specified.
 * @param : showErrorMessage is set to true , and error dialog box will be displayed if the connection fails.
 * @return Returns true if the connection is OK,and false otherwise
 * @throws OdaException
 */
private boolean testConnection() throws OdaException {
  if (!isValidDataSource()) {
    return false;
  }
  String url=jdbcUrl.getText().trim();
  String userid=userName.getText().trim();
  String passwd=password.getText();
  String driverName=getSelectedDriverClassName();
  String jndiNameValue=getODAJndiName();
  if (jndiNameValue.length() == 0)   jndiNameValue=null;
  if (bidiSupportObj == null) {
    if (m_wizardPage instanceof JDBCSelectionWizardPage) {
      bidiSupportObj=((JDBCSelectionWizardPage)m_wizardPage).getBidiSupport();
    }
 else     if (m_propertyPage instanceof JDBCPropertyPage) {
      bidiSupportObj=((JDBCPropertyPage)m_propertyPage).getBidiSupport();
    }
  }
  Properties privateProperties=collectSpecifiedProperties();
  Map appContext=new HashMap();
  appContext.put(org.eclipse.datatools.connectivity.oda.util.ResourceIdentifiers.ODA_APP_CONTEXT_KEY_CONSUMER_RESOURCE_IDS,this.resourceIdentifier);
  ResourceLocator.resolveConnectionProperties(privateProperties,driverName,appContext);
  if (bidiSupportObj != null) {
    return DriverLoader.testConnection(driverName,url,jndiNameValue,userid,passwd,bidiSupportObj.getMetadataBidiFormat().toString(),privateProperties);
  }
  return DriverLoader.testConnection(driverName,url,jndiNameValue,userid,passwd,privateProperties);
}
Program: 65218
Project: 65218
Buggy source:
private void drawPropertyText(Group propertyGroup,final String propertyName,String propertyContent,boolean encrypt){
  GridData gd;
  final Text propertyText;
  if (encrypt) {
    propertyText=new Text(propertyGroup,SWT.BORDER | SWT.PASSWORD);
  }
 else {
    propertyText=new Text(propertyGroup,SWT.BORDER);
  }
  boolean isEncryptionMethod=Constants.DRIVER_INFO_PROPERTY_ENCRYPTION_METHOD.equals(propertyName);
  if (propertyContent != null) {
    propertyText.setText(propertyContent);
    databaseProperties.put(propertyName,propertyContent);
  }
 else   if (isEncryptionMethod) {
    propertyText.setText(ENCRYTPION_METHOD_DEFAULT_VALUE);
  }
  gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=3;
  propertyText.setLayoutData(gd);
  if (isEncryptionMethod) {
    Label blankLabel=new Label(propertyGroup,SWT.NONE);
    GridData blankLabelGd=new GridData();
    blankLabelGd.horizontalSpan=2;
    blankLabel.setLayoutData(blankLabelGd);
    Label prompLabel=new Label(propertyGroup,SWT.NONE);
    prompLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
    GridData labelGd=new GridData(GridData.FILL_HORIZONTAL);
    labelGd.horizontalSpan=3;
    prompLabel.setLayoutData(labelGd);
  }
  propertyText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      databaseProperties.put(propertyName,propertyText.getText());
    }
  }
);
  propertyText.getParent().layout();
}

Fixed version (ground truth):
private void drawPropertyText(Group propertyGroup,final String propertyName,String propertyContent,boolean encrypt){
  GridData gd;
  final Text propertyText;
  if (encrypt) {
    propertyText=new Text(propertyGroup,SWT.BORDER | SWT.PASSWORD);
  }
 else {
    propertyText=new Text(propertyGroup,SWT.BORDER);
  }
  boolean isEncryptionMethod=DriverInfoConstants.DRIVER_INFO_PROPERTY_ENCRYPTION_METHOD.equals(propertyName);
  if (propertyContent != null) {
    propertyText.setText(propertyContent);
    databaseProperties.put(propertyName,propertyContent);
  }
 else   if (isEncryptionMethod) {
    propertyText.setText(ENCRYTPION_METHOD_DEFAULT_VALUE);
  }
  gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=3;
  propertyText.setLayoutData(gd);
  if (isEncryptionMethod) {
    Label blankLabel=new Label(propertyGroup,SWT.NONE);
    GridData blankLabelGd=new GridData();
    blankLabelGd.horizontalSpan=2;
    blankLabel.setLayoutData(blankLabelGd);
    Label prompLabel=new Label(propertyGroup,SWT.NONE);
    prompLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
    GridData labelGd=new GridData(GridData.FILL_HORIZONTAL);
    labelGd.horizontalSpan=3;
    prompLabel.setLayoutData(labelGd);
  }
  propertyText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      databaseProperties.put(propertyName,propertyText.getText());
    }
  }
);
  propertyText.getParent().layout();
}
Program: 65222
Project: 65222
Buggy source:
public static boolean isKeepCubeHierarchyAndNotCubeTopLevelOnCategory(Chart model,CubeHandle cubeHandle,ReportItemHandle itemHandle){
  boolean isKeepCubeHierarchy=isKeepCubeHierarchyOnCategory(model);
  if (!isKeepCubeHierarchy) {
    return false;
  }
  if (cubeHandle == null) {
    return false;
  }
  SeriesDefinition sd=ChartUtil.getBaseSeriesDefinitions(model).get(0);
  Query query=ChartUtil.getDataQuery(sd,0);
  return !isCubeTopLevel(query,itemHandle);
}

Fixed version (ground truth):
public static boolean isKeepCubeHierarchyAndNotCubeTopLevelOnCategory(Chart model,CubeHandle cubeHandle,ReportItemHandle itemHandle){
  if (model == null) {
    return false;
  }
  boolean isKeepCubeHierarchy=isKeepCubeHierarchyOnCategory(model);
  if (!isKeepCubeHierarchy) {
    return false;
  }
  if (cubeHandle == null) {
    return false;
  }
  SeriesDefinition sd=ChartUtil.getBaseSeriesDefinitions(model).get(0);
  Query query=ChartUtil.getDataQuery(sd,0);
  return !isCubeTopLevel(query,itemHandle);
}
Program: 65223
Project: 65223
Buggy source:
public static boolean isKeepCubeHierarchyAndNotCubeTopLevelOnSeries(Chart model,CubeHandle cubeHandle,ReportItemHandle itemHandle){
  boolean isKeepCubeHierarchy=isKeepCubeHierarchyOnSeries(model);
  if (!isKeepCubeHierarchy) {
    return false;
  }
  if (cubeHandle == null) {
    return false;
  }
  Query query=ChartUtil.getAllOrthogonalSeriesDefinitions(model).get(0).getQuery();
  return !isCubeTopLevel(query,itemHandle);
}

Fixed version (ground truth):
public static boolean isKeepCubeHierarchyAndNotCubeTopLevelOnSeries(Chart model,CubeHandle cubeHandle,ReportItemHandle itemHandle){
  if (model == null) {
    return false;
  }
  boolean isKeepCubeHierarchy=isKeepCubeHierarchyOnSeries(model);
  if (!isKeepCubeHierarchy) {
    return false;
  }
  if (cubeHandle == null) {
    return false;
  }
  Query query=ChartUtil.getAllOrthogonalSeriesDefinitions(model).get(0).getQuery();
  return !isCubeTopLevel(query,itemHandle);
}
Program: 65225
Project: 65225
Buggy source:
/** 
 * Returns the index of specified expression on GroupDefinition.
 * @param expr specified expression.
 * @param groupDefinitions list of <code>GroupDefinition</code>
 * @return
 * @throws ChartException
 */
private int getGroupIndex(String expr,List<IGroupDefinition> groupDefinitions) throws ChartException {
  if (expr == null) {
    return -1;
  }
  exprCodec.decode(expr);
  Set<String> bindingNameSet=exprCodec.getRowBindingNameSet();
  boolean isJavaScript=ExpressionCodec.JAVASCRIPT.equals(exprCodec.getType());
  for (int i=0; i < groupDefinitions.size(); i++) {
    IGroupDefinition gd=groupDefinitions.get(i);
    String exprGroupKey=gd.getKeyExpression();
    if (isJavaScript) {
      if (expr.indexOf(exprGroupKey) >= 0) {
        return i;
      }
    }
    if (!bindingNameSet.isEmpty()) {
      Set<String> grpBindings=exprCodec.getRowBindingNameSet(exprGroupKey);
      for (      String grpBinding : grpBindings) {
        if (bindingNameSet.contains(grpBinding)) {
          return i;
        }
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Returns the index of specified expression on GroupDefinition.
 * @param expr specified expression.
 * @param groupDefinitions list of <code>GroupDefinition</code>
 * @param isCategory
 * @return
 * @throws ChartException
 */
private int getGroupIndex(String expr,List<IGroupDefinition> groupDefinitions,boolean isCategory) throws ChartException {
  if (expr == null) {
    return -1;
  }
  exprCodec.decode(expr);
  Set<String> bindingNameSet=exprCodec.getRowBindingNameSet();
  boolean isJavaScript=ExpressionCodec.JAVASCRIPT.equals(exprCodec.getType());
  if (isCategory) {
    for (int i=groupDefinitions.size() - 1; i >= 0; i--) {
      IGroupDefinition gd=groupDefinitions.get(i);
      String exprGroupKey=gd.getKeyExpression();
      if (isJavaScript) {
        if (expr.indexOf(exprGroupKey) >= 0) {
          return i;
        }
      }
      if (!bindingNameSet.isEmpty()) {
        Set<String> grpBindings=exprCodec.getRowBindingNameSet(exprGroupKey);
        for (        String grpBinding : grpBindings) {
          if (bindingNameSet.contains(grpBinding)) {
            return i;
          }
        }
      }
    }
  }
 else {
    for (int i=0; i < groupDefinitions.size(); i++) {
      IGroupDefinition gd=groupDefinitions.get(i);
      String exprGroupKey=gd.getKeyExpression();
      if (isJavaScript) {
        if (expr.indexOf(exprGroupKey) >= 0) {
          return i;
        }
      }
      if (!bindingNameSet.isEmpty()) {
        Set<String> grpBindings=exprCodec.getRowBindingNameSet(exprGroupKey);
        for (        String grpBinding : grpBindings) {
          if (bindingNameSet.contains(grpBinding)) {
            return i;
          }
        }
      }
    }
  }
  return -1;
}
Program: 65228
Project: 65228
Buggy source:
private String getDataText(Object element){
  if (element != null) {
    if (expectedColumnDataType == DataType.SQL_DATE_TYPE && element instanceof Date) {
      formatter.applyPattern("String_Node_Str");
      return formatter.format((Date)element);
    }
 else     if (expectedColumnDataType == DataType.SQL_TIME_TYPE && element instanceof Date) {
      formatter.applyPattern("String_Node_Str");
      return formatter.format((Date)element);
    }
 else     if (expectedColumnDataType == DataType.DATE_TYPE && element instanceof Date) {
      formatter.applyPattern("String_Node_Str");
      return formatter.format((Date)element);
    }
 else {
      try {
        return DataTypeUtil.toString(element);
      }
 catch (      BirtException e) {
        return String.valueOf(element);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private String getDataText(Object element){
  if (element != null) {
    if (expectedColumnDataType == DataType.SQL_DATE_TYPE && element instanceof Date) {
      formatter.applyPattern("String_Node_Str");
      return formatter.format((Date)element);
    }
 else     if (expectedColumnDataType == DataType.SQL_TIME_TYPE && element instanceof Date) {
      formatter.applyPattern("String_Node_Str");
      return formatter.format((Date)element);
    }
 else     if (expectedColumnDataType == DataType.DATE_TYPE && element instanceof Date) {
      formatter.applyPattern("String_Node_Str");
      return formatter.format((Date)element);
    }
 else     if (element instanceof Number) {
      try {
        return DataTypeUtil.toLocaleNeutralString(element);
      }
 catch (      BirtException e) {
        return String.valueOf(element);
      }
    }
 else {
      try {
        return DataTypeUtil.toString(element);
      }
 catch (      BirtException e) {
        return String.valueOf(element);
      }
    }
  }
  return null;
}
Program: 65229
Project: 65229
Buggy source:
public BaseTopBottomAccumulator(){
  this.tempDir=TempDir.getInstance().getPath();
  targetValue=new BasicCachedArray(tempDir,0);
}

Fixed version (ground truth):
public BaseTopBottomAccumulator(){
  if (DataEngineThreadLocal.getInstance().getPathManager() != null) {
    tempDir=DataEngineThreadLocal.getInstance().getPathManager().getTempFileName("String_Node_Str",this.hashCode(),null) + File.separator;
  }
 else {
    tempDir=System.getProperty("String_Node_Str") + "String_Node_Str" + this.hashCode()+ File.separator;
  }
  targetValue=new BasicCachedArray(tempDir,0);
}
Program: 65230
Project: 65230
Buggy source:
public BaseTopBottomAccumulator(){
  if (DataEngineThreadLocal.getInstance().getPathManager() != null) {
    tempDir=DataEngineThreadLocal.getInstance().getPathManager().getTempFileName("String_Node_Str",this.hashCode(),null) + File.separator;
  }
 else {
    tempDir=System.getProperty("String_Node_Str") + "String_Node_Str" + this.hashCode()+ File.separator;
  }
  targetValue=new BasicCachedArray(tempDir,0);
}

Fixed version (ground truth):
public BaseTopBottomAccumulator(){
  if (DataEngineThreadLocal.getInstance().getPathManager() != null) {
    tempDir=DataEngineThreadLocal.getInstance().getPathManager().getTempFileName("String_Node_Str",this.hashCode(),null) + File.separator;
  }
 else {
    tempDir=System.getProperty("String_Node_Str") + "String_Node_Str" + this.hashCode()+ File.separator;
  }
  targetValue=new BasicCachedArray(tempDir,0);
  DataEngineThreadLocal.getInstance().getCloseListener().add(this);
}
Program: 65231
Project: 65231
Buggy source:
/** 
 * @return
 * @throws IOException
 */
private long getOffset() throws IOException {
  return randomAccessFile.getFilePointer();
}

Fixed version (ground truth):
/** 
 * @return
 * @throws IOException
 */
private long getOffset() throws IOException {
  return getRandomAccessFile().getFilePointer();
}
Program: 65232
Project: 65232
Buggy source:
/** 
 * @throws IOException
 */
public BaseDiskArray() throws IOException {
  this.currentCacheStartIndex=0;
  this.size=0;
  this.buffer=new Object[bufferSize];
  this.segmentOffsets=new ArrayList<Long>();
  this.segmentOffsets.add(Long.valueOf(0L));
  createRandomAccessFile();
  DataEngineThreadLocal.getInstance().getCloseListener().add(this);
}

Fixed version (ground truth):
/** 
 * @throws IOException
 */
public BaseDiskArray() throws IOException {
  this.currentCacheStartIndex=0;
  this.size=0;
  this.buffer=new Object[bufferSize];
  this.segmentOffsets=new ArrayList<Long>();
  this.segmentOffsets.add(Long.valueOf(0L));
  DataEngineThreadLocal.getInstance().getCloseListener().add(this);
}
Program: 65233
Project: 65233
Buggy source:
/** 
 * Reads up to <code>readSize</code> objects from disk.
 * @param dis
 * @param list
 * @return
 * @throws IOException
 */
private void readObjects(long offset,int readSize) throws IOException {
  this.randomAccessFile.seek(offset);
  for (int i=0; i < readSize; i++) {
    this.buffer[i]=readObject();
  }
}

Fixed version (ground truth):
/** 
 * Reads up to <code>readSize</code> objects from disk.
 * @param dis
 * @param list
 * @return
 * @throws IOException
 */
private void readObjects(long offset,int readSize) throws IOException {
  getRandomAccessFile().seek(offset);
  for (int i=0; i < readSize; i++) {
    this.buffer[i]=readObject();
  }
}
Program: 65234
Project: 65234
Buggy source:
protected void writeObject(Object object) throws IOException {
  if (object == null) {
    randomAccessFile.writeShort(NULL_VALUE);
    return;
  }
  randomAccessFile.writeShort(NORMAL_VALUE);
  if (fieldWriter == null) {
    fieldWriter=IOUtil.getRandomWriter(DataType.getDataType(object.getClass()));
    fieldReader=IOUtil.getRandomReader(DataType.getDataType(object.getClass()));
  }
  fieldWriter.write(randomAccessFile,object);
}

Fixed version (ground truth):
protected void writeObject(Object object) throws IOException {
  if (object == null) {
    getRandomAccessFile().writeShort(NULL_VALUE);
    return;
  }
  getRandomAccessFile().writeShort(NORMAL_VALUE);
  if (fieldWriter == null) {
    fieldWriter=IOUtil.getRandomWriter(DataType.getDataType(object.getClass()));
    fieldReader=IOUtil.getRandomReader(DataType.getDataType(object.getClass()));
  }
  fieldWriter.write(getRandomAccessFile(),object);
}
Program: 65235
Project: 65235
Buggy source:
protected Object readObject() throws IOException {
  short fieldCount=randomAccessFile.readShort();
  if (fieldCount == NULL_VALUE) {
    return null;
  }
  return fieldReader.read(randomAccessFile);
}

Fixed version (ground truth):
protected Object readObject() throws IOException {
  short fieldCount=getRandomAccessFile().readShort();
  if (fieldCount == NULL_VALUE) {
    return null;
  }
  return fieldReader.read(getRandomAccessFile());
}
Program: 65237
Project: 65237
Buggy source:
private void resetDataSetReference(Object value,boolean clearHistory){
  try {
    startTrans("String_Node_Str");
    getReportItemHandle().setDataBindingReference(null);
    DataSetHandle dataSet=null;
    if (value != null) {
      dataSet=SessionHandleAdapter.getInstance().getReportDesignHandle().findDataSet(value.toString());
    }
    if (getReportItemHandle().getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      getReportItemHandle().setDataBindingReference(null);
    }
    getReportItemHandle().setCube(null);
    getReportItemHandle().setDataSet(dataSet);
    if (clearHistory) {
      getReportItemHandle().getColumnBindings().clearValue();
      getReportItemHandle().getPropertyHandle(ReportItemHandle.PARAM_BINDINGS_PROP).clearValue();
    }
    getDependedProvider().generateAllBindingColumns();
    commit();
  }
 catch (  SemanticException e) {
    rollback();
    ExceptionHandler.handle(e);
  }
  section.load();
}

Fixed version (ground truth):
private void resetDataSetReference(Object value,boolean clearHistory){
  try {
    startTrans("String_Node_Str");
    getReportItemHandle().setDataBindingReference(null);
    DataSetHandle dataSet=null;
    if (value != null) {
      dataSet=SessionHandleAdapter.getInstance().getReportDesignHandle().findDataSet(value.toString());
    }
    if (getReportItemHandle().getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      getReportItemHandle().setDataBindingReference(null);
    }
    getReportItemHandle().setCube(null);
    if (dataSet == null && value != null) {
      getReportItemHandle().setDataSet(null);
      new LinkedDataSetAdapter().setLinkedDataModel(getReportItemHandle(),value);
    }
 else {
      new LinkedDataSetAdapter().setLinkedDataModel(getReportItemHandle(),null);
      getReportItemHandle().setDataSet(dataSet);
    }
    if (clearHistory) {
      getReportItemHandle().getColumnBindings().clearValue();
      getReportItemHandle().getPropertyHandle(ReportItemHandle.PARAM_BINDINGS_PROP).clearValue();
    }
    getDependedProvider().generateAllBindingColumns();
    commit();
  }
 catch (  SemanticException e) {
    rollback();
    ExceptionHandler.handle(e);
  }
  section.load();
}
Program: 65238
Project: 65238
Buggy source:
private void resetCubeReference(Object value,boolean clearHistory){
  try {
    startTrans("String_Node_Str");
    CubeHandle cubeHandle=null;
    if (value != null) {
      cubeHandle=SessionHandleAdapter.getInstance().getReportDesignHandle().findCube(value.toString());
    }
    if (getReportItemHandle().getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      getReportItemHandle().setDataBindingReference(null);
    }
    getReportItemHandle().setDataSet(null);
    getReportItemHandle().setCube(cubeHandle);
    if (clearHistory) {
      getReportItemHandle().getColumnBindings().clearValue();
      getReportItemHandle().getPropertyHandle(ReportItemHandle.PARAM_BINDINGS_PROP).clearValue();
    }
    commit();
  }
 catch (  SemanticException e) {
    rollback();
    ExceptionHandler.handle(e);
  }
  section.load();
}

Fixed version (ground truth):
private void resetCubeReference(Object value,boolean clearHistory){
  try {
    startTrans("String_Node_Str");
    CubeHandle cubeHandle=null;
    if (value != null) {
      cubeHandle=SessionHandleAdapter.getInstance().getReportDesignHandle().findCube(value.toString());
    }
    if (getReportItemHandle().getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      getReportItemHandle().setDataBindingReference(null);
    }
    getReportItemHandle().setDataSet(null);
    if (cubeHandle == null && value != null) {
      getReportItemHandle().setDataSet(null);
      new LinkedDataSetAdapter().setLinkedDataModel(getReportItemHandle(),value);
    }
 else {
      new LinkedDataSetAdapter().setLinkedDataModel(getReportItemHandle(),null);
      getReportItemHandle().setCube(cubeHandle);
    }
    getReportItemHandle().setCube(cubeHandle);
    if (clearHistory) {
      getReportItemHandle().getColumnBindings().clearValue();
      getReportItemHandle().getPropertyHandle(ReportItemHandle.PARAM_BINDINGS_PROP).clearValue();
    }
    commit();
  }
 catch (  SemanticException e) {
    rollback();
    ExceptionHandler.handle(e);
  }
  section.load();
}
Program: 65239
Project: 65239
Buggy source:
public String[] getAvailableDatasetItems(){
  String[] dataSets=ChoiceSetFactory.getDataSets();
  String[] cubes=getCubes();
  int length=1;
  if (dataSets.length > 0)   length+=(dataSets.length + 1);
  if (cubes.length > 0)   length+=(cubes.length + 1);
  String[] newList=new String[length];
  newList[0]=NONE;
  if (dataSets.length > 0) {
    newList[1]=DATA_SETS_DEFAULT;
    System.arraycopy(dataSets,0,newList,2,dataSets.length);
  }
  if (cubes.length > 0) {
    newList[newList.length - cubes.length - 1]=DATA_CUBES_DEFAULT;
    System.arraycopy(cubes,0,newList,newList.length - cubes.length,cubes.length);
  }
  return newList;
}

Fixed version (ground truth):
public BindingInfo[] getAvailableDatasetItems(){
  ModuleHandle handle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  List<DataSetHandle> dataSets=UIUtil.getVisibleDataSetHandles(handle);
  List<CubeHandle> cubes=handle.getVisibleCubes();
  int length=1;
  if (dataSets.size() > 0)   length+=(dataSets.size() + 1);
  if (cubes.size() > 0)   length+=(cubes.size() + 1);
  BindingInfo[] newList=new BindingInfo[length];
  newList[0]=NullDatasetChoice;
  if (dataSets.size() > 0) {
    newList[1]=new BindingInfo(ReportItemHandle.DATABINDING_TYPE_DATA,DATA_SETS_DEFAULT,true);
    for (int i=0; i < dataSets.size(); i++) {
      DataSetHandle dataSet=dataSets.get(i);
      if (handle.findDataSet(dataSet.getQualifiedName()) == dataSet) {
        newList[i + 2]=new BindingInfo(ReportItemHandle.DATABINDING_TYPE_DATA,dataSet.getQualifiedName(),true);
      }
 else {
        newList[i + 2]=new BindingInfo(ReportItemHandle.DATABINDING_TYPE_DATA,dataSet.getQualifiedName(),false);
      }
    }
  }
  if (cubes.size() > 0) {
    newList[newList.length - cubes.size() - 1]=new BindingInfo(ReportItemHandle.DATABINDING_TYPE_DATA,DATA_CUBES_DEFAULT,true);
    ;
    for (int i=0; i < cubes.size(); i++) {
      CubeHandle cube=cubes.get(i);
      newList[i + newList.length - cubes.size()]=new BindingInfo(ReportItemHandle.DATABINDING_TYPE_DATA,cube.getQualifiedName(),true);
    }
  }
  return newList;
}
Program: 65240
Project: 65240
Buggy source:
/** 
 * Uses BIRT data engine to do query and wraps data with <code>IDataRowExpressionEvaluator</code> for chart doing data binding.
 * @return
 * @throws BirtException
 */
private IDataRowExpressionEvaluator prepareRowExpressionEvaluator(ChartWithAxes chart,String[] expressions) throws BirtException {
  OdaDataSourceDesign odaDataSource=newDataSource();
  OdaDataSetDesign odaDataSet=newDataSet(odaDataSource);
  QueryDefinition query=createQueryDefinition(odaDataSet,expressions);
  DataEngine dataEngine=newDataEngine();
  dataEngine.defineDataSource(odaDataSource);
  dataEngine.defineDataSet(odaDataSet);
  IPreparedQuery preparedQuery=dataEngine.prepare(query);
  IQueryResults queryResults=preparedQuery.execute(null);
  return new GroupedRowExpressionsEvaluator(queryResults.getResultIterator(),true){
    public Object evaluate(    String expression){
      String bindingName=expressionMap.get(expression);
      if (bindingName != null)       return super.evaluate(bindingName);
      return super.evaluate(expression);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Uses BIRT data engine to do query and wraps data with <code>IDataRowExpressionEvaluator</code> for chart doing data binding.
 * @return
 * @throws BirtException
 */
private IDataRowExpressionEvaluator prepareRowExpressionEvaluator(ChartWithAxes chart,String[] expressions) throws BirtException {
  OdaDataSourceDesign odaDataSource=newDataSource();
  OdaDataSetDesign odaDataSet=newDataSet(odaDataSource);
  QueryDefinition query=createQueryDefinition(chart,odaDataSet);
  DataEngine dataEngine=newDataEngine();
  dataEngine.defineDataSource(odaDataSource);
  dataEngine.defineDataSet(odaDataSet);
  IPreparedQuery preparedQuery=dataEngine.prepare(query);
  IQueryResults queryResults=preparedQuery.execute(null);
  return new GroupedRowExpressionsEvaluator(queryResults.getResultIterator(),true){
    public Object evaluate(    String expression){
      String bindingName=expressionMap.get(expression);
      if (bindingName != null)       return super.evaluate(bindingName);
      return super.evaluate(expression);
    }
  }
;
}
Program: 65242
Project: 65242
Buggy source:
public boolean isSaveAsAllowed(){
  return getActivePageInstance().isSaveAsAllowed();
}

Fixed version (ground truth):
public boolean isSaveAsAllowed(){
  if (getActivePageInstance() != null) {
    return getActivePageInstance().isSaveAsAllowed();
  }
  return false;
}
Program: 65243
Project: 65243
Buggy source:
protected void okPressed(){
  result=new Object[3];
  if (dataSetName != null || dataSetCombo.getSelectionIndex() > 0) {
    if (dataSetName == null) {
      result[0]=dataSetCombo.getItem(dataSetCombo.getSelectionIndex());
    }
 else {
      result[0]=dataSetName;
    }
    if (columnViewers.getCheckedElements() != null) {
      result[1]=columnViewers.getCheckedElements();
      List<String> list=new ArrayList<String>();
      for (int i=0; i < columnViewers.getTable().getItemCount(); i++) {
        ResultSetColumnHandle column=(ResultSetColumnHandle)columnViewers.getElementAt(i);
        if (!columnViewers.getChecked(column)) {
          list.add(column.getColumnName());
        }
      }
      result[2]=list.toArray();
    }
 else {
      result[1]=null;
      List<String> list=new ArrayList<String>();
      for (int i=0; i < columnViewers.getTable().getItemCount(); i++) {
        ResultSetColumnHandle column=(ResultSetColumnHandle)columnViewers.getElementAt(i);
        if (!columnViewers.getChecked(column)) {
          list.add(column.getColumnName());
        }
      }
      if (list.isEmpty())       result[2]=null;
 else       result[2]=list.toArray();
    }
  }
 else {
    result[0]=null;
    result[1]=null;
    result[2]=null;
  }
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  result=new Object[3];
  if (dataSetName != null || dataSetCombo.getSelectionIndex() > -1) {
    if (dataSetName == null) {
      result[0]=dataSetCombo.getItem(dataSetCombo.getSelectionIndex());
    }
 else {
      result[0]=dataSetName;
    }
    if (columnViewers.getCheckedElements() != null) {
      result[1]=columnViewers.getCheckedElements();
      List<String> list=new ArrayList<String>();
      for (int i=0; i < columnViewers.getTable().getItemCount(); i++) {
        ResultSetColumnHandle column=(ResultSetColumnHandle)columnViewers.getElementAt(i);
        if (!columnViewers.getChecked(column)) {
          list.add(column.getColumnName());
        }
      }
      result[2]=list.toArray();
    }
 else {
      result[1]=null;
      List<String> list=new ArrayList<String>();
      for (int i=0; i < columnViewers.getTable().getItemCount(); i++) {
        ResultSetColumnHandle column=(ResultSetColumnHandle)columnViewers.getElementAt(i);
        if (!columnViewers.getChecked(column)) {
          list.add(column.getColumnName());
        }
      }
      if (list.isEmpty())       result[2]=null;
 else       result[2]=list.toArray();
    }
  }
 else {
    result[0]=null;
    result[1]=null;
    result[2]=null;
  }
  super.okPressed();
}
Program: 65244
Project: 65244
Buggy source:
protected void handleDatasetComboSelectedEvent(){
  if (dataSetName != null) {
    DataSetHandle datasetHandle=DataUtil.findDataSet(dataSetName);
    Iterator iter=null;
    if (datasetHandle != null) {
      try {
        CachedMetaDataHandle cmdh=DataSetUIUtil.getCachedMetaDataHandle(datasetHandle);
        iter=cmdh.getResultSet().iterator();
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
    }
 else {
      iter=new LinkedDataSetAdapter().getDataSetResLinkedDataModel(dataSetName);
    }
    if (iter != null) {
      columnViewers.setInput(iter);
    }
 else {
      columnViewers.setInput(Collections.EMPTY_LIST.iterator());
    }
  }
 else {
    if (dataSetCombo.getSelectionIndex() > 0) {
      String dataset=dataSetCombo.getItem(dataSetCombo.getSelectionIndex());
      DataSetHandle datasetHandle=SessionHandleAdapter.getInstance().getModule().findDataSet(dataset);
      Iterator iter=null;
      if (datasetHandle != null) {
        try {
          CachedMetaDataHandle cmdh=DataSetUIUtil.getCachedMetaDataHandle(datasetHandle);
          iter=cmdh.getResultSet().iterator();
        }
 catch (        SemanticException e) {
          ExceptionHandler.handle(e);
        }
      }
 else {
        iter=new LinkedDataSetAdapter().getDataSetResLinkedDataModel(dataset);
      }
      if (iter != null) {
        columnViewers.setInput(iter);
      }
 else {
        columnViewers.setInput(Collections.EMPTY_LIST.iterator());
      }
    }
 else {
      columnViewers.setInput(Collections.EMPTY_LIST.iterator());
    }
  }
}

Fixed version (ground truth):
protected void handleDatasetComboSelectedEvent(){
  Iterator iter=null;
  DataSetHandle handle=null;
  if (datasetHandle != null) {
    handle=datasetHandle;
  }
 else   if (dataSetName != null) {
    handle=DataUtil.findDataSet(dataSetName);
  }
 else {
    handle=getSelectedDataSet();
  }
  if (handle != null) {
    try {
      CachedMetaDataHandle cmdh=DataSetUIUtil.getCachedMetaDataHandle(handle);
      iter=cmdh.getResultSet().iterator();
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
 else {
    iter=new LinkedDataSetAdapter().getDataSetResLinkedDataModel(dataSetName);
  }
  if (iter != null) {
    columnViewers.setInput(iter);
  }
 else {
    columnViewers.setInput(Collections.EMPTY_LIST.iterator());
  }
}
Program: 65245
Project: 65245
Buggy source:
protected void createDataSetContents(Composite parent){
  if (dataSetName != null) {
    Label lb=new Label(parent,SWT.NONE);
    lb.setText(Messages.getString("String_Node_Str"));
    GridData data=new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan=2;
    lb.setLayoutData(data);
  }
 else {
    Label dateSetLabel=new Label(parent,SWT.NONE);
    dateSetLabel.setText(Messages.getString("String_Node_Str"));
    dataSetCombo=new Combo(parent,SWT.BORDER | SWT.READ_ONLY);
    dataSetCombo.setItems(getAvailableDatasetItems());
    dataSetCombo.select(0);
    GridData data=new GridData(GridData.FILL_HORIZONTAL);
    dataSetCombo.setLayoutData(data);
    dataSetCombo.setVisibleItemCount(30);
    dataSetCombo.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        handleDatasetComboSelectedEvent();
      }
    }
);
  }
}

Fixed version (ground truth):
protected void createDataSetContents(Composite parent){
  if (dataSetName != null) {
    Label lb=new Label(parent,SWT.NONE);
    lb.setText(Messages.getString("String_Node_Str"));
    GridData data=new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan=2;
    lb.setLayoutData(data);
  }
 else {
    Label dateSetLabel=new Label(parent,SWT.NONE);
    dateSetLabel.setText(Messages.getString("String_Node_Str"));
    dataSetCombo=new Combo(parent,SWT.BORDER | SWT.READ_ONLY);
    ModuleHandle handle=SessionHandleAdapter.getInstance().getReportDesignHandle();
    datasets=org.eclipse.birt.report.designer.internal.ui.util.UIUtil.getVisibleDataSetHandles(handle);
    for (int i=0; i < datasets.size(); i++) {
      dataSetCombo.add(datasets.get(i).getQualifiedName());
    }
    dataSetCombo.select(0);
    GridData data=new GridData(GridData.FILL_HORIZONTAL);
    dataSetCombo.setLayoutData(data);
    dataSetCombo.setVisibleItemCount(30);
    dataSetCombo.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        handleDatasetComboSelectedEvent();
      }
    }
);
  }
}
Program: 65246
Project: 65246
Buggy source:
private void preBasicIV() throws BirtException {
  IQueryResults qr=null;
  QueryDefinition qd=newSummaryQuery();
  qd.setQueryResultsID(this.GEN_queryResultID);
  qr=myPreDataEngine.prepare(qd).execute(null);
  this.UPDATE_queryResultID=qr.getID();
  qr=myPreDataEngine.getQueryResults(this.UPDATE_queryResultID);
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    String abc="String_Node_Str";
    for (int i=0; i < bindingName.length; i++)     abc+=ri.getValue(this.bindingName[i]) + "String_Node_Str";
    this.testPrintln(abc);
  }
  this.testPrintln("String_Node_Str");
  ri.close();
  qr.close();
  myPreDataEngine.shutdown();
  myPreDataEngine.clearCache(dataSource,dataSet);
  myPreDataEngine=null;
}

Fixed version (ground truth):
private void preBasicIV() throws BirtException {
  IQueryResults qr=null;
  QueryDefinition qd;
  if (useDateGroup) {
    qd=newSummaryQuery1();
  }
 else {
    qd=newSummaryQuery();
  }
  qd.setQueryResultsID(this.GEN_queryResultID);
  qr=myPreDataEngine.prepare(qd).execute(null);
  this.UPDATE_queryResultID=qr.getID();
  qr=myPreDataEngine.getQueryResults(this.UPDATE_queryResultID);
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    String abc="String_Node_Str";
    for (int i=0; i < bindingName.length; i++)     abc+=ri.getValue(this.bindingName[i]) + "String_Node_Str";
    this.testPrintln(abc);
  }
  this.testPrintln("String_Node_Str");
  ri.close();
  qr.close();
  myPreDataEngine.shutdown();
  myPreDataEngine.clearCache(dataSource,dataSet);
  myPreDataEngine=null;
}
Program: 65247
Project: 65247
Buggy source:
/** 
 * @throws BirtException
 */
private void genBasicIV() throws BirtException {
  QueryDefinition qd=newSummaryQuery();
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  GEN_queryResultID=qr.getID();
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    String abc="String_Node_Str";
    for (int i=0; i < bindingName.length; i++)     abc+=ri.getValue(this.bindingName[i]) + "String_Node_Str";
    this.testPrintln(abc);
  }
  this.testPrintln("String_Node_Str");
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
  myGenDataEngine.clearCache(dataSource,dataSet);
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
private void genBasicIV() throws BirtException {
  QueryDefinition qd;
  if (useDateGroup) {
    qd=newSummaryQuery1();
  }
 else {
    qd=newSummaryQuery();
  }
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  GEN_queryResultID=qr.getID();
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    String abc="String_Node_Str";
    for (int i=0; i < bindingName.length; i++)     abc+=ri.getValue(this.bindingName[i]) + "String_Node_Str";
    this.testPrintln(abc);
  }
  this.testPrintln("String_Node_Str");
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
  myGenDataEngine.clearCache(dataSource,dataSet);
}
Program: 65248
Project: 65248
Buggy source:
public void displayURL(String url) throws Exception {
  try {
    IWebBrowser browser=getExternalBrowser();
    if (browser != null) {
      browser.openURL(new URL(url));
    }
  }
 catch (  PartInitException pie) {
    ViewerPlugin.logError(pie.getLocalizedMessage(),pie);
  }
}

Fixed version (ground truth):
public void displayURL(String url) throws Exception {
  try {
    browser=getExternalBrowser();
    if (browser != null) {
      browser.openURL(new URL(url));
    }
  }
 catch (  PartInitException pie) {
    ViewerPlugin.logError(pie.getLocalizedMessage(),pie);
  }
}
Program: 65249
Project: 65249
Buggy source:
public boolean isCloseSupported(){
  return false;
}

Fixed version (ground truth):
public boolean isCloseSupported(){
  return true;
}
Program: 65250
Project: 65250
Buggy source:
public void close(){
}

Fixed version (ground truth):
public void close(){
  if (browser != null) {
    browser.close();
  }
}
Program: 65251
Project: 65251
Buggy source:
/** 
 * Get the inherited handle
 * @param itemHandle
 * @return ListHandle or TabHandle or GridHandle
 */
public static ReportItemHandle getInheritedHandle(ReportItemHandle itemHandle){
  if (isContainerInheritable(itemHandle)) {
    DesignElementHandle handle=itemHandle.getContainer();
    while (handle != null && !(handle instanceof ListingHandle || handle instanceof GridHandle)) {
      handle=handle.getContainer();
    }
    if (handle instanceof TableHandle) {
      return (TableHandle)handle;
    }
 else     if (handle instanceof ListHandle) {
      return (ListHandle)handle;
    }
 else     if (handle instanceof GridHandle) {
      return (GridHandle)handle;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get the inherited handle
 * @param itemHandle
 * @return ListHandle or TabHandle or GridHandle
 */
public static ReportItemHandle getInheritedHandle(ReportItemHandle itemHandle){
  if (itemHandle.getDataSet() == null && isContainerInheritable(itemHandle)) {
    DesignElementHandle handle=itemHandle.getContainer();
    while (handle != null && !(handle instanceof ListingHandle || handle instanceof GridHandle)) {
      handle=handle.getContainer();
    }
    if (handle instanceof TableHandle) {
      return (TableHandle)handle;
    }
 else     if (handle instanceof ListHandle) {
      return (ListHandle)handle;
    }
 else     if (handle instanceof GridHandle) {
      return (GridHandle)handle;
    }
  }
  return null;
}
Program: 65253
Project: 65253
Buggy source:
protected ICubeCursor getSubCubeCursor(String startingColumnLevel,String startingRowLevel) throws DataException {
  ICubeCursor cubeCursorImpl;
  if (this.cubeView != null) {
    BirtCubeView subCV=cubeView.createSubView();
    CubeCursor subCubeCursor=null;
    if (subScope == null) {
      Scriptable scope=cubeView.getCubeQueryExecutor().getSession().getSharedScope();
      subScope=Context.getCurrentContext().newObject(scope);
      subScope.setParentScope(scope);
      subScope.setPrototype(scope);
    }
    try {
      subCubeCursor=subCV.getCubeCursor(null,startingColumnLevel,startingRowLevel,this.cubeView);
      subScope.put(ScriptConstants.MEASURE_SCRIPTABLE,subScope,new JSMeasureAccessor(subCubeCursor,subCV.getMeasureMapping()));
      subScope.put(ScriptConstants.DIMENSION_SCRIPTABLE,subScope,new JSLevelAccessor(this.cubeView.getCubeQueryExecutor().getCubeQueryDefinition(),subCV));
    }
 catch (    OLAPException e) {
      throw new DataException(e.getLocalizedMessage());
    }
    cubeCursorImpl=new CubeCursorImpl(null,subCubeCursor,subScope,cx,this.cubeView.getCubeQueryExecutor().getCubeQueryDefinition(),subCV);
  }
 else {
    throw new DataException(ResourceConstants.NO_PARENT_RESULT_CURSOR);
  }
  return cubeCursorImpl;
}

Fixed version (ground truth):
protected ICubeCursor getSubCubeCursor(String startingColumnLevel,String startingRowLevel) throws DataException {
  ICubeCursor cubeCursorImpl;
  if (this.cubeView != null) {
    BirtCubeView subCV=cubeView.createSubView();
    CubeCursor subCubeCursor=null;
    if (subScope == null) {
      Scriptable scope=cubeView.getCubeQueryExecutor().getSession().getSharedScope();
      subScope=Context.getCurrentContext().newObject(scope);
      subScope.setParentScope(scope);
      subScope.setPrototype(scope);
    }
    try {
      subCubeCursor=subCV.getCubeCursor(null,startingColumnLevel,startingRowLevel,this.cubeView);
      subScope.put(ScriptConstants.MEASURE_SCRIPTABLE,subScope,new JSMeasureAccessor(subCubeCursor,subCV.getMeasureMapping()));
      subScope.put(ScriptConstants.DIMENSION_SCRIPTABLE,subScope,new JSLevelAccessor(this.cubeView.getCubeQueryExecutor().getCubeQueryDefinition(),subCV));
    }
 catch (    OLAPException e) {
      throw new DataException(e.getLocalizedMessage());
    }
    cubeCursorImpl=new SubCubeCursorImpl(null,subCubeCursor,subScope,cx,this.cubeView.getCubeQueryExecutor().getCubeQueryDefinition(),subCV);
  }
 else {
    throw new DataException(ResourceConstants.NO_PARENT_RESULT_CURSOR);
  }
  return cubeCursorImpl;
}
Program: 65254
Project: 65254
Buggy source:
public void close() throws IOException {
  if (randomAccessFile != null) {
    randomAccessFile.close();
    randomAccessFile=null;
  }
  clearDiskFile();
  this.size=0;
}

Fixed version (ground truth):
public void close() throws IOException {
  if (randomAccessFile != null) {
    randomAccessFile.close();
    randomAccessFile=null;
  }
  clearDiskFile();
  this.size=0;
  this.buffer=null;
}
Program: 65255
Project: 65255
Buggy source:
public void close() throws IOException {
  if (delegate != null)   delegate.close();
  clearDiskFile();
}

Fixed version (ground truth):
public void close() throws IOException {
  if (delegate != null)   delegate.close();
  clearDiskFile();
  this.buffer=null;
}
Program: 65256
Project: 65256
Buggy source:
private void clearTempDir() throws IOException {
  if (diskList != null) {
    diskList.close();
  }
}

Fixed version (ground truth):
private void clearTempDir() throws IOException {
  if (diskList != null) {
    diskList.close();
    diskList=null;
  }
}
Program: 65257
Project: 65257
Buggy source:
public void close() throws IOException {
  clearTempDir();
}

Fixed version (ground truth):
public void close() throws IOException {
  this.buffer=null;
  clearTempDir();
}
Program: 65258
Project: 65258
Buggy source:
private List getSelectValueList() throws BirtException {
  List selectValueList=new ArrayList();
  ReportItemHandle reportItem=DEUtil.getBindingHolder(currentItem);
  if (bindingName != null && reportItem != null) {
    if (reportItem instanceof ExtendedItemHandle) {
      Object obj=ElementAdapterManager.getAdapters(reportItem,IUseCubeQueryList.class);
      if (obj instanceof Object[]) {
        Object arrays[]=(Object[])obj;
        if (arrays.length == 1 && arrays[0] != null) {
          List valueList=((IUseCubeQueryList)arrays[0]).getQueryList(ExpressionUtility.getDataExpression(bindingName,ExpressionUtility.getExpressionConverter(ExpressionType.JAVASCRIPT)),(ExtendedItemHandle)reportItem);
          selectValueList.addAll(valueList);
        }
      }
    }
    if (selectValueList.size() == 0) {
      selectValueList=SelectValueFetcher.getSelectValueFromBinding(ExpressionButtonUtil.getExpression(getExpressionControl()),reportItem.getDataSet(),DEUtil.getVisiableColumnBindingsList(designHandle).iterator(),DEUtil.getGroups(designHandle).iterator(),false);
    }
  }
 else {
    ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return selectValueList;
}

Fixed version (ground truth):
private List getSelectValueList() throws BirtException {
  List selectValueList=new ArrayList();
  ReportItemHandle reportItem=DEUtil.getBindingHolder(currentItem);
  boolean hasFetched=false;
  if (bindingName != null && reportItem != null) {
    if (reportItem instanceof ExtendedItemHandle) {
      Object obj=ElementAdapterManager.getAdapters(reportItem,IUseCubeQueryList.class);
      if (obj instanceof Object[]) {
        Object arrays[]=(Object[])obj;
        if (arrays.length == 1 && arrays[0] != null) {
          List valueList=((IUseCubeQueryList)arrays[0]).getQueryList(ExpressionUtility.getDataExpression(bindingName,ExpressionUtility.getExpressionConverter(ExpressionType.JAVASCRIPT)),(ExtendedItemHandle)reportItem);
          selectValueList.addAll(valueList);
          hasFetched=true;
        }
      }
    }
    if (!hasFetched && selectValueList.size() == 0) {
      selectValueList=SelectValueFetcher.getSelectValueFromBinding(ExpressionButtonUtil.getExpression(getExpressionControl()),reportItem.getDataSet(),DEUtil.getVisiableColumnBindingsList(designHandle).iterator(),DEUtil.getGroups(designHandle).iterator(),false);
    }
  }
 else {
    ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return selectValueList;
}
Program: 65259
Project: 65259
Buggy source:
private String getExpressionBindingName(){
  for (Iterator iter=columnList.iterator(); iter.hasNext(); ) {
    String columnName=getColumnName(iter.next());
    if (designHandle instanceof DataItemHandle) {
      if (designHandle.getContainer() instanceof ExtendedItemHandle) {
        if (ExpressionUtility.getDataExpression(columnName,ExpressionUtility.getExpressionConverter(ExpressionButtonUtil.getExpression(getExpressionControl()).getType())).equals(getExpression())) {
          return columnName;
        }
      }
 else {
        if (ExpressionUtility.getColumnExpression(columnName,ExpressionUtility.getExpressionConverter(ExpressionButtonUtil.getExpression(getExpressionControl()).getType())).equals(getExpression())) {
          return columnName;
        }
      }
    }
 else {
      Expression expr=ExpressionButtonUtil.getExpression(getExpressionControl());
      if (expr != null) {
        String exprType=expr.getType();
        IExpressionConverter converter=ExpressionUtility.getExpressionConverter(exprType);
        if (getExpression().equals(ExpressionUtility.getColumnExpression(columnName,converter))) {
          return columnName;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private String getExpressionBindingName(){
  for (Iterator iter=columnList.iterator(); iter.hasNext(); ) {
    String columnName=getColumnName(iter.next());
    if (designHandle instanceof DataItemHandle) {
      if (designHandle.getContainer() instanceof ExtendedItemHandle) {
        if (ExpressionUtility.getDataExpression(columnName,ExpressionUtility.getExpressionConverter(ExpressionButtonUtil.getExpression(getExpressionControl()).getType())).equals(getExpression())) {
          return columnName;
        }
      }
 else {
        if (ExpressionUtility.getColumnExpression(columnName,ExpressionUtility.getExpressionConverter(ExpressionButtonUtil.getExpression(getExpressionControl()).getType())).equals(getExpression())) {
          return columnName;
        }
      }
    }
 else {
      Expression expr=ExpressionButtonUtil.getExpression(getExpressionControl());
      if (expr != null) {
        String exprType=expr.getType();
        IExpressionConverter converter=ExpressionUtility.getExpressionConverter(exprType);
        String tempExpression=ExpressionUtility.getColumnExpression(columnName,converter);
        if (DEUtil.isBindingCube(designHandle)) {
          tempExpression=ExpressionUtility.getDataExpression(columnName,converter);
        }
        if (getExpression().equals(tempExpression)) {
          return columnName;
        }
      }
    }
  }
  return null;
}