Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
Closes gh-33681
  • Loading branch information
ngocnhan-tran1996 authored and sdeleuze committed Oct 14, 2024
1 parent 5bcce17 commit e191c34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ public Collection<V> values() {
Collection<V> values = this.values;
if (values == null) {
Collection<List<V>> targetValues = this.targetMap.values();
values = new AbstractCollection<V>() {
values = new AbstractCollection<>() {
@Override
public Iterator<V> iterator() {
Iterator<List<V>> targetIterator = targetValues.iterator();
return new Iterator<V>() {
return new Iterator<>() {
@Override
public boolean hasNext() {
return targetIterator.hasNext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected void printResolvedException(@Nullable Exception resolvedException) thr
protected void printModelAndView(@Nullable ModelAndView mav) throws Exception {
this.printer.printValue("View name", (mav != null) ? mav.getViewName() : 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);
}
else {
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,7 +65,8 @@ public void handleReturnValue(@Nullable Object returnValue, MethodParameter retu
if (returnValue == null) {
return;
}
else if (returnValue instanceof Model model) {

if (returnValue instanceof Model model) {
mavContainer.addAllAttributes(model.asMap());
}
else {
Expand Down

0 comments on commit e191c34

Please sign in to comment.