tmf: Fix NPE in TmfTraceType when refreshing custom trace types
authorPatrick Tasse <patrick.tasse@gmail.com>
Thu, 19 Dec 2013 23:25:30 +0000 (18:25 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Tue, 7 Jan 2014 21:59:15 +0000 (16:59 -0500)
commit52885aeb60f311e40a784a44e7d77c3abd45d9cc
treedd8ea3af46cd69cd4695c21bcfd233ac5ed3ccea
parent5237a9316a05ddb77ce3ecb1a8e84d814b2461aa
tmf: Fix NPE in TmfTraceType when refreshing custom trace types

Since custom trace types are dynamic, TmfTraceType is constantly
refreshing the list of custom trace types whenever the available trace
types are requested.

Before reloading the list, the current custom trace types are removed
from the list. Because this refresh can occur concurrently in different
threads, a NullPointerException can occur.

This patch ensures that the custom parser list is only populated once at
initialization. The list is then modified dynamically as custom parsers
are created, edited or removed.

The list of custom trace types therefore no longer needs to be refreshed
when getting the available trace types.

Change-Id: I08bd0c351b0f573fe36e0fa7fd1aad62de81f1e5
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/20093
Tested-by: Hudson CI
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTraceDefinition.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlTraceDefinition.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceType.java
This page took 0.025634 seconds and 5 git commands to generate.