DESCRIPTION

lttng: Fix off-by-one in the check for new attributes

In some places, we want to check if a get*AndAdd() call just
created an attribute, or re-used an existing one. The correct
way to check for this is if (quark == ss.getNbAttributes() - 1).
The -1 was missing.

This precision was also added in the Javadoc comment.

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


COMMENTS

author: Ivy Mitchell
date: 2012-08-02 20:08:54.000000000

Patch Set 1: Verified; I would prefer that you didn't submit this; IP review completed

(2 inline comments)

Looks good, please add comments explaining the logic, if not I  gravely fear that someone will optimize it by extracting the number of attributes to a variable.

Line:283, lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelHandler.java -> if this doesn't exist, create one.

Line:285, lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelHandler.java -> this may not be the same as the previous one.

-------------------------------------
author: Braxton Mccarthy
date: 2012-08-03 17:19:28.000000000

Patch Set 1: Abandoned

Superseded by https://git.eclipse.org/r/#/c/7103/ (targeting kepler branch)

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