Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369155 - [TMF] Missing clone and equals for TmfLocation
Summary: [TMF] Missing clone and equals for TmfLocation
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: LinuxTools (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Francois Chouinard CLA
QA Contact: Francois Chouinard CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-19 17:46 EST by Patrick Tasse CLA
Modified: 2022-01-13 14:52 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Tasse CLA 2012-01-19 17:46:09 EST
In TmfExperiment, the methods seekLocation() and getNextEvent() use an experiment context that contains the location of each trace. The locations are copied from the trace context. When getting the next event of each trace, the trace context and its location can change. Since the locations in the experiment context are a copy of the location object reference, they can be modified when it is not desired. The solution is for the experiment context to clone the locations taken from the trace context.

The experiment context's location object is an instance of the class TmfLocationArray. This class does not implement equals() and hashCode() therefore the comparison of experiment context locations give incorrect results. The solution is to implement equals() and hashCode() in this class.

The class TmfRawEventViewer maintains a cache of parsed event text lines which contain the event's location. Since the locations in the line cache are a copy of the location object reference, they can be modified when it is not desired. The solution is for the line cache to clone the locations of each event.
Comment 1 Patrick Tasse CLA 2012-01-19 18:01:31 EST
Pushed to master branch.

commit 0ab23142e67b3e9c6b752f14e4e2800aa5116087
Comment 2 Francois Chouinard CLA 2012-03-26 14:07:25 EDT
Delivered in 0.10.0