[utilities COMMIT] /java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ClasspathResource...

noreply at shibboleth.net noreply at shibboleth.net
Fri Jan 6 10:13:09 GMT 2012


Author: rdw
Date: Fri Jan  6 10:13:09 2012
New Revision: 192

URL: http://svn.shibboleth.net/view/utilities?rev=192&view=rev
Log:
ClasspathResource#getLocation check on initialized and hence cannot be called in the constructor

Modified:
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ClasspathResource.java

Modified: java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ClasspathResource.java
URL: http://svn.shibboleth.net/view/utilities/java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ClasspathResource.java?rev=192&r1=191&r2=192&view=diff
==============================================================================
--- java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ClasspathResource.java (original)
+++ java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ClasspathResource.java Fri Jan  6 10:13:09 2012
@@ -47,12 +47,13 @@
      * @param classLoader class loader used to locate the resource
      */
     public ClasspathResource(final String resourcePath, final ClassLoader classLoader) {
-        setLocation(Assert.isNotNull(StringSupport.trimOrNull(resourcePath), "Resource path may not be null or empty"));
+        String myLocation = Assert.isNotNull(StringSupport.trimOrNull(resourcePath), "Resource path may not be null or empty");
+        setLocation(myLocation);
 
         Assert.isNotNull(classLoader, "Resource class loader may not be null");
 
         classpathResource =
-                Assert.isNotNull(classLoader.getResource(getLocation()), "Resource " + resourcePath
+                Assert.isNotNull(classLoader.getResource(myLocation), "Resource " + resourcePath
                         + " does not exist on the classpath");
     }
 



More information about the commits mailing list