Hi Edson,

the private Method you refer to is expected to return a ManageableCollection. thus it's required to do this cast.

I don't see how this could be avoided.

The method
private ManageableCollection getCollectionByQuery(Class collectionClass, Class itemClass, Query query)
is called by


public ManageableCollection getCollectionByQuery(Class collectionClass, Query query, boolean lazy) throws PersistenceBrokerException

which is again called by
public ManageableCollection getCollectionByQuery(Class collectionClass, Query query)


The javadoc of this method states:
"Retrieve a userdefined Collection that implements the interface ManageableCollection that contains all Objects matching the Query query."


So we really rely on the fact that only ManeagbleCollections are used as collection-class entries.
But I think this has not changed for a very long time now?


cheers,
thomas


Edson Carlos Ericksson Richter wrote:
Hi! In my M:N testing work, I've discovered that class-descriptor now works
ONLY for ManageableCollections now.
This problem is caused by

    private ManageableCollection getCollectionByQuery(Class collectionClass,
Class itemClass, Query query)
      ...
            result = (ManageableCollection) collectionClass.newInstance();
     ...

in PersistenceBrokerImpl (1312).

Should not this piece of code be returning a Collection? See DTD:

" The collection-class may hold a fully qualified class name.
 This class must be the Java type of the Collection attribute.
 This attribute must only specified if the attribute type is not
 a java.util.Collection (or subclass) or Array type."

So, if we are forcing this to be a ManageableCollection, we are in trouble,
no?

Thanks for your attention.

Edson Richter



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 25/6/2003


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to