Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369155

Summary: [TMF] Missing clone and equals for TmfLocation
Product: z_Archived Reporter: Patrick Tasse <patrick.tasse>
Component: LinuxToolsAssignee: Francois Chouinard <fchouinard>
Status: CLOSED FIXED QA Contact: Francois Chouinard <fchouinard>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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