Program: 64972
Project: 64972
Buggy source:
@SuppressWarnings("String_Node_Str") public IPreparedDSQuery prepare() throws DataException {
  if (odaStatement != null)   throw new DataException(ResourceConstants.QUERY_HAS_PREPARED);
  populateQuerySpecification();
  if (this.querySpecificaton != null && this.querySpecificaton.getBaseQuery() instanceof CombinedQuery) {
    odaStatement=dataSource.prepareStatement(null,queryType,this.querySpecificaton);
  }
 else {
    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;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public IPreparedDSQuery prepare() throws DataException {
  long start=System.currentTimeMillis();
  if (odaStatement != null)   throw new DataException(ResourceConstants.QUERY_HAS_PREPARED);
  populateQuerySpecification();
  if (this.querySpecificaton != null && this.querySpecificaton.getBaseQuery() instanceof CombinedQuery) {
    odaStatement=dataSource.prepareStatement(null,queryType,this.querySpecificaton);
  }
 else {
    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;
  }
  logger.fine("String_Node_Str" + (System.currentTimeMillis() - start) + "String_Node_Str");
  return this;
}