[
https://issues.apache.org/jira/browse/JDO-679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Craig L Russell reassigned JDO-679:
-----------------------------------
Assignee: Craig L Russell
> Clarify downcasts in queries
> ----------------------------
>
> Key: JDO-679
> URL: https://issues.apache.org/jira/browse/JDO-679
> Project: JDO
> Issue Type: Improvement
> Components: specification
> Affects Versions: JDO 3 maintenance release 1
> Reporter: Matthew T. Adams
> Assignee: Craig L Russell
> Labels: cast, classcastexception, downcast, filter,
> jdouserexception, query
>
> The specification needs clarification when it comes to downcasting within the
> query filter. Currently, the JDO 3.0 specification states (14.6.2):
> "Navigation through a null-valued field, which would throw
> NullPointerException, is treated as if the subexpression returned false.
> Similarly, a failed cast operation, which would throw ClassCastException, is
> treated as if the subexpression returned false. Other subexpressions or other
> values for variables might still qualify the candidate instance for inclusion
> in the result set."
> The clarification is that if a cast will never be successful (casting
> Employee as Integer, for example), then an exception should be thrown
> (JDOUserException with an inner ClassCastException?), otherwise, the cast
> behaves as the specification dictates.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira