DESCRIPTION

tmf: Make TmfTimestamp and TmfTimeRange immutable

Mark the fields in TmfTimestamp/TmfTimeRange final, to ensure they
do not get modified after the object is created.

This required re-working the copy constructor in TmfSimpleTimestamp,
so we trade a IllegalArgumentException for a NullPointerException.
Both are run-time exceptions, so I don't think this is a big problem.

Other than that, the setter methods didn't seem to be used anywhere
so the impacts are minimal.

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


COMMENTS

author: Braxton Mccarthy
date: 2012-10-30 22:06:32.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2012-10-30 22:11:08.000000000

Patch Set 3:

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

-------------------------------------
author: Brenden Conley
date: 2012-10-30 22:23:20.000000000

Patch Set 3: Verified

Build Successful 

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

-------------------------------------
author: Janet Compton
date: 2012-10-31 04:40:59.000000000

Patch Set 3: Verified; IP review completed

(2 inline comments)

If you could fix the copy constructor of TmfSimpleTimestamp as per the the comment, I would be OK with the patch (i.e. OK to commit)

Line:52, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfSimpleTimestamp.java -> You have to keep the call to normalize() since the the ITmfTimestamp parameter could have a scale != 0 and and yet be convertible into a TmfSimpleTimestamp (where scale == 0). We can assume that the original precision is not important if the caller specifically invokes this constructor.

Line:58, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimeRange.java -> If you are to make TmfTimeRange immutable, maybe an obviously empty range would be better here (start = BIG_CRUNCH, end = BIG_BANG). This is really academic since this constructor is not used.

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