Grokbase Groups Cayenne dev June 2006
FAQ accesses private class fields with same name as relationship

Key: CAY-582
Project: Cayenne
Type: Bug

Components: Cayenne Core Library
Versions: 1.2
Environment: Debian Linux (unstable), sun's jdk 1.5.0_06, cayenne version 1.2RC2 (presumably any version after dropping beanutils dependency)
Reporter: Robert Zeigler
Priority: Minor

In any event, here is the situation where the invalid access occurs:
X has a to-many relationship to Y. Z also has a to-many relationship to Y.
Y has a to-many relationship named k, and also has a private List k;
xinstance, zinstance , and yinstance are instances of X, Z and Y,
respectively, and xinstance and zinstance share a yinstance.
X loads its list of Y via xinstance.getY(). xinstance does some
processing that results in
k's initialization in the shared yinstance. zinstance now does
zinstance.getY() and attempts to perform some operation on the list
(size(), get(0), iterator(), etc... something that forces cayenne to
fault the toManyList). While processing the shared yinstance, cayenne
will choke with a ClassCastException because it will see the private
variable k (now initialized, eg, to an ArrayList) rather than the
relationship with the same name.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
postedJun 28, '06 at 2:30p
activeJun 28, '06 at 2:30p

1 user in discussion

Robert Zeigler (JIRA): 1 post



site design / logo © 2022 Grokbase