Previously, if the user do not specify an event in a transition, the
validation always yields false, which is not true. This patch returns
true instead.
Change-Id: I2ec0afb344c3e4fb51366168cca8ebac6c7cb30f
Signed-off-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/77272
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Reviewed-by: Hudson CI
public TmfXmlBasicTransition(Element element) {
final @NonNull String events = element.getAttribute(TmfXmlStrings.EVENT);
fAcceptedEvents = new ArrayList<>();
public TmfXmlBasicTransition(Element element) {
final @NonNull String events = element.getAttribute(TmfXmlStrings.EVENT);
fAcceptedEvents = new ArrayList<>();
- for (String eventName : Arrays.asList(events.split(TmfXmlStrings.OR_SEPARATOR))) {
- String name = WILDCARD_PATTERN.matcher(eventName).replaceAll(".*"); //$NON-NLS-1$
- fAcceptedEvents.add(Pattern.compile(name));
+ if (!events.isEmpty()) {
+ for (String eventName : Arrays.asList(events.split(TmfXmlStrings.OR_SEPARATOR))) {
+ String name = WILDCARD_PATTERN.matcher(eventName).replaceAll(".*"); //$NON-NLS-1$
+ fAcceptedEvents.add(Pattern.compile(name));
+ }
}
final @NonNull String conditions = element.getAttribute(TmfXmlStrings.COND);
fCond = conditions.isEmpty() ? new ArrayList<>() : Arrays.asList(conditions.split(TmfXmlStrings.AND_SEPARATOR));
}
final @NonNull String conditions = element.getAttribute(TmfXmlStrings.COND);
fCond = conditions.isEmpty() ? new ArrayList<>() : Arrays.asList(conditions.split(TmfXmlStrings.AND_SEPARATOR));
private boolean validateEvent(ITmfEvent event) {
String eventName = event.getName();
private boolean validateEvent(ITmfEvent event) {
String eventName = event.getName();
+ if (fAcceptedEvents.isEmpty()) {
+ return true;
+ }
/*
* This validates the event name with the accepted regular expressions
*/
/*
* This validates the event name with the accepted regular expressions
*/