DESCRIPTION

TMF: Add an analysis requirement manager

The manager will make possible to get a list of requirement values from an
analysis module helper or a set of module. For both case, it permits to get the
values in different ways.

Change-Id: I16287dd1bbaf99a7f15767ef7d044a81e48457dc
Signed-off-by: Bailey Galloway xxx@xxx.xxx
Signed-off-by: Keshawn Lopez xxx@xxx.xxx


COMMENTS

author: Bailey Galloway
date: 2014-04-04 15:27:02.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2014-04-04 16:03:26.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6239/

-------------------------------------
author: Brenden Conley
date: 2014-04-04 16:40:34.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6239/ : SUCCESS

-------------------------------------
author: Annalise Jimenez
date: 2014-04-07 13:47:19.000000000

Patch Set 2: Code-Review-1

(10 comments)

That a nice utility class that will greatly simplify the management of requirements for multiple analysis. 

Some comments, I think you could add more flexibility by supporting also modules and not just helpers (it's straightforward)

Line:35, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/analysis/AnalysisRequirementManagerTest.java -> You should name those variables fTestModuleHelper. I read this line very fast and further was surprised to find out they are not modules, but actually helpers ;-)

Line:48, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/analysis/AnalysisRequirementManagerTest.java -> Using assertEquals(values.size(), fRequirementFactory.getRequirementValues1().size()) will make sure that if it the test fails, you'll know what were the size values of each, so it's a more interesting fail message.

Line:66, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/analysis/AnalysisRequirementManagerTest.java -> If you know exactly what the size should be (which should be the case), use assertEquals instead.

This applies to other assertTrues in the file

Line:88, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/analysis/AnalysisRequirementManagerTest.java -> If the map's value type is a set instead of a list, this would be enforced by the type itself and no need to test (unless it is to test the equality method)

Line:29, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAnalysisRequirementManager.java -> This class has utility methods to avoid having to do those loops and lookup in the caller's code. But it is not a manager (managers usually contain manage some things through static lists, see TmfTraceManager and TmfAnalysisManager). I'd call that either TmfAnalysisRequirementHelper or TmfAnalysisRequirementUtil.

Line:47, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAnalysisRequirementManager.java -> You should use your new IAnalysisRequirementProvider interface instead of IAnalysisModuleHelper. This class can be used with modules as well

Line:48, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAnalysisRequirementManager.java -> As said in previous file, using Sets instead of list here, and in the methods below, will make sure you have no duplicates

Line:93, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAnalysisRequirementManager.java -> List -> Set will simplify the else

Line:114, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAnalysisRequirementManager.java -> "filtered by" means "equals"? Please mention it because reading this, it could mean this priority level and higher.

Line:127, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAnalysisRequirementManager.java -> There is a chance that you add the type and the empty list, but when adding the values, none qualifies, so you'll have a type with an empty list. Maybe you should make the Set of values first and if not empty, then check to add the type and the values.

-------------------------------------
author: Bailey Galloway
date: 2014-04-07 18:46:07.000000000

Patch Set 2:

(4 comments)

I'll change the helper to IAnalysisRequirementProvider instead.

Line:88, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/analysis/AnalysisRequirementManagerTest.java -> Interesting again how Sets can be useful for us.

Line:29, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAnalysisRequirementManager.java -> Great point, we had difficulty naming it properly.

Line:114, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAnalysisRequirementManager.java -> For now, it's "equals".

Line:127, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAnalysisRequirementManager.java -> The power of Sets.

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