Skip to content

Commit a4b5425

Browse files
committed
ResourcePatternUtils.getResourcePatternResolver actually accepts null argument
Issue: SPR-14500 (cherry picked from commit f1fc74c)
1 parent 74b4dd0 commit a4b5425

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spring-core/src/main/java/org/springframework/core/io/support/ResourcePatternUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,12 +17,11 @@
1717
package org.springframework.core.io.support;
1818

1919
import org.springframework.core.io.ResourceLoader;
20-
import org.springframework.util.Assert;
2120
import org.springframework.util.ResourceUtils;
2221

2322
/**
2423
* Utility class for determining whether a given URL is a resource
25-
* location that can be loaded via a ResourcePatternResolver.
24+
* location that can be loaded via a {@link ResourcePatternResolver}.
2625
*
2726
* <p>Callers will usually assume that a location is a relative path
2827
* if the {@link #isUrl(String)} method returns {@code false}.
@@ -59,7 +58,6 @@ public static boolean isUrl(String resourceLocation) {
5958
* @see PathMatchingResourcePatternResolver
6059
*/
6160
public static ResourcePatternResolver getResourcePatternResolver(ResourceLoader resourceLoader) {
62-
Assert.notNull(resourceLoader, "ResourceLoader must not be null");
6361
if (resourceLoader instanceof ResourcePatternResolver) {
6462
return (ResourcePatternResolver) resourceLoader;
6563
}

0 commit comments

Comments
 (0)