From: Matthew Khouzam Date: Mon, 13 Jul 2015 14:39:19 +0000 (-0400) Subject: ctf: Collapse if statement in StructDefinition X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=1dec66b2205fc7c0df10301dbea525aa5981a2c5;p=deliverable%2Ftracecompass.git ctf: Collapse if statement in StructDefinition Change-Id: I2736507e0ebbee70a172930cd4315c89872eb001 Signed-off-by: Matthew Khouzam Reviewed-on: https://git.eclipse.org/r/51857 Reviewed-by: Hudson CI Reviewed-by: Francis Giraldeau --- diff --git a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java index 1376e41079..733bd22ef0 100644 --- a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java +++ b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java @@ -265,16 +265,14 @@ public class StructDeclaration extends Declaration { if (fTraceDef != null) { lookupDefinition = fTraceDef.lookupDefinition(lookupPath); } - if (lookupDefinition == null) { - if (fEventHeaderDef != null) { - String[] paths = EVENT_HEADER.split(lookupPath); - if (paths.length > 1) { - String[] childLookup = paths[1].split("\\."); //$NON-NLS-1$ - return getRecursiveDef(fEventHeaderDef.getDefinition(childLookup[0]), childLookup, 1); - } - if (fDefinition != null) { - return fDefinition.lookupDefinition(lookupPath); - } + if (lookupDefinition == null && fEventHeaderDef != null) { + String[] paths = EVENT_HEADER.split(lookupPath); + if (paths.length > 1) { + String[] childLookup = paths[1].split("\\."); //$NON-NLS-1$ + return getRecursiveDef(fEventHeaderDef.getDefinition(childLookup[0]), childLookup, 1); + } + if (fDefinition != null) { + return fDefinition.lookupDefinition(lookupPath); } } return lookupDefinition;