From: SourceForge.net <no...@so...> - 2006-02-12 13:56:46
|
Bugs item #1430090, was opened at 2006-02-12 14:56 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=391879&aid=1430090&group_id=27895 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: In-Memory Impl Group: TM4J 0.9.7 Status: Open Resolution: None Priority: 5 Submitted By: Thomas Much (thmuch) Assigned to: Nobody/Anonymous (nobody) Summary: AssociationImpl.getMembers inefficient? Initial Comment: If an association has no members, getMembers() returns a new ArrayList on each invocation. Why not return Collections.EMPTY_SET instead? public Collection getMembers() { Collection ret = m_members; if (ret == null) { return java.util.Collections.EMPTY_SET; // already immutable } return Collections.unmodifiableCollection(ret); } Or, if implementations rely on a list being returned, EMPTY_LIST. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=391879&aid=1430090&group_id=27895 |