From 214cc822cf04da427a928e931b9c68ad4f6efad4 Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Mon, 8 Apr 2013 15:43:23 -0400 Subject: [PATCH] tmf: Only keep the full constructor in TmfEventField It's relatively risky to have two methods (in this case constructors) where one uses 'Object' and the other 'ITmfEventField[]', since an array is also an Object, so one constructor overloads the other. We've had problems in the past with CtfTmfEventField, and it was changed to only keep one constructor with all three arguments. Propagate this change up to TmfEventField, and fixes all callers. It's now much clearer what type of field we are constructing. Change-Id: I3c19b9fffb53905f228f71b67200400c1ccc43ae Signed-off-by: Alexandre Montplaisir Reviewed-on: https://git.eclipse.org/r/11734 --- .../core/event/GdbTraceEventContent.java | 6 ++--- .../ui/views/events/GdbEventsTable.java | 8 +++---- .../ui/viewers/events/LTTng2EventsTable.java | 8 +++---- .../tests/ctfadaptor/CtfTmfEventTypeTest.java | 4 ++-- .../core/tests/event/TmfEventFieldTest.java | 20 ++++++++-------- .../tmf/core/tests/event/TmfEventTest.java | 12 +++++----- .../TmfAsyncSequenceDiagramEventTest.java | 4 ++-- .../TmfSyncSequenceDiagramEventTest.java | 2 +- .../tests/stubs/event/TmfEventTypeStub.java | 12 +++++----- .../tests/stubs/trace/TmfEventParserStub.java | 2 +- .../tmf/core/ctfadaptor/CtfTmfEvent.java | 2 +- .../core/ctfadaptor/CtfTmfEventFactory.java | 2 +- .../tmf/core/event/TmfEventField.java | 24 ++----------------- .../TmfBaseColumnDataProviderTest.java | 6 ++--- .../statistics/TmfBaseStatisticsDataTest.java | 6 ++--- .../TmfTreeContentProviderTest.java | 4 ++-- .../uml2sd/trace/TmfUml2SDTestTrace.java | 6 ++--- .../tmf/ui/parsers/custom/CustomEvent.java | 4 ++-- .../ui/parsers/custom/CustomEventContent.java | 2 +- .../ui/parsers/custom/CustomEventType.java | 4 ++-- .../tmf/ui/viewers/events/TmfEventsTable.java | 10 ++++---- 21 files changed, 64 insertions(+), 84 deletions(-) diff --git a/org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/event/GdbTraceEventContent.java b/org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/event/GdbTraceEventContent.java index bac5fc8bd6..13b5505186 100644 --- a/org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/event/GdbTraceEventContent.java +++ b/org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/event/GdbTraceEventContent.java @@ -47,9 +47,9 @@ public class GdbTraceEventContent extends TmfEventField { super(ITmfEventField.ROOT_FIELD_ID, content.replaceAll("\r?\n", " | "), //$NON-NLS-1$ //$NON-NLS-2$ new ITmfEventField[] { - new TmfEventField(TRACE_FRAME, frameNumber), - new TmfEventField(TRACEPOINT, tracepointNumber)} - ); + new TmfEventField(TRACE_FRAME, frameNumber, null), + new TmfEventField(TRACEPOINT, tracepointNumber, null) + }); fTracepointNumber = tracepointNumber; fFrameNumber = frameNumber; diff --git a/org.eclipse.linuxtools.gdbtrace.ui/src/org/eclipse/linuxtools/internal/gdbtrace/ui/views/events/GdbEventsTable.java b/org.eclipse.linuxtools.gdbtrace.ui/src/org/eclipse/linuxtools/internal/gdbtrace/ui/views/events/GdbEventsTable.java index 03b54d18f3..f4e06c18e1 100644 --- a/org.eclipse.linuxtools.gdbtrace.ui/src/org/eclipse/linuxtools/internal/gdbtrace/ui/views/events/GdbEventsTable.java +++ b/org.eclipse.linuxtools.gdbtrace.ui/src/org/eclipse/linuxtools/internal/gdbtrace/ui/views/events/GdbEventsTable.java @@ -115,10 +115,10 @@ public class GdbEventsTable extends TmfEventsTable { if (event != null) { GdbTraceEventContent content = (GdbTraceEventContent) event.getContent(); fields = new TmfEventField[] { - new TmfEventField(TRACE_FRAME_COLUMN, content.getFrameNumber()), - new TmfEventField(TRACEPOINT_COLUMN, content.getTracepointNumber()), - new TmfEventField(FILE_COLUMN, event.getReference()), - new TmfEventField(CONTENT_COLUMN, content.toString()) + new TmfEventField(TRACE_FRAME_COLUMN, content.getFrameNumber(), null), + new TmfEventField(TRACEPOINT_COLUMN, content.getTracepointNumber(), null), + new TmfEventField(FILE_COLUMN, event.getReference(), null), + new TmfEventField(CONTENT_COLUMN, content.toString(), null) }; } return fields; diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/LTTng2EventsTable.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/LTTng2EventsTable.java index a2420bd1d4..9027bd732f 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/LTTng2EventsTable.java +++ b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/LTTng2EventsTable.java @@ -73,10 +73,10 @@ public class LTTng2EventsTable extends TmfEventsTable { ITmfEventField[] fields = new TmfEventField[0]; if (event != null) { fields = new TmfEventField[] { - new TmfEventField(ITmfEvent.EVENT_FIELD_TIMESTAMP, event.getTimestamp().toString()), - new TmfEventField(ITmfEvent.EVENT_FIELD_REFERENCE, event.getReference()), - new TmfEventField(ITmfEvent.EVENT_FIELD_TYPE, event.getType().getName()), - new TmfEventField(ITmfEvent.EVENT_FIELD_CONTENT, event.getContent().toString()) + new TmfEventField(ITmfEvent.EVENT_FIELD_TIMESTAMP, event.getTimestamp().toString(), null), + new TmfEventField(ITmfEvent.EVENT_FIELD_REFERENCE, event.getReference(), null), + new TmfEventField(ITmfEvent.EVENT_FIELD_TYPE, event.getType().getName(), null), + new TmfEventField(ITmfEvent.EVENT_FIELD_CONTENT, event.getContent().toString(), null) }; } return fields; diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfEventTypeTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfEventTypeTest.java index 06753e7621..7c601b4460 100644 --- a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfEventTypeTest.java +++ b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfEventTypeTest.java @@ -36,7 +36,7 @@ public class CtfTmfEventTypeTest { @Test public void testCtfTmfEventType() { String eventName = ""; - ITmfEventField content = new TmfEventField("", new ITmfEventField[] {}); + ITmfEventField content = new TmfEventField("", null, new ITmfEventField[] {}); CtfTmfEventType result = new CtfTmfEventType( eventName, content); assertNotNull(result); @@ -50,7 +50,7 @@ public class CtfTmfEventTypeTest { */ @Test public void testToString() { - ITmfEventField emptyField = new TmfEventField("", new ITmfEventField[] {}); + ITmfEventField emptyField = new TmfEventField("", null, new ITmfEventField[] {}); CtfTmfEventType fixture = new CtfTmfEventType("", emptyField); String result = fixture.toString(); diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventFieldTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventFieldTest.java index 97ee56b831..c615a8fb1a 100644 --- a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventFieldTest.java +++ b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventFieldTest.java @@ -41,21 +41,21 @@ public class TmfEventFieldTest { private final Object fValue1 = "Value"; private final Object fValue2 = Integer.valueOf(10); - private final TmfEventField fField1 = new TmfEventField(fFieldName1, fValue1); + private final TmfEventField fField1 = new TmfEventField(fFieldName1, fValue1, null); private final TmfEventField fField2 = new TmfEventField(fFieldName2, fValue2, null); private final TmfEventField fField3 = new TmfEventField(fFieldName1, fValue2, null); private final String fStructRootFieldName = "Root-S"; private final String[] fStructFieldNames = new String[] { fFieldName1, fFieldName2 }; - private final TmfEventField fStructTerminalField1 = new TmfEventField(fFieldName1, null); - private final TmfEventField fStructTerminalField2 = new TmfEventField(fFieldName2, null); - private final TmfEventField fStructTerminalField3 = new TmfEventField(fFieldName1, null); - private final TmfEventField fStructRootField = new TmfEventField(fStructRootFieldName, + private final TmfEventField fStructTerminalField1 = new TmfEventField(fFieldName1, null, null); + private final TmfEventField fStructTerminalField2 = new TmfEventField(fFieldName2, null, null); + private final TmfEventField fStructTerminalField3 = new TmfEventField(fFieldName1, null, null); + private final TmfEventField fStructRootField = new TmfEventField(fStructRootFieldName, null, new ITmfEventField[] { fStructTerminalField1, fStructTerminalField2 }); private final String fRootFieldName = "Root"; private final String[] fFieldNames = new String[] { fFieldName1, fFieldName2 }; - private final TmfEventField fRootField = new TmfEventField(fRootFieldName, + private final TmfEventField fRootField = new TmfEventField(fRootFieldName, null, new ITmfEventField[] { fField1, fField2 }); // ------------------------------------------------------------------------ @@ -265,16 +265,16 @@ public class TmfEventFieldTest { @Test public void testNonEqualValues() { - final TmfEventField copy1 = new TmfEventField(fFieldName1, fValue1); - TmfEventField copy2 = new TmfEventField(fFieldName1, fValue1); + final TmfEventField copy1 = new TmfEventField(fFieldName1, fValue1, null); + TmfEventField copy2 = new TmfEventField(fFieldName1, fValue1, null); assertTrue("equals", copy1.equals(copy2)); assertTrue("equals", copy2.equals(copy1)); - copy2 = new TmfEventField(fFieldName1, fValue2); + copy2 = new TmfEventField(fFieldName1, fValue2, null); assertFalse("equals", copy1.equals(copy2)); assertFalse("equals", copy2.equals(copy1)); - copy2 = new TmfEventField(fFieldName1, null); + copy2 = new TmfEventField(fFieldName1, null, null); assertFalse("equals", copy1.equals(copy2)); assertFalse("equals", copy2.equals(copy1)); } diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java index ce9ffbc751..5a22bc6b36 100644 --- a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java +++ b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java @@ -63,22 +63,22 @@ public class TmfEventTest { private final Object fValue1a = "Some string"; private final Object fValue1b = Integer.valueOf(10); - private final ITmfEventField fField1a = new TmfEventField(fLabel1, fValue1a); - private final ITmfEventField fField1b = new TmfEventField(fLabel2, fValue1b); + private final ITmfEventField fField1a = new TmfEventField(fLabel1, fValue1a, null); + private final ITmfEventField fField1b = new TmfEventField(fLabel2, fValue1b, null); private final ITmfEventField[] fFields1 = new ITmfEventField[] { fField1a, fField1b }; private final String fRawContent1 = fField1a.toString() + fField1b.toString(); - private final ITmfEventField fContent1 = new TmfEventField(fRawContent1, fFields1); + private final ITmfEventField fContent1 = new TmfEventField(fRawContent1, null, fFields1); private final TmfTimestamp fTimestamp1 = new TmfTimestamp(12345, 2, 5); private final String fReference1 = "Some reference"; private final ITmfEvent fEvent1 = new TmfEvent(null, 0, fTimestamp1, fSource, fType, fContent1, fReference1); private final Object fValue2a = "Another string"; private final Object fValue2b = Integer.valueOf(-4); - private final ITmfEventField fField2a = new TmfEventField(fLabel1, fValue2a); - private final ITmfEventField fField2b = new TmfEventField(fLabel2, fValue2b); + private final ITmfEventField fField2a = new TmfEventField(fLabel1, fValue2a, null); + private final ITmfEventField fField2b = new TmfEventField(fLabel2, fValue2b, null); private final ITmfEventField[] fFields2 = new ITmfEventField[] { fField2a, fField2b }; private final String fRawContent2 = fField2a.toString() + fField2b.toString(); - private final ITmfEventField fContent2 = new TmfEventField(fRawContent2, fFields2); + private final ITmfEventField fContent2 = new TmfEventField(fRawContent2, null, fFields2); private final TmfTimestamp fTimestamp2 = new TmfTimestamp(12350, 2, 5); private final String fReference2 = "Some other reference"; private final ITmfEvent fEvent2 = new TmfEvent(null, 1, fTimestamp2, fSource, fType, fContent2, fReference2); diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/uml2sd/TmfAsyncSequenceDiagramEventTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/uml2sd/TmfAsyncSequenceDiagramEventTest.java index a47ee19db5..8c0d54c6d7 100644 --- a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/uml2sd/TmfAsyncSequenceDiagramEventTest.java +++ b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/uml2sd/TmfAsyncSequenceDiagramEventTest.java @@ -54,10 +54,10 @@ public class TmfAsyncSequenceDiagramEventTest { * Constructor for the test case */ public TmfAsyncSequenceDiagramEventTest() { - fContent1 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some content"); + fContent1 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some content", null); fEvent1 = new TmfEvent(null, fTimestamp1, fSource, fType, fContent1, fReference); - fContent2 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other content"); + fContent2 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other content", null); fEvent2 = new TmfEvent(null, fTimestamp2, fSource, fType, fContent2, fReference); } diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/uml2sd/TmfSyncSequenceDiagramEventTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/uml2sd/TmfSyncSequenceDiagramEventTest.java index e2a008d5f0..b8a6b157d4 100644 --- a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/uml2sd/TmfSyncSequenceDiagramEventTest.java +++ b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/uml2sd/TmfSyncSequenceDiagramEventTest.java @@ -51,7 +51,7 @@ public class TmfSyncSequenceDiagramEventTest { * Constructor for the test case */ public TmfSyncSequenceDiagramEventTest() { - fContent1 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some content"); + fContent1 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some content", null); fEvent1 = new TmfEvent(null, fTimestamp1, fSource, fType, fContent1, fReference); } diff --git a/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/event/TmfEventTypeStub.java b/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/event/TmfEventTypeStub.java index 1e57a6642a..5d65e3bdbe 100644 --- a/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/event/TmfEventTypeStub.java +++ b/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/event/TmfEventTypeStub.java @@ -21,16 +21,16 @@ import org.eclipse.linuxtools.tmf.core.event.TmfEventType; @SuppressWarnings("javadoc") public class TmfEventTypeStub extends TmfEventType { - private static final ITmfEventField FIELD_1 = new TmfEventField("Field1", null); - private static final ITmfEventField FIELD_2 = new TmfEventField("Field2", null); - private static final ITmfEventField FIELD_3 = new TmfEventField("Field3", null); - private static final ITmfEventField FIELD_4 = new TmfEventField("Field4", null); - private static final ITmfEventField FIELD_5 = new TmfEventField("Field5", null); + private static final ITmfEventField FIELD_1 = new TmfEventField("Field1", null, null); + private static final ITmfEventField FIELD_2 = new TmfEventField("Field2", null, null); + private static final ITmfEventField FIELD_3 = new TmfEventField("Field3", null, null); + private static final ITmfEventField FIELD_4 = new TmfEventField("Field4", null, null); + private static final ITmfEventField FIELD_5 = new TmfEventField("Field5", null, null); private static final ITmfEventField[] FIELDS = new ITmfEventField[] { FIELD_1, FIELD_2, FIELD_3, FIELD_4, FIELD_5 }; - private static ITmfEventField ROOT = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, FIELDS); + private static ITmfEventField ROOT = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, null, FIELDS); public TmfEventTypeStub() { super("UnitTest", "TmfEventTypeStub", ROOT); diff --git a/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfEventParserStub.java b/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfEventParserStub.java index 4a136ab420..7214299540 100644 --- a/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfEventParserStub.java +++ b/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfEventParserStub.java @@ -106,7 +106,7 @@ public class TmfEventParserStub implements ITmfEventParser { } content.append("]"); - final TmfEventField root = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, content.toString()); + final TmfEventField root = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, content.toString(), null); final ITmfEvent event = new TmfEvent(fEventStream, new TmfTimestamp(ts, -3, 0), // millisecs source, fTypes[typeIndex], root, reference.toString()); diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java index 2b8aff967e..9d8488900b 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java @@ -93,7 +93,7 @@ public final class CtfTmfEvent extends TmfEvent implements ITmfSourceLookup, ITm new CtfTmfTimestamp(-1), null, null, - new TmfEventField("", new CtfTmfEventField[0]), //$NON-NLS-1$ + new TmfEventField("", null, new CtfTmfEventField[0]), //$NON-NLS-1$ NO_STREAM); this.sourceCPU = -1; this.typeId = -1; diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventFactory.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventFactory.java index 6071f9bd09..ead5231283 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventFactory.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventFactory.java @@ -61,7 +61,7 @@ public final class CtfTmfEventFactory { int sourceCPU = eventDef.getCPU(); ITmfEventField content = new TmfEventField( - ITmfEventField.ROOT_FIELD_ID, parseFields(eventDef)); + ITmfEventField.ROOT_FIELD_ID, null, parseFields(eventDef)); String reference = fileName == null ? CtfTmfEvent.NO_STREAM : fileName; diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfEventField.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfEventField.java index eb46ae1e1f..aa62945166 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfEventField.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfEventField.java @@ -46,26 +46,6 @@ public class TmfEventField implements ITmfEventField { // Constructors // ------------------------------------------------------------------------ - /** - * Constructor for a structural field - * - * @param name the event field id - * @param fields the list of subfields - */ - public TmfEventField(final String name, final ITmfEventField[] fields) { - this(name, null, fields); - } - - /** - * Constructor for a terminal field (no subfields) - * - * @param name the event field id - * @param value the event field value - */ - public TmfEventField(final String name, final Object value) { - this(name, value, null); - } - /** * Full constructor * @@ -189,10 +169,10 @@ public class TmfEventField implements ITmfEventField { public final static ITmfEventField makeRoot(final String[] labels) { final ITmfEventField[] fields = new ITmfEventField[labels.length]; for (int i = 0; i < labels.length; i++) { - fields[i] = new TmfEventField(labels[i], null); + fields[i] = new TmfEventField(labels[i], null, null); } // Return a new root field; - return new TmfEventField(ITmfEventField.ROOT_FIELD_ID, fields); + return new TmfEventField(ITmfEventField.ROOT_FIELD_ID, null, fields); } // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataProviderTest.java b/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataProviderTest.java index 19fec89add..e8a07fa5fa 100644 --- a/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataProviderTest.java +++ b/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataProviderTest.java @@ -95,13 +95,13 @@ public class TmfBaseColumnDataProviderTest { * Constructor */ public TmfBaseColumnDataProviderTest() { - fContent1 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some content"); + fContent1 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some content", null); fEvent1 = new TmfEvent(null, fTimestamp1, fSource, fType1, fContent1, fReference); - fContent2 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other content"); + fContent2 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other content", null); fEvent2 = new TmfEvent(null, fTimestamp2, fSource, fType2, fContent2, fReference); - fContent3 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other different content"); + fContent3 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other different content", null); fEvent3 = new TmfEvent(null, fTimestamp3, fSource, fType3, fContent3, fReference); fStatsData = new TmfStatisticsTree(); diff --git a/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseStatisticsDataTest.java b/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseStatisticsDataTest.java index dffdaf3c44..fe96cbbaea 100755 --- a/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseStatisticsDataTest.java +++ b/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseStatisticsDataTest.java @@ -86,13 +86,13 @@ public class TmfBaseStatisticsDataTest { * Constructor */ public TmfBaseStatisticsDataTest() { - fContent1 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some content"); + fContent1 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some content", null); fEvent1 = new TmfEvent(null, fTimestamp1, fSource, fType1, fContent1, fReference); - fContent2 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other content"); + fContent2 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other content", null); fEvent2 = new TmfEvent(null, fTimestamp2, fSource, fType2, fContent2, fReference); - fContent3 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other different content"); + fContent3 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other different content", null); fEvent3 = new TmfEvent(null, fTimestamp3, fSource, fType3, fContent3, fReference); fStatsTree = new TmfStatisticsTree(); diff --git a/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfTreeContentProviderTest.java b/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfTreeContentProviderTest.java index a270edbc49..19b15110dd 100755 --- a/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfTreeContentProviderTest.java +++ b/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfTreeContentProviderTest.java @@ -81,10 +81,10 @@ public class TmfTreeContentProviderTest { * Constructor */ public TmfTreeContentProviderTest() { - fContent1 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some content"); + fContent1 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some content", null); fEvent1 = new TmfEvent(null, fTimestamp1, fSource, fType1, fContent1, fReference); - fContent2 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other content"); + fContent2 = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, "Some other content", null); fEvent2 = new TmfEvent(null, fTimestamp2, fSource, fType2, fContent2, fReference); fStatsData = new TmfStatisticsTree(); diff --git a/org.eclipse.linuxtools.tmf.ui.tests/widgetStubs/org/eclipse/linuxtools/tmf/ui/tests/uml2sd/trace/TmfUml2SDTestTrace.java b/org.eclipse.linuxtools.tmf.ui.tests/widgetStubs/org/eclipse/linuxtools/tmf/ui/tests/uml2sd/trace/TmfUml2SDTestTrace.java index 17dedf9be6..c4499cb830 100644 --- a/org.eclipse.linuxtools.tmf.ui.tests/widgetStubs/org/eclipse/linuxtools/tmf/ui/tests/uml2sd/trace/TmfUml2SDTestTrace.java +++ b/org.eclipse.linuxtools.tmf.ui.tests/widgetStubs/org/eclipse/linuxtools/tmf/ui/tests/uml2sd/trace/TmfUml2SDTestTrace.java @@ -95,9 +95,9 @@ public class TmfUml2SDTestTrace implements ITmfEventParser { // Pre-parse the content TmfEventField[] fields = new TmfEventField[3]; - fields[0] = new TmfEventField("sender", sender); - fields[1] = new TmfEventField("receiver", receiver); - fields[2] = new TmfEventField("signal", signal); + fields[0] = new TmfEventField("sender", sender, null); + fields[1] = new TmfEventField("receiver", receiver, null); + fields[2] = new TmfEventField("signal", signal, null); ITmfEventField tmfContent = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, content, fields); ITmfEvent tmfEvent = new TmfEvent(fEventStream, new TmfTimestamp(ts, -9), source, tmfEventType, tmfContent, reference); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEvent.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEvent.java index f58d8f6cfb..391395556e 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEvent.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEvent.java @@ -214,9 +214,9 @@ public class CustomEvent extends TmfEvent { String value = fData.get(outputColumn.name); if (outputColumn.name.equals(CustomTraceDefinition.TAG_TIMESTAMP) && date != null) { SimpleDateFormat dateFormat = new SimpleDateFormat(fDefinition.timeStampOutputFormat); - fColumnData[i++] = new TmfEventField(outputColumn.name, dateFormat.format(date)); + fColumnData[i++] = new TmfEventField(outputColumn.name, dateFormat.format(date), null); } else { - fColumnData[i++] = new TmfEventField(outputColumn.name, (value != null ? value : "")); //$NON-NLS-1$ + fColumnData[i++] = new TmfEventField(outputColumn.name, (value != null ? value : ""), null); //$NON-NLS-1$ } } CustomEventContent curContent = (CustomEventContent) getContent(); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventContent.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventContent.java index e3f0f60643..1ecde7bddb 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventContent.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventContent.java @@ -31,7 +31,7 @@ public class CustomEventContent extends TmfEventField { * Event content */ public CustomEventContent(CustomEvent parent, StringBuffer content) { - super(ITmfEventField.ROOT_FIELD_ID, content); + super(ITmfEventField.ROOT_FIELD_ID, content, null); } /** diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventType.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventType.java index 0646dd6745..e94b961d19 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventType.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventType.java @@ -38,9 +38,9 @@ public abstract class CustomEventType extends TmfEventType { private static ITmfEventField getRootField(CustomTraceDefinition definition) { ITmfEventField[] fields = new ITmfEventField[definition.outputs.size()]; for (int i = 0; i < fields.length; i++) { - fields[i] = new TmfEventField(definition.outputs.get(i).name, null); + fields[i] = new TmfEventField(definition.outputs.get(i).name, null, null); } - ITmfEventField rootField = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, fields); + ITmfEventField rootField = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, null, fields); return rootField; } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java index 172d9e748c..d722c3f620 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java @@ -1782,11 +1782,11 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS final String reference = event.getReference(); final String content = event.getContent().toString(); fields = new TmfEventField[] { - new TmfEventField(ITmfEvent.EVENT_FIELD_TIMESTAMP, timestamp), - new TmfEventField(ITmfEvent.EVENT_FIELD_SOURCE, source), - new TmfEventField(ITmfEvent.EVENT_FIELD_TYPE, type), - new TmfEventField(ITmfEvent.EVENT_FIELD_REFERENCE, reference), - new TmfEventField(ITmfEvent.EVENT_FIELD_CONTENT, content) + new TmfEventField(ITmfEvent.EVENT_FIELD_TIMESTAMP, timestamp, null), + new TmfEventField(ITmfEvent.EVENT_FIELD_SOURCE, source, null), + new TmfEventField(ITmfEvent.EVENT_FIELD_TYPE, type, null), + new TmfEventField(ITmfEvent.EVENT_FIELD_REFERENCE, reference, null), + new TmfEventField(ITmfEvent.EVENT_FIELD_CONTENT, content, null) }; } return fields; -- 2.34.1