Enabled adaptive choices cause ArrayIndexOutOfBoundsException when table model is changed

Issue #8 resolved
Former user created an issue

``` Hi!

I upgraded the filters version to 4.4.1 and generaly enjoy it, but it has a problem with adaptive choices option. Enabled adaptive choices cause ArrayIndexOutOfBoundsException when table model is changed.

What steps will reproduce the problem?

1. filterHeader.setAdaptiveChoices(true) (if it was disabled) 2. change the table model (retrieve next page, which will result in different number of rows /add row/ delete row) ---------------------------------------------------------- What is the expected output? What do you see instead? This causes following exception: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 15600 at java.util.Vector.get(Vector.java:694) at com.xn.log_util.gui.screens.search.SeachResultsTableModel.getValueAt(SeachResultsTableModel.java:77) at net.coderazzi.filters.gui.ChoicesHandler$RowEntry.getValue(ChoicesHandler.java:186) at net.coderazzi.filters.parser.Parser$REOperand$1.include(Parser.java:344) at net.coderazzi.filters.gui.editor.FilterEditor$EditorFilter.include(FilterEditor.java:817) at net.coderazzi.filters.gui.AdaptiveChoicesHandler$AdaptiveChoicesSupport$RowInfo$Filter.include(AdaptiveChoicesHandler.java:676) at net.coderazzi.filters.gui.AdaptiveChoicesHandler$AdaptiveChoicesSupport.rowsUpdated(AdaptiveChoicesHandler.java:277) at net.coderazzi.filters.gui.AdaptiveChoicesHandler$AdaptiveChoicesSupport.tableChanged(AdaptiveChoicesHandler.java:238) at net.coderazzi.filters.gui.AdaptiveChoicesHandler.tableUpdated(AdaptiveChoicesHandler.java:137) at net.coderazzi.filters.gui.ChoicesHandler.tableChanged(ChoicesHandler.java:108) at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280) at javax.swing.table.AbstractTableModel.fireTableDataChanged(AbstractTableModel.java:182) at com.xn.log_util.gui.screens.search.SeachResultsTableModel.populateData(SeachResultsTableModel.java:193) at com.xn.log_util.gui.screens.search.SeachResultsTableModel.bringPage(SeachResultsTableModel.java:168) at com.xn.log_util.gui.screens.search.SearchTab$PaggingActionListener$1.run(SearchTab.java:564)

What version of the product are you using? On what operating system? 4.1.1

Thanks in advance, Polina.

```

Original issue reported on code.google.com by `pulke83` on 2011-03-16 15:04:51

Comments (11)

  1. coderazzi coderazzi repo owner

    ``` Hi, Polina, thanks for submitting the error.

    The problem lies on how the event is propagated (as an update of all the cells in the table): it is incorrectly recognized this event on the filter handler library.

    [The library expects the user to propagate a table model change as fireTableStructureChanged(), while you invoke, correctly, fireTableDataChanged()]

    I will include the solution on 4.2.0, which I should release this week, together with some performance enhancements.

    Best regards,

    Lu. ```

    Original issue reported on code.google.com by `coderazzi` on 2011-03-20 23:26:36

  2. coderazzi coderazzi repo owner

    ``` Solved on release 4.1.2 ```

    Original issue reported on code.google.com by `coderazzi` on 2011-03-23 04:06:45

  3. coderazzi coderazzi repo owner

    ``` (No text was entered with this change) ```

    Original issue reported on code.google.com by `coderazzi` on 2011-11-14 23:12:13

  4. Former user Account Deleted

    ``` I still see this error with version 4.1.4 ```

    Original issue reported on code.google.com by `Paul.R.Humphrey` on 2012-03-14 17:29:52

  5. Former user Account Deleted

    ``` This is not fixed in 4.1.4! ```

    Original issue reported on code.google.com by `humph.astro` on 2012-03-15 12:30:11

  6. Former user Account Deleted

    ``` This is not fixed in version 4.1.4, can you confirm that it is fixed in the latest (4.3.0)?

    ```

    Original issue reported on code.google.com by `humph.astro` on 2012-03-15 12:43:47

  7. coderazzi coderazzi repo owner

    ``` Open the ticket again, until solution is clarified ```

    Original issue reported on code.google.com by `coderazzi` on 2012-03-15 15:02:49

  8. Former user Account Deleted

    ``` Have now tried 4.3.0 - still not fixed. ```

    Original issue reported on code.google.com by `Paul.R.Humphrey` on 2012-03-15 15:06:57

  9. coderazzi coderazzi repo owner

    ``` Hi,

    the problem was supposedly solved on 4.1.2, no additional work on this matter has been done since. I have checked if the solution was lost on later releases, but the patch is present in 4.1.4 (and 4.3.0), so the exception shouldn't be raised.

    Of course, if you are still seeing the exception, it means that the patch was incomplete, but then I need to have some sample code to verify the exception being raised and the conditions under which the code is misbehaving. Can you provide that?

    Best regards,

    Lu. ```

    Original issue reported on code.google.com by `coderazzi` on 2012-03-16 14:57:05

  10. coderazzi coderazzi repo owner

    ``` On testing the error does not appear, and no additional information has been provided on the exception conditions, so I will close the issue ```

    Original issue reported on code.google.com by `coderazzi` on 2012-07-08 22:13:32

  11. Log in to comment