DESCRIPTION

ctf: extract static methods of IOStructGen to IOStructGenUtils

Reduce cyclomatic complexity and code duplication in IOStructGen.java

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


COMMENTS

author: Braxton Mccarthy
date: 2014-09-17 18:27:37.000000000

Patch Set 4: Code-Review-1

(8 comments)

Good initiative! Some comments.

They stab it with their steely knives,
But they just can't kill the beast

Line:29, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/metadata/IOStructGenUtils.java -> What about keeping this public (but internal? well, it is internal already). This would allow eventual unit tests to use this directly.

Same with all the methods below. Could some of them become private even?

Line:158, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/metadata/IOStructGenUtils.java -> One-line description?

Line:168, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/metadata/IOStructGenUtils.java -> same

Line:177, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/metadata/IOStructGenUtils.java -> same

Line:396, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/metadata/IOStructGenUtils.java -> xxx@xxx.xxx Encoding

Line:539, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/metadata/IOStructGenUtils.java -> ... xxx@xxx.xxx String

Line:111, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/metadata/MetadataStrings.java -> There is no need for "static final" here, it is implicit since we are in an interface. Might as well update this file while we're at it?

Line:1846, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/metadata/IOStructGen.java -> is it really worth extracting this in a separate method? Both are relatively small already, and it's only called from that place.

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