tmf: Add generics to ITmfEventAspect
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Wed, 30 Mar 2016 23:31:45 +0000 (19:31 -0400)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Tue, 19 Apr 2016 00:37:56 +0000 (20:37 -0400)
The generic type can allow us to define the type of
the resolve() method's return value.

Change-Id: Id9bb9ddaf143fa6b3ed09bf32eab98e1718e7ee3
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/69569
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
40 files changed:
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/trace/TmfXmlKernelTraceStub.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/event/aspect/LinuxTidAspect.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/event/aspect/ThreadPriorityAspect.java
btf/org.eclipse.tracecompass.btf.core/src/org/eclipse/tracecompass/btf/core/trace/BtfEventAspects.java
btf/org.eclipse.tracecompass.btf.core/src/org/eclipse/tracecompass/btf/core/trace/BtfTrace.java
ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/aspect/CtfChannelAspect.java
ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java
gdbtrace/org.eclipse.tracecompass.gdbtrace.core/src/org/eclipse/tracecompass/internal/gdbtrace/core/trace/GdbEventAspects.java
gdbtrace/org.eclipse.tracecompass.gdbtrace.core/src/org/eclipse/tracecompass/internal/gdbtrace/core/trace/GdbTrace.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoBinaryAspect.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoSourceAspect.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/trace/LttngUstTrace.java
pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/event/aspect/PcapDestinationAspect.java
pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/event/aspect/PcapProtocolAspect.java
pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/event/aspect/PcapReferenceAspect.java
pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/event/aspect/PcapSourceAspect.java
pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/trace/PcapTrace.java
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/TmfTraceTest.java
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/TmfTraceUtilsTest.java
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/stub/XmlStubTraceTest.java
tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/trace/text/SyslogTrace.java
tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/trace/xml/TmfXmlTraceStub.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/parsers/custom/CustomEventAspects.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/aspect/ITmfEventAspect.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/aspect/TmfContentFieldAspect.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/aspect/TmfCpuAspect.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/aspect/TmfEventFieldAspect.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/aspect/TmfStateSystemAspect.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/filter/model/TmfFilterAspectNode.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/filter/xml/TmfFilterContentHandler.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomTxtTrace.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomXmlTrace.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/ITmfTrace.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceUtils.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfEventsEditor.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/columns/TmfEventTableColumn.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/filter/FilterViewer.java

index b5a53886f0c8d43d32a438d6bf18d2669897e9d9..0a158deda79929e24736cb7e3bf17f4a594de79f 100644 (file)
@@ -49,12 +49,12 @@ public class TmfXmlKernelTraceStub extends TmfXmlTraceStub implements IKernelTra
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         /*
          * This method needs to fill the aspects dynamically because aspects in
          * the parent class are not all present at the beginning of the trace
          */
-        ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder();
+        ImmutableSet.Builder<ITmfEventAspect<?>> builder = ImmutableSet.builder();
         builder.addAll(super.getEventAspects());
         builder.add(KernelTidAspect.INSTANCE);
         builder.add(ThreadPriorityAspect.INSTANCE);
index 4f8fbfd3d02bba70af8b957dacff4ed96a82781e..c63a854e91e56abe8001486fc10304020ae3d1b1 100644 (file)
@@ -23,7 +23,7 @@ import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
  * @author Geneviève Bastien
  * @since 1.0
  */
