geirm 01/12/06 15:55:38
Modified: src/java/org/apache/velocity/runtime/resource
ResourceManagerImpl.java
Log:
Added Dan Finkelstein <[EMAIL PROTECTED]> patch to
stop the NPE's when a resource loader name is listed
resource.loader = foo
but there are no
foo.resource.loader.xxxx
properties. The manager just ignores it and moves on to the next one
after logging a warning.
Revision Changes Path
1.2 +12 -1
jakarta-velocity/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java
Index: ResourceManagerImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ResourceManagerImpl.java 2001/11/06 03:22:00 1.1
+++ ResourceManagerImpl.java 2001/12/06 23:55:38 1.2
@@ -83,7 +83,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Paulo Gaspar</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: ResourceManagerImpl.java,v 1.1 2001/11/06 03:22:00 geirm Exp $
+ * @version $Id: ResourceManagerImpl.java,v 1.2 2001/12/06 23:55:38 geirm Exp $
*/
public class ResourceManagerImpl implements ResourceManager
{
@@ -279,6 +279,17 @@
ExtendedProperties loaderConfiguration =
rsvc.getConfiguration().subset(loaderID);
+
+ /*
+ * we can't really count on ExtendedProperties to give us an empty set
+ */
+
+ if ( loaderConfiguration == null)
+ {
+ rsvc.warn("ResourceManager : No configuration information for
resource loader named '"
+ + resourceLoaderNames.get(i) + "'. Skipping.");
+ continue;
+ }
/*
* add the loader name token to the initializer if we need it
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>