Return-Path: Delivered-To: apmail-ibatis-dev-archive@www.apache.org Received: (qmail 856 invoked from network); 1 Aug 2006 11:17:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2006 11:17:59 -0000 Received: (qmail 9859 invoked by uid 500); 1 Aug 2006 11:17:53 -0000 Delivered-To: apmail-ibatis-dev-archive@ibatis.apache.org Received: (qmail 9770 invoked by uid 500); 1 Aug 2006 11:17:52 -0000 Mailing-List: contact dev-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ibatis.apache.org Delivered-To: mailing list dev@ibatis.apache.org Received: (qmail 9603 invoked by uid 99); 1 Aug 2006 11:17:51 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 04:17:51 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 04:17:47 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E808F410017 for ; Tue, 1 Aug 2006 11:15:15 +0000 (GMT) Message-ID: <11081384.1154430915947.JavaMail.jira@brutus> Date: Tue, 1 Aug 2006 04:15:15 -0700 (PDT) From: "Larry Meadors (JIRA)" To: dev@ibatis.apache.org Subject: [jira] Closed: (IBATIS-329) capitalized name of bean's property cased error? In-Reply-To: <23335568.1154395453825.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/IBATIS-329?page=all ] Larry Meadors closed IBATIS-329. -------------------------------- > capitalized name of bean's property cased error? > ------------------------------------------------ > > Key: IBATIS-329 > URL: http://issues.apache.org/jira/browse/IBATIS-329 > Project: iBatis for Java > Issue Type: Bug > Components: SQL Maps > Affects Versions: 2.1.7 > Reporter: takaya yuko > > Hello, > Using capitalized letter on bean's property-name leads the following > error: See next stack trace & source, is this valid? > (conditions) > public class A { > /* property's name:indexOf(1) == UpperCase */ > private String eMail; > public String getEMail(){ > return eMail; > } > public void setEMail(String email) { > eMail = email; > } > } > /* use bean as resultMap */ > > javaType="java.lang.String"/> > > > SELECT > EMAIL > FROM > A_TABLE > > (results) > --- Cause: com.ibatis.common.beans.ProbeException: > There is no READABLE property named 'eMail' in class 'A' > (our resolution) > public class A { > private String eMail; > /* method'name:get + property's name */ > geteMail(){ > return EMail; > } > seteMail(String email) { > eMail = email; > } > } > iBATIS_DBL-2.1.7.597.zip (iBATIS Java 2.1.7). i suppose > that this code prevent to exchange "getter-name" to "property-name". > i took a provisional countermeasure changing "get + property-name" > (e.g: gateMail), and avoid this error now. > but i'm not sure whether this changes fits your spec or not. > could you tell me about that? > ---com.ibatis.common.beans.ClassInfo---------------------------------- > private static String dropCase(String name) { > if (name.startsWith("is")) { > name = name.substring(2); > } else if (name.startsWith("get") || name.startsWith("set")) { > name = name.substring(3); > } else { > throw new ProbeException("Error parsing property name '" > + name + "'. Didn't start with 'is', 'get' or 'set'."); > } > if (name.length() == 1 || (name.length() > 1 > && !Character.isUpperCase(name.charAt(1)))) { ---------# > name = name.substring(0, 1).toLowerCase(Locale.US) > + name.substring(1); > } > return name; > } > ---------------------------------------------------------------------- > thanks in advance, -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira