Skip to content

Commit da814e0

Browse files
committed
Polishing
1 parent 5d4c284 commit da814e0

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

spring-messaging/src/main/java/org/springframework/messaging/handler/HandlerMethod.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -212,7 +212,7 @@ public Class<?> getBeanType() {
212212

213213
/**
214214
* If the bean method is a bridge method, this method returns the bridged
215-
* (user-defined) method. Otherwise it returns the same method as {@link #getMethod()}.
215+
* (user-defined) method. Otherwise, it returns the same method as {@link #getMethod()}.
216216
*/
217217
protected Method getBridgedMethod() {
218218
return this.bridgedMethod;
@@ -298,8 +298,8 @@ public HandlerMethod createWithResolvedBean() {
298298
* Return a short representation of this handler method for log message purposes.
299299
*/
300300
public String getShortLogMessage() {
301-
int args = this.method.getParameterCount();
302-
return getBeanType().getSimpleName() + "#" + this.method.getName() + "[" + args + " args]";
301+
return getBeanType().getSimpleName() + "#" + this.method.getName() +
302+
"[" + this.method.getParameterCount() + " args]";
303303
}
304304

305305

@@ -365,13 +365,11 @@ protected void assertTargetBean(Method method, Object targetBean, Object[] args)
365365
}
366366

367367
protected String formatInvokeError(String text, Object[] args) {
368-
369368
String formattedArgs = IntStream.range(0, args.length)
370369
.mapToObj(i -> (args[i] != null ?
371370
"[" + i + "] [type=" + args[i].getClass().getName() + "] [value=" + args[i] + "]" :
372371
"[" + i + "] [null]"))
373372
.collect(Collectors.joining(",\n", " ", " "));
374-
375373
return text + "\n" +
376374
"Endpoint [" + getBeanType().getName() + "]\n" +
377375
"Method [" + getBridgedMethod().toGenericString() + "] " +

spring-web/src/main/java/org/springframework/web/method/HandlerMethod.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -218,6 +218,7 @@ private HandlerMethod(HandlerMethod handlerMethod, Object handler) {
218218
this.description = handlerMethod.description;
219219
}
220220

221+
221222
private MethodParameter[] initMethodParameters() {
222223
int count = this.bridgedMethod.getParameterCount();
223224
MethodParameter[] result = new MethodParameter[count];
@@ -248,7 +249,7 @@ private static String initDescription(Class<?> beanType, Method method) {
248249
for (Class<?> paramType : method.getParameterTypes()) {
249250
joiner.add(paramType.getSimpleName());
250251
}
251-
return beanType.getName() + "#" + method.getName() + joiner.toString();
252+
return beanType.getName() + "#" + method.getName() + joiner;
252253
}
253254

254255

0 commit comments

Comments
 (0)