parent
5bcce17fd9
commit
e191c34078
|
@ -139,11 +139,11 @@ final class MultiToSingleValueMapAdapter<K, V> implements Map<K, V>, Serializabl
|
||||||
Collection<V> values = this.values;
|
Collection<V> values = this.values;
|
||||||
if (values == null) {
|
if (values == null) {
|
||||||
Collection<List<V>> targetValues = this.targetMap.values();
|
Collection<List<V>> targetValues = this.targetMap.values();
|
||||||
values = new AbstractCollection<V>() {
|
values = new AbstractCollection<>() {
|
||||||
@Override
|
@Override
|
||||||
public Iterator<V> iterator() {
|
public Iterator<V> iterator() {
|
||||||
Iterator<List<V>> targetIterator = targetValues.iterator();
|
Iterator<List<V>> targetIterator = targetValues.iterator();
|
||||||
return new Iterator<V>() {
|
return new Iterator<>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
return targetIterator.hasNext();
|
return targetIterator.hasNext();
|
||||||
|
|
|
@ -207,7 +207,7 @@ public class PrintingResultHandler implements ResultHandler {
|
||||||
protected void printModelAndView(@Nullable ModelAndView mav) throws Exception {
|
protected void printModelAndView(@Nullable ModelAndView mav) throws Exception {
|
||||||
this.printer.printValue("View name", (mav != null) ? mav.getViewName() : null);
|
this.printer.printValue("View name", (mav != null) ? mav.getViewName() : null);
|
||||||
this.printer.printValue("View", (mav != null) ? mav.getView() : null);
|
this.printer.printValue("View", (mav != null) ? mav.getView() : null);
|
||||||
if (mav == null || mav.getModel().size() == 0) {
|
if (mav == null || mav.getModel().isEmpty()) {
|
||||||
this.printer.printValue("Model", null);
|
this.printer.printValue("Model", null);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2022 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -65,7 +65,8 @@ public class ModelMethodProcessor implements HandlerMethodArgumentResolver, Hand
|
||||||
if (returnValue == null) {
|
if (returnValue == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (returnValue instanceof Model model) {
|
|
||||||
|
if (returnValue instanceof Model model) {
|
||||||
mavContainer.addAllAttributes(model.asMap());
|
mavContainer.addAllAttributes(model.asMap());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue