提交 f1fc74c4 编写于 作者: J Juergen Hoeller

ResourcePatternUtils.getResourcePatternResolver actually accepts null argument

Issue: SPR-14500
(cherry picked from commit 8ccfdbbc)
上级 a39276ad
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 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.
......@@ -17,12 +17,11 @@
package org.springframework.core.io.support;
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.Assert;
import org.springframework.util.ResourceUtils;
/**
* Utility class for determining whether a given URL is a resource
* location that can be loaded via a ResourcePatternResolver.
* location that can be loaded via a {@link ResourcePatternResolver}.
*
* <p>Callers will usually assume that a location is a relative path
* if the {@link #isUrl(String)} method returns {@code false}.
......@@ -59,7 +58,6 @@ public abstract class ResourcePatternUtils {
* @see PathMatchingResourcePatternResolver
*/
public static ResourcePatternResolver getResourcePatternResolver(ResourceLoader resourceLoader) {
Assert.notNull(resourceLoader, "ResourceLoader must not be null");
if (resourceLoader instanceof ResourcePatternResolver) {
return (ResourcePatternResolver) resourceLoader;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册