Consistent support for java.util.Optional for all applicable handler method arguments
Issue: SPR-12171
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -114,12 +114,9 @@ public class MatrixVariableMethodArgumentResolver extends AbstractNamedValueMeth
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleMissingValue(String name, MethodParameter param) throws ServletRequestBindingException {
|
||||
Class<?> paramType = param.getParameterType();
|
||||
if (!paramType.getName().equals("java.util.Optional")) {
|
||||
throw new ServletRequestBindingException(
|
||||
"Missing matrix variable '" + name + "' for method parameter type [" + paramType.getName() + "]");
|
||||
}
|
||||
protected void handleMissingValue(String name, MethodParameter parameter) throws ServletRequestBindingException {
|
||||
throw new ServletRequestBindingException("Missing matrix variable '" + name +
|
||||
"' for method parameter type " + parameter.getParameterType().getSimpleName());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -101,10 +101,9 @@ public class PathVariableMethodArgumentResolver extends AbstractNamedValueMethod
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleMissingValue(String name, MethodParameter param) throws ServletRequestBindingException {
|
||||
String paramType = param.getParameterType().getName();
|
||||
throw new ServletRequestBindingException(
|
||||
"Missing URI template variable '" + name + "' for method parameter type [" + paramType + "]");
|
||||
protected void handleMissingValue(String name, MethodParameter parameter) throws ServletRequestBindingException {
|
||||
throw new ServletRequestBindingException("Missing URI template variable '" + name +
|
||||
"' for method parameter type " + parameter.getParameterType().getSimpleName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user