Skip to content

Commit 6f4a8cc

Browse files
committed
Polish "Change log messages to use singular or plural instead of "noun(s)""
See gh-37017
1 parent c6c7fbc commit 6f4a8cc

File tree

1 file changed

+6
-9
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven

1 file changed

+6
-9
lines changed

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java

+6-9
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,12 @@ protected EnvVariables resolveEnvVariables() {
277277
private void addArgs(List<String> args) {
278278
RunArguments applicationArguments = resolveApplicationArguments();
279279
Collections.addAll(args, applicationArguments.asArray());
280-
String suffix = (applicationArguments.asArray().length == 1) ? "" : "s";
281-
logArguments("Application argument" + suffix + ": ", applicationArguments.asArray());
280+
logArguments("Application argument", applicationArguments.asArray());
282281
}
283282

284283
private Map<String, String> determineEnvironmentVariables() {
285284
EnvVariables envVariables = resolveEnvVariables();
286-
String suffix = (envVariables.asArray().length == 1) ? "" : "s";
287-
logArguments("Environment variable" + suffix + ": ", envVariables.asArray());
285+
logArguments("Environment variable", envVariables.asArray());
288286
return envVariables.asMap();
289287
}
290288

@@ -309,8 +307,7 @@ protected RunArguments resolveJvmArguments() {
309307
private void addJvmArgs(List<String> args) {
310308
RunArguments jvmArguments = resolveJvmArguments();
311309
Collections.addAll(args, jvmArguments.asArray());
312-
String suffix = (jvmArguments.asArray().length == 1) ? "" : "s";
313-
logArguments("JVM argument" + suffix + ": ", jvmArguments.asArray());
310+
logArguments("JVM argument", jvmArguments.asArray());
314311
}
315312

316313
private void addAgents(List<String> args) {
@@ -337,8 +334,7 @@ private void addActiveProfileArgument(RunArguments arguments) {
337334
}
338335
}
339336
arguments.getArgs().addFirst(arg.toString());
340-
String suffix = (this.profiles.length == 1) ? "" : "s";
341-
logArguments("Active profile" + suffix + ": ", this.profiles);
337+
logArguments("Active profile", this.profiles);
342338
}
343339
}
344340

@@ -417,8 +413,9 @@ private void addDependencies(List<URL> urls) throws MalformedURLException, MojoE
417413
}
418414
}
419415

420-
private void logArguments(String message, String[] args) {
416+
private void logArguments(String name, String[] args) {
421417
if (getLog().isDebugEnabled()) {
418+
String message = (args.length == 1) ? name + ": " : name + "s: ";
422419
getLog().debug(Arrays.stream(args).collect(Collectors.joining(" ", message, "")));
423420
}
424421
}

0 commit comments

Comments
 (0)