aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Montplaisir2012-03-17 20:49:20 (EDT)
committerFrancois Chouinard2012-03-19 17:43:52 (EDT)
commit9901a4af877c6d74fe200597b175dd8bf6caecfb (patch)
tree16a78b6f531371365f544f55bb0cacc7706528b7
parent2a5a7d97e0bafd32cd85337e103a691db28e5cf9 (diff)
downloadorg.eclipse.linuxtools-9901a4af877c6d74fe200597b175dd8bf6caecfb.zip
org.eclipse.linuxtools-9901a4af877c6d74fe200597b175dd8bf6caecfb.tar.gz
org.eclipse.linuxtools-9901a4af877c6d74fe200597b175dd8bf6caecfb.tar.bz2
Avoid printing the exception when CtfTmfTrace.validate() fails
It simply means the type of trace doesn't match, which can happen in normal conditions. Also made getCTFTrace() non-public, only CtfIterator uses it, and we don't want to pass on the CTFTrace dependency.
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
index 047aa64..e2c2cbf 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
@@ -131,11 +131,10 @@ public class CtfTmfTrace extends TmfEventProvider<CtfTmfEvent> implements
try {
final CTFTrace temp = new CTFTrace(path);
return temp.majortIsSet(); // random test
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ } catch (CTFReaderException e) {
+ /* Nope, not a CTF trace we can read */
+ return false;
}
- return false;
}
@Override
@@ -335,7 +334,7 @@ public class CtfTmfTrace extends TmfEventProvider<CtfTmfEvent> implements
this.fResource = fResource;
}
- public CTFTrace getCTFTrace() {
+ CTFTrace getCTFTrace() {
return fTrace;
}
}