[ https://java.net/jira/browse/GLAZEDLISTS-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=394007#comment-394007 ] fabian_ commented on GLAZEDLISTS-523: ------------------------------------- Fixed here: https://github.com/glazedlists/glazedlists/pull/15 > Incorrect grouping in GroupingList on element update events > ----------------------------------------------------------- > > Key: GLAZEDLISTS-523 > URL: https://java.net/jira/browse/GLAZEDLISTS-523 > Project: glazedlists > Issue Type: Bug > Components: core > Affects Versions: 1.8.0 > Reporter: brands > Fix For: 1.10.0 > > > The following to test cases fail with the current implementation: > {code} > public void testSplitFirstGroup_FixMe() { > TransactionList<String> source = new TransactionList<String>( > new BasicEventList<String>()); > Comparator<String> comparator = GlazedListsTests.getFirstLetterComparator(); > GroupingList<String> grouped = new GroupingList<String>(source, comparator); > ListConsistencyListener<List<String>> listener = ListConsistencyListener.<List<String>>install(grouped, "GROUPED:", true); > listener.setPreviousElementTracked(false); > source.add("C"); > source.add("CC"); > source.add("CCC"); > assertEquals("[[C, CC, CCC]]", grouped.toString()); > source.beginEvent(); > source.set(0, "A"); > source.set(1, "B"); > source.commitEvent(); > assertEquals("[[A], [B], [CCC]]", grouped.toString()); > } > > public void testJoinToFirstGroup_FixMe() { > TransactionList<String> source = new TransactionList<String>( > new BasicEventList<String>()); > Comparator<String> comparator = GlazedListsTests.getFirstLetterComparator(); > GroupingList<String> grouped = new GroupingList<String>(source, comparator); > ListConsistencyListener<List<String>> listener = ListConsistencyListener.<List<String>>install(grouped, "GROUPED:", true); > listener.setPreviousElementTracked(false); > source.add("A"); > source.add("B"); > source.add("CCC"); > assertEquals("[[A], [B], [CCC]]", grouped.toString()); > source.beginEvent(); > source.set(0, "C"); > source.set(1, "CC"); > source.commitEvent(); > assertEquals("[[C, CC, CCC]]", grouped.toString()); > } > {code} > The first test failure is caused by the patch for issue 491. > Reverting it, makes the test pass (of course, other tests start to fail then). > The second test failure is independent of issue 491. -- This message was sent by Atlassian JIRA (v6.2.3#6260) |
Free forum by Nabble | Edit this page |