DESCRIPTION

ctf: replace HashMaps with ArrayLists for EventDeclaration storage

Parser no longer supports events with IDs larger than Integer.MAX_VALUE

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


COMMENTS

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.

-------------------------------------
author: Braxton Mccarthy
date: 2014-08-14 20:47:51.000000000

Uploaded patch set 20.

-------------------------------------
author: Luciana Barry
date: 2014-08-14 21:47:13.000000000

Patch Set 20: Code-Review-1

(2 comments)

Line:267, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> Slight worry that someone might expect this exception when using a bad positive event id? Would it be simpler to return null?

Line:272, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> ArrayIndexOutOfBoundsException thrown if the list is empty.

-------------------------------------
author: Ivy Mitchell
date: 2014-08-15 01:14:58.000000000

Patch Set 20: Code-Review-1

(1 comment)

let's all -1 this formerly +2'd patch.

Line:280, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> I prefer an aoobe or invalid argument exception than returning a null.

-------------------------------------
author: Braxton Mccarthy
date: 2014-08-15 01:29:57.000000000

Patch Set 20: Code-Review-1

(3 comments)

TO THE GROUND BABY

Line:267, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> If it's positive (and fits within an int) then it is not "bad". Any positive value is possible. In those cases we do return null.

Perhaps the javadoc could be clearer, "throws IAE If the passed ID is negative"? because a negative ID is always invalid.

Line:272, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> oh good point, and we don't even check the value of fEventUnsetId...

Line:280, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> In this particular case though, it should be null. If we had a treemap with 10 entries, 1 to 10, and someone did get(10000), you'd get a null. Here if it happens to be smaller than the current size of the array you get null, but if it's bigger you get AOOBE. The ID 10000 is technically valid, we just don't have any declaration with that ID.

-------------------------------------
author: Brenden Conley
date: 2014-08-15 04:00:40.000000000

Patch Set 20:

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

-------------------------------------
author: Brenden Conley
date: 2014-08-15 04:56:21.000000000

Patch Set 20: Verified-1

Build Failed 

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

-------------------------------------
author: Ivy Mitchell
date: 2014-08-15 15:27:49.000000000

Patch Set 20:

(1 comment)

Line:272, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFStream.java -> eventIndex = (eventId == EventDeclaration.UNSET_EVENT_ID)?0:eventId; then skip the first branch.

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