ebourg      2004/06/15 04:49:25

  Modified:    configuration/src/java/org/apache/commons/configuration
                        BasePropertiesConfiguration.java
                        DOM4JConfiguration.java DOMConfiguration.java
  Log:
  Replaced the NestableRuntimeExceptions with ConfigurationRuntimeExceptions
  
  Revision  Changes    Path
  1.10      +4 -6      
jakarta-commons/configuration/src/java/org/apache/commons/configuration/BasePropertiesConfiguration.java
  
  Index: BasePropertiesConfiguration.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/BasePropertiesConfiguration.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BasePropertiesConfiguration.java  15 Jun 2004 10:12:29 -0000      1.9
  +++ BasePropertiesConfiguration.java  15 Jun 2004 11:49:25 -0000      1.10
  @@ -1,5 +1,3 @@
  -package org.apache.commons.configuration;
  -
   /*
    * Copyright 2001-2004 The Apache Software Foundation.
    *
  @@ -16,6 +14,8 @@
    * limitations under the License.
    */
   
  +package org.apache.commons.configuration;
  +
   import java.io.File;
   import java.io.FileWriter;
   import java.io.IOException;
  @@ -24,14 +24,12 @@
   import java.io.LineNumberReader;
   import java.io.Reader;
   import java.io.UnsupportedEncodingException;
  -
   import java.util.Date;
   import java.util.Iterator;
   import java.util.List;
   
   import org.apache.commons.lang.StringEscapeUtils;
   import org.apache.commons.lang.StringUtils;
  -import org.apache.commons.lang.exception.NestableRuntimeException;
   
   /**
    * loads the configuration from a properties file. <p>
  @@ -472,7 +470,7 @@
                           inUnicode = false;
                           hadSlash = false;
                       } catch (NumberFormatException nfe) {
  -                        throw new NestableRuntimeException("Unable to parse unicode 
value: " + unicode, nfe);
  +                        throw new ConfigurationRuntimeException("Unable to parse 
unicode value: " + unicode, nfe);
                       }
                   }
                   continue;
  
  
  
  1.6       +10 -7     
jakarta-commons/configuration/src/java/org/apache/commons/configuration/DOM4JConfiguration.java
  
  Index: DOM4JConfiguration.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/DOM4JConfiguration.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DOM4JConfiguration.java   3 Jun 2004 16:13:32 -0000       1.5
  +++ DOM4JConfiguration.java   15 Jun 2004 11:49:25 -0000      1.6
  @@ -1,5 +1,3 @@
  -package org.apache.commons.configuration;
  -
   /*
    * Copyright 2004 The Apache Software Foundation.
    *
  @@ -16,6 +14,8 @@
    * limitations under the License.
    */
   
  +package org.apache.commons.configuration;
  +
   import java.io.BufferedOutputStream;
   import java.io.File;
   import java.io.FileOutputStream;
  @@ -26,6 +26,7 @@
   import java.util.Iterator;
   import java.util.List;
   
  +import org.apache.commons.lang.StringUtils;
   import org.dom4j.Attribute;
   import org.dom4j.Document;
   import org.dom4j.DocumentException;
  @@ -34,9 +35,6 @@
   import org.dom4j.io.SAXReader;
   import org.dom4j.io.XMLWriter;
   
  -import org.apache.commons.lang.StringUtils;
  -import org.apache.commons.lang.exception.NestableRuntimeException;
  -
   /**
    * Reads a XML configuration file.
    *
  @@ -48,6 +46,10 @@
    * changes to disk, unless <code>autoSave=true</code>.
    *
    * @since 0.8.1
  + *
  + * @author <a href="mailto:[EMAIL PROTECTED]">Kelvin Tan</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
  + * @version $Revision$, $Date$
    */
   public class DOM4JConfiguration extends XMLConfiguration
   {
  @@ -287,7 +289,7 @@
       }
   
       /**
  -     * @throws 
  +     * Save the configuration if the automatic persistence is enabled.
        */
       private void possiblySave()
       {
  @@ -299,13 +301,14 @@
               }
               catch (ConfigurationException ce)
               {
  -                throw new NestableRuntimeException("Failed to auto-save", ce);
  +                throw new ConfigurationRuntimeException("Failed to auto-save", ce);
               }
           }
       }
   
       /**
        * If true, changes are automatically persisted.
  +     *
        * @param autoSave
        */
       public void setAutoSave(boolean autoSave)
  
  
  
  1.3       +10 -8     
jakarta-commons/configuration/src/java/org/apache/commons/configuration/DOMConfiguration.java
  
  Index: DOMConfiguration.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/DOMConfiguration.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMConfiguration.java     3 Jun 2004 16:13:32 -0000       1.2
  +++ DOMConfiguration.java     15 Jun 2004 11:49:25 -0000      1.3
  @@ -1,5 +1,3 @@
  -package org.apache.commons.configuration;
  -
   /*
    * Copyright 2004 The Apache Software Foundation.
    *
  @@ -16,26 +14,24 @@
    * limitations under the License.
    */
   
  +package org.apache.commons.configuration;
  +
   import java.io.File;
   import java.io.FileWriter;
   import java.io.IOException;
   import java.net.URL;
  -
   import javax.xml.parsers.DocumentBuilder;
   import javax.xml.parsers.DocumentBuilderFactory;
   import javax.xml.parsers.FactoryConfigurationError;
   import javax.xml.parsers.ParserConfigurationException;
   
   import org.apache.commons.lang.StringUtils;
  -import org.apache.commons.lang.exception.NestableRuntimeException;
  -
   import org.w3c.dom.Attr;
   import org.w3c.dom.CharacterData;
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
   import org.w3c.dom.NamedNodeMap;
   import org.w3c.dom.NodeList;
  -
   import org.xml.sax.SAXException;
   
   /**
  @@ -48,7 +44,10 @@
    * Setting property values will <b>NOT</b> automatically persist
    * changes to disk, unless <code>autoSave=true</code>.
    *
  - * @since commons-configuragtion 1.0
  + * @since commons-configuration 1.0
  + *
  + * @author Jörg Schaible
  + * @version $Revision$, $Date$
    */
   public class DOMConfiguration extends XMLConfiguration
   {
  @@ -359,6 +358,9 @@
           }
       }
   
  +    /**
  +     * Save the configuration if the automatic persistence is enabled.
  +     */
       private void possiblySave()
       {
           if (autoSave)
  @@ -369,7 +371,7 @@
               }
               catch (ConfigurationException ce)
               {
  -                throw new NestableRuntimeException("Failed to auto-save", ce);
  +                throw new ConfigurationRuntimeException("Failed to auto-save", ce);
               }
           }
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to