-public abstract class LinuxTidAspect implements ITmfEventAspect {
+public abstract class LinuxTidAspect implements ITmfEventAspect<Integer> {
 
     @Override
     public final String getName() {
index 9702577776e39fd7ee0479508823136d369dafa2..50578b51a704c528ee374aa9e04f0c53ea9ba41b 100644 (file)
@@ -37,7 +37,7 @@ import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
  * @author Christian Mansky
  * @since 2.0
  */
-public final class ThreadPriorityAspect implements ITmfEventAspect {
+public final class ThreadPriorityAspect implements ITmfEventAspect<Integer> {
 
     /** The singleton instance */
     public static final ThreadPriorityAspect INSTANCE = new ThreadPriorityAspect();
index e14a70305b232b4b770c1021054e57b44aacb5ab..49a6bff89177c9dbf12565cc25503ba4f6a87639 100644 (file)
@@ -33,7 +33,7 @@ public final class BtfEventAspects {
 
     private BtfEventAspects() {}
 
-    private static final Iterable<ITmfEventAspect> BTF_ASPECTS =
+    private static final Iterable<ITmfEventAspect<?>> BTF_ASPECTS =
             ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     new BtfSourceAspect(),
@@ -48,7 +48,7 @@ public final class BtfEventAspects {
     /**
      * The "source" aspect, whose value comes from {@link ITmfEvent#getSource()}
      */
-    private static class BtfSourceAspect implements ITmfEventAspect {
+    private static class BtfSourceAspect implements ITmfEventAspect<String> {
 
         @Override
         public String getName() {
@@ -74,7 +74,7 @@ public final class BtfEventAspects {
      * The "target" aspect, taking its value from
      * {@link ITmfEvent#getTarget()}.
      */
-    private static class BtfTargetAspect implements ITmfEventAspect {
+    private static class BtfTargetAspect implements ITmfEventAspect<String> {
 
         @Override
         public String getName() {
@@ -101,7 +101,7 @@ public final class BtfEventAspects {
      *
      * @return The aspects
      */
-    public static Iterable<ITmfEventAspect> getAspects() {
+    public static Iterable<ITmfEventAspect<?>> getAspects() {
         return BTF_ASPECTS;
     }
 }
\ No newline at end of file
index 3f45414a82cdbc326b9b61f9359ea45927242347..b881b9bb216b2a2ab47aa75ed51ad0d2f438e2aa 100644 (file)
@@ -480,7 +480,7 @@ public class BtfTrace extends TmfTrace implements ITmfPersistentlyIndexable, ITm
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         return BtfEventAspects.getAspects();
     }
 
index 1e4a8b88247b912ea37454e2e31f815b41b3f714..badab5f5a43a7d919f0674c01cf15b0d5221da95 100644 (file)
@@ -21,7 +21,7 @@ import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
  *
  * @author Alexandre Montplaisir
  */
-public class CtfChannelAspect implements ITmfEventAspect {
+public class CtfChannelAspect implements ITmfEventAspect<String> {
 
     @Override
     public String getName() {
index 76591c698938f219dff617e2c6943ce88acdba19..57c02e39490df384f4e1763b6b62b370045c253f 100644 (file)
@@ -103,7 +103,7 @@ public class CtfTmfTrace extends TmfTrace
      * Event aspects available for all CTF traces
      * @since 1.0
      */
-    protected static final @NonNull Collection<@NonNull ITmfEventAspect> CTF_ASPECTS =
+    protected static final @NonNull Collection<@NonNull ITmfEventAspect<?>> CTF_ASPECTS =
             ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     new CtfChannelAspect(),
@@ -297,7 +297,7 @@ public class CtfTmfTrace extends TmfTrace
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         return CTF_ASPECTS;
     }
 
index 188c14bd48c98b84b642f0fa7e79b2550bda9bf4..c61284ae2f9891c0392e2bd4e645cb291a61375a 100644 (file)
@@ -31,7 +31,7 @@ public final class GdbEventAspects {
 
     private GdbEventAspects() {}
 
-    private static final @NonNull Iterable<ITmfEventAspect> GDB_ASPECTS =
+    private static final @NonNull Iterable<ITmfEventAspect<?>> GDB_ASPECTS =
             ImmutableList.of(
                     new TmfContentFieldAspect(GdbTraceEventContent.TRACE_FRAME, GdbTraceEventContent.TRACE_FRAME),
                     new TmfContentFieldAspect(GdbTraceEventContent.TRACEPOINT, GdbTraceEventContent.TRACEPOINT),
@@ -39,7 +39,7 @@ public final class GdbEventAspects {
                     ITmfEventAspect.BaseAspects.CONTENTS
                     );
 
-    private static class GdbFileAspect implements ITmfEventAspect {
+    private static class GdbFileAspect implements ITmfEventAspect<String> {
 
         @Override
         public String getName() {
@@ -66,7 +66,7 @@ public final class GdbEventAspects {
      *
      * @return The set of aspects
      */
-    public static @NonNull Iterable<ITmfEventAspect> getAspects() {
+    public static @NonNull Iterable<ITmfEventAspect<?>> getAspects() {
         return GDB_ASPECTS;
     }
 }
index 36d336f923ea1cb41f654c46231705dc87587963..f29fee6a81ff93ea14f7464b22d0d890e7647ac3 100644 (file)
@@ -165,7 +165,7 @@ public class GdbTrace extends TmfTrace {
     // ------------------------------------------------------------------------
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         return GdbEventAspects.getAspects();
     }
 
index 949497d849108ee15c268ae16108d5ec370f44dd..84b3a4f9d9ee1c30cec71cf2cc40eb244f0b6fab 100644 (file)
@@ -71,10 +71,10 @@ public class LttngKernelTrace extends CtfTmfTrace implements IKernelTrace {
     /**
      * Event aspects available for all Lttng Kernel traces
      */
-    private static final @NonNull Collection<ITmfEventAspect> LTTNG_KERNEL_ASPECTS;
+    private static final @NonNull Collection<ITmfEventAspect<?>> LTTNG_KERNEL_ASPECTS;
 
     static {
-        ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder();
+        ImmutableSet.Builder<ITmfEventAspect<?>> builder = ImmutableSet.builder();
         builder.addAll(CtfTmfTrace.CTF_ASPECTS);
         builder.add(KernelTidAspect.INSTANCE);
         builder.add(ThreadPriorityAspect.INSTANCE);
@@ -163,7 +163,7 @@ public class LttngKernelTrace extends CtfTmfTrace implements IKernelTrace {
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
          return LTTNG_KERNEL_ASPECTS;
     }
 
index 9812c714b9576f24d245ceefe3db8213b6f49f31..c2fc6206bbf8dc6ea841d2fe1149d32672bb4746 100644 (file)
@@ -30,7 +30,7 @@ import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
  * @author Alexandre Montplaisir
  * @since 2.0
  */
-public class UstDebugInfoBinaryAspect implements ITmfEventAspect {
+public class UstDebugInfoBinaryAspect implements ITmfEventAspect<BinaryCallsite> {
 
     /** Singleton instance */
     public static final UstDebugInfoBinaryAspect INSTANCE = new UstDebugInfoBinaryAspect();
index 15afdd0a5e80d1bc7ae41aea9dceb274502d3f3a..8f947bcf8016aa7e737466171e9f368e79fb0a69 100644 (file)
@@ -29,7 +29,7 @@ import com.google.common.collect.Iterables;
  * @author Alexandre Montplaisir
  * @since 2.0
  */
-public class UstDebugInfoSourceAspect implements ITmfEventAspect {
+public class UstDebugInfoSourceAspect implements ITmfEventAspect<TmfCallsite> {
 
     /** Singleton instance */
     public static final UstDebugInfoSourceAspect INSTANCE = new UstDebugInfoSourceAspect();
index 6e9345cd4c69bc0f1d292ad187ecdd35769c13ba..32bf54e99e098eb47e6a76da596177d26457ffb4 100644 (file)
@@ -57,10 +57,10 @@ public class LttngUstTrace extends CtfTmfTrace {
 
     private static final int CONFIDENCE = 100;
 
-    private static final @NonNull Collection<ITmfEventAspect> LTTNG_UST_ASPECTS;
+    private static final @NonNull Collection<ITmfEventAspect<?>> LTTNG_UST_ASPECTS;
 
     static {
-        ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder();
+        ImmutableSet.Builder<ITmfEventAspect<?>> builder = ImmutableSet.builder();
         builder.addAll(CtfTmfTrace.CTF_ASPECTS);
         builder.add(UstDebugInfoBinaryAspect.INSTANCE);
         builder.add(UstDebugInfoSourceAspect.INSTANCE);
@@ -121,7 +121,7 @@ public class LttngUstTrace extends CtfTmfTrace {
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         return LTTNG_UST_ASPECTS;
     }
 
index ee732709213d8f9dc9cda66d2ec1a2d96ce29709..f25e13d3e7d366f5ce64bf88cc22590f28f013d2 100644 (file)
@@ -25,7 +25,7 @@ import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
  *
  * @author Alexandre Montplaisir
  */
-public class PcapDestinationAspect implements ITmfEventAspect {
+public class PcapDestinationAspect implements ITmfEventAspect<String> {
 
     /** Singleton instance */
     public static final PcapDestinationAspect INSTANCE = new PcapDestinationAspect();
index 31bf56afcab7a08dfb40c06de3cae89f16fcd186..304a2401956be39e2e84e2f77eeaa3c244075df9 100644 (file)
@@ -25,7 +25,7 @@ import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
  *
  * @author Alexandre Montplaisir
  */
-public class PcapProtocolAspect implements ITmfEventAspect {
+public class PcapProtocolAspect implements ITmfEventAspect<String> {
 
     /** Singleton instance */
     public static final PcapProtocolAspect INSTANCE = new PcapProtocolAspect();
index 043235898aa72f9eadd8fef7eaf3c08c172f9bd5..032c3f2711cf081278d283c964c26b86878eb4b5 100644 (file)
@@ -24,7 +24,7 @@ import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
  *
  * @author Alexandre Montplaisir
  */
-public class PcapReferenceAspect implements ITmfEventAspect {
+public class PcapReferenceAspect implements ITmfEventAspect<String> {
 
     /** Singleton instance */
     public static final PcapReferenceAspect INSTANCE = new PcapReferenceAspect();
index 7732d5fd64e54b170cf54331139968bef72e412f..e43d116dbc7aa09d1506d5878da5c609ac74120a 100644 (file)
@@ -28,7 +28,7 @@ import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
  *
  * @author Alexandre Montplaisir
  */
-public class PcapSourceAspect implements ITmfEventAspect {
+public class PcapSourceAspect implements ITmfEventAspect<String> {
 
     /** Singleton instance */
     public static final PcapSourceAspect INSTANCE = new PcapSourceAspect();
index 624334cf82acd7042b8c826d06139cd51cad79a7..277f8b89d4b4a68323a6a1f38913fede5ba71996 100644 (file)
@@ -69,7 +69,7 @@ public class PcapTrace extends TmfTrace implements ITmfPropertiesProvider {
     /** pcap trace type id as defined in plugin.xml */
     public static final String TRACE_TYPE_ID = "org.eclipse.linuxtools.tmf.pcap.core.pcaptrace"; //$NON-NLS-1$
 
-    private static final Collection<ITmfEventAspect> PCAP_ASPECTS =
+    private static final Collection<ITmfEventAspect<?>> PCAP_ASPECTS =
             ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     PcapSourceAspect.INSTANCE,
@@ -128,7 +128,7 @@ public class PcapTrace extends TmfTrace implements ITmfPropertiesProvider {
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         return PCAP_ASPECTS;
     }
 
index 29cabe658d4384b6baef1f8cf4e2676086ce5217..1b0006aaf832772379a8a1b3aa3794ebefcd3003 100644 (file)
@@ -1415,8 +1415,8 @@ public class TmfTraceTest {
      */
     @Test
     public void testGetEventAspects() {
-        Iterable<ITmfEventAspect> aspects = fTrace.getEventAspects();
-        for (ITmfEventAspect aspect : aspects) {
+        Iterable<ITmfEventAspect<?>> aspects = fTrace.getEventAspects();
+        for (ITmfEventAspect<?> aspect : aspects) {
             assertTrue(TmfTrace.BASE_ASPECTS.contains(aspect));
         }
     }
index ba66c7bfd30e853e4645cb5ac8efea8c97731394..719ef25aaf7b5403b8f756ef33e4966739cb0115 100644 (file)
@@ -63,9 +63,9 @@ public class TmfTraceUtilsTest {
 
     private static class TmfTraceStubWithAspects extends TmfTraceStub {
 
-        private static final @NonNull Collection<ITmfEventAspect> EVENT_ASPECTS;
+        private static final @NonNull Collection<ITmfEventAspect<?>> EVENT_ASPECTS;
         static {
-            ImmutableList.Builder<ITmfEventAspect> builder = ImmutableList.builder();
+            ImmutableList.Builder<ITmfEventAspect<?>> builder = ImmutableList.builder();
             builder.add(new TmfCpuAspect() {
                 @Override
                 public Integer resolve(ITmfEvent event) {
@@ -81,7 +81,7 @@ public class TmfTraceUtilsTest {
         }
 
         @Override
-        public Iterable<ITmfEventAspect> getEventAspects() {
+        public Iterable<ITmfEventAspect<?>> getEventAspects() {
             return EVENT_ASPECTS;
         }
 
index b171c511434caab9b66d2423bb38843da015a3c7..d3abb8c22751f764edce72099b73535ebacdb4db 100644 (file)
@@ -145,10 +145,10 @@ public class XmlStubTraceTest {
             fail(e1.getMessage());
         }
 
-        ITmfEventAspect cpuAspect = null;
-        ITmfEventAspect testAspect = null;
+        ITmfEventAspect<?> cpuAspect = null;
+        ITmfEventAspect<?> testAspect = null;
         int aspectCount = 0;
-        for (ITmfEventAspect aspect : trace.getEventAspects()) {
+        for (ITmfEventAspect<?> aspect : trace.getEventAspects()) {
             aspectCount++;
             if (aspect instanceof TmfCpuAspect) {
                 cpuAspect = aspect;
index 68547d4bb0c360e339fc6533fffa3b2f3da3f71b..b5df50009e44bd28ce30b56a2f8c8a21321550ec 100644 (file)
@@ -64,7 +64,7 @@ public class SyslogTrace extends TextTrace<SyslogEvent> {
     }
 
     /** The event aspects */
-    public static final @NonNull Collection<ITmfEventAspect> ASPECTS =
+    public static final @NonNull Collection<ITmfEventAspect<?>> ASPECTS =
             ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     new TmfContentFieldAspect(Field.HOST, Field.HOST),
@@ -140,7 +140,7 @@ public class SyslogTrace extends TextTrace<SyslogEvent> {
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         return ASPECTS;
     }
 }
index 1477160a08dd9043ae6c7015262390950fca0ddf..ccb079d1a7961902dc2c19d5773b2515f76e8047 100644 (file)
@@ -99,8 +99,8 @@ public class TmfXmlTraceStub extends TmfTrace {
     private final CustomXmlTraceDefinition fDefinition;
     private CustomXmlTrace fTrace;
 
-    private Collection<ITmfEventAspect> fAspects = TmfTrace.BASE_ASPECTS;
-    private final Collection<ITmfEventAspect> fAdditionalAspects = new HashSet<>();
+    private Collection<ITmfEventAspect<?>> fAspects = TmfTrace.BASE_ASPECTS;
+    private final Collection<ITmfEventAspect<?>> fAdditionalAspects = new HashSet<>();
 
     /**
      * Constructor. Constructs the custom XML trace with the appropriate
@@ -322,7 +322,7 @@ public class TmfXmlTraceStub extends TmfTrace {
     }
 
     private void generateAspects(ITmfEventField[] fieldsArray) {
-        ImmutableList.Builder<ITmfEventAspect> builder = new ImmutableList.Builder<>();
+        ImmutableList.Builder<ITmfEventAspect<?>> builder = new ImmutableList.Builder<>();
 
         /* Initialize the first default trace aspects */
         builder.add(ITmfEventAspect.BaseAspects.TIMESTAMP);
@@ -331,7 +331,7 @@ public class TmfXmlTraceStub extends TmfTrace {
         /* Add custom aspects in between */
         for (ITmfEventField field : fieldsArray) {
             String name = field.getName();
-            final ITmfEventAspect aspect = new TmfContentFieldAspect(name, name);
+            final ITmfEventAspect<?> aspect = new TmfContentFieldAspect(name, name);
             if (name.equals(ASPECT_CPU)) {
                 builder.add(new TmfCpuAspect() {
                     @Override
@@ -356,7 +356,7 @@ public class TmfXmlTraceStub extends TmfTrace {
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         return fAspects;
     }
 
@@ -371,7 +371,7 @@ public class TmfXmlTraceStub extends TmfTrace {
      * @param aspect
      *            The aspect to have
      */
-    public void addEventAspect(ITmfEventAspect aspect) {
+    public void addEventAspect(ITmfEventAspect<?> aspect) {
         fAdditionalAspects.add(aspect);
     }
 
index a0b97dffae23a5e09a8a2deb310aff5d621807f2..b9f38e3a3b607809a5965d0ed49486858ec3e46d 100644 (file)
@@ -42,7 +42,7 @@ public class CustomEventAspects {
      * Aspects for custom events, which use an integer ID to represent each
      * field.
      */
-    private static final class CustomEventFieldAspect implements ITmfEventAspect {
+    private static final class CustomEventFieldAspect implements ITmfEventAspect<String> {
 
         private final @NonNull String fName;
         private final int fIndex;
@@ -87,8 +87,8 @@ public class CustomEventAspects {
      *            want the aspects
      * @return The set of event aspects for the given trace
      */
-    public static @NonNull Iterable<ITmfEventAspect> generateAspects(CustomTraceDefinition definition) {
-        ImmutableList.Builder<ITmfEventAspect> builder = new ImmutableList.Builder<>();
+    public static @NonNull Iterable<ITmfEventAspect<?>> generateAspects(CustomTraceDefinition definition) {
+        ImmutableList.Builder<ITmfEventAspect<?>> builder = new ImmutableList.Builder<>();
         List<OutputColumn> outputs = definition.outputs;
         for (int i = 0; i < outputs.size(); i++) {
             String name = outputs.get(i).name;
index 7fa0fe1942573d0b24ffa086c7b16cb385579a95..314f8ab01152aabbac780ae655771cf4308f6be6 100644 (file)
@@ -34,8 +34,9 @@ import com.google.common.collect.ImmutableList;
  * on to only keep certain events, to plot XY charts, etc.
  *
  * @author Alexandre Montplaisir
+ * @param <T> Type of the return value of the {@link #resolve} method
  */
-public interface ITmfEventAspect {
+public interface ITmfEventAspect<T> {
 
     /**
      * Static definition of an empty string. You can use this instead of 'null'!
@@ -45,7 +46,7 @@ public interface ITmfEventAspect {
     /**
      * List of all common base aspects
      */
-    public static final List<ITmfEventAspect> BASE_ASPECTS =
+    public static final List<ITmfEventAspect<?>> BASE_ASPECTS =
             ImmutableList.of(
                     BaseAspects.TIMESTAMP,
                     BaseAspects.EVENT_TYPE,
@@ -61,7 +62,7 @@ public interface ITmfEventAspect {
         /**
          * Aspect for the event timestamp
          */
-        ITmfEventAspect TIMESTAMP = new ITmfEventAspect() {
+        ITmfEventAspect<ITmfTimestamp> TIMESTAMP = new ITmfEventAspect<ITmfTimestamp>() {
             @Override
             public String getName() {
                 return Messages.getMessage(Messages.AspectName_Timestamp);
@@ -81,7 +82,7 @@ public interface ITmfEventAspect {
         /**
          * Aspect for the event type
          */
-        ITmfEventAspect EVENT_TYPE = new ITmfEventAspect() {
+        ITmfEventAspect<String> EVENT_TYPE = new ITmfEventAspect<String>() {
             @Override
             public String getName() {
                 return Messages.getMessage(Messages.AspectName_EventType);
@@ -121,7 +122,7 @@ public interface ITmfEventAspect {
         /**
          * Aspect for the trace's name (for experiments with many traces)
          */
-        ITmfEventAspect TRACE_NAME = new ITmfEventAspect() {
+        ITmfEventAspect<String> TRACE_NAME = new ITmfEventAspect<String>() {
             @Override
             public String getName() {
                 return Messages.getMessage(Messages.AspectName_TraceName);
@@ -177,5 +178,5 @@ public interface ITmfEventAspect {
      *            The event to process
      * @return The resulting tidbit of information for this event.
      */
-    @Nullable Object resolve(ITmfEvent event);
+    @Nullable T resolve(ITmfEvent event);
 }
index 7f5b7a11943438c6ca37b9e9d5394ea69ab74ff6..86936f50087ceae594de875970a4661b71c364cd 100644 (file)
@@ -27,7 +27,7 @@ import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
  *
  * @author Alexandre Montplaisir
  */
-public class TmfContentFieldAspect implements ITmfEventAspect {
+public class TmfContentFieldAspect implements ITmfEventAspect<Object> {
 
     private final String fAspectName;
     private final String[] fFieldPath;
index 80d104930abf234f6e2ba999c5f2febff490c944..ef28a226eaf475656304b4d7dff792078053f502 100644 (file)
@@ -23,7 +23,7 @@ import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
  *
  * @author Alexandre Montplaisir
  */
-public abstract class TmfCpuAspect implements ITmfEventAspect {
+public abstract class TmfCpuAspect implements ITmfEventAspect<Integer> {
 
     @Override
     public final String getName() {
index 759a84d254cb539f8aef2186bc6423daedf4dd74..f94c2db0c4913ddde0e88e313cf590ef16316e9c 100644 (file)
@@ -27,7 +27,7 @@ import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
  *
  * @author Patrick Tasse
  */
-public class TmfEventFieldAspect implements ITmfEventAspect {
+public class TmfEventFieldAspect implements ITmfEventAspect<Object> {
 
     private static final char SLASH = '/';
     private static final char BACKSLASH = '\\';
index a43a451dd02a5154a1dd795c1f06e2b71afa3afb..793e4135873325336f9e7c40332520ef2e81157f 100644 (file)
@@ -32,7 +32,7 @@ import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
  *
  * @author Alexandre Montplaisir
  */
-public class TmfStateSystemAspect implements ITmfEventAspect {
+public class TmfStateSystemAspect implements ITmfEventAspect<String> {
 
     private final @Nullable String fName;
     private final ITmfStateSystem fSS;
index 58ba56d8caa6ab473975d0926ff93bc9f7a531c8..c3f84efd885d891a24b07e78f4dd2346e8ba8a66 100644 (file)
@@ -32,7 +32,7 @@ public abstract class TmfFilterAspectNode extends TmfFilterTreeNode {
     public static final String BASE_ASPECT_ID = "BASE.ASPECT.ID"; //$NON-NLS-1$
 
     /** event aspect */
-    protected ITmfEventAspect fEventAspect;
+    protected ITmfEventAspect<?> fEventAspect;
 
     private String fTraceTypeId;
 
@@ -46,7 +46,7 @@ public abstract class TmfFilterAspectNode extends TmfFilterTreeNode {
     /**
      * @return The event aspect of this filter
      */
-    public ITmfEventAspect getEventAspect() {
+    public ITmfEventAspect<?> getEventAspect() {
         return fEventAspect;
     }
 
@@ -54,7 +54,7 @@ public abstract class TmfFilterAspectNode extends TmfFilterTreeNode {
      * @param aspect
      *            The event aspect to assign to this filter
      */
-    public void setEventAspect(ITmfEventAspect aspect) {
+    public void setEventAspect(ITmfEventAspect<?> aspect) {
         fEventAspect = aspect;
     }
 
index dc159844fc3a3a79698a030329c5e6dd58246d7f..b336cf32fd719be3d4c3d0efbacdaeefdb5342ca 100644 (file)
@@ -232,7 +232,7 @@ public class TmfFilterContentHandler extends DefaultHandler {
         traceTypeId = TmfTraceType.buildCompatibilityTraceTypeId(traceTypeId);
         String name = atts.getValue(TmfFilterAspectNode.EVENT_ASPECT_ATTR);
         if (TmfFilterAspectNode.BASE_ASPECT_ID.equals(traceTypeId)) {
-            for (ITmfEventAspect eventAspect : ITmfEventAspect.BASE_ASPECTS) {
+            for (ITmfEventAspect<?> eventAspect : ITmfEventAspect.BASE_ASPECTS) {
                 if (eventAspect.getName().equals(name)) {
                     node.setEventAspect(eventAspect);
                     node.setTraceTypeId(traceTypeId);
@@ -248,7 +248,7 @@ public class TmfFilterContentHandler extends DefaultHandler {
         } else if (traceTypeId != null && name != null) {
             TraceTypeHelper helper = TmfTraceType.getTraceType(traceTypeId);
             if (helper != null) {
-                for (ITmfEventAspect eventAspect : helper.getTrace().getEventAspects()) {
+                for (ITmfEventAspect<?> eventAspect : helper.getTrace().getEventAspects()) {
                     if (eventAspect.getName().equals(name)) {
                         node.setEventAspect(eventAspect);
                         node.setTraceTypeId(traceTypeId);
index 2cecbaa36eeb5093810a7ef11802273ea24bc15d..e89e3e42c75d6a15862677755f76019b29a21aa0 100644 (file)
@@ -148,7 +148,7 @@ public class CustomTxtTrace extends TmfTrace implements ITmfPersistentlyIndexabl
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         return CustomEventAspects.generateAspects(fDefinition);
     }
 
index 8af0cc739abd72bccb62aef67672ce3ac72b2dc2..65326e6e7e2b8ac9c6f0ed14e19c5fb1956ee841 100644 (file)
@@ -156,7 +156,7 @@ public class CustomXmlTrace extends TmfTrace implements ITmfPersistentlyIndexabl
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         return CustomEventAspects.generateAspects(fDefinition);
     }
 
index d00e6914978b1ccc5b9e5f6624c3f4219397b663..05505624ecadc1907749c288c59af8fde5aab8f1 100644 (file)
@@ -269,7 +269,7 @@ public interface ITmfTrace extends ITmfEventProvider {
      *
      * @return The event aspects for this trace
      */
-    @NonNull Iterable<@NonNull ITmfEventAspect> getEventAspects();
+    @NonNull Iterable<@NonNull ITmfEventAspect<?>> getEventAspects();
 
     // ------------------------------------------------------------------------
     // Trace characteristics getters
index e941c2a1563f913fe0e1590235e3bac5496fc3de..8bdf031a4db06e30a19db736065563ecaedadae5 100644 (file)
@@ -97,7 +97,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
     /**
      * Basic aspects that should be valid for all trace types.
      */
-    public static final @NonNull Collection<@NonNull ITmfEventAspect> BASE_ASPECTS =
+    public static final @NonNull Collection<@NonNull ITmfEventAspect<?>> BASE_ASPECTS =
             ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     ITmfEventAspect.BaseAspects.EVENT_TYPE,
@@ -322,7 +322,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
     }
 
     @Override
-    public Iterable<ITmfEventAspect> getEventAspects() {
+    public Iterable<ITmfEventAspect<?>> getEventAspects() {
         /* By default we provide only the base aspects valid for all trace types */
         return BASE_ASPECTS;
     }
index 8948bca04302e259aa7f5baf29fe6fb89336dd31..77ee466be9b9aa989aaf54afd7b04cb7450f6fb4 100644 (file)
@@ -101,10 +101,10 @@ public final class TmfTraceUtils {
      *         {@link ITmfEventAspect#resolve(ITmfEvent)} that returns non null
      *         for the event or {@code null} otherwise
      */
-    public static @Nullable <T extends ITmfEventAspect> Object resolveEventAspectOfClassForEvent(
+    public static @Nullable <T extends ITmfEventAspect<?>> Object resolveEventAspectOfClassForEvent(
             ITmfTrace trace, Class<T> aspectClass, ITmfEvent event) {
-        Iterable<ITmfEventAspect> aspects = trace.getEventAspects();
-        for (ITmfEventAspect aspect : aspects) {
+        Iterable<ITmfEventAspect<?>> aspects = trace.getEventAspects();
+        for (ITmfEventAspect<?> aspect : aspects) {
             if (aspectClass.isAssignableFrom(aspect.getClass())) {
                 Object obj = aspect.resolve(event);
                 if (obj != null) {
@@ -131,7 +131,7 @@ public final class TmfTraceUtils {
      *         for the event or {@code null} otherwise
      * @since 2.0
      */
-    public static @Nullable <T extends ITmfEventAspect> Integer resolveIntEventAspectOfClassForEvent(
+    public static @Nullable <T extends ITmfEventAspect<Integer>> Integer resolveIntEventAspectOfClassForEvent(
             ITmfTrace trace, Class<T> aspectClass, ITmfEvent event) {
         Object result = resolveEventAspectOfClassForEvent(trace, aspectClass, event);
         if (result instanceof Integer) {
index c45fa3434914443ea7c37fb4cdf3ecc6b193f3d3..0b4246a39b0aef86a8d603b7e39765e08608d416 100644 (file)
@@ -304,7 +304,7 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
          * Use the aspects defined by the trace type (or each trace type in an
          * experiment) to build a table consisting of these.
          */
-        Iterable<ITmfEventAspect> aspects = getTraceAspects(trace);
+        Iterable<ITmfEventAspect<?>> aspects = getTraceAspects(trace);
         if (Iterables.isEmpty(aspects)) {
             /* Couldn't find any event aspects, use a default table */
             return new TmfEventsTable(parent, cacheSize);
@@ -325,7 +325,7 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
      *            The cache size to use
      * @return The event table for the trace
      */
-    private static @NonNull Iterable<ITmfEventAspect> getTraceAspects(ITmfTrace trace) {
+    private static @NonNull Iterable<ITmfEventAspect<?>> getTraceAspects(ITmfTrace trace) {
         if (trace instanceof TmfExperiment) {
             return getExperimentAspects((TmfExperiment) trace);
         }
@@ -345,10 +345,10 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
      *            the event table cache size
      * @return An event table of the appropriate type
      */
-    private static @NonNull Iterable<ITmfEventAspect> getExperimentAspects(
+    private static @NonNull Iterable<ITmfEventAspect<?>> getExperimentAspects(
             final TmfExperiment experiment) {
         List<ITmfTrace> traces = experiment.getTraces();
-        ImmutableSet.Builder<ITmfEventAspect> builder = new ImmutableSet.Builder<>();
+        ImmutableSet.Builder<ITmfEventAspect<?>> builder = new ImmutableSet.Builder<>();
 
         /* For experiments, we'll add a "trace name" aspect/column */
         builder.add(ITmfEventAspect.BaseAspects.TRACE_NAME);
@@ -368,7 +368,7 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
              * trace types.
              */
             for (ITmfTrace trace : traces) {
-                Iterable<ITmfEventAspect> traceAspects = trace.getEventAspects();
+                Iterable<ITmfEventAspect<?>> traceAspects = trace.getEventAspects();
                 builder.addAll(traceAspects);
             }
         }
index 54d991e3894de0d37446261c5ac28cd71a714f74..12299f726d41824708525b91f9bff9406abfc5b1 100644 (file)
@@ -771,10 +771,10 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     }
 
     @Deprecated
-    private static @NonNull Iterable<ITmfEventAspect> convertFromColumnData(
+    private static @NonNull Iterable<ITmfEventAspect<?>> convertFromColumnData(
             org.eclipse.tracecompass.tmf.ui.widgets.virtualtable.ColumnData[] columnData) {
 
-        ImmutableList.Builder<ITmfEventAspect> builder = new ImmutableList.Builder<>();
+        ImmutableList.Builder<ITmfEventAspect<?>> builder = new ImmutableList.Builder<>();
         for (org.eclipse.tracecompass.tmf.ui.widgets.virtualtable.ColumnData col : columnData) {
             String fieldName = col.header;
             if (fieldName != null) {
@@ -800,7 +800,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
      *            </p>
      */
     public TmfEventsTable(final Composite parent, int cacheSize,
-            @NonNull Iterable<ITmfEventAspect> aspects) {
+            @NonNull Iterable<ITmfEventAspect<?>> aspects) {
         super("TmfEventsTable"); //$NON-NLS-1$
 
         fComposite = new Composite(parent, SWT.NONE);
@@ -862,7 +862,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         fTable.setLinesVisible(true);
 
         // Setup the columns
-        for (ITmfEventAspect aspect : aspects) {
+        for (ITmfEventAspect<?> aspect : aspects) {
             if (aspect != null) {
                 fColumns.add(new TmfEventTableColumn(aspect));
             }
@@ -1827,7 +1827,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                             return false;
                         }
                         final TmfFilterMatchesNode filter = new TmfFilterMatchesNode(null);
-                        ITmfEventAspect aspect = (ITmfEventAspect) column.getData(Key.ASPECT);
+                        ITmfEventAspect<?> aspect = (ITmfEventAspect<?>) column.getData(Key.ASPECT);
                         filter.setEventAspect(aspect);
                         filter.setRegex(regex);
                         column.setData(Key.SEARCH_OBJ, filter);
@@ -3342,7 +3342,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
      */
     private static final class TmfMarginColumn extends TmfEventTableColumn {
 
-        private static final @NonNull ITmfEventAspect MARGIN_ASPECT = new ITmfEventAspect() {
+        private static final @NonNull ITmfEventAspect<String> MARGIN_ASPECT =
+                new ITmfEventAspect<String>() {
 
             @Override
             public String getName() {
index de1384297391ef774d5543b62a8ecc4e0db0a6f8..2bde1955e7cfb6abf03641c519b9bc727a549fdd 100644 (file)
@@ -38,7 +38,7 @@ public class TmfEventTableColumn {
     // Fields
     // ------------------------------------------------------------------------
 
-    private final ITmfEventAspect fAspect;
+    private final ITmfEventAspect<?> fAspect;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -51,7 +51,7 @@ public class TmfEventTableColumn {
      *            The {@link ITmfEventAspect} to be used to populate this
      *            column.
      */
-    public TmfEventTableColumn(ITmfEventAspect aspect) {
+    public TmfEventTableColumn(ITmfEventAspect<?> aspect) {
         fAspect = aspect;
     }
 
@@ -95,7 +95,7 @@ public class TmfEventTableColumn {
      *
      * @return The event aspect
      */
-    public ITmfEventAspect getEventAspect() {
+    public ITmfEventAspect<?> getEventAspect() {
         return fAspect;
     }
 
index 205fce44fb0ee0aa5700af23d6b753b0af84c7d1..5d73f60f59fc8bea47565eb85436422f3f06aa3a 100644 (file)
@@ -95,14 +95,14 @@ class FilterViewer extends Composite {
 
     private static class AspectItem {
         public String label;
-        public ITmfEventAspect eventAspect;
+        public ITmfEventAspect<?> eventAspect;
         public String traceTypeId;
 
         public AspectItem(String label) {
             this.label = label;
         }
 
-        public AspectItem(String label, ITmfEventAspect eventAspect, String traceTypeId) {
+        public AspectItem(String label, ITmfEventAspect<?> eventAspect, String traceTypeId) {
             this.label = label;
             this.eventAspect = eventAspect;
             this.traceTypeId = traceTypeId;
@@ -626,7 +626,7 @@ class FilterViewer extends Composite {
             ArrayList<AspectItem> aspectList = new ArrayList<>();
 
             aspectList.add(new AspectItem(Messages.FilterViewer_CommonCategory));
-            for (ITmfEventAspect aspect : ITmfEventAspect.BASE_ASPECTS) {
+            for (ITmfEventAspect<?> aspect : ITmfEventAspect.BASE_ASPECTS) {
                 aspectList.add(new AspectItem(aspect.getName(), aspect, TmfFilterAspectNode.BASE_ASPECT_ID));
             }
 
@@ -634,7 +634,7 @@ class FilterViewer extends Composite {
             if (helper != null) {
                 aspectList.add(new AspectItem("")); //$NON-NLS-1$
                 aspectList.add(new AspectItem('[' + helper.getLabel() + ']'));
-                for (ITmfEventAspect aspect : helper.getTrace().getEventAspects()) {
+                for (ITmfEventAspect<?> aspect : helper.getTrace().getEventAspects()) {
                     for (AspectItem baseAspect : aspectList) {
                         if (aspect.equals(baseAspect.eventAspect)) {
                             aspectList.remove(baseAspect);
This page took 0.04871 seconds and 5 git commands to generate.