Consistent use of ClassUtils.toClassArray (and related polishing)

This commit is contained in:
Juergen Hoeller
2018-02-22 14:27:57 +01:00
parent caed04473e
commit 8b071633d3
20 changed files with 110 additions and 104 deletions

View File

@@ -28,6 +28,7 @@ import org.springframework.context.annotation.AnnotationConfigUtils;
import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
import org.springframework.context.annotation.ScopeMetadataResolver;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.context.ContextLoader;
@@ -207,7 +208,7 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
logger.info("Registering annotated classes: [" +
StringUtils.collectionToCommaDelimitedString(this.annotatedClasses) + "]");
}
reader.register(this.annotatedClasses.toArray(new Class<?>[this.annotatedClasses.size()]));
reader.register(ClassUtils.toClassArray(this.annotatedClasses));
}
if (!this.basePackages.isEmpty()) {