From dev-return-6925-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Sun Dec 02 23:32:06 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 5068 invoked from network); 2 Dec 2007 23:32:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Dec 2007 23:32:06 -0000 Received: (qmail 19287 invoked by uid 500); 2 Dec 2007 23:31:55 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 19232 invoked by uid 500); 2 Dec 2007 23:31:54 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 19223 invoked by uid 99); 2 Dec 2007 23:31:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Dec 2007 15:31:54 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Dec 2007 23:32:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 06E167141EB for ; Sun, 2 Dec 2007 15:31:43 -0800 (PST) Message-ID: <32671652.1196638303018.JavaMail.jira@brutus> Date: Sun, 2 Dec 2007 15:31:43 -0800 (PST) From: "Anil Gangolli (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-457) ClassCastException in Filters.convert MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org ClassCastException in Filters.convert ------------------------------------- Key: OPENJPA-457 URL: https://issues.apache.org/jira/browse/OPENJPA-457 Project: OpenJPA Issue Type: Bug Affects Versions: 1.0.1, 1.0.0, 0.9.7 Environment: openjpa 0.9.7, Sun JDK 1.5.0_12, MySQL 5.0.45, Ubuntu Linux 7.1 Reporter: Anil Gangolli I am seeing this problem in 0.9.7 but examination of trunk code suggests that the same bug is still present in current trunk. The exception occurs when Filters.convert(o,type) is called with o of class String and type Long.class. This leads to a ClassCastException at line 292 where o is cast to Number. The same path seems to be reached for any type assignable from Number, except Integer.class which is handled in a separate case at line 275. Example stacktrace fragment: Caused by: java.lang.ClassCastException: java.lang.String at org.apache.openjpa.kernel.Filters.convert(Filters.java:292) at org.apache.openjpa.jdbc.kernel.exps.UnaryOp.load(UnaryOp.java:110) at org.apache.openjpa.jdbc.kernel.ProjectionResultObjectProvider.getResultObject(ProjectionResultObjectProvider.java:76) at org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:36) at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1219) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:987) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.