Skip to content

Commit

Permalink
Remove redundant toString() calls in KiwiUrls and KiwiStringsTest (#612)
Browse files Browse the repository at this point in the history
Closes #611
  • Loading branch information
sleberknight authored Oct 20, 2021
1 parent a013123 commit 73972d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/kiwiproject/net/KiwiUrls.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public static URL toURL(URI uri) {
try {
return uri.toURL();
} catch (MalformedURLException e) {
var message = "Error creating URL from: " + uri.toString();
var message = "Error creating URL from: " + uri;
throw new UncheckedMalformedURLException(message, e);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/kiwiproject/base/KiwiStringsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void shouldFormat_withSomeArguments_ContainingNullValues() {
void shouldFormat_withMoreArgs_ThanPlaceholders() {
var o = new Object();
var result = format("This is a %s template with %s placeholders but more arguments", "great", 2, 3.14, o);
assertThat(result).isEqualTo("This is a great template with 2 placeholders but more arguments [3.14, " + o.toString() + "]");
assertThat(result).isEqualTo("This is a great template with 2 placeholders but more arguments [3.14, " + o + "]");
}
}

Expand Down Expand Up @@ -296,7 +296,7 @@ void shouldFormat_withSomeArguments_ContainingNullValues() {
void shouldFormat_withMoreArgs_ThanPlaceholders() {
var o = new Object();
var result = format("This is a {} template with {} placeholders but more arguments", "great", 2, 3.14, o);
assertThat(result).isEqualTo("This is a great template with 2 placeholders but more arguments [3.14, " + o.toString() + "]");
assertThat(result).isEqualTo("This is a great template with 2 placeholders but more arguments [3.14, " + o + "]");
}
}

Expand Down

0 comments on commit 73972d5

Please sign in to comment.