[MAGNOLIA-3319] Getting children of a content with Comparator makes use of TreeSet Created: 08/Oct/10  Updated: 09/Oct/12  Resolved: 12/Jan/11

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 4.3.7
Fix Version/s: 4.3.9, 4.4.2, 4.5

Type: Bug Priority: Major
Reporter: Vincent Gombert Assignee: Jan Haderka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

The method DefaultContent.getChildren(Content.ContentFilter, String, Comparator) might not want to use TreeSet for ordering child nodes because TreeSet will consider as equal two nodes which are equivalent for the comparator and then will remove one of them. In other words, if the comparator is not fully discriminant, some nodes will be removed.
A better way would be to use an ArrayList and sort it with Collections.sort(List, Comparator).



 Comments   
Comment by Philipp Bärfuss [ 11/Oct/10 ]

Thanks for the hint. We will change that.

Generated at Mon Feb 12 03:45:20 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.