You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by ge...@apache.org on 2001/12/07 00:55:38 UTC
cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime/resource ResourceManagerImpl.java
geirm 01/12/06 15:55:38
Modified: src/java/org/apache/velocity/runtime/resource
ResourceManagerImpl.java
Log:
Added Dan Finkelstein <da...@bluescope.com> 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:jvanzyl@apache.org">Jason van Zyl</a>
* @author <a href="mailto:paulo.gaspar@krankikom.de">Paulo Gaspar</a>
* @author <a href="mailto:geirm@optonline.net">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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>