Skip to content

Commit 19955c5

Browse files
imkulwantsbrannen
authored andcommitted
Remove unnecessary calls to toString()
See gh-29408
1 parent bd57d86 commit 19955c5

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

spring-websocket/src/main/java/org/springframework/web/socket/messaging/SessionDisconnectEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public CloseStatus getCloseStatus() {
8989

9090
@Override
9191
public String toString() {
92-
return "SessionDisconnectEvent[sessionId=" + this.sessionId + ", " + this.status.toString() + "]";
92+
return "SessionDisconnectEvent[sessionId=" + this.sessionId + ", " + this.status + "]";
9393
}
9494

9595
}

spring-websocket/src/test/java/org/springframework/web/socket/adapter/standard/ConvertingEncoderDecoderSupportTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,15 @@ public boolean equals(Object obj) {
244244
private static class MyTypeToStringConverter implements Converter<MyType, String> {
245245
@Override
246246
public String convert(MyType source) {
247-
return "_" + source.toString();
247+
return "_" + source;
248248
}
249249
}
250250

251251

252252
private static class MyTypeToBytesConverter implements Converter<MyType, byte[]> {
253253
@Override
254254
public byte[] convert(MyType source) {
255-
return ("~" + source.toString()).getBytes();
255+
return ("~" + source).getBytes();
256256
}
257257
}
258258

spring-websocket/src/test/java/org/springframework/web/socket/sockjs/client/RestTemplateXhrTransportTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void connectReceiveAndCloseWithPrelude() throws Exception {
9191
for (int i = 0; i < 2048; i++) {
9292
sb.append('h');
9393
}
94-
String body = sb.toString() + "\n" + "o\n" + "a[\"foo\"]\n" + "c[3000,\"Go away!\"]";
94+
String body = sb + "\n" + "o\n" + "a[\"foo\"]\n" + "c[3000,\"Go away!\"]";
9595
ClientHttpResponse response = response(HttpStatus.OK, body);
9696
connect(response);
9797

0 commit comments

Comments
 (0)