From f105670cecaa951e829e96a8296b62029fc6af6e Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Wed, 15 Dec 2010 17:34:31 +0000 Subject: [PATCH] Fix breaking logic around getFilename() call --- .../core/io/support/PropertiesLoaderSupport.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/org.springframework.core/src/main/java/org/springframework/core/io/support/PropertiesLoaderSupport.java b/org.springframework.core/src/main/java/org/springframework/core/io/support/PropertiesLoaderSupport.java index 97b37690d4..e4b4147a40 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/io/support/PropertiesLoaderSupport.java +++ b/org.springframework.core/src/main/java/org/springframework/core/io/support/PropertiesLoaderSupport.java @@ -180,11 +180,10 @@ public abstract class PropertiesLoaderSupport { try { is = location.getInputStream(); - if (location instanceof AbstractFileResolvingResource) { - String filename = location.getFilename(); - if (filename != null && filename.endsWith(XML_FILE_EXTENSION)) { - this.propertiesPersister.loadFromXml(props, is); - } + 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) {