Author: wglass Date: Mon Sep 19 22:43:25 2005 New Revision: 290365 URL: http://svn.apache.org/viewcvs?rev=290365&view=rev Log: If configuration for resource loader cache is invalid, use defaults.
Patch by Daniel Rall from VELOCITY-199. Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java?rev=290365&r1=290364&r2=290365&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java Mon Sep 19 22:43:25 2005 @@ -21,6 +21,7 @@ import org.apache.velocity.runtime.RuntimeServices; import org.apache.velocity.runtime.resource.Resource; +import org.apache.velocity.runtime.resource.ResourceCacheImpl; import org.apache.velocity.exception.ResourceNotFoundException; @@ -73,14 +74,40 @@ * don't cache, and modCheckInterval irrelevant... */ - isCachingOn = configuration.getBoolean("cache", false); - modificationCheckInterval = configuration.getLong("modificationCheckInterval", 0); + try + { + isCachingOn = configuration.getBoolean("cache", false); + } + catch (Exception e) + { + isCachingOn = false; + rs.error(e.getMessage() + ": Using default of '" + isCachingOn + + '\''); + } + try + { + modificationCheckInterval = configuration.getLong("modificationCheckInterval", 0); + } + catch (Exception e) + { + modificationCheckInterval = 0; + rs.error(e.getMessage() + ": Using default of '" + + modificationCheckInterval + '\''); + } /* * this is a must! */ - - className = configuration.getString("class"); + className = ResourceCacheImpl.class.getName(); + try + { + className = configuration.getString("class", className); + } + catch (Exception e) + { + rs.error(e.getMessage() + ": Using default of '" + className + + '\''); + } } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]