DESCRIPTION

tmf: Add null annotations to tmf.core.statevalue

Introduce the use of the new amazingly-useful JDT Null Analysis
annotations. See http://wiki.eclipse.org/JDT_Core/Null_Analysis

Let's start by something small and isolated, like the TMF state
values.

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


COMMENTS

author: Brenden Conley
date: 2013-06-26 18:33:31.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2013-06-26 18:46:54.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Ricky Reeves
date: 2013-06-28 12:59:23.000000000

Patch Set 1:

(2 comments)

Line:19, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statevalue/NullStateValue.java -> Is the whole sentence still true, I mean the part "an Integer (-1)"?

Line:44, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statevalue/NullStateValue.java -> why don't we xxx@xxx.xxx here and in IntegerStateValue.toString() we do?

-------------------------------------
author: Braxton Mccarthy
date: 2013-07-02 18:17:31.000000000

Patch Set 1:

(2 comments)

Line:19, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statevalue/NullStateValue.java -> It is, although it's not very clear indeed... The "-1" <->" null state value" transition is done in TmfStateValue, which has the factory methods and the unboxing methods.

Line:44, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statevalue/NullStateValue.java -> IntegerStateValue.toString() (and LongStateValue.toString()) call String.format(), which like all base Java methods, do not have any @NonNull annotation. This means that it can potentially return a null value, which is why the analysis tool wants xxx@xxx.xxx annotation.

Here we return a final field to which we assign a value, so we're allowed to mark it xxx@xxx.xxx (from the default package setting).

-------------------------------------
author: Ricky Reeves
date: 2013-07-02 18:25:04.000000000

Patch Set 1: Verified+1 Code-Review+1 IP-Clean+1

It always obvious :-) but nice addition

-------------------------------------
author: Braxton Mccarthy
date: 2013-07-02 18:39:36.000000000

Patch Set 1: Code-Review+2

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