Polishing

This commit is contained in:
Juergen Hoeller
2018-08-02 17:45:46 +02:00
parent 2474c48749
commit 217aa38cbb
2 changed files with 13 additions and 11 deletions

View File

@@ -83,18 +83,18 @@ class InitBinderBindingContext extends BindingContext {
return dataBinder;
}
private void invokeBinderMethod(WebExchangeDataBinder dataBinder, ServerWebExchange exchange,
SyncInvocableHandlerMethod binderMethod) {
private void invokeBinderMethod(
WebExchangeDataBinder dataBinder, ServerWebExchange exchange, SyncInvocableHandlerMethod binderMethod) {
HandlerResult result = binderMethod.invokeForHandlerResult(exchange, this.binderMethodContext, dataBinder);
if (result != null && result.getReturnValue() != null) {
throw new IllegalStateException(
"@InitBinder methods should return void: " + binderMethod);
"@InitBinder methods must not return a value (should be void): " + binderMethod);
}
// Should not happen (no Model argument resolution) ...
if (!this.binderMethodContext.getModel().asMap().isEmpty()) {
throw new IllegalStateException(
"@InitBinder methods should not add model attributes: " + binderMethod);
"@InitBinder methods are not allowed to add model attributes: " + binderMethod);
}
}