Program: 74420
Project: 74420
Buggy source:
/** 
 * set the page's layout
 */
private void setPageLayout(){
  removeAllAvailableDbObjects();
  enableSchemaComponent(isSchemaSupported);
  setRootElement();
  sourceViewerConfiguration.getContentAssistProcessor().setDataSourceHandle(this.getDataSetDesign().getDataSourceDesign());
  populateAvailableDbObjects();
  try {
    if (metaDataProvider.getConnection() == null || this.getDataSetDesign().getQueryText() == null || this.getDataSetDesign().getQueryText().trim().length() == 0)     return;
    ResultSetMetaData meta=null;
    try {
      meta=this.metaDataProvider.getConnection().prepareStatement(this.getDataSetDesign().getQueryText()).getMetaData();
    }
 catch (    SQLException e) {
      try {
        meta=this.metaDataProvider.getConnection().prepareStatement(this.getDataSetDesign().getQueryText()).executeQuery().getMetaData();
      }
 catch (      Exception ex) {
        meta=null;
      }
    }
    if (meta == null)     return;
    if (this.getDataSetDesign().getPrimaryResultSet() == null) {
      this.shouldUpdateDataSetDesign=true;
      return;
    }
    ResultSetColumns rsc=this.getDataSetDesign().getPrimaryResultSet().getResultSetColumns();
    if (meta.getColumnCount() != rsc.getResultColumnDefinitions().size()) {
      this.shouldUpdateDataSetDesign=true;
      return;
    }
    for (int i=0; i < rsc.getResultColumnDefinitions().size(); i++) {
      ColumnDefinition cd=(ColumnDefinition)rsc.getResultColumnDefinitions().get(i);
      if (!(cd.getAttributes().getName().equals(meta.getColumnName(i + 1)) && cd.getAttributes().getNativeDataTypeCode() == meta.getColumnType(i + 1))) {
        this.shouldUpdateDataSetDesign=true;
        return;
      }
    }
  }
 catch (  SQLException e) {
    logger.log(Level.FINE,e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * set the page's layout
 */
private void setPageLayout(){
  removeAllAvailableDbObjects();
  enableSchemaComponent(isSchemaSupported);
  setRootElement();
  sourceViewerConfiguration.getContentAssistProcessor().setDataSourceHandle(this.getDataSetDesign().getDataSourceDesign());
  populateAvailableDbObjects();
  try {
    if (metaDataProvider.getConnection() == null || this.getDataSetDesign().getQueryText() == null || this.getDataSetDesign().getQueryText().trim().length() == 0)     return;
    MetaDataRetriever retriever=new MetaDataRetriever(this.metaDataProvider,this.getDataSetDesign().getQueryText());
    IResultSetMetaData rsMeta=retriever.getResultSetMetaData();
    if (rsMeta == null) {
      retriever.close();
      return;
    }
    if (this.getDataSetDesign().getPrimaryResultSet() == null) {
      this.shouldUpdateDataSetDesign=true;
      retriever.close();
      return;
    }
    ResultSetColumns rsc=this.getDataSetDesign().getPrimaryResultSet().getResultSetColumns();
    if (rsMeta.getColumnCount() != rsc.getResultColumnDefinitions().size()) {
      this.shouldUpdateDataSetDesign=true;
      retriever.close();
      return;
    }
    for (int i=0; i < rsc.getResultColumnDefinitions().size(); i++) {
      ColumnDefinition cd=(ColumnDefinition)rsc.getResultColumnDefinitions().get(i);
      if (!(cd.getAttributes().getName().equals(rsMeta.getColumnName(i + 1)) && cd.getAttributes().getNativeDataTypeCode() == rsMeta.getColumnType(i + 1))) {
        this.shouldUpdateDataSetDesign=true;
        retriever.close();
        return;
      }
    }
    retriever.close();
  }
 catch (  OdaException e) {
    logger.log(Level.FINE,e.getMessage(),e);
  }
}