From fd8d11c7e3e8e1ea133213504399464b62266eef Mon Sep 17 00:00:00 2001 From: Qimiao Chen Date: Sun, 5 Apr 2020 02:05:19 +0800 Subject: [PATCH] Use single String instead of String[] for varargs argument Closes gh-24864 --- .../web/context/XmlWebApplicationContextTests.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/XmlWebApplicationContextTests.java b/spring-webmvc/src/test/java/org/springframework/web/context/XmlWebApplicationContextTests.java index 493928a076..aa6de67cdf 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/XmlWebApplicationContextTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/context/XmlWebApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 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. @@ -55,7 +55,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes root.getEnvironment().addActiveProfile("rootProfile1"); MockServletContext sc = new MockServletContext(""); root.setServletContext(sc); - root.setConfigLocations(new String[] {"/org/springframework/web/context/WEB-INF/applicationContext.xml"}); + root.setConfigLocations("/org/springframework/web/context/WEB-INF/applicationContext.xml"); root.addBeanFactoryPostProcessor(new BeanFactoryPostProcessor() { @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) { @@ -80,7 +80,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes wac.setParent(root); wac.setServletContext(sc); wac.setNamespace("test-servlet"); - wac.setConfigLocations(new String[] {"/org/springframework/web/context/WEB-INF/test-servlet.xml"}); + wac.setConfigLocations("/org/springframework/web/context/WEB-INF/test-servlet.xml"); wac.refresh(); return wac; } @@ -120,7 +120,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes wac.setParent(root); wac.setServletContext(sc); wac.setNamespace("testNamespace"); - wac.setConfigLocations(new String[] {"/org/springframework/web/context/WEB-INF/test-servlet.xml"}); + wac.setConfigLocations("/org/springframework/web/context/WEB-INF/test-servlet.xml"); wac.refresh(); assertThatExceptionOfType(NoSuchMessageException.class).isThrownBy(() -> wac.getMessage("someMessage", null, Locale.getDefault()));