roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r230917 - in /incubator/roller/trunk/src/org/roller: business/PropertiesManagerImpl.java config/RollerRuntimeConfig.java config/runtime/RuntimeConfigDefsParser.java
Date Mon, 08 Aug 2005 22:18:31 GMT
Author: agilliland
Date: Mon Aug  8 15:18:28 2005
New Revision: 230917

URL: http://svn.apache.org/viewcvs?rev=230917&view=rev
Log:
adding some null checks to prevent null pointers in cases where the runtime config defs file
can't be read in properly, like running tasks outside the webapp.

Modified:
    incubator/roller/trunk/src/org/roller/business/PropertiesManagerImpl.java
    incubator/roller/trunk/src/org/roller/config/RollerRuntimeConfig.java
    incubator/roller/trunk/src/org/roller/config/runtime/RuntimeConfigDefsParser.java

Modified: incubator/roller/trunk/src/org/roller/business/PropertiesManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/PropertiesManagerImpl.java?rev=230917&r1=230916&r2=230917&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/PropertiesManagerImpl.java (original)
+++ incubator/roller/trunk/src/org/roller/business/PropertiesManagerImpl.java Mon Aug  8 15:18:28
2005
@@ -206,6 +206,10 @@
         RuntimeConfigDefs runtimeConfigDefs = 
                 RollerRuntimeConfig.getRuntimeConfigDefs();
         
+        // can't do initialization without our config defs
+        if(runtimeConfigDefs == null)
+            return props;
+        
         // iterator through all the definitions and add properties
         // that are not already in our props map
         ConfigDef configDef = null;

Modified: incubator/roller/trunk/src/org/roller/config/RollerRuntimeConfig.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/config/RollerRuntimeConfig.java?rev=230917&r1=230916&r2=230917&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/config/RollerRuntimeConfig.java (original)
+++ incubator/roller/trunk/src/org/roller/config/RollerRuntimeConfig.java Mon Aug  8 15:18:28
2005
@@ -103,7 +103,7 @@
             // unmarshall the config defs file
             try {
                 InputStream is = 
-                        RollerConfig.class.getResourceAsStream(runtime_config);
+                        RollerRuntimeConfig.class.getResourceAsStream(runtime_config);
                 
                 RuntimeConfigDefsParser parser = new RuntimeConfigDefsParser();
                 configDefs = parser.unmarshall(is);

Modified: incubator/roller/trunk/src/org/roller/config/runtime/RuntimeConfigDefsParser.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/config/runtime/RuntimeConfigDefsParser.java?rev=230917&r1=230916&r2=230917&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/config/runtime/RuntimeConfigDefsParser.java (original)
+++ incubator/roller/trunk/src/org/roller/config/runtime/RuntimeConfigDefsParser.java Mon
Aug  8 15:18:28 2005
@@ -35,6 +35,9 @@
     public RuntimeConfigDefs unmarshall(InputStream instream) 
         throws IOException, JDOMException {
         
+        if(instream == null)
+            throw new IOException("InputStream is null!");
+        
         RuntimeConfigDefs configs = new RuntimeConfigDefs();
         
         SAXBuilder builder = new SAXBuilder();



Mime
View raw message