When removing an input that has a previous input child to the same
parent input, the previous input's next input reference should be
updated to the next input of the removed input. Otherwise the removed
input may remain as a ghost next input and interfere with the previous
input's child inputs. This is only a problem when testing the parsing of
sample trace text from within the custom parser wizard, since the next
input relation is not stored in the XML definition, it is always rebuilt
from the parent-child relations when loading the definition from file
into memory.
Change-Id: I3531d705a46f13ac164325cd875e53d59b95ef1c
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/80516
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
if (inputLine.parentInput == null) {
definition.inputs.remove(inputLine);
} else {
+ int index = inputLine.parentInput.childrenInputs.indexOf(inputLine);
+ if (index > 0) {
+ inputLine.parentInput.childrenInputs.get(index - 1).nextInput = inputLine.nextInput;
+ }
inputLine.parentInput.childrenInputs.remove(inputLine);
}
treeViewer.refresh();