On 5/11/05, David Easley <[EMAIL PROTECTED]> wrote:

> I expected my case to go south of the else clause but instead it went north
> and used the 3 param version of _infoFactory.createCollection which always
> uses the default collection type.

I'm experiencing the same behavior with my test case and it's due to
the fact that the xmlType in this snippet (line 244):

        XMLType xmlType = component.getXMLType();

is not able to be retreived. Therefore the code block wrapped in this
condition:

        if (xmlType != null) {

is never entered causing the boolean named simpleTypeCollection is
never set to true hence the lack of recognition of the collection
type.

> Here's a very suspicious code snippet I noticed along the way:
> 
> org.exolab.castor.builder.FieldInfoFactory:
> 117    public CollectionInfo createCollection
> 118        (XSType contentType, String name, String elementName, String
> collectionName)
> 119    {
> 120
> 121        String temp = collectionName;
> 122        if (temp == null || temp.length() >0)
> 123            temp = _default;
> 124
> 125        CollectionInfo cInfo = null;
> 126        if (temp.equals(VECTOR)) {
> 127             cInfo = new CollectionInfo(contentType,name,elementName);
> 128        } else if (temp.equals(ARRAY_LIST)) {
> 129             cInfo = new CollectionInfoJ2(contentType,name,elementName);
> 130        } else if (temp.equals(ODMG)) {
> 131             cInfo = new
> CollectionInfoODMG30(contentType,name,elementName);
> 132        }
>            ...
> 
> Surely line 122 should be:
> 
> 122        if (temp == null || temp.length() == 0)
> 
> i.e. the comment for the 121-123 block would be
> // If no collection name has been specified, use the default

Yes, this is definitely incorrect and should be patched. I can do
this, but I'd like to commit both fixes at the same time.

> I tentatively fixed this, but SourceGenerator still took no notice of the
> member element's collection attribute (collectionName and _default and both
> "vector", despite me specifying some other type in the bindings file).
> 
> So, two questions:
> 1. Does anyone know how to make SourceGenerator take any notice of the
> member element's collection attribute?

It appears that this is either a bug or a missing feature. I need
either Andrew of Keith to chime in here simply because they're more
experienced in this are of the code.

> 2. Do any Castor commiters think line 122 looks wrong?

Yes, see my comment above on this one. 

Bruce 
-- 
perl -e 'print unpack("u30","D0G)[EMAIL 
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

The Castor Project
http://www.castor.org/

Apache Geronimo
http://geronimo.apache.org/

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to