DESCRIPTION

Add or fix CTF types toString

* struct: add field names
* variant: print the current field
* enum: print value and container value

Change-Id: I45d9a2fd900a29cd2ef99f15d2d58d4d01151ee1


COMMENTS

author: Kason Bridges
date: 2013-02-19 20:44:37.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2013-02-19 20:44:42.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/sandbox/job/linuxtools/1409/ 

-------------------------------------
author: Brenden Conley
date: 2013-02-19 20:49:04.000000000

Patch Set 2: Fails

Build Failed 

https://hudson.eclipse.org/sandbox/job/linuxtools/1409/ : FAILURE

-------------------------------------
author: Ivy Mitchell
date: 2013-02-19 21:02:32.000000000

Patch Set 2: Looks good to me, but someone else must approve; IP review completed

Looks good, but hudson said no, so I will have to recompile it later today or tomorrow morning.

-------------------------------------
author: Ivy Mitchell
date: 2013-02-19 21:12:04.000000000

Patch Set 2:

It would make me happy like a girl at a a new kids on the block concert if you could add some test cases for this.

-------------------------------------
author: Brenden Conley
date: 2013-02-19 22:04:36.000000000

Patch Set 2: No score

Build Started https://hudson.eclipse.org/sandbox/job/linuxtools/1419/ 

-------------------------------------
author: Braxton Mccarthy
date: 2013-02-19 22:12:11.000000000

Patch Set 2: I would prefer that you didn't submit this

(2 inline comments)

Looks good! But I agree with Matthew, there should be some unit tests that show what the new expected values are.

All unit tests, even the CTF ones, are now run on Hudson so it's worth having them ;)

Line:127, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/EnumDefinition.java -> You could directly use:
  return "{ value = " + getValue() + ...

it'll create the String in one go. StringBuilder is useful when you want to append to a string in a loop (so you don't create an extra string every iteration).

Line:281, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/VariantDefinition.java -> If you insert only one character, you can use single quotes ('?'). It's a tiny tiny tiny bit faster, and you don't need a NON-NLS annotation!

-------------------------------------
author: Brenden Conley
date: 2013-02-19 22:18:17.000000000

Patch Set 2: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/linuxtools/1419/ : SUCCESS

-------------------------------------
author: Kason Bridges
date: 2013-02-20 03:05:02.000000000

Patch Set 2: (2 inline comments)

Response to comments.

Line:127, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/EnumDefinition.java -> Done

Line:281, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/VariantDefinition.java -> Noted, but I have simplified it after your other comment.

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