Buggy code:
public class TableController extends BasicController { private static final String VC_VAR_USE_NO_FILTER_OPTION = "useNoFilterOption" ; private static final String COMPONENT_TABLE_NAME = "table" ; private static final String VC_VAR_SELECTED_FILTER_VALUE = "selectedFilterValue" ; private static final String LINK_NUMBER_OF_ELEMENTS = "link.numberOfElements" ; private static final String VC_VAR_IS_FILTERED = "isFiltered" ; private static final String VC_VAR_HAS_TABLE_SEARCH = "hasTableSearch" ; private OLog log = Tracing . createLoggerFor ( this . getClass ( ) ) ; private static final String CMD_FILTER = "cmd.filter." ; private static final String CMD_FILTER_NOFILTER = "cmd.filter.nofilter" ; public static final Event EVENT_NOFILTER_SELECTED = new Event ( "nofilter.selected" ) ; public static final Event EVENT_FILTER_SELECTED = new Event ( "filter.selected" ) ; private VelocityContainer contentVc ; private Table table ; private Choice colsChoice ; private TablePrefs prefs ; private TableGuiConfiguration tableConfig ; private List < ShortName > filters ; private String filterTitle ; private ShortName activeFilter ; private boolean tablePrefsInitialized = false ; private CloseableCalloutWindowController cmc ; private AutoCompleterController tableSearchController ; private TableSort tableSort ; private Link resetLink ; private Link preferenceLink ; private Link downloadLink ; public TableController ( final TableGuiConfiguration tableConfig , final UserRequest ureq , final WindowControl wControl , final List < ShortName > filters , final ShortName activeFilter , final String filterTitle , final String noFilterOption , final Translator tableTrans ) { } public TableController ( final TableGuiConfiguration tableConfig , final UserRequest ureq , final WindowControl wControl , final List < ShortName > filters , final ShortName activeFilter , final String filterTitle , final String noFilterOption , final boolean enableTableSearch , final Translator tableTrans ) { } public TableController ( final TableGuiConfiguration tableConfigP , final UserRequest ureq , final WindowControl wControl , final Translator tableTrans ) { } public TableController ( final TableGuiConfiguration tableConfig , final UserRequest ureq , final WindowControl wControl , final Translator tableTrans , final boolean enableTableSearch ) { } private AutoCompleterController createTableSearchController ( final UserRequest ureq , final WindowControl wControl ) { } public void event ( final UserRequest ureq , final Component source , final Event event ) { if ( source == ( table ) ) { String cmd = event . getCommand ( ) ; if ( cmd . equalsIgnoreCase ( COMMAND_SORTBYCOLUMN ) ) { tableSort . setDirty ( true ) ; } else if ( ( ! ( cmd . equalsIgnoreCase ( COMMAND_SHOW_PAGES ) ) ) && ( ! ( cmd . equalsIgnoreCase ( COMMAND_PAGEACTION_SHOWALL ) ) ) ) { fireEvent ( ureq , event ) ; } } else if ( source == ( contentVc ) ) { handleCommandsOfTableVcContainer ( ureq , event ) ; } else if ( ( source == ( preferenceLink ) ) && ( ( tableConfig . getPreferencesKey ( ) ) != null ) ) { colsChoice = getColumnListAndTheirVisibility ( ) ; removeAsListenerAndDispose ( cmc ) ; cmc = new CloseableCalloutWindowController ( ureq , getWindowControl ( ) , colsChoice , preferenceLink , translate ( "title.changecols" ) , true , "" ) ; listenTo ( cmc ) ; cmc . activate ( ) ; } else if ( ( source == ( downloadLink ) ) && ( tableConfig . isDownloadOffered ( ) ) ) { TableExporter tableExporter = tableConfig . getDownloadOffered ( ) ; MediaResource mr = tableExporter . export ( table ) ; ureq . getDispatchResult ( ) . setResultingMediaResource ( mr ) ; } else if ( source == ( colsChoice ) ) { if ( event == ( Choice . EVNT_VALIDATION_OK ) ) { applyAndcheckChangedColumnsChoice ( ureq , colsChoice . getSelectedRows ( ) ) ; } else if ( event == ( Choice . EVNT_FORM_RESETED ) ) { <START_BUG> List < Integer > visibleCols = table . getDefaultVisibleColumns ( ) ; <END_BUG> applyAndcheckChangedColumnsChoice ( ureq , visibleCols ) ; } else { cmc . deactivate ( ) ; } } else if ( source == ( resetLink ) ) { table . setSearchString ( null ) ; modelChanged ( ) ; } } private void handleCommandsOfTableVcContainer ( final UserRequest ureq , final Event event ) { } private void applyAndcheckChangedColumnsChoice ( final UserRequest ureq , List < Integer > selRows ) { } private Choice getColumnListAndTheirVisibility ( ) { } @ Override public void event ( final UserRequest ureq , final Controller source , final Event event ) { } public int getRowCount ( ) { } public int getSortedRow ( int originalRow ) { } public Object getSortedObjectAt ( int sortedRow ) { } public int getIndexOfSortedObject ( Object obj ) { } public ShortName getActiveFilter ( ) { } public void setActiveFilter ( final ShortName activeFilter ) { } public void setFilters ( final List < ShortName > filters , final ShortName activeFilter ) { } public void modelChanged ( ) { } public void modelChanged ( final boolean resetSearchString ) { } public void setTableDataModel ( final TableDataModel tableDataModel ) { } public void addColumnDescriptor ( final boolean visible , final ColumnDescriptor cd ) { } public void addColumnDescriptor ( final ColumnDescriptor cd ) { } public ColumnDescriptor getColumnDescriptor ( final int row ) { } public TableDataModel getTableDataModel ( ) { } public List getSelectedSortedObjects ( final BitSet objectMarkers , final DefaultTableDataModel defaultTableDataModel ) { } public List getObjects ( final BitSet objectMarkers ) { } public void setSelectedRowId ( final int selectedRowId ) { } public void setPage ( Integer pageNr ) { } public int getPageSize ( ) { } public void setSortColumn ( final int sortColumn , final boolean isSortAscending ) { } public void setSortColumn ( final ColumnDescriptor sortColumn , final boolean isSortAscending ) { } public void setMultiSelect ( final boolean isMultiSelect ) { } public void setMultiSelectSelectedAt ( final int row , final boolean selected ) { } public void setMultiSelectReadonlyAt ( final int row , final boolean readonly ) { } public void addMultiSelectAction ( final String actionKeyi18n , final String actionIdentifier ) { } public void addLabeledMultiSelectAction ( final String label , final String actionIdentifier ) { } public int getTableSortCol ( ) { } public boolean getTableSortAsc ( ) { }

Fix:
List < Integer > visibleCols = table . getDefaultVisibleColumnsToResetColumnsChoice ( ) ;