Skip to content

Commit e191c34

Browse files
ngocnhan-tran1996sdeleuze
authored andcommitted
Polishing
Closes gh-33681
1 parent 5bcce17 commit e191c34

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

spring-core/src/main/java/org/springframework/util/MultiToSingleValueMapAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ public Collection<V> values() {
139139
Collection<V> values = this.values;
140140
if (values == null) {
141141
Collection<List<V>> targetValues = this.targetMap.values();
142-
values = new AbstractCollection<V>() {
142+
values = new AbstractCollection<>() {
143143
@Override
144144
public Iterator<V> iterator() {
145145
Iterator<List<V>> targetIterator = targetValues.iterator();
146-
return new Iterator<V>() {
146+
return new Iterator<>() {
147147
@Override
148148
public boolean hasNext() {
149149
return targetIterator.hasNext();

spring-test/src/main/java/org/springframework/test/web/servlet/result/PrintingResultHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ protected void printResolvedException(@Nullable Exception resolvedException) thr
207207
protected void printModelAndView(@Nullable ModelAndView mav) throws Exception {
208208
this.printer.printValue("View name", (mav != null) ? mav.getViewName() : null);
209209
this.printer.printValue("View", (mav != null) ? mav.getView() : null);
210-
if (mav == null || mav.getModel().size() == 0) {
210+
if (mav == null || mav.getModel().isEmpty()) {
211211
this.printer.printValue("Model", null);
212212
}
213213
else {

spring-web/src/main/java/org/springframework/web/method/annotation/ModelMethodProcessor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -65,7 +65,8 @@ public void handleReturnValue(@Nullable Object returnValue, MethodParameter retu
6565
if (returnValue == null) {
6666
return;
6767
}
68-
else if (returnValue instanceof Model model) {
68+
69+
if (returnValue instanceof Model model) {
6970
mavContainer.addAllAttributes(model.asMap());
7071
}
7172
else {

0 commit comments

Comments
 (0)