Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Hufmann2013-05-24 12:45:27 +0000
committerBernd Hufmann2013-05-24 16:47:00 +0000
commitb952a3e8b7540fec3d6da0df697e52c46f6b370a (patch)
tree23ae54efc6f862a674eba5beed66f01756978dab
parentc86ec565724aa283ff0f5d3779131213ec0d5a97 (diff)
downloadorg.eclipse.linuxtools-b952a3e8b7540fec3d6da0df697e52c46f6b370a.tar.gz
org.eclipse.linuxtools-b952a3e8b7540fec3d6da0df697e52c46f6b370a.tar.xz
org.eclipse.linuxtools-b952a3e8b7540fec3d6da0df697e52c46f6b370a.zip
tmf-tests: Handle NullPointerException in TmfEventParserStub
With commit 7e670c5, any exception in the TmfEventThread will be logged in the plug-in's error log. There is a NullPointerException in the TmfEventParserStub which was was silently handled. With this commit the NPE will be prevented. Change-Id: I1c5d34a5869d8f071847a0d3f23fde2de1b3867e Reviewed-on: https://git.eclipse.org/r/13121 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.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfEventParserStub.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfEventParserStub.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfEventParserStub.java
index 7214299540..0d97326fea 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfEventParserStub.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfEventParserStub.java
@@ -76,6 +76,10 @@ public class TmfEventParserStub implements ITmfEventParser {
// Highly inefficient...
final RandomAccessFile stream = ((TmfTraceStub) fEventStream).getStream();
+ if (stream == null) {
+ return null;
+ }
+
// String name = eventStream.getName();
// name = name.substring(name.lastIndexOf('/') + 1);

Back to the top