You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2009/02/28 20:56:04 UTC
svn commit: r748913 -
/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
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: ");