Nick-The-Uncharted / tablefilter-swing

Automatically exported from code.google.com/p/tablefilter-swing
1 stars 1 forks source link

Enabled adaptive choices cause ArrayIndexOutOfBoundsException when table model is changed #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 pulk...@gmail.com on 16 Mar 2011 at 3:04

GoogleCodeExporter commented 9 years ago
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 comment by coderazzi on 20 Mar 2011 at 11:26

GoogleCodeExporter commented 9 years ago
Solved on release 4.1.2

Original comment by coderazzi on 23 Mar 2011 at 4:06

GoogleCodeExporter commented 9 years ago

Original comment by coderazzi on 14 Nov 2011 at 11:12

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This is not fixed in version 4.1.4, can you confirm that it is fixed in the 
latest (4.3.0)?

Original comment by humph.as...@gmail.com on 15 Mar 2012 at 12:43

GoogleCodeExporter commented 9 years ago
Open the ticket again, until solution is clarified

Original comment by coderazzi on 15 Mar 2012 at 3:02

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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 comment by coderazzi on 16 Mar 2012 at 2:57

GoogleCodeExporter commented 9 years ago
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 comment by coderazzi on 8 Jul 2012 at 10:13