Grokbase Groups Cayenne dev June 2006
FAQ
org.objectstyle.cayenne.property.FieldAccessor accesses private class fields with same name as relationship
------------------------------------------------------------------------------------------------------------

Key: CAY-582
URL: http://issues.apache.org/cayenne/browse/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;
declaration.
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:
http://issues.apache.org/cayenne/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedJun 28, '06 at 2:30p
activeJun 28, '06 at 2:30p
posts1
users1
websitecayenne.apache.org

1 user in discussion

Robert Zeigler (JIRA): 1 post

People

Translate

site design / logo © 2022 Grokbase