Skip to content

Commit 2cd5c22

Browse files
Cleaned up strings
1 parent 6130b55 commit 2cd5c22

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/se/gustavkarlsson/rocketchat/jira_trigger/configuration/EnvVarConfigMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public Boolean getBoolean(String key) {
5757
} else if (string.equalsIgnoreCase("false")) {
5858
return false;
5959
} else {
60-
throw new IllegalStateException("'" + string + "' could not be parsed to a boolean value");
60+
throw new IllegalStateException(String.format("'%s' could not be parsed to a boolean value", string));
6161
}
6262
})
6363
.orElse(null);

src/main/java/se/gustavkarlsson/rocketchat/jira_trigger/jira/AuthHandlerProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private String readPassword(String username) {
5555
if (console == null) {
5656
throw new IllegalStateException("No console available for password input");
5757
}
58-
char[] password = console.readPassword("Enter JIRA password for user " + username + ": ");
58+
char[] password = console.readPassword(String.format("Enter JIRA password for user %s: ", username));
5959
return new String(password);
6060
}
6161
}

src/main/java/se/gustavkarlsson/rocketchat/jira_trigger/routes/DetectIssueRoute.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected ToRocketChatMessage handle(Request request, Response response, FromRoc
7474
log.debug("Issues: {}", issues.stream().map(Issue::getId).collect(toList()));
7575
log.debug("Creating message");
7676
ToRocketChatMessage message = messageFactory.create();
77-
message.setText(issues.size() == 1 ? "Found 1 issue" : "Found " + issues.size() + " issues");
77+
message.setText(issues.size() == 1 ? "Found 1 issue" : String.format("Found %d issues", issues.size()));
7878
List<ToRocketChatAttachment> attachments = createAttachments(issues);
7979
message.setAttachments(attachments);
8080
return message;

0 commit comments

Comments
 (0)