Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Jul 4, 2023
1 parent 5d4c284 commit da814e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -212,7 +212,7 @@ public Class<?> getBeanType() {

/**
* If the bean method is a bridge method, this method returns the bridged
* (user-defined) method. Otherwise it returns the same method as {@link #getMethod()}.
* (user-defined) method. Otherwise, it returns the same method as {@link #getMethod()}.
*/
protected Method getBridgedMethod() {
return this.bridgedMethod;
Expand Down Expand Up @@ -298,8 +298,8 @@ public HandlerMethod createWithResolvedBean() {
* Return a short representation of this handler method for log message purposes.
*/
public String getShortLogMessage() {
int args = this.method.getParameterCount();
return getBeanType().getSimpleName() + "#" + this.method.getName() + "[" + args + " args]";
return getBeanType().getSimpleName() + "#" + this.method.getName() +
"[" + this.method.getParameterCount() + " args]";
}


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

protected String formatInvokeError(String text, Object[] args) {

String formattedArgs = IntStream.range(0, args.length)
.mapToObj(i -> (args[i] != null ?
"[" + i + "] [type=" + args[i].getClass().getName() + "] [value=" + args[i] + "]" :
"[" + i + "] [null]"))
.collect(Collectors.joining(",\n", " ", " "));

return text + "\n" +
"Endpoint [" + getBeanType().getName() + "]\n" +
"Method [" + getBridgedMethod().toGenericString() + "] " +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -218,6 +218,7 @@ private HandlerMethod(HandlerMethod handlerMethod, Object handler) {
this.description = handlerMethod.description;
}


private MethodParameter[] initMethodParameters() {
int count = this.bridgedMethod.getParameterCount();
MethodParameter[] result = new MethodParameter[count];
Expand Down Expand Up @@ -248,7 +249,7 @@ private static String initDescription(Class<?> beanType, Method method) {
for (Class<?> paramType : method.getParameterTypes()) {
joiner.add(paramType.getSimpleName());
}
return beanType.getName() + "#" + method.getName() + joiner.toString();
return beanType.getName() + "#" + method.getName() + joiner;
}


Expand Down

0 comments on commit da814e0

Please sign in to comment.