commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ep...@apache.org
Subject cvs commit: jakarta-commons/configuration/src/java/org/apache/commons/configuration HierarchicalConfiguration.java PropertiesConfiguration.java ConfigurationUtils.java BasePropertiesConfiguration.java
Date Sun, 28 Mar 2004 14:43:04 GMT
epugh       2004/03/28 06:43:04

  Modified:    configuration/src/java/org/apache/commons/configuration
                        HierarchicalConfiguration.java
                        PropertiesConfiguration.java
                        ConfigurationUtils.java
                        BasePropertiesConfiguration.java
  Log:
  Fixes suggested by findbugs
  
  Revision  Changes    Path
  1.6       +2 -8      jakarta-commons/configuration/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
  
  Index: HierarchicalConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HierarchicalConfiguration.java	13 Mar 2004 17:04:04 -0000	1.5
  +++ HierarchicalConfiguration.java	28 Mar 2004 14:43:04 -0000	1.6
  @@ -322,13 +322,7 @@
                   {
                       result.getRoot().addChild((Node) children.get(i));
                   } /* for */
  -            } /* if */
  -            else
  -            {
  -                // In this case we cannot shorten the key because only
  -                // values are found without further child nodes.
  -                // result.getRoot().addChild(visitor.getClone());
  -            } /* else */
  +            } /* if */           
           } /* for */
   
           return (result.isEmpty()) ? new HierarchicalConfiguration() : result;
  
  
  
  1.5       +2 -6      jakarta-commons/configuration/src/java/org/apache/commons/configuration/PropertiesConfiguration.java
  
  Index: PropertiesConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/PropertiesConfiguration.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PropertiesConfiguration.java	27 Feb 2004 17:41:35 -0000	1.4
  +++ PropertiesConfiguration.java	28 Mar 2004 14:43:04 -0000	1.5
  @@ -21,9 +21,6 @@
   import java.net.MalformedURLException;
   import java.net.URL;
   
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
  -
   import org.apache.commons.lang.StringUtils;
   
   /**
  @@ -46,8 +43,7 @@
           extends BasePropertiesConfiguration
           implements Configuration
   {
  -    /** Static logger */
  -    Log log = LogFactory.getLog(PropertiesConfiguration.class);
  +    
   
       /** File separator. */
       protected String fileSeparator = System.getProperty("file.separator");
  
  
  
  1.3       +1 -1      jakarta-commons/configuration/src/java/org/apache/commons/configuration/ConfigurationUtils.java
  
  Index: ConfigurationUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/ConfigurationUtils.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConfigurationUtils.java	27 Feb 2004 17:41:35 -0000	1.2
  +++ ConfigurationUtils.java	28 Mar 2004 14:43:04 -0000	1.3
  @@ -33,7 +33,7 @@
   public class ConfigurationUtils
   {
       /** File separator. */
  -    protected static String fileSeparator = System.getProperty("file.separator");
  +    protected static final String fileSeparator = System.getProperty("file.separator");
   
       private ConfigurationUtils()
       {
  
  
  
  1.6       +11 -2     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BasePropertiesConfiguration.java	13 Mar 2004 17:34:37 -0000	1.5
  +++ BasePropertiesConfiguration.java	28 Mar 2004 14:43:04 -0000	1.6
  @@ -229,9 +229,10 @@
       public void save(String filename)
           throws ConfigurationException
       {
  +        PropertiesWriter out = null;
           File file = new File(filename);
           try {
  -        	PropertiesWriter out = new PropertiesWriter(file);
  +        	out = new PropertiesWriter(file);
   
           	out.writeComment("written by PropertiesConfiguration");
           	out.writeComment(new Date().toString());
  @@ -246,6 +247,14 @@
           	out.close();
           }
           catch (IOException ioe){
  +            try {
  +                if (out !=null){
  +                    out.close();
  +                }
  +            }
  +            catch (IOException ioe2){
  +                
  +            }
           	throw new ConfigurationException("Could not save to file " + filename,ioe);
           }
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message