DESCRIPTION

tmf: Make TmfLocation and CtfLocation immutable

Make CtfLocation extend TmfLocation directly (saves a bit
of redundant code), and remove its .setLocation() method.

The fLocationData field is now final, and can only be set at the
constructor. When seeking to different location, a new Location
object is created instead of modifying the existing one
(while this is not the case with C for example, in Java it's
usually faster to do it this way).

CtfLocation.clone() has been simplified to do a shallow copy
of it's fLocationData object. This is safe since we know its
fLocationData is a CtfLocationData, and this type is immutable.

TmfLocation.clone() retains its clone check using reflection.

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


COMMENTS

author: Braxton Mccarthy
date: 2012-08-16 20:26:30.000000000

Uploaded patch set 2.

-------------------------------------
author: Braxton Mccarthy
date: 2012-08-16 20:51:09.000000000

Patch Set 2:

Ok, so in the end I gave up trying to add an ITmfLocationData, it touches absolutely everything in the codebase, and I don't think it's worth spending one week to fix it for something that's ultimately an aesthetic change...

This new version stays closer to the status quo, the big change is that TmfLocation.fLocation is now final, and the CtfLocation's are re-newed at every usage instead of being re-used (which might fix some synchronization problems we had).

It also depends on the fLocation -> fLocationData rename I proposed in a separate patch.

-------------------------------------
author: Ricky Reeves
date: 2012-09-17 11:55:08.000000000

Patch Set 2:

I think you can abandon this change since it is covered by
https://git.eclipse.org/r/#/c/7768/

-------------------------------------
author: Braxton Mccarthy
date: 2012-09-17 14:29:21.000000000

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

Change 7768 does not make the Location/LocationData immutable, it just changes the API (I didn't want to have too much stuff changing in one commit). I was hoping to push that one first, and then update this change here on top of it ;)

Thanks for the reviews Meredith Scott!

-------------------------------------
author: Braxton Mccarthy
date: 2012-10-03 19:56:02.000000000

Patch Set 2: Abandoned

Obsolete, now TmfLocation's are immutable and don't implement any clone/copy method.

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