Program: 75166
Project: 75166
Buggy source:
/** 
 * refresh page
 */
private void refreshPage(){
  DataSourceDesign curDataSourceDesign=this.getDataSetDesign().getDataSourceDesign();
  if (curDataSourceDesign != prevDataSourceDesign) {
    RemoveAllAvailableDbObjects();
    resetJdbcInfo(curDataSourceDesign);
    enableSchemaComponent(isSchemaSupported);
    setRootElement();
    sourceViewerConfiguration.getContentAssistProcessor().setDataSourceHandle(curDataSourceDesign);
    populateAvailableDbObjects();
    prevDataSourceDesign=curDataSourceDesign;
    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) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * refresh page
 */
private void refreshPage(){
  DataSourceDesign curDataSourceDesign=this.getDataSetDesign().getDataSourceDesign();
  if (curDataSourceDesign != prevDataSourceDesign) {
    RemoveAllAvailableDbObjects();
    resetJdbcInfo(curDataSourceDesign);
    enableSchemaComponent(isSchemaSupported);
    setRootElement();
    sourceViewerConfiguration.getContentAssistProcessor().setDataSourceHandle(curDataSourceDesign);
    populateAvailableDbObjects();
    prevDataSourceDesign=curDataSourceDesign;
    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);
    }
  }
}