If a scenario is not set as initial scenario, then no scenario is created and
the isNewScenarioAllowed method throws a IndexOutOfBoundsException. This patch
reorders the condition so it is first verified that the scenario count is more
than 0
Change-Id: I034e049ce6e1655fccbf6caf03978515285e9b73
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/72035
Reviewed-by: Hudson CI
Reviewed-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Tested-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
* @return True if the start of a new scenario is allowed, false otherwise
*/
public synchronized boolean isNewScenarioAllowed() {
- return !fActiveScenariosList.get(fActiveScenariosList.size() - 1).getScenarioInfos().getStatus().equals(ScenarioStatusType.PENDING)
- && fInstanceMultipleEnabled && fTotalScenarios > 0;
+ return fTotalScenarios > 0
+ && !fActiveScenariosList.get(fActiveScenariosList.size() - 1).getScenarioInfos().getStatus().equals(ScenarioStatusType.PENDING)
+ && fInstanceMultipleEnabled;
}
}