DESCRIPTION

tmf: Modernize ITmfEventField

Remove the notion of field indexes. Fields should be accessed by
name, not by arbitrary numerical value. Replace all arrays in the
API by Collection<String>. (Iterable would have been better but
many places made use of .size(), didn't want to break too much
things).

However, TextTraceEventContent made heavy use of field indexes.
Left this behavior as-is, by simply returning a List instead and
making those methods specific to this implementation.

Also fixes bug #433801.

Change-Id: I889355f86a3141d92ff2af3f30afec13f05152dd
Signed-off-by: Braxton Mccarthy xxx@xxx.xxx


COMMENTS

author: Braxton Mccarthy
date: 2014-04-29 22:19:11.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2014-04-29 23:56:56.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6742/

-------------------------------------
author: Brenden Conley
date: 2014-04-30 00:14:25.000000000

Patch Set 1: Verified-1

Build Failed 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6742/ : FAILURE

-------------------------------------
author: Ivy Mitchell
date: 2014-04-30 17:41:16.000000000

Patch Set 1: Code-Review-1

(8 comments)

First pass... I'm feeling like a street walking cheetah with a heart full of napalm

Line:62, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventType.java -> who would use this, it's always blank in reality... take the axe to it.

Line:118, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java -> What? why are we doing this. If the api wants it, we should do it. If we can't do it, don't put it in the API.

Line:123, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java -> throw an unsupportedOperationException()

Line:264, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java -> either iterate over the fields or get the fieldname and the field... tostring is not the place for fast code.

Line:51, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventField.java -> how about an interface here?

Line:57, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventField.java -> should this be in the interface above?

Line:75, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventField.java -> remove me, use getFieldNames and getField(name)

Line:92, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventField.java -> move this to another interface

-------------------------------------
author: Ivy Mitchell
date: 2014-04-30 17:50:35.000000000

Patch Set 1:

add a topic please

-------------------------------------
author: Braxton Mccarthy
date: 2014-04-30 18:13:26.000000000

Patch Set 1:

(7 comments)

Thanks for the comments. There's indeed a bunch of cleanups that could be done. We'll get to it, one step at a time ;)

Line:62, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventType.java -> I have no idea what this does... but the ONLY thing that uses it is FilterView. It's outside of this patch, but we can probably do something about it.

Line:118, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java -> ITmfEventField offers supports for nested fields. This trace type here doesn't make use of it, but the interface requires us to implement it... (once again, Java 8 will save the day).

We could argue "support for nested fields doesn't need to be in the base framework". I am not disagree with that. But that would be another big change.

Line:123, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java -> That could be an option, but might break some tests. I feel I've broken enough copy-pasted tests in this patch already ;)

Line:264, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java -> a Joiner would probably be best here, but then again, I wanted to limit the cleanup-creep to things related to the interface.

Line:51, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventField.java -> Could make sense, that would be a big refactor though (this is quite core to the framework...)

Line:75, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventField.java -> I don't like it either, but TmfEventPropertySource, among other things, makes use of iterating on both the keys and the values separately.

I wanted to limit to "cleanup creep" of this patch, so for now I've left it as-is. If you want to fix it in an ulterior patch, please do! :)

Line:92, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventField.java -> Which interface? This goes with the other "get sub field x" methods, which we need if we want to support nested fields.

Although this is mostly just a utility class, it could probably become a default method once we move to Java 8.

-------------------------------------
author: Ivy Mitchell
date: 2014-04-30 18:30:17.000000000

Patch Set 1:

(1 comment)

Line:92, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventField.java -> I would suggest this be only for flat fields. ITmfHierachicalField

-------------------------------------
author: Gerrit Code Review
date: 2014-05-02 15:26:36.000000000

The change could not be merged due to a path conflict.

Please rebase the change locally and upload the rebased commit for review.

-------------------------------------
