in src/main/java/com/googlesource/gerrit/plugins/renameproject/conditions/RenamePreconditions.java [91:107]
private void assertHasNoChildProjects(ProjectResource rsrc) throws CannotRenameProjectException {
try {
Response<List<ProjectInfo>> children = listChildProjectsProvider.get().apply(rsrc);
if (!children.value().isEmpty()) {
String childrenString =
String.join(
", ",
children.value().stream().map(info -> info.name).collect(Collectors.toList()));
String message =
String.format("Cannot rename project because it has children: %s", childrenString);
log.error(message);
throw new CannotRenameProjectException(message);
}
} catch (Exception e) {
throw new CannotRenameProjectException(e);
}
}