DESCRIPTION

ctf: replace hashmaps with arraylists for eventdeclaration storage

Change-Id: I088943c5a041f16638cb89b832ab79f8ef9c1d76
Signed-off-by: Ivy Mitchell xxx@xxx.xxx


COMMENTS

author: Ivy Mitchell
date: 2014-08-05 02:34:45.000000000

Uploaded patch set 7.

-------------------------------------
author: Brenden Conley
date: 2014-08-05 02:37:48.000000000

Patch Set 7:

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

-------------------------------------
author: Brenden Conley
date: 2014-08-05 03:19:06.000000000

Patch Set 7: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/8083/ : SUCCESS

-------------------------------------
author: Braxton Mccarthy
date: 2014-08-05 18:49:05.000000000

Patch Set 7: Code-Review-1

(8 comments)

Since ID's are integers, seems like a good idea to store a list instead of a map. However, this could be made much more simply imo, see comments in CTFStream.

Line:7, /COMMIT_MSG -> Is your Shift key broken?

Line:268, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java -> cast should be checked here, this level has no control on "id"

Line:82, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/EventDeclaration.java -> eww, why not just change fId to a int/Integer, and in the existing getter/setters do the conversion (and change the signature to in only when we break the API)

Line:178, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStreamInputReader.java -> getEventDeclaration() does a copy already, doesn't it?

Line:64, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> There is no point storing an "immutable" list, then just switching the reference around. If the list of events can change (which is the case here, through the addEvent() method), you should store a final, mutable list as the field, then do a copy in the getter for the whole list (should there even be such a getter, anyway?)

Line:66, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> This seems like an ugly work-around. Why not just use "null" elements in the list, and make get(int xxx@xxx.xxx This will force a null-check everywhere it's used, whereas you can't force a "UNASSIGNED check".

Downside is that you can't use Immutable collections, but as I said above, these don't seem very appropriate here anyway.

Line:252, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> Isn't that very bad that all of a sudden the ID's don't match the rank index? Isn't the whole point of storing in an ArrayList to have index == ID?

Line:276, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> Should you have a separate field for the Event with unset ID? (there can be only of those anyway, right?)

-------------------------------------
author: Luciana Barry
date: 2014-08-05 20:50:24.000000000

Patch Set 7:

(5 comments)

Line:64, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> agree

Line:66, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> agree++

Line:252, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> Internally the index is the ID, but here we're just providing the list of declarations. I wouldn't even try to explain it in the Javadoc, this is just the expected result.

Line:276, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> Thought it was a cool way to do it that once you have the unset id it becomes an unmodifiable list with a single element.

Line:315, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> Don't really care, but SingletonList sounds like it would be appropriate here.

-------------------------------------
author: Ivy Mitchell
date: 2014-08-08 03:26:10.000000000

Patch Set 7:

(2 comments)

Line:82, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/EventDeclaration.java -> Done

Line:178, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStreamInputReader.java -> defensive/offensive copies

-------------------------------------
author: Braxton Mccarthy
date: 2014-08-13 19:52:18.000000000

Patch Set 7:

(2 comments)

Line:275, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> check bool

Line:347, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> Collection

-------------------------------------
author: Braxton Mccarthy
date: 2014-08-13 20:03:21.000000000

Patch Set 7:

(1 comment)

Line:178, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStreamInputReader.java -> STATE OF THE AAAAAAART

-------------------------------------
author: Gerrit Code Review
date: 2014-08-14 00:47:25.000000000

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

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

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