Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1C0D7C5A for ; Fri, 16 Sep 2011 22:17:50 +0000 (UTC) Received: (qmail 59900 invoked by uid 500); 16 Sep 2011 22:17:50 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 59840 invoked by uid 500); 16 Sep 2011 22:17:50 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 59833 invoked by uid 99); 16 Sep 2011 22:17:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Sep 2011 22:17:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Sep 2011 22:17:49 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5391B23888E4 for ; Fri, 16 Sep 2011 22:17:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1171827 - /commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java Date: Fri, 16 Sep 2011 22:17:29 -0000 To: commits@commons.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20110916221729.5391B23888E4@eris.apache.org> 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 nullMethods = new HashMap(); + /** + * 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]); } }