DESCRIPTION

tmf: Remove generic type from ITmfLocation

Second part of bug 382905.

This introduces the ITmfLocationData interface to replace the
generic argument in ITmfLocation.

A big advantage is that we can now enforce Cloneable on all
its subclasses, which guarantees that all types of TmfLocation
can be cloned safely. This should bring some non-negligible
performance improvements when cloning TmfLocation's.

The test cases were updated to reflect this, by introducing
new extensions of TmfLocation. The commonly-used "Long" type
has been kept in the framework itself, since it's needed by
the custom parser views.

Finally, some of the cloneable/uncloneable test cases were
removed ; they are not needed anymore since we can now guarantee
that all sub-classes are cloneable.

Change-Id: I732880bc48343800e10f0dc1a8447e29ffd4abbf
Signed-off-by: Braxton Mccarthy xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2012-09-14 20:02:55.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/sandbox/job/linuxtools/177/ 

-------------------------------------
author: Brenden Conley
date: 2012-09-14 20:16:50.000000000

Patch Set 1: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/linuxtools/177/ : SUCCESS

-------------------------------------
author: Ricky Reeves
date: 2012-09-17 11:53:04.000000000

Patch Set 1: Verified; Looks good to me, but someone else must approve; IP review completed

The only disadvantage of this is that also for "primitive" locations (e.g. String, Integer etc as location data) a corresponding TmfLocation and TmfLocationData class has to be implemented. You already did it for Long.However, if it's much faster this is a trade-off we can take.

-------------------------------------
author: Braxton Mccarthy
date: 2012-09-17 14:23:20.000000000

Patch Set 1:

Yep, the unit tests especially were a good textbook example of when to use generic types.

In practice however, we wouldn't really use Strings for locations. Long's are common, but other than that it's usually a combination of many things (rank and/or timestamp and/or position in file, etc.). This is why I think the generic type here was limiting more than helping.

I agree that it seems a bit redundant now to have two classes that are always mapped one-to-one (ITmfLocation and ITmfLocationData). Perhaps in the future we'll be able to merge those?

-------------------------------------
author: Janet Compton
date: 2012-09-18 14:41:21.000000000

Patch Set 1: I would prefer that you didn't submit this

I think that this is a bit misleaded.

First, although an interesting goal, removing the generics is hardly an absolute imperative.

Second, I'm not convinced that your solution is really an improvement: introducing ITmfLocationData to replace <L> doesn't address the central issue (IMHO) that we have 2 API's/classes that mean essentially the same thing (ITmfLocation + ITmfLocationData and ITmflocation + <L>).

Location should be location, period, and there shouldn't be this de-referencing scheme in there. If we are to remove the generics and introduce an interface, maybe we should do it like in the Event model: an API (ITmfLocation) and some generic implementations (TmfLongLocation, TmfTimestampLocation) with the possibility for other FW users to define their own lcoation types.

-------------------------------------
author: Braxton Mccarthy
date: 2012-09-18 15:08:40.000000000

Patch Set 1:

The problem runs deeper than just trying to remove generics. Location cloning is really slow at the moment, and it's one of the reasons that the CTF adaptor classes bypass the entire framework (which ends up in lots of duplicate code, etc.)

Although I totally agree that we shouldn't need two classes (Location and LocationData) where one would suffice. As you mentioned, it would be best to drop what we currently call "TmfLocation" and expose what this patch calls TmfLocationData directly (and rename that to TmfLocation).

-------------------------------------
author: Braxton Mccarthy
date: 2012-09-21 21:21:03.000000000

Patch Set 1: Abandoned

Superseded by https://git.eclipse.org/r/#/c/7839/

-------------------------------------
