commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r426227 - in /jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration: AbstractConfiguration.java PropertiesConfiguration.java tree/ViewNode.java
Date Thu, 27 Jul 2006 20:17:15 GMT
Author: oheger
Date: Thu Jul 27 13:17:14 2006
New Revision: 426227

URL: http://svn.apache.org/viewvc?rev=426227&view=rev
Log:
Fixed some problems reported by findbugs

Modified:
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/tree/ViewNode.java

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java?rev=426227&r1=426226&r2=426227&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
(original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
Thu Jul 27 13:17:14 2006
@@ -1049,7 +1049,7 @@
             else if (value instanceof boolean[])
             {
                 boolean[] array = (boolean[]) value;
-                value = array.length == 0 ? null : new Boolean(array[0]);
+                value = array.length == 0 ? null : array[0] ? Boolean.TRUE : Boolean.FALSE;
             }
             else if (value instanceof byte[])
             {

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java?rev=426227&r1=426226&r2=426227&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java
(original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java
Thu Jul 27 13:17:14 2006
@@ -338,7 +338,7 @@
      * layout object will be created
      * @since 1.3
      */
-    public void setLayout(PropertiesConfigurationLayout layout)
+    public synchronized void setLayout(PropertiesConfigurationLayout layout)
     {
         this.layout = layout;
     }

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/tree/ViewNode.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/tree/ViewNode.java?rev=426227&r1=426226&r2=426227&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/tree/ViewNode.java
(original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/tree/ViewNode.java
Thu Jul 27 13:17:14 2006
@@ -52,9 +52,13 @@
         if (attr != null)
         {
             parent = attr.getParentNode();
+            super.addAttribute(attr);
+            attr.setParentNode(parent);
+        }
+        else
+        {
+            throw new IllegalArgumentException("Attribute node must not be null!");
         }
-        super.addAttribute(attr);
-        attr.setParentNode(parent);
     }
 
     /**
@@ -70,9 +74,13 @@
         if (child != null)
         {
             parent = child.getParentNode();
+            super.addChild(child);
+            child.setParentNode(parent);
+        }
+        else
+        {
+            throw new IllegalArgumentException("Child node must not be null!");
         }
-        super.addChild(child);
-        child.setParentNode(parent);
     }
 
     /**



---------------------------------------------------------------------
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