Merge branch 'stable-2.14' into stable-2.15

* stable-2.14:
  Use Logger's built-in string formatting where possible
  Doc: Fix code example in JS API

Change-Id: I1b953b6d9ab5cd066b8b6f43bb1843dcb1736d1b
This commit is contained in:
David Pursehouse
2018-05-23 20:17:58 +09:00
26 changed files with 116 additions and 124 deletions

View File

@@ -185,7 +185,7 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
throw new ResourceConflictException(
"Cannot update " + projectName + ": " + e.getCause().getMessage());
}
log.warn(String.format("Failed to update config of project %s.", projectName), e);
log.warn("Failed to update config of project {}.", projectName, e);
throw new ResourceConflictException("Cannot update " + projectName);
}
@@ -220,9 +220,7 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
ProjectConfigEntry projectConfigEntry = pluginConfigEntries.get(pluginName, v.getKey());
if (projectConfigEntry != null) {
if (!isValidParameterName(v.getKey())) {
log.warn(
String.format(
"Parameter name '%s' must match '^[a-zA-Z0-9]+[a-zA-Z0-9-]*$'", v.getKey()));
log.warn("Parameter name '{}' must match '^[a-zA-Z0-9]+[a-zA-Z0-9-]*$'", v.getKey());
continue;
}
String oldValue = cfg.getString(v.getKey());
@@ -271,9 +269,9 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
break;
default:
log.warn(
String.format(
"The type '%s' of parameter '%s' is not supported.",
projectConfigEntry.getType().name(), v.getKey()));
"The type '{}' of parameter '{}' is not supported.",
projectConfigEntry.getType().name(),
v.getKey());
}
} catch (NumberFormatException ex) {
throw new BadRequestException(