From f1fc74c4ec8346904e915eb7b5d5b08eedfe4840 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 21 Jul 2016 14:06:30 +0200 Subject: [PATCH] ResourcePatternUtils.getResourcePatternResolver actually accepts null argument Issue: SPR-14500 (cherry picked from commit 8ccfdbb) --- .../core/io/support/ResourcePatternUtils.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/io/support/ResourcePatternUtils.java b/spring-core/src/main/java/org/springframework/core/io/support/ResourcePatternUtils.java index 9c0c12eecd1..e9721a95172 100644 --- a/spring-core/src/main/java/org/springframework/core/io/support/ResourcePatternUtils.java +++ b/spring-core/src/main/java/org/springframework/core/io/support/ResourcePatternUtils.java @@ -1,5 +1,5 @@ /* - * 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}. * *

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; }