in src/main/java/com/googlesource/gerrit/plugins/task/TaskConfig.java [259:279]
public Task getTaskOptional(String name) throws ConfigInvalidException {
int end = 0;
Matcher m = OPTIONAL_TASK_PATTERN.matcher(name);
while (m.find()) {
end = m.end();
Task task = getTaskOrNull(m.group(1));
if (task != null) {
return task;
}
}
String last = name.substring(end);
if (!"".equals(last)) { // Last entry was not optional
Task task = getTaskOrNull(last);
if (task != null) {
return task;
}
throw new ConfigInvalidException("task not defined");
}
return null;
}