Author: simonetripodi
Date: Fri Sep 16 22:17:28 2011
New Revision: 1171827
URL: http://svn.apache.org/viewvc?rev=1171827&view=rev
Log:
7 is a magic number, that is 'getNull' string size
Modified:
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
Modified:
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
URL:
http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java?rev=1171827&r1=1171826&r2=1171827&view=diff
==============================================================================
---
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
(original)
+++
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
Fri Sep 16 22:17:28 2011
@@ -76,13 +76,19 @@ public class SqlNullCheckedResultSet imp
*/
private static final Map<String, Method> nullMethods = new HashMap<String,
Method>();
+ /**
+ * The {@code getNull} string prefix.
+ * @since 1.4
+ */
+ private static final String GET_NULL_PREFIX = "getNull";
+
static {
Method[] methods = SqlNullCheckedResultSet.class.getMethods();
for (int i = 0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.startsWith("getNull")) {
- String normalName = "get" + methodName.substring(7);
+ if (methodName.startsWith(GET_NULL_PREFIX)) {
+ String normalName = "get" +
methodName.substring(GET_NULL_PREFIX.length());
nullMethods.put(normalName, methods[i]);
}
}