summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorBernd Hufmann2013-02-28 08:12:48 (EST)
committer Bernd Hufmann2013-02-28 13:51:20 (EST)
commit38f5fde427b87c1c7f96e1f9fc920a0623d306fa (patch)
tree2d36742cc9df37c508b3d0b5e4adeffb8dfedd8f
parentd853ca9d7245fad44bafc8745648e885f2521831 (diff)
downloadorg.eclipse.linuxtools-38f5fde427b87c1c7f96e1f9fc920a0623d306fa.zip
org.eclipse.linuxtools-38f5fde427b87c1c7f96e1f9fc920a0623d306fa.tar.gz
org.eclipse.linuxtools-38f5fde427b87c1c7f96e1f9fc920a0623d306fa.tar.bz2
lttng: Add clear() call before add elements to listrefs/changes/31/10731/3
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: Bernd Hufmann <bhufmann@gmail.com> Reviewed-on: https://git.eclipse.org/r/10731 Tested-by: Hudson CI Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/BaseEventInfo.java3
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java3
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/DomainInfo.java1
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java1
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/UstProviderInfo.java1
5 files changed, 7 insertions, 2 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/BaseEventInfo.java b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/BaseEventInfo.java
index 094d73e..e14c5ec 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/BaseEventInfo.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/BaseEventInfo.java
@@ -202,6 +202,7 @@ public class BaseEventInfo extends TraceInfo implements IBaseEventInfo {
*/
@Override
public void setFields(List<IFieldInfo> fields) {
+ fFields.clear();
for (Iterator<IFieldInfo> iterator = fields.iterator(); iterator.hasNext();) {
IFieldInfo fieldInfo = iterator.next();
fFields.add(fieldInfo);
@@ -305,4 +306,4 @@ public class BaseEventInfo extends TraceInfo implements IBaseEventInfo {
output.append(")]");
return output.toString();
}
-} \ No newline at end of file
+}
diff --git a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java
index 72f096a..8f873fe 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java
@@ -259,6 +259,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
*/
@Override
public void setEvents(List<IEventInfo> events) {
+ fEvents.clear();
for (Iterator<IEventInfo> iterator = events.iterator(); iterator.hasNext();) {
IEventInfo eventInfo = iterator.next();
fEvents.add(eventInfo);
@@ -378,4 +379,4 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
}
-} \ No newline at end of file
+}
diff --git a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/DomainInfo.java b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/DomainInfo.java
index 0c2feaa..fda6fc9 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/DomainInfo.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/DomainInfo.java
@@ -100,6 +100,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
*/
@Override
public void setChannels(List<IChannelInfo> channels) {
+ fChannels.clear();
for (Iterator<IChannelInfo> iterator = channels.iterator(); iterator.hasNext();) {
IChannelInfo channelInfo = iterator.next();
fChannels.add(channelInfo);
diff --git a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java
index 6778532..87fb4ea 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java
@@ -148,6 +148,7 @@ public class SessionInfo extends TraceInfo implements ISessionInfo {
*/
@Override
public void setDomains(List<IDomainInfo> domains) {
+ fDomains.clear();
for (Iterator<IDomainInfo> iterator = domains.iterator(); iterator.hasNext();) {
IDomainInfo domainInfo = iterator.next();
fDomains.add(domainInfo);
diff --git a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/UstProviderInfo.java b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/UstProviderInfo.java
index ffe0e98..23d76e0 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/UstProviderInfo.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/UstProviderInfo.java
@@ -105,6 +105,7 @@ public class UstProviderInfo extends TraceInfo implements IUstProviderInfo {
*/
@Override
public void setEvents(List<IBaseEventInfo> events) {
+ fEvents.clear();
for (Iterator<IBaseEventInfo> iterator = events.iterator(); iterator.hasNext();) {
IBaseEventInfo eventInfo = iterator.next();
fEvents.add(eventInfo);