Some very simple improvements regarding ArrayList

This commit is contained in:
stsypanov
2019-02-14 18:31:27 +02:00
committed by Juergen Hoeller
parent 5e0cd9fb60
commit 92053bb84e
4 changed files with 12 additions and 11 deletions

View File

@@ -317,8 +317,7 @@ public class ErrorsTag extends AbstractHtmlElementBodyTag implements BodyTag {
*/
@Override
protected void exposeAttributes() throws JspException {
List<String> errorMessages = new ArrayList<>();
errorMessages.addAll(Arrays.asList(getBindStatus().getErrorMessages()));
List<String> errorMessages = new ArrayList<>(Arrays.asList(getBindStatus().getErrorMessages()));
this.oldMessages = this.pageContext.getAttribute(MESSAGES_ATTRIBUTE, PageContext.PAGE_SCOPE);
this.pageContext.setAttribute(MESSAGES_ATTRIBUTE, errorMessages, PageContext.PAGE_SCOPE);
this.errorMessagesWereExposed = true;