code: public static ResourcePatternResolver getResourcePatternResolver(ResourceLoader resourceLoader) {
  		Assert.notNull(resourceLoader, "ResourceLoader must not be null");
  		if (resourceLoader instanceof ResourcePatternResolver) {
  			return (ResourcePatternResolver) resourceLoader;
  		}
  		else if (resourceLoader != null) {
  			return new PathMatchingResourcePatternResolver(resourceLoader);
  		}
  		else {
  			return new PathMatchingResourcePatternResolver();
  		}
  	}
docs: Return a default ResourcePatternResolver for the given ResourceLoader.
  <p>This might be the ResourceLoader itself, if it implements the
  ResourcePatternResolver extension, or a PathMatchingResourcePatternResolver
  built on the given ResourceLoader.
  @param resourceLoader the ResourceLoader to build a pattern resolver for
  (may be {@code null} to indicate a default ResourceLoader)
  @return the ResourcePatternResolver
  @see PathMatchingResourcePatternResolver