DESCRIPTION

lttng: Add clear() call before add elements to list

In various LTTng Tracer Control core model classes, the relevant 
array list is not cleared when the setter is being called. For
example, the method DomainInfo.setChannels(List chans) doesn't
clear the channel list before filling the channel list with the
new channels passed as parameter.

Change-Id: I0e5c8c4f0bd84a6de1c383131255b61c7ca94406
Signed-off-by: Ricky Reeves xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2013-02-28 18:11:11.000000000

Patch Set 2:

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

-------------------------------------
author: Brenden Conley
date: 2013-02-28 18:29:18.000000000

Patch Set 2: Verified

Build Successful 

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

-------------------------------------
author: Braxton Mccarthy
date: 2013-02-28 18:47:41.000000000

Patch Set 2: Looks good to me, approved; IP review completed

I read somewhere that doing "list = new ArrayList<...>()" is surprisingly a bit faster than "list.clear()", because then the deletion of the contained objects is done in a deferred manner by the GC.

I'm often torn between this and my unrequited love for final fields...

But in the case here, it's definitely not performance-critical, and the fields are already final, so .clear() is the way to go.

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