Add #getName() and #getNameKey() to ProjectState

This commit adds #getName() and #getNameKey() to ProjectState and
migrates callers to spare calling #getProject() in many places.

Change-Id: I124d370b47723ff3fc7d5bc51a697890a16ab01c
This commit is contained in:
Patrick Hiesel
2017-09-07 16:07:34 +02:00
parent d46fb98646
commit 55326bd493
29 changed files with 61 additions and 63 deletions

View File

@@ -105,7 +105,7 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
public ConfigInfo apply(ProjectState projectState, ConfigInput input)
throws ResourceNotFoundException, BadRequestException, ResourceConflictException {
Project.NameKey projectName = projectState.getProject().getNameKey();
Project.NameKey projectName = projectState.getNameKey();
if (input == null) {
throw new BadRequestException("config is required");
}
@@ -309,7 +309,7 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
throw new BadRequestException(
String.format(
"Not allowed to set parameter '%s' of plugin '%s' on project '%s'.",
parameterName, pluginName, projectState.getProject().getName()));
parameterName, pluginName, projectState.getName()));
}
}