diff --git a/org.springframework.core/src/main/java/org/springframework/core/io/DefaultResourceLoader.java b/org.springframework.core/src/main/java/org/springframework/core/io/DefaultResourceLoader.java
index d422c50ed19..46b5e273aa2 100644
--- a/org.springframework.core/src/main/java/org/springframework/core/io/DefaultResourceLoader.java
+++ b/org.springframework.core/src/main/java/org/springframework/core/io/DefaultResourceLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2009 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.
@@ -74,15 +74,13 @@ public class DefaultResourceLoader implements ResourceLoader {
}
/**
- * Return the ClassLoader to load class path resources with,
- * or null if using the thread context class loader on actual access
- * (applying to the thread that constructs the ClassPathResource object).
+ * Return the ClassLoader to load class path resources with.
*
Will get passed to ClassPathResource's constructor for all
* ClassPathResource objects created by this resource loader.
* @see ClassPathResource
*/
public ClassLoader getClassLoader() {
- return this.classLoader;
+ return (this.classLoader != null ? this.classLoader : ClassUtils.getDefaultClassLoader());
}
diff --git a/org.springframework.core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java b/org.springframework.core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java
index 0756cce85a9..23a86994427 100644
--- a/org.springframework.core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java
+++ b/org.springframework.core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2009 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.
@@ -198,6 +198,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
* Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader.
* @param classLoader the ClassLoader to load classpath resources with,
* or null for using the thread context class loader
+ * at the time of actual resource access
* @see org.springframework.core.io.DefaultResourceLoader
*/
public PathMatchingResourcePatternResolver(ClassLoader classLoader) {