From b65984a0782c96e1799475ebaed45b5ed4a908c6 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 16 Sep 2019 14:35:00 +0200 Subject: [PATCH] Consume getProtocolResolvers() rather than internal list This commit makes sure that DefaultResourceLoader consistently use getProtocolResolvers() to access additional protocol resolvers. This allows subclasses to define how the list is provided. Closes gh-23564 --- .../org/springframework/core/io/DefaultResourceLoader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/io/DefaultResourceLoader.java b/spring-core/src/main/java/org/springframework/core/io/DefaultResourceLoader.java index 5b078492b28..936c1d3e50f 100644 --- a/spring-core/src/main/java/org/springframework/core/io/DefaultResourceLoader.java +++ b/spring-core/src/main/java/org/springframework/core/io/DefaultResourceLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2019 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. @@ -144,7 +144,7 @@ public class DefaultResourceLoader implements ResourceLoader { public Resource getResource(String location) { Assert.notNull(location, "Location must not be null"); - for (ProtocolResolver protocolResolver : this.protocolResolvers) { + for (ProtocolResolver protocolResolver : getProtocolResolvers()) { Resource resource = protocolResolver.resolve(location, this); if (resource != null) { return resource;