commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r748913 - /commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
Date Sat, 28 Feb 2009 19:56:04 GMT
Author: bayard
Date: Sat Feb 28 19:56:04 2009
New Revision: 748913

URL: http://svn.apache.org/viewvc?rev=748913&view=rev
Log:
Adding braces to if statements

Modified:
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java?rev=748913&r1=748912&r2=748913&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java (original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java Sat
Feb 28 19:56:04 2009
@@ -215,9 +215,10 @@
             PropertyDescriptor property = properties[i];
             Object value = null;
             Method method = property.getReadMethod();
-            if (method == null)
+            if (method == null) {
                 throw new RuntimeException("No read method for bean property "
                         + bean.getClass() + " " + property.getName());
+            }
             try {
                 value = method.invoke(bean, new Object[0]);
             } catch (InvocationTargetException e) {
@@ -259,8 +260,9 @@
         PropertyDescriptor[] sorted = new PropertyDescriptor[propertyNames.length];
         for (int i = 0; i < propertyNames.length; i++) {
             String propertyName = propertyNames[i];
-            if (propertyName == null)
+            if (propertyName == null) {
                 throw new NullPointerException("propertyName can't be null: " + i);
+            }
             boolean found = false;
             for (int j = 0; j < descriptors.length; j++) {
                 PropertyDescriptor descriptor = descriptors[j];
@@ -270,9 +272,10 @@
                     break;
                 }
             }
-            if (!found)
+            if (!found) {
                 throw new RuntimeException("Couldn't find bean property: "
                         + bean.getClass() + " " + propertyName);
+            }
         }
         fillStatementWithBean(stmt, bean, sorted);
     }
@@ -517,7 +520,9 @@
         throws SQLException {
 
         String causeMessage = cause.getMessage();
-        if (causeMessage == null) causeMessage = "";
+        if (causeMessage == null) {
+            causeMessage = "";
+        }
         StringBuffer msg = new StringBuffer(causeMessage);
 
         msg.append(" Query: ");



Mime
View raw message