I think it would be better that return empty LinkedHashMap instead of Collections.emptyMap() in PathVariableMapMethodArgumentResolver, because they do't have same support for put operation. And I think that the supported operatioin of Map annotated with @PathVariable should not be changed according the value(empty or not).
Comment From: bclozel
Those are not meant to mutable; in several places we're wrapping the underlying collections with Collections.unmodifiableMap. So using Collections.emptyMap() is consistent with that approach.
I'm declining this PR as a result. Thanks!
Comment From: dugenkui03
@bclozel Thanks for your response.
In mvc.method.annotation.PathVariableMapMethodArgumentResolver, the original Map maybe immutable, but the returned value is mutable .
Do you think is it nessary that return unmodifiable view of copy even the Map is not empty, for keep same support for
put operation.
Comment From: bclozel
For consistency we could indeed change that to make it immutable.