JDK-8096857 : FilteredList: broken change notification
  • Type: Bug
  • Component: javafx
  • Sub-Component: base
  • Affected Version: fx2.0
  • Priority: P5
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2011-07-25
  • Updated: 2015-07-21
  • Resolved: 2013-05-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Blocks :  
Blocks :  
Description
The test case below is about a single add - probably more issues with other modifications of underlying list, too lazy to go for a hunt

    /**
     * Change incorrect on add.
     */
    @Test
    public void testFilteredNotificationAdd() {
        ObservableList<Integer> original = FXCollections.observableArrayList(
                0, 1, 2, 3, 4 ,5, 6, 7, 8, 9
        );
        FilteredList list = new FilteredList(original, new Always());
        final ObjectProperty<Change> change = new ObjectProperty<Change>();
        ListChangeListener l = new ListChangeListener() {

            @Override
            public void onChanged(Change c) {
                change.set(c);
            }
            
        };
        list.addListener(l);
        original.add(20);
        assertEquals("from", list.size() - 1, change.get().getFrom());
        assertEquals("to", list.size(), change.get().getTo());
        assertEquals("added", true, change.get().wasAdded());
}

     

Comments
Verified for 8.0 b122
07-01-2014

Fixed in the new implementation (RT-17053)
07-05-2013

Reducing priority and moving to Lombard, because FilteredList is going to be removed from the public API.
04-08-2011