Fix breaking logic around getFilename() call

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3816 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Chris Beams 2010-12-15 17:34:31 +00:00
parent e78ced16b1
commit 5898259f1e
1 changed files with 4 additions and 5 deletions

View File

@ -180,12 +180,11 @@ public abstract class PropertiesLoaderSupport {
try {
is = location.getInputStream();
if (location instanceof AbstractFileResolvingResource) {
String filename = location.getFilename();
String filename = (location instanceof AbstractFileResolvingResource) ?
location.getFilename() : null;
if (filename != null && filename.endsWith(XML_FILE_EXTENSION)) {
this.propertiesPersister.loadFromXml(props, is);
}
}
else {
if (this.fileEncoding != null) {
this.propertiesPersister.load(props, new InputStreamReader(is, this.fileEncoding));