Skip to content

Commit 5d0fc72

Browse files
wonyonggsbrannen
andauthored
Document intention of toString() in HandlerMethod
Document that HandlerMethod.toString() is used in log and error messages, and that the returned description should typically include the method signature of the underlying handler method for clarity and debugging. Closes gh-35055 Signed-off-by: WonYong Hwang <[email protected]> Co-authored-by: Sam Brannen <[email protected]>
1 parent a265a13 commit 5d0fc72

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,12 @@ public int hashCode() {
352352
return (this.bean.hashCode() * 31 + super.hashCode());
353353
}
354354

355+
/**
356+
* Returns a concise description of this {@code HandlerMethod}, which is used
357+
* in log and error messages.
358+
* <p>The description should typically include the method signature of the
359+
* underlying handler method for clarity and debugging purposes.
360+
*/
355361
@Override
356362
public String toString() {
357363
return this.description;

0 commit comments

Comments
 (0)