Bug 528398 - Query cache shouldn't use "Object#equals(Object)" for its keys
Summary: Query cache shouldn't use "Object#equals(Object)" for its keys
Status: NEW
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 527839
  Show dependency tree
 
Reported: 2017-12-11 04:25 EST by Laurent Goubet CLA
Modified: 2017-12-12 06:58 EST (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 Laurent Goubet CLA 2017-12-11 04:25:33 EST
In the case of a bug like bug 527839, we're calling a Query with LinkedHashSets. The java implementation of LinkedHashSet doesn't care for element ordering when checking for equality. Thus,
OrderedSet{1, 2, 3}
is equal to
OrderedSet{3, 2, 1}

Calling a query with these two distincts set will produce the same result since the QueryCache will be triggered on second invocation even though the list aren't really identical.

We need to implement a "smarter" equality test that considers order for the QueryCache.