nus-yam/ex-repair huggingface dataset:
Program: 65813
Project: 65813
Buggy source:
public ResultSet getAlltables(String schemaPattern,String namePattern,String[] types){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getTables(connection.getCatalog(),schemaPattern,namePattern,types);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
catch (    Exception ex) {
      return null;
    }
  }
  try {
    return connection.getMetaData().getTables(connection.getCatalog(),schemaPattern,namePattern,types);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getTables(connection.getCatalog(),schemaPattern,namePattern,types);
    }
 catch (    SQLException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      return null;
    }
catch (    OdaException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      return null;
    }
  }
}

Fixed version (ground truth):
public ResultSet getAlltables(String schemaPattern,String namePattern,String[] types){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getTables(getCatalog(),schemaPattern,namePattern,types);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
catch (    Exception ex) {
      return null;
    }
  }
  try {
    return connection.getMetaData().getTables(getCatalog(),schemaPattern,namePattern,types);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getTables(getCatalog(),schemaPattern,namePattern,types);
    }
 catch (    SQLException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      return null;
    }
catch (    OdaException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      return null;
    }
  }
}
Program: 65814
Project: 65814
Buggy source:
public ResultSet getTableColumns(String schemaPattern,String tableNamePattern,String columnNamePattern){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getColumns(connection.getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
catch (    Exception ex) {
      return null;
    }
  }
  try {
    return connection.getMetaData().getColumns(connection.getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getColumns(connection.getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
    }
 catch (    SQLException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
catch (    OdaException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
  }
}

Fixed version (ground truth):
public ResultSet getTableColumns(String schemaPattern,String tableNamePattern,String columnNamePattern){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getColumns(getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
catch (    Exception ex) {
      return null;
    }
  }
  try {
    return connection.getMetaData().getColumns(getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getColumns(getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
    }
 catch (    SQLException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
catch (    OdaException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
  }
}
Program: 65815
Project: 65815
Buggy source:
public ResultSet getProcedures(String schemaPattern,String procedureNamePattern){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getProcedures(connection.getCatalog(),schemaPattern,procedureNamePattern);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
catch (    Exception ex) {
      return null;
    }
  }
  try {
    return connection.getMetaData().getProcedures(connection.getCatalog(),schemaPattern,procedureNamePattern);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getProcedures(connection.getCatalog(),schemaPattern,procedureNamePattern);
    }
 catch (    Exception e1) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
}

Fixed version (ground truth):
public ResultSet getProcedures(String schemaPattern,String procedureNamePattern){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getProcedures(getCatalog(),schemaPattern,procedureNamePattern);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
catch (    Exception ex) {
      return null;
    }
  }
  try {
    return connection.getMetaData().getProcedures(getCatalog(),schemaPattern,procedureNamePattern);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getProcedures(getCatalog(),schemaPattern,procedureNamePattern);
    }
 catch (    Exception e1) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
}
Program: 65816
Project: 65816
Buggy source:
public ResultSet getProcedureColumns(String schemaPattern,String procedureNamePattern,String columnNamePattern){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getProcedureColumns(connection.getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
catch (    Exception ex) {
      return null;
    }
  }
  try {
    return connection.getMetaData().getProcedureColumns(connection.getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getProcedureColumns(connection.getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
    }
 catch (    SQLException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
catch (    OdaException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
  }
}

Fixed version (ground truth):
public ResultSet getProcedureColumns(String schemaPattern,String procedureNamePattern,String columnNamePattern){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getProcedureColumns(getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
catch (    Exception ex) {
      return null;
    }
  }
  try {
    return connection.getMetaData().getProcedureColumns(getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getProcedureColumns(getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
    }
 catch (    SQLException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
catch (    OdaException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
  }
}
Program: 65817
Project: 65817
Buggy source:
public boolean reloadOutlinePage(){
  if (!getActivePageInstance().getId().equals(XMLSourcePage_ID) || outlinePage == null || !getCurrentPageInstance().getId().equals(XMLSourcePage_ID)) {
    return false;
  }
  if (outlinePage.getCurrentPage() instanceof DesignerOutlinePage || outlinePage.getCurrentPage() == null) {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(IContentOutlinePage.class));
  }
 else {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(ContentOutlinePage.class));
  }
  if (outlinePage.getSite() != null) {
    outlinePage.getSite().getActionBars().updateActionBars();
  }
  return true;
}

Fixed version (ground truth):
public boolean reloadOutlinePage(){
  if (!getActivePageInstance().getId().equals(XMLSourcePage_ID) || outlinePage == null || !getCurrentPageInstance().getId().equals(XMLSourcePage_ID)) {
    return false;
  }
  if (outlinePage.getCurrentPage() instanceof DesignerOutlinePage || outlinePage.getCurrentPage() == null || outlinePage.getCurrentPage() instanceof EmptyPage) {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(IContentOutlinePage.class));
  }
 else {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(ContentOutlinePage.class));
  }
  if (outlinePage.getSite() != null) {
    outlinePage.getSite().getActionBars().updateActionBars();
  }
  return true;
}
Program: 65818
Project: 65818
Buggy source:
@Override public Object getAdapter(Object adaptableObject,Class adapterType){
  if (adaptableObject instanceof ExtendedItemHandle && ((ExtendedItemHandle)adaptableObject).getExtensionName().equals("String_Node_Str") && adapterType == IMenuListener.class) {
    final ExtendedItemHandle handle=(ExtendedItemHandle)adaptableObject;
    return new ISchematicMenuListener(){
      public void menuAboutToShow(      IMenuManager manager){
        CrosstabReportItemHandle crosstab=null;
        try {
          crosstab=(CrosstabReportItemHandle)((ExtendedItemHandle)handle).getReportItem();
        }
 catch (        ExtendedElementException e) {
          return;
        }
        manager.appendToGroup(GEFActionConstants.GROUP_VIEW,new AddComputedMeasureAction(crosstab));
        manager.appendToGroup(GEFActionConstants.GROUP_VIEW,new AddRelativeTimePeriodAction(handle));
      }
      public void setActionRegistry(      ActionRegistry actionRegistry){
      }
    }
;
  }
  return null;
}

Fixed version (ground truth):
public Object getAdapter(Object adaptableObject,Class adapterType){
  if (adaptableObject instanceof ExtendedItemHandle && ((ExtendedItemHandle)adaptableObject).getExtensionName().equals("String_Node_Str") && adapterType == IMenuListener.class) {
    final ExtendedItemHandle handle=(ExtendedItemHandle)adaptableObject;
    return new ISchematicMenuListener(){
      public void menuAboutToShow(      IMenuManager manager){
        CrosstabReportItemHandle crosstab=null;
        try {
          crosstab=(CrosstabReportItemHandle)((ExtendedItemHandle)handle).getReportItem();
        }
 catch (        ExtendedElementException e) {
          return;
        }
        manager.appendToGroup(GEFActionConstants.GROUP_VIEW,new AddComputedMeasureAction(crosstab));
        manager.appendToGroup(GEFActionConstants.GROUP_VIEW,new AddRelativeTimePeriodAction(handle));
      }
      public void setActionRegistry(      ActionRegistry actionRegistry){
      }
    }
;
  }
  return null;
}
Program: 65819
Project: 65819
Buggy source:
@Override public Class[] getAdapterList(){
  return null;
}

Fixed version (ground truth):
public Class[] getAdapterList(){
  return null;
}
Program: 65820
Project: 65820
Buggy source:
private List<String> getMesures(){
  List<String> measures=new ArrayList<String>();
  try {
    CrosstabReportItemHandle xtabHandle=(CrosstabReportItemHandle)((ExtendedItemHandle)getBindingHolder()).getReportItem();
    measures.add("String_Node_Str");
    for (int i=0; i < xtabHandle.getMeasureCount(); i++) {
      MeasureViewHandle mv=xtabHandle.getMeasure(i);
      if (mv instanceof ComputedMeasureViewHandle) {
        continue;
      }
      measures.add(DEUtil.getExpression(mv.getCubeMeasure()));
    }
  }
 catch (  ExtendedElementException e) {
  }
  return measures;
}

Fixed version (ground truth):
private List<String> getMesures(){
  List<String> measures=new ArrayList<String>();
  try {
    CrosstabReportItemHandle xtabHandle=(CrosstabReportItemHandle)((ExtendedItemHandle)getBindingHolder()).getReportItem();
    measures.add("String_Node_Str");
    CubeHandle cubeHandle=xtabHandle.getCube();
    List children=cubeHandle.getContents(CubeHandle.MEASURE_GROUPS_PROP);
    for (int i=0; i < children.size(); i++) {
      MeasureGroupHandle group=(MeasureGroupHandle)children.get(i);
      List measreHandles=group.getContents(MeasureGroupHandle.MEASURES_PROP);
      for (int j=0; j < measreHandles.size(); j++) {
        MeasureHandle measure=(MeasureHandle)measreHandles.get(j);
        String str=DEUtil.getExpression(measure);
        if (!measures.contains(str)) {
          measures.add(str);
        }
      }
    }
  }
 catch (  ExtendedElementException e) {
  }
  return measures;
}
Program: 65821
Project: 65821
Buggy source:
/** 
 * @param size
 */
private void createReadersAndWriters(int size){
  fieldWriters=new ObjectWriter[size];
  fieldReaders=new ObjectReader[size];
  for (int i=0; i < size; i++) {
    fieldWriters[i]=new ObjectWriter();
    fieldReaders[i]=new ObjectReader();
  }
}

Fixed version (ground truth):
/** 
 * @param size
 */
private void createReadersAndWriters(int size){
  if (fieldWriters == null && fieldReaders == null) {
    fieldWriters=new ObjectWriter[size];
    fieldReaders=new ObjectReader[size];
    for (int i=0; i < size; i++) {
      fieldWriters[i]=new ObjectWriter();
      fieldReaders[i]=new ObjectReader();
    }
  }
 else {
    int i=fieldWriters.length;
    fieldReaders=copyOf(fieldReaders,size);
    fieldWriters=copyOf(fieldWriters,size);
    for (; i < fieldReaders.length; i++) {
      fieldWriters[i]=new ObjectWriter();
      fieldReaders[i]=new ObjectReader();
    }
  }
}
Program: 65822
Project: 65822
Buggy source:
/** 
 * Checks if the given editPart child is in a Table.
 * @param child
 * @return
 */
private static boolean isInTable(EditPart child){
  if (child instanceof TableCellEditPart) {
    return false;
  }
  EditPart part=child.getParent();
  while (part != null) {
    if (part instanceof TableCellEditPart) {
      return true;
    }
    part=part.getParent();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if the given editPart child is in a Table.
 * @param child
 * @return
 */
private static boolean isInTable(EditPart child){
  if (child instanceof AbstractCellEditPart) {
    return false;
  }
  EditPart part=child.getParent();
  while (part != null) {
    if (part instanceof AbstractCellEditPart) {
      return true;
    }
    part=part.getParent();
  }
  return false;
}
Program: 65823
Project: 65823
Buggy source:
/** 
 * @param size
 */
private void createReadersAndWriters(int size){
  fieldWriters=new ObjectWriter[size];
  fieldReaders=new ObjectReader[size];
  for (int i=0; i < size; i++) {
    fieldWriters[i]=new ObjectWriter();
    fieldReaders[i]=new ObjectReader();
  }
}

Fixed version (ground truth):
/** 
 * @param size
 */
private void createReadersAndWriters(int size){
  if (fieldWriters == null && fieldReaders == null) {
    fieldWriters=new ObjectWriter[size];
    fieldReaders=new ObjectReader[size];
    for (int i=0; i < size; i++) {
      fieldWriters[i]=new ObjectWriter();
      fieldReaders[i]=new ObjectReader();
    }
  }
 else {
    int i=fieldWriters.length;
    fieldReaders=copyOf(fieldReaders,size);
    fieldWriters=copyOf(fieldWriters,size);
    for (; i < fieldReaders.length; i++) {
      fieldWriters[i]=new ObjectWriter();
      fieldReaders[i]=new ObjectReader();
    }
  }
}
Program: 65824
Project: 65824
Buggy source:
public void refreshFigure(){
  CellBorder cborder=new CellBorder();
  if (getFigure().getBorder() instanceof CellBorder) {
    cborder.setBorderInsets(((CellBorder)getFigure().getBorder()).getBorderInsets());
  }
  refreshBorder(getCellAdapter().getHandle(),cborder);
  Insets ist=getCellAdapter().getPadding(getFigure().getInsets());
  ((CellBorder)(getFigure().getBorder())).setPaddingInsets(ist);
  StyleHandle style=((CellHandle)getModel()).getPrivateStyle();
  String hAlign=style.getTextAlign();
  String vAlign=style.getVerticalAlign();
  ReportFlowLayout rflayout=(ReportFlowLayout)getFigure().getLayoutManager();
  if (DesignChoiceConstants.TEXT_ALIGN_CENTER.equals(hAlign)) {
    rflayout.setMajorAlignment(ReportFlowLayout.ALIGN_CENTER);
  }
 else   if (DesignChoiceConstants.TEXT_ALIGN_RIGHT.equals(hAlign) && !this.getFigure().isMirrored()) {
    rflayout.setMajorAlignment(ReportFlowLayout.ALIGN_RIGHTBOTTOM);
  }
 else   if (DesignChoiceConstants.TEXT_ALIGN_LEFT.equals(hAlign) && this.getFigure().isMirrored()) {
    rflayout.setMajorAlignment(ReportFlowLayout.ALIGN_RIGHTBOTTOM);
  }
 else {
    rflayout.setMajorAlignment(ReportFlowLayout.ALIGN_LEFTTOP);
  }
  if (DesignChoiceConstants.VERTICAL_ALIGN_MIDDLE.equals(vAlign)) {
    rflayout.setMinorAlignment(ReportFlowLayout.ALIGN_CENTER);
  }
 else   if (DesignChoiceConstants.VERTICAL_ALIGN_BOTTOM.equals(vAlign)) {
    rflayout.setMinorAlignment(ReportFlowLayout.ALIGN_RIGHTBOTTOM);
  }
 else {
    rflayout.setMinorAlignment(ReportFlowLayout.ALIGN_LEFTTOP);
  }
  ((CellFigure)getFigure()).setDirectionRTL(BidiUIUtils.INSTANCE.isDirectionRTL(getModel()));
  rflayout.layout(getFigure());
  updateBlankString();
  refreshBackground((DesignElementHandle)getModel());
}

Fixed version (ground truth):
public void refreshFigure(){
  CellBorder cborder=new CellBorder();
  if (getFigure().getBorder() instanceof CellBorder) {
    cborder.setBorderInsets(((CellBorder)getFigure().getBorder()).getBorderInsets());
  }
  refreshBorder(getCellAdapter().getHandle(),cborder);
  Insets ist=getCellAdapter().getPadding(getFigure().getInsets());
  ((CellBorder)(getFigure().getBorder())).setPaddingInsets(ist);
  setTextAliment(((CellHandle)getModel()).getPrivateStyle());
  ((CellFigure)getFigure()).setDirectionRTL(BidiUIUtils.INSTANCE.isDirectionRTL(getModel()));
  updateBlankString();
  refreshBackground((DesignElementHandle)getModel());
}
Program: 65825
Project: 65825
Buggy source:
public void refreshFigure(){
  CellBorder cborder=new CellBorder();
  if (getFigure().getBorder() instanceof CellBorder) {
    cborder.setBorderInsets(((CellBorder)getFigure().getBorder()).getBorderInsets());
  }
  refreshBorder(getCrosstabCellAdapter().getDesignElementHandle(),cborder);
  refreshBackground(getCrosstabCellAdapter().getDesignElementHandle());
  ((CellFigure)getFigure()).setDirectionRTL(BidiUIUtils.INSTANCE.isDirectionRTL(getModel()));
}

Fixed version (ground truth):
public void refreshFigure(){
  CellBorder cborder=new CellBorder();
  if (getFigure().getBorder() instanceof CellBorder) {
    cborder.setBorderInsets(((CellBorder)getFigure().getBorder()).getBorderInsets());
  }
  refreshBorder(getCrosstabCellAdapter().getDesignElementHandle(),cborder);
  refreshBackground(getCrosstabCellAdapter().getDesignElementHandle());
  ((CellFigure)getFigure()).setDirectionRTL(BidiUIUtils.INSTANCE.isDirectionRTL(getModel()));
  if (getCrosstabCellAdapter().getDesignElementHandle() != null) {
    setTextAliment(getCrosstabCellAdapter().getDesignElementHandle().getPrivateStyle());
  }
}
Program: 65826
Project: 65826
Buggy source:
/** 
 * whether to save empty parameter
 * @param parameters
 * @return
 */
private boolean doSaveEmptyParameter(PropertyHandle parameters){
  if (isJointOrDerivedDataSetHandle) {
    return true;
  }
  if (parameters == null) {
    parameters=((DataSetHandle)getContainer().getModel()).getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  }
  if (parameters != null) {
    Iterator iter=parameters.iterator();
    String paramName=null;
    if (iter != null) {
      while (iter.hasNext()) {
        DataSetParameterHandle parameter=(DataSetParameterHandle)iter.next();
        if (isOdaDataSetHandle)         paramName=((OdaDataSetParameterHandle)parameter).getParamName();
        if (parameter.isInput() && paramName == null && (parameter.getDefaultValue() == null || parameter.getDefaultValue().trim().length() == 0)) {
          setNoneValuedParameterName(parameter.getName());
          return false;
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * whether to save empty parameter
 * @param parameters
 * @return
 */
private boolean doSaveEmptyParameter(PropertyHandle parameters){
  if (isJointOrDerivedDataSetHandle) {
    return true;
  }
  if (parameters == null) {
    parameters=((DataSetHandle)getContainer().getModel()).getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
  }
  if (parameters != null) {
    Iterator iter=parameters.iterator();
    String paramName=null;
    if (iter != null) {
      while (iter.hasNext()) {
        DataSetParameterHandle parameter=(DataSetParameterHandle)iter.next();
        if (isOdaDataSetHandle)         paramName=((OdaDataSetParameterHandle)parameter).getParamName();
        if (parameter.isInput() && paramName == null && (!parameter.isOutput()) && (parameter.getDefaultValue() == null || parameter.getDefaultValue().trim().length() == 0)) {
          setNoneValuedParameterName(parameter.getName());
          return false;
        }
      }
    }
  }
  return true;
}
Program: 65827
Project: 65827
Buggy source:
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINEST,Connection.class.getName(),"String_Node_Str","String_Node_Str");
  if (jdbcConn == null) {
    return;
  }
  try {
    if (this.appContext != null && jdbcConn != null) {
      Object option=this.appContext.get(IConnectionFactory.CLOSE_PASS_IN_CONNECTION);
      boolean closePassInConnection=(option instanceof Boolean) ? ((Boolean)option).booleanValue() : true;
      if (!closePassInConnection)       return;
    }
    if (jdbcConn.isClosed() == false) {
      jdbcConn.close();
      logger.log(Level.WARNING,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
 else {
      logger.log(Level.FINER,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    try {
      if (DBConfig.getInstance().qualifyPolicy(jdbcConn.getMetaData().getDriverName(),DBConfig.IGNORE_UNIMPORTANT_EXCEPTION))       return;
    }
 catch (    SQLException e1) {
    }
    throw new JDBCException(ResourceConstants.CONN_CANNOT_CLOSE,e);
  }
  jdbcConn=null;
}

Fixed version (ground truth):
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINEST,Connection.class.getName(),"String_Node_Str","String_Node_Str");
  if (jdbcConn == null) {
    return;
  }
  try {
    if (this.appContext != null && jdbcConn != null) {
      Object option=this.appContext.get(IConnectionFactory.CLOSE_PASS_IN_CONNECTION);
      boolean closePassInConnection=(option instanceof Boolean) ? ((Boolean)option).booleanValue() : true;
      if (!closePassInConnection)       return;
    }
    if (jdbcConn.isClosed() == false) {
      jdbcConn.close();
      logger.log(Level.FINER,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
 else {
      logger.log(Level.FINER,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    try {
      if (DBConfig.getInstance().qualifyPolicy(jdbcConn.getMetaData().getDriverName(),DBConfig.IGNORE_UNIMPORTANT_EXCEPTION))       return;
    }
 catch (    SQLException e1) {
    }
    throw new JDBCException(ResourceConstants.CONN_CANNOT_CLOSE,e);
  }
  jdbcConn=null;
}
Program: 65829
Project: 65829
Buggy source:
public synchronized Driver getDriverInstance(Class driver,boolean refreshDriver) throws OdaException {
  String driverName=driver.getName();
  Driver drv=cachedJdbcDrivers.get(driverName);
  if (refreshDriver || drv == null) {
    Driver instance=null;
    try {
      instance=new WrappedDriver((Driver)driver.newInstance(),driverName);
    }
 catch (    Exception e) {
      throw new OdaException(e);
    }
    cachedJdbcDrivers.put(driverName,instance);
    return instance;
  }
 else {
    return drv;
  }
}

Fixed version (ground truth):
private Driver getDriverInstance(String driverName){
  return cachedJdbcDrivers.get(driverName);
}
Program: 65830
Project: 65830
Buggy source:
/** 
 * Searches extension registry for connection factory defined for driverClass. Returns an  instance of the factory if there is a connection factory for the driver class. Returns null otherwise.
 */
public synchronized IConnectionFactory getDriverConnectionFactory(String driverClass) throws OdaException {
}

Fixed version (ground truth):
/** 
 * Searches extension registry for connection factory defined for driverClass. Returns an  instance of the factory if there is a connection factory for the driver class. Returns null otherwise.
 */
public IConnectionFactory getDriverConnectionFactory(String driverClass) throws OdaException {
}
Program: 65831
Project: 65831
Buggy source:
/** 
 * For the given odi resultset, calcaulate the value of aggregate from aggregateTable
 * @param aggrTable
 * @param odiResult
 * @throws DataException 
 */
public ProgressiveAggregationHelper(IAggrDefnManager manager,String tempDir,Scriptable currentScope,ScriptContext sc) throws DataException {
  this.manager=manager;
  this.currentRoundAggrValue=new List[0];
  this.accumulators=new ArrayList<Accumulator>();
  this.sc=sc;
  try {
    this.currentScope=((IDataScriptEngine)this.sc.getScriptEngine(IDataScriptEngine.ENGINE_NAME)).getJSContext(sc).initStandardObjects();
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  this.currentScope.setParentScope(currentScope);
  this.jsRow=new DummyJSResultSetRow();
  this.currentScope.put("String_Node_Str",this.currentScope,this.jsRow);
  this.populateAggregations(tempDir);
}

Fixed version (ground truth):
/** 
 * For the given odi resultset, calcaulate the value of aggregate from aggregateTable
 * @param aggrTable
 * @param odiResult
 * @throws DataException 
 */
public ProgressiveAggregationHelper(IAggrDefnManager manager,String tempDir,Scriptable currentScope,ScriptContext sc) throws DataException {
  this.manager=manager;
  this.currentRoundAggrValue=new List[0];
  this.accumulators=new ArrayList<Accumulator>();
  this.sc=sc;
  try {
    this.currentScope=((IDataScriptEngine)this.sc.getScriptEngine(IDataScriptEngine.ENGINE_NAME)).getJSContext(sc).initStandardObjects();
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  this.currentScope.setParentScope(currentScope);
  this.jsRow=new DummyJSResultSetRow();
  this.currentScope.put("String_Node_Str",this.currentScope,this.jsRow);
  this.currentScope.put("String_Node_Str",this.currentScope,this.jsRow);
  this.populateAggregations(tempDir);
}
Program: 65832
Project: 65832
Buggy source:
/** 
 * Sets the display property of the Label.
 * @param display the display property. this should be one of the following: DesignChoiceConstants.DISPLAY_BLOCK | DesignChoiceConstants.DISPLAY_INLINE | DesignChoiceConstants.DISPLAY_NONE
 */
public void setDisplay(String display){
  if (DesignChoiceConstants.DISPLAY_NONE.equals(display)) {
    setDisplay(DesignChoiceConstants.DISPLAY_BLOCK);
  }
  this.display=display;
}

Fixed version (ground truth):
/** 
 * Sets the display property of the Label.
 * @param display the display property. this should be one of the following: DesignChoiceConstants.DISPLAY_BLOCK | DesignChoiceConstants.DISPLAY_INLINE | DesignChoiceConstants.DISPLAY_NONE
 */
public void setDisplay(String display){
  if (DesignChoiceConstants.DISPLAY_NONE.equals(display)) {
    this.display=DesignChoiceConstants.DISPLAY_BLOCK;
  }
 else {
    this.display=display;
  }
}
Program: 65833
Project: 65833
Buggy source:
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINEST,Connection.class.getName(),"String_Node_Str","String_Node_Str");
  if (jdbcConn == null) {
    return;
  }
  try {
    if (this.appContext != null && jdbcConn != null) {
      Object option=this.appContext.get(IConnectionFactory.CLOSE_PASS_IN_CONNECTION);
      boolean closePassInConnection=(option instanceof Boolean) ? ((Boolean)option).booleanValue() : true;
      if (!closePassInConnection)       return;
    }
    if (jdbcConn.isClosed() == false) {
      jdbcConn.close();
      logger.log(Level.FINER,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
 else {
      logger.log(Level.FINER,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    try {
      if (DBConfig.getInstance().qualifyPolicy(jdbcConn.getMetaData().getDriverName(),DBConfig.IGNORE_UNIMPORTANT_EXCEPTION))       return;
    }
 catch (    SQLException e1) {
    }
    throw new JDBCException(ResourceConstants.CONN_CANNOT_CLOSE,e);
  }
  jdbcConn=null;
}

Fixed version (ground truth):
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINEST,Connection.class.getName(),"String_Node_Str","String_Node_Str");
  if (jdbcConn == null) {
    return;
  }
  try {
    if (this.appContext != null && jdbcConn != null) {
      Object option=this.appContext.get(IConnectionFactory.CLOSE_PASS_IN_CONNECTION);
      boolean closePassInConnection=(option instanceof Boolean) ? ((Boolean)option).booleanValue() : true;
      if (!closePassInConnection)       return;
    }
    if (jdbcConn.isClosed() == false) {
      jdbcConn.close();
      logger.log(Level.WARNING,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
 else {
      logger.log(Level.FINER,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    try {
      if (DBConfig.getInstance().qualifyPolicy(jdbcConn.getMetaData().getDriverName(),DBConfig.IGNORE_UNIMPORTANT_EXCEPTION))       return;
    }
 catch (    SQLException e1) {
    }
    throw new JDBCException(ResourceConstants.CONN_CANNOT_CLOSE,e);
  }
  jdbcConn=null;
}
Program: 65835
Project: 65835
Buggy source:
private Driver getDriverInstance(String driverName){
  return cachedJdbcDrivers.get(driverName);
}

Fixed version (ground truth):
public synchronized Driver getDriverInstance(Class driver,boolean refreshDriver) throws OdaException {
  String driverName=driver.getName();
  Driver drv=cachedJdbcDrivers.get(driverName);
  if (refreshDriver || drv == null) {
    Driver instance=null;
    try {
      instance=new WrappedDriver((Driver)driver.newInstance(),driverName);
    }
 catch (    Exception e) {
      throw new OdaException(e);
    }
    cachedJdbcDrivers.put(driverName,instance);
    return instance;
  }
 else {
    return drv;
  }
}
Program: 65836
Project: 65836
Buggy source:
/** 
 * Searches extension registry for connection factory defined for driverClass. Returns an  instance of the factory if there is a connection factory for the driver class. Returns null otherwise.
 */
public IConnectionFactory getDriverConnectionFactory(String driverClass) throws OdaException {
}

Fixed version (ground truth):
/** 
 * Searches extension registry for connection factory defined for driverClass. Returns an  instance of the factory if there is a connection factory for the driver class. Returns null otherwise.
 */
public synchronized IConnectionFactory getDriverConnectionFactory(String driverClass) throws OdaException {
}
Program: 65837
Project: 65837
Buggy source:
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINEST,Connection.class.getName(),"String_Node_Str","String_Node_Str");
  if (jdbcConn == null) {
    return;
  }
  try {
    if (this.appContext != null && jdbcConn != null) {
      Object option=this.appContext.get(IConnectionFactory.CLOSE_PASS_IN_CONNECTION);
      boolean closePassInConnection=(option instanceof Boolean) ? ((Boolean)option).booleanValue() : true;
      if (!closePassInConnection)       return;
    }
    if (jdbcConn.isClosed() == false) {
      jdbcConn.close();
      logger.log(Level.FINER,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
 else {
      logger.log(Level.FINER,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    try {
      if (DBConfig.getInstance().qualifyPolicy(jdbcConn.getMetaData().getDriverName(),DBConfig.IGNORE_UNIMPORTANT_EXCEPTION))       return;
    }
 catch (    SQLException e1) {
    }
    throw new JDBCException(ResourceConstants.CONN_CANNOT_CLOSE,e);
  }
  jdbcConn=null;
}

Fixed version (ground truth):
public void close() throws OdaException {
  logger.logp(java.util.logging.Level.FINEST,Connection.class.getName(),"String_Node_Str","String_Node_Str");
  if (jdbcConn == null) {
    return;
  }
  try {
    if (this.appContext != null && jdbcConn != null) {
      Object option=this.appContext.get(IConnectionFactory.CLOSE_PASS_IN_CONNECTION);
      boolean closePassInConnection=(option instanceof Boolean) ? ((Boolean)option).booleanValue() : true;
      if (!closePassInConnection)       return;
    }
    if (jdbcConn.isClosed() == false) {
      jdbcConn.close();
      logger.log(Level.FINE,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
 else {
      logger.log(Level.FINER,"String_Node_Str" + jdbcConn + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    try {
      if (DBConfig.getInstance().qualifyPolicy(jdbcConn.getMetaData().getDriverName(),DBConfig.IGNORE_UNIMPORTANT_EXCEPTION))       return;
    }
 catch (    SQLException e1) {
    }
    throw new JDBCException(ResourceConstants.CONN_CANNOT_CLOSE,e);
  }
  jdbcConn=null;
}
Program: 65839
Project: 65839
Buggy source:
private void loadDriverExtensions(){
  if (driverExtensions != null)   return;
  driverExtensions=new HashMap();
  IExtensionRegistry extReg=Platform.getExtensionRegistry();
  IExtensionPoint extPoint=extReg.getExtensionPoint(OdaJdbcDriver.Constants.DRIVER_INFO_EXTENSION);
  if (extPoint == null)   return;
  IExtension[] exts=extPoint.getExtensions();
  if (exts == null)   return;
  for (int e=0; e < exts.length; e++) {
    IConfigurationElement[] configElems=exts[e].getConfigurationElements();
    if (configElems == null)     continue;
    for (int i=0; i < configElems.length; i++) {
      if (configElems[i].getName().equals(OdaJdbcDriver.Constants.DRIVER_INFO_ELEM_JDBCDRIVER)) {
        String driverClass=configElems[i].getAttribute(OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_DRIVERCLASS);
        String connectionFactory=configElems[i].getAttribute(OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_CONNFACTORY);
        logger.info("String_Node_Str" + driverClass + "String_Node_Str"+ connectionFactory);
        if (driverClass != null && driverClass.length() > 0 && connectionFactory != null && connectionFactory.length() > 0) {
          driverExtensions.put(driverClass,configElems[i]);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void loadDriverExtensions(){
  if (driverExtensions != null)   return;
synchronized (this) {
    driverExtensions=new HashMap();
    IExtensionRegistry extReg=Platform.getExtensionRegistry();
    IExtensionPoint extPoint=extReg.getExtensionPoint(OdaJdbcDriver.Constants.DRIVER_INFO_EXTENSION);
    if (extPoint == null)     return;
    IExtension[] exts=extPoint.getExtensions();
    if (exts == null)     return;
    for (int e=0; e < exts.length; e++) {
      IConfigurationElement[] configElems=exts[e].getConfigurationElements();
      if (configElems == null)       continue;
      for (int i=0; i < configElems.length; i++) {
        if (configElems[i].getName().equals(OdaJdbcDriver.Constants.DRIVER_INFO_ELEM_JDBCDRIVER)) {
          String driverClass=configElems[i].getAttribute(OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_DRIVERCLASS);
          String connectionFactory=configElems[i].getAttribute(OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_CONNFACTORY);
          logger.info("String_Node_Str" + driverClass + "String_Node_Str"+ connectionFactory);
          if (driverClass != null && driverClass.length() > 0 && connectionFactory != null && connectionFactory.length() > 0) {
            driverExtensions.put(driverClass,configElems[i]);
          }
        }
      }
    }
  }
}
Program: 65840
Project: 65840
Buggy source:
/** 
 * Creates multiple objects
 * @param array multiple creation source
 * @param target
 * @param targetParent
 * @return first creation in layout
 * @throws SemanticException
 */
protected static DesignElementHandle performMultiInsert(Object[] array,Object target,Object targetParent) throws SemanticException {
  DesignElementHandle result=null;
  MultiItemsExpandRule rule=new MultiItemsExpandRule(array,target);
  if (rule.canInsert()) {
    Object[] positions=(Object[])rule.getInsertPosition();
    if (positions != null) {
      for (int i=0; i < array.length; i++) {
        DesignElementHandle newObj=performInsert(array[i],positions[i],targetParent);
        if (i == rule.getFocusIndex()) {
          result=newObj;
        }
 else {
          DNDUtil.addElementHandle(positions[i],newObj);
        }
      }
    }
  }
 else   if (array.length != 0) {
    result=performInsert(array[0],target,targetParent);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Creates multiple objects
 * @param array multiple creation source
 * @param target
 * @param targetParent
 * @return first creation in layout
 * @throws SemanticException
 */
protected static DesignElementHandle performMultiInsert(Object[] array,Object target,Object targetParent) throws SemanticException {
  DesignElementHandle result=null;
  MultiItemsExpandRule rule=new MultiItemsExpandRule(array,target);
  if (rule.canInsert()) {
    Object[] positions=(Object[])rule.getInsertPosition();
    if (positions != null) {
      for (int i=0; i < array.length; i++) {
        DesignElementHandle newObj=performInsert(array[i],positions[i],targetParent);
        if (i == rule.getFocusIndex()) {
          result=newObj;
        }
 else {
          DNDUtil.addElementHandle(positions[i],newObj);
          if (newObj instanceof DesignElementHandle) {
            DEUtil.setDefaultTheme((DesignElementHandle)newObj);
          }
        }
      }
    }
  }
 else   if (array.length != 0) {
    result=performInsert(array[0],target,targetParent);
  }
  return result;
}
Program: 65842
Project: 65842
Buggy source:
/** 
 * Saves   {@code CubeQueryDefinition} instance into report document
 * @param queryResultID
 * @param writer
 * @param qd
 * @throws DataException
 * @throws IOException
 */
public static void save(String queryResultID,IDocArchiveWriter writer,ICubeQueryDefinition qd) throws DataException, IOException {
  DataOutputStream dos=null;
  try {
    RAOutputStream outputStream=writer.createRandomAccessStream(queryResultID + STREAM_FLAG);
    dos=new DataOutputStream(outputStream);
    IOUtil.writeString(dos,qd.getName());
    IOUtil.writeBool(dos,qd.cacheQueryResults());
    IOUtil.writeInt(dos,qd.getFilterOption());
    saveBindings(dos,qd.getBindings(),VersionManager.getLatestVersion());
    saveFilters(dos,qd.getFilters());
    saveSortDefns(dos,qd.getSorts());
    saveMeasures(dos,qd.getMeasures());
    saveComputedMeasures(dos,qd.getComputedMeasures());
    saveCalculatedMeasures(dos,qd.getDerivedMeasures());
    saveEdges(dos,qd);
    saveCubeOperations(dos,qd.getCubeOperations(),VersionManager.getLatestVersion());
    dos.flush();
    saveVersion(queryResultID,writer);
  }
  finally {
    if (dos != null) {
      dos.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Saves   {@code CubeQueryDefinition} instance into report document
 * @param queryResultID
 * @param writer
 * @param qd
 * @throws DataException
 * @throws IOException
 */
public static void save(String queryResultID,DataEngineContext context,ICubeQueryDefinition qd) throws DataException, IOException {
  DataOutputStream dos=null;
  try {
    StreamManager manager=new StreamManager(context,new QueryResultInfo(queryResultID,null,0));
    int version=manager.getVersion();
    IDocArchiveWriter writer=context.getDocWriter();
    RAOutputStream outputStream=writer.createRandomAccessStream(queryResultID + STREAM_FLAG);
    dos=new DataOutputStream(outputStream);
    IOUtil.writeString(dos,qd.getName());
    IOUtil.writeBool(dos,qd.cacheQueryResults());
    IOUtil.writeInt(dos,qd.getFilterOption());
    saveBindings(dos,qd.getBindings(),version);
    saveFilters(dos,qd.getFilters());
    saveSortDefns(dos,qd.getSorts());
    saveMeasures(dos,qd.getMeasures());
    saveComputedMeasures(dos,qd.getComputedMeasures());
    saveCalculatedMeasures(dos,qd.getDerivedMeasures(),version);
    saveEdges(dos,qd);
    saveCubeOperations(dos,qd.getCubeOperations(),version);
    dos.flush();
  }
  finally {
    if (dos != null) {
      dos.close();
    }
  }
}
Program: 65843
Project: 65843
Buggy source:
private static void loadCalculatedMeasures(DataInputStream dis,ICubeQueryDefinition qd,int version) throws DataException, IOException {
  if (version < VersionManager.getLatestVersion())   return;
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    IDerivedMeasureDefinition md=loadCaculatedMeasure(dis);
    IMeasureDefinition md1=qd.createDerivedMeasure(md.getName(),md.getDataType(),md.getExpression());
    md1.setAggrFunction(md.getAggrFunction());
  }
}

Fixed version (ground truth):
private static void loadCalculatedMeasures(DataInputStream dis,ICubeQueryDefinition qd,int version) throws DataException, IOException {
  if (version < VersionManager.VERSION_2_6_3_1)   return;
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    IDerivedMeasureDefinition md=loadCaculatedMeasure(dis);
    IMeasureDefinition md1=qd.createDerivedMeasure(md.getName(),md.getDataType(),md.getExpression());
    md1.setAggrFunction(md.getAggrFunction());
  }
}
Program: 65844
Project: 65844
Buggy source:
/** 
 * Loads   {@code CubeQueryDefinition} instance from report document
 * @param queryResultID
 * @param reader
 * @return
 * @throws DataException
 * @throws IOException
 */
public static ICubeQueryDefinition load(String queryResultID,DataEngineContext context) throws DataException, IOException {
  DataInputStream dis=null;
  IDocArchiveReader reader=context.getDocReader();
  int version=0;
  try {
    if (reader.exists(queryResultID + "String_Node_Str")) {
      RAInputStream inputStream=reader.getStream(queryResultID + "String_Node_Str");
      DataInputStream stream=new DataInputStream(inputStream);
      version=IOUtil.readInt(stream);
    }
    RAInputStream inputStream=reader.getStream(queryResultID + STREAM_FLAG);
    dis=new DataInputStream(inputStream);
    String name=IOUtil.readString(dis);
    ICubeQueryDefinition cqd=new CubeQueryDefinition(name);
    cqd.setCacheQueryResults(IOUtil.readBool(dis));
    cqd.setFilterOption(IOUtil.readInt(dis));
    loadBindings(dis,cqd,version);
    loadFilters(dis,cqd);
    loadSortDefns(dis,cqd);
    loadMeasures(dis,cqd);
    loadComputedMeasures(dis,cqd);
    loadCalculatedMeasures(dis,cqd,version);
    loadEdges(dis,cqd);
    loadCubeOperations(dis,cqd,version);
    return cqd;
  }
  finally {
    if (dis != null) {
      dis.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads   {@code CubeQueryDefinition} instance from report document
 * @param queryResultID
 * @param reader
 * @return
 * @throws DataException
 * @throws IOException
 */
public static ICubeQueryDefinition load(String queryResultID,DataEngineContext context) throws DataException, IOException {
  DataInputStream dis=null;
  IDocArchiveReader reader=context.getDocReader();
  int version;
  if (context.hasInStream(null,null,DataEngineContext.VERSION_INFO_STREAM) == false) {
    version=0;
  }
 else {
    StreamManager manager=new StreamManager(context,new QueryResultInfo(queryResultID,null,0));
    version=manager.getVersion();
  }
  try {
    RAInputStream inputStream=reader.getStream(queryResultID + STREAM_FLAG);
    dis=new DataInputStream(inputStream);
    String name=IOUtil.readString(dis);
    ICubeQueryDefinition cqd=new CubeQueryDefinition(name);
    cqd.setCacheQueryResults(IOUtil.readBool(dis));
    cqd.setFilterOption(IOUtil.readInt(dis));
    loadBindings(dis,cqd,version);
    loadFilters(dis,cqd);
    loadSortDefns(dis,cqd);
    loadMeasures(dis,cqd);
    loadComputedMeasures(dis,cqd);
    loadCalculatedMeasures(dis,cqd,version);
    loadEdges(dis,cqd);
    loadCubeOperations(dis,cqd,version);
    return cqd;
  }
  finally {
    if (dis != null) {
      dis.close();
    }
  }
}
Program: 65845
Project: 65845
Buggy source:
private static void saveCalculatedMeasures(DataOutputStream dos,List<IDerivedMeasureDefinition> derivedMeasures) throws IOException, DataException {
  if (writeSize(dos,derivedMeasures) > 0) {
    for (    IDerivedMeasureDefinition m : derivedMeasures) {
      saveCalculatedMeasure(dos,m);
    }
  }
}

Fixed version (ground truth):
private static void saveCalculatedMeasures(DataOutputStream dos,List<IDerivedMeasureDefinition> derivedMeasures,int version) throws IOException, DataException {
  if (version < VersionManager.VERSION_2_6_3_1)   return;
  if (writeSize(dos,derivedMeasures) > 0) {
    for (    IDerivedMeasureDefinition m : derivedMeasures) {
      saveCalculatedMeasure(dos,m);
    }
  }
}
Program: 65847
Project: 65847
Buggy source:
private IAggregationResultSet[] executeQuery(BirtCubeView view,AggregationDefinition[] aggrDefns,boolean saveToRD,String queryResutID,IBindingValueFetcher fetcher) throws IOException, BirtException {
  IAggregationResultSet[] rs;
  CubeQueryExecutor executor=view.getCubeQueryExecutor();
  rs=cubeQueryExecutorHelper.execute(aggrDefns,executor.getSession().getStopSign());
  rs=applyNoAggrUpdateFilters(getNoAggrUpdateFilters(executor.getCubeQueryDefinition().getFilters()),executor,rs,view.getCube(),fetcher);
  MirrorOperationExecutor moe=new MirrorOperationExecutor();
  rs=moe.execute(rs,view,cubeQueryExecutorHelper);
  validateLimitSetting(view,rs);
  if (executor.getCubeQueryDefinition().cacheQueryResults()) {
    File tmpDir=new File(executor.getSession().getTempDir());
    if (!FileSecurity.fileExist(tmpDir) || !FileSecurity.fileIsDirectory(tmpDir)) {
      FileSecurity.fileMakeDirs(tmpDir);
    }
    ArchiveWriter writer=new ArchiveWriter(new ArchiveFile(executor.getSession().getTempDir() + "String_Node_Str","String_Node_Str"));
    AggregationResultSetSaveUtil.save(queryResutID,rs,writer);
    writer.finish();
  }
  if (saveToRD) {
    CubeQueryDefinitionIOUtil.save(queryResutID,executor.getContext().getDocWriter(),executor.getCubeQueryDefinition());
    AggregationResultSetSaveUtil.save(queryResutID,rs,executor.getContext().getDocWriter());
  }
  return rs;
}

Fixed version (ground truth):
private IAggregationResultSet[] executeQuery(BirtCubeView view,AggregationDefinition[] aggrDefns,boolean saveToRD,String queryResutID,IBindingValueFetcher fetcher) throws IOException, BirtException {
  IAggregationResultSet[] rs;
  CubeQueryExecutor executor=view.getCubeQueryExecutor();
  rs=cubeQueryExecutorHelper.execute(aggrDefns,executor.getSession().getStopSign());
  rs=applyNoAggrUpdateFilters(getNoAggrUpdateFilters(executor.getCubeQueryDefinition().getFilters()),executor,rs,view.getCube(),fetcher);
  MirrorOperationExecutor moe=new MirrorOperationExecutor();
  rs=moe.execute(rs,view,cubeQueryExecutorHelper);
  validateLimitSetting(view,rs);
  if (executor.getCubeQueryDefinition().cacheQueryResults()) {
    File tmpDir=new File(executor.getSession().getTempDir());
    if (!FileSecurity.fileExist(tmpDir) || !FileSecurity.fileIsDirectory(tmpDir)) {
      FileSecurity.fileMakeDirs(tmpDir);
    }
    ArchiveWriter writer=new ArchiveWriter(new ArchiveFile(executor.getSession().getTempDir() + "String_Node_Str","String_Node_Str"));
    AggregationResultSetSaveUtil.save(queryResutID,rs,writer);
    writer.finish();
  }
  if (saveToRD) {
    CubeQueryDefinitionIOUtil.save(queryResutID,executor.getContext(),executor.getCubeQueryDefinition());
    AggregationResultSetSaveUtil.save(queryResutID,rs,executor.getContext().getDocWriter());
  }
  return rs;
}