tmf: Fix unsafe cast warning in TmfTrace
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Fri, 4 Oct 2013 21:57:28 +0000 (17:57 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Sat, 23 Nov 2013 07:47:28 +0000 (02:47 -0500)
Now that TmfData/EventProvider are merged, .getType() will always
return an instance of an ÌTmfEvent. Simply fix the generic types
to take this in consideration.

Change-Id: I791b59c480311a34c7416564219f6d3fed3f5951
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/17054
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
IP-Clean: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Hudson CI
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfTraceTest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/component/TmfEventProvider.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java

index ecf0c126ae762b0fb5f323c7460c55685303bcdf..339956aff1b82911b17cb38893806933a9eabad0 100644 (file)
@@ -189,7 +189,7 @@ public class CtfTmfTraceTest {
      */
     @Test
     public void testGetEventType() {
-        Class<ITmfEvent> result = fixture.getEventType();
+        Class<? extends ITmfEvent> result = fixture.getEventType();
         assertNotNull(result);
     }
 
index 013a261999e8f29452fcd897a2c4659357e27487..18bfbf8967bcb62c9ad4c59b2d7b1fceefa25f01 100644 (file)
@@ -177,7 +177,7 @@ public abstract class TmfEventProvider extends TmfComponent implements ITmfEvent
      *
      * @return The type of ITmfEvent
      */
-    public Class<?> getType() {
+    public Class<? extends ITmfEvent> getType() {
         return fType;
     }
 
index f5f018ea3fc3c51a2b32726a606bbdbbf8873408..1dad18591e2f8714891812de4c43405a6e4b711f 100644 (file)
@@ -393,8 +393,8 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
     // ------------------------------------------------------------------------
 
     @Override
-    public Class<ITmfEvent> getEventType() {
-        return (Class<ITmfEvent>) super.getType();
+    public Class<? extends ITmfEvent> getEventType() {
+        return super.getType();
     }
 
     @Override
This page took 0.029245 seconds and 5 git commands to generate.