Bug 419458 - Usage of HashSet and HashMap does not preserve the Resources ordering
Summary: Usage of HashSet and HashMap does not preserve the Resources ordering
Status: CLOSED WONTFIX
Alias: None
Product: Sphinx
Classification: Automotive
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-15 09:49 EDT by Alin Guran CLA
Modified: 2024-05-06 23:28 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alin Guran CLA 2013-10-15 09:49:46 EDT
Calling the Sphinx APIs doesn't provide a reliable result due to HashSet and HashMap usage 

An example is: EcorePlatformUtil#getResourcesInModels(IContainer,IMetaModelDescriptor,boolean) return resources in different order for different calls.

This behavior is in contrast with the goal of ScopingResourceSetImpl# getResourcesInScope(Object, boolean, boolean) which says:

/*
 * IMPORTANT: A LinkedHashSet is used to preserve the ordering of the Resources. Using a simple HashSet will
 * not preserve the ordering which leads to inconsistent results when implementing Resource merging based on
 * the getResourcesInScope() method.
*/ 
At a first look HashSet and HashMap are found in more than fifty places.
Comment 1 Balazs Grill CLA 2024-05-06 23:28:53 EDT
Closed stale issue before migration