cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giac...@apache.org
Subject svn commit: r472032 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java
Date Tue, 07 Nov 2006 08:42:11 GMT
Author: giacomo
Date: Tue Nov  7 00:42:10 2006
New Revision: 472032

URL: http://svn.apache.org/viewvc?view=rev&rev=472032
Log:
seems JCI needs a store anyway to prevent it from NPE

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java?view=diff&rev=472032&r1=472031&r2=472032
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java
Tue Nov  7 00:42:10 2006
@@ -142,17 +142,18 @@
     
     /**
      * If a store node is configured in the class-dir/src-dir configuration, 
-     * let's configure the store; the default one is the JCI MemoryStore
+     * let's configure the store; if no store node is configured add a default;
+     * the default one is the JCI MemoryStore
      */
     private static void configureStore(ReloadingClassLoaderConfiguration configBean,
                                        String                            dirUri,
                                        Configuration                     storeConfig)
     throws Exception {
-        if (storeConfig != null) {
-            final String storeClassName = storeConfig.getAttribute("class","org.apache.commons.jci.stores.MemoryResourceStore");
-            final ResourceStore store = (ResourceStore)Class.forName(storeClassName).newInstance();
-            final URL url = new URL(dirUri);
-            configBean.addStore(url.getFile(),store);
-        }
+        final String storeClassName = (storeConfig != null 
+            ? storeConfig.getAttribute("class","org.apache.commons.jci.stores.MemoryResourceStore")
+                : "org.apache.commons.jci.stores.MemoryResourceStore");
+        final ResourceStore store = (ResourceStore)Class.forName(storeClassName).newInstance();
+        final URL url = new URL(dirUri);
+        configBean.addStore(url.getFile(),store);
     }
 }



Mime
View raw message