Program: 65564
Project: 65564
Buggy source:
@SuppressWarnings("String_Node_Str") public IPreparedDSQuery prepare() throws DataException {
  if (odaStatement != null)   throw new DataException(ResourceConstants.QUERY_HAS_PREPARED);
  populateQuerySpecification();
  odaStatement=dataSource.prepareStatement(queryText,queryType,this.querySpecificaton);
  addPropertiesToPreparedStatement();
  addParameterDefns();
  int maxRows=this.getRowFetchLimit();
  if (maxRows <= 0) {
    if (this.getQueryDefinition() instanceof IQueryDefinition) {
      IQueryDefinition qd=(IQueryDefinition)this.getQueryDefinition();
      maxRows=qd.getMaxRows();
    }
  }
  odaStatement.setMaxRows(maxRows);
  IOdaDataSetDesign design=null;
  if (session.getDataSetCacheManager().getCurrentDataSetDesign() instanceof IOdaDataSetDesign)   design=(IOdaDataSetDesign)session.getDataSetCacheManager().getCurrentDataSetDesign();
  ICancellable queryCanceller=new OdaQueryCanceller(odaStatement,session.getStopSign());
  if (design != null) {
    if (canAccessResultSetByName(design)) {
      addCustomFields(design.getPrimaryResultSetName(),odaStatement);
      addColumnHints(design.getPrimaryResultSetName(),odaStatement);
      if (this.projectedFields != null)       odaStatement.setColumnsProjection(design.getPrimaryResultSetName(),this.projectedFields);
    }
 else     if (canAccessResultSetByNumber(design)) {
      addCustomFields(design.getPrimaryResultSetNumber(),odaStatement);
      addColumnHints(design.getPrimaryResultSetNumber(),odaStatement);
      if (this.projectedFields != null)       odaStatement.setColumnsProjection(design.getPrimaryResultSetNumber(),this.projectedFields);
    }
 else {
      this.session.getCancelManager().register(queryCanceller);
      if (!session.getStopSign().isStopped()) {
        prepareColumns();
      }
      this.session.getCancelManager().deregister(queryCanceller);
    }
  }
 else {
    this.session.getCancelManager().register(queryCanceller);
    if (!session.getStopSign().isStopped()) {
      prepareColumns();
    }
    this.session.getCancelManager().deregister(queryCanceller);
  }
  try {
    this.session.getCancelManager().register(queryCanceller);
    if (!session.getStopSign().isStopped())     resultMetadata=getMetaData((IOdaDataSetDesign)session.getDataSetCacheManager().getCurrentDataSetDesign(),odaStatement);
    if (design != null) {
      List modelResultHints=design.getResultSetHints();
      resultMetadata=mergeResultHint(modelResultHints,resultMetadata);
    }
    if (queryCanceller.collectException() != null) {
      if (!(queryCanceller.collectException().getCause() instanceof UnsupportedOperationException))       throw queryCanceller.collectException();
    }
    this.session.getCancelManager().deregister(queryCanceller);
  }
 catch (  DataException e) {
    resultMetadata=null;
  }
  return this;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public IPreparedDSQuery prepare() throws DataException {
  if (odaStatement != null)   throw new DataException(ResourceConstants.QUERY_HAS_PREPARED);
  populateQuerySpecification();
  odaStatement=dataSource.prepareStatement(queryText,queryType,this.querySpecificaton);
  addPropertiesToPreparedStatement();
  addParameterDefns();
  odaStatement.setMaxRows(this.getRowFetchLimit());
  IOdaDataSetDesign design=null;
  if (session.getDataSetCacheManager().getCurrentDataSetDesign() instanceof IOdaDataSetDesign)   design=(IOdaDataSetDesign)session.getDataSetCacheManager().getCurrentDataSetDesign();
  ICancellable queryCanceller=new OdaQueryCanceller(odaStatement,session.getStopSign());
  if (design != null) {
    if (canAccessResultSetByName(design)) {
      addCustomFields(design.getPrimaryResultSetName(),odaStatement);
      addColumnHints(design.getPrimaryResultSetName(),odaStatement);
      if (this.projectedFields != null)       odaStatement.setColumnsProjection(design.getPrimaryResultSetName(),this.projectedFields);
    }
 else     if (canAccessResultSetByNumber(design)) {
      addCustomFields(design.getPrimaryResultSetNumber(),odaStatement);
      addColumnHints(design.getPrimaryResultSetNumber(),odaStatement);
      if (this.projectedFields != null)       odaStatement.setColumnsProjection(design.getPrimaryResultSetNumber(),this.projectedFields);
    }
 else {
      this.session.getCancelManager().register(queryCanceller);
      if (!session.getStopSign().isStopped()) {
        prepareColumns();
      }
      this.session.getCancelManager().deregister(queryCanceller);
    }
  }
 else {
    this.session.getCancelManager().register(queryCanceller);
    if (!session.getStopSign().isStopped()) {
      prepareColumns();
    }
    this.session.getCancelManager().deregister(queryCanceller);
  }
  try {
    this.session.getCancelManager().register(queryCanceller);
    if (!session.getStopSign().isStopped())     resultMetadata=getMetaData((IOdaDataSetDesign)session.getDataSetCacheManager().getCurrentDataSetDesign(),odaStatement);
    if (design != null) {
      List modelResultHints=design.getResultSetHints();
      resultMetadata=mergeResultHint(modelResultHints,resultMetadata);
    }
    if (queryCanceller.collectException() != null) {
      if (!(queryCanceller.collectException().getCause() instanceof UnsupportedOperationException))       throw queryCanceller.collectException();
    }
    this.session.getCancelManager().deregister(queryCanceller);
  }
 catch (  DataException e) {
    resultMetadata=null;
  }
  return this;
}