You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Pinaki Poddar (JIRA)" <ji...@apache.org> on 2008/08/02 16:07:44 UTC
[jira] Closed: (OPENJPA-457) ClassCastException in Filters.convert
[ https://issues.apache.org/jira/browse/OPENJPA-457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pinaki Poddar closed OPENJPA-457.
---------------------------------
> ClassCastException in Filters.convert
> -------------------------------------
>
> Key: OPENJPA-457
> URL: https://issues.apache.org/jira/browse/OPENJPA-457
> Project: OpenJPA
> Issue Type: Bug
> Affects Versions: 0.9.7, 1.0.0, 1.0.1
> Environment: openjpa 0.9.7, Sun JDK 1.5.0_12, MySQL 5.0.45, Ubuntu Linux 7.1
> Reporter: Anil Gangolli
> Assignee: Pinaki Poddar
> Fix For: 1.3.0
>
>
> 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.<init>(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.