You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Robert Zeigler <ro...@puregumption.com> on 2007/01/17 17:04:52 UTC

CAY-597?

What's the status of CAY-597? Kevin mentioned something about
intentional behavior in the comments, but there's definitely a bug there
(see my comments from last night). The gist is that, when using a
mapping file, collections fail to properly close the last element in a
list of objects, so you get behavior like:
<!-- root object has children listitem... three of them for the
demonstration purpose.  root object  also has child singletonitem -->
<root>
  <listitem>
     ...
  </listitem>
  <listitem>
    ...
   </listitem>
   <listitem>
    <singletonitem>
       ...
     </singletonitem>
  </listitem>
</root>


Note how all "listitem" elements are correct closed/nested, except the last.
Comments?  A possible fix would be to make XMLEncoder.pop protected,
instead of private, and then have SerializableEntity call pop in
encodeAsXML:
 
            if (!c.isEmpty()) {

                // push the first node, and create the rest as peers.
                Iterator it = c.iterator();
                encodeObject(encoder, it.next(), true);
                while (it.hasNext()) {
                    encodeObject(encoder, it.next(), false);
                }
                encoder.pop()<--- something like that...
            }


Robert

Re: CAY-597?

Posted by Robert Zeigler <ro...@puregumption.com>.
Great, thanks!

Robert
On Feb 4, 2007, at 2/47:45 PM , Kevin Menard wrote:

> I'm back and working through a backlog of email and other work.   
> Robert,
> I should be able to look at this in the next couple days.  I'll let  
> you
> know once I have.
>
> -- 
> Kevin
>
>> -----Original Message-----
>> From: Andrus Adamchik [mailto:andrus@objectstyle.org]
>> Sent: Thursday, January 18, 2007 5:02 AM
>> To: cayenne-dev@incubator.apache.org
>> Subject: Re: CAY-597?
>>
>> Hi Robert,
>>
>> I can't comment on the substance, but AFAIK Kevin is on
>> vacation right now, so he probably won't be able to reply for
>> the next week (or more?).
>>
>> Andrus


RE: CAY-597?

Posted by Kevin Menard <km...@servprise.com>.
I'm back and working through a backlog of email and other work.  Robert,
I should be able to look at this in the next couple days.  I'll let you
know once I have.

-- 
Kevin 

> -----Original Message-----
> From: Andrus Adamchik [mailto:andrus@objectstyle.org] 
> Sent: Thursday, January 18, 2007 5:02 AM
> To: cayenne-dev@incubator.apache.org
> Subject: Re: CAY-597?
> 
> Hi Robert,
> 
> I can't comment on the substance, but AFAIK Kevin is on 
> vacation right now, so he probably won't be able to reply for 
> the next week (or more?).
> 
> Andrus

Re: CAY-597?

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Robert,

I can't comment on the substance, but AFAIK Kevin is on vacation  
right now, so he probably won't be able to reply for the next week  
(or more?).

Andrus


On Jan 17, 2007, at 7:04 PM, Robert Zeigler wrote:

> What's the status of CAY-597? Kevin mentioned something about
> intentional behavior in the comments, but there's definitely a bug  
> there
> (see my comments from last night). The gist is that, when using a
> mapping file, collections fail to properly close the last element in a
> list of objects, so you get behavior like:
> <!-- root object has children listitem... three of them for the
> demonstration purpose.  root object  also has child singletonitem -->
> <root>
>   <listitem>
>      ...
>   </listitem>
>   <listitem>
>     ...
>    </listitem>
>    <listitem>
>     <singletonitem>
>        ...
>      </singletonitem>
>   </listitem>
> </root>
>
>
> Note how all "listitem" elements are correct closed/nested, except  
> the last.
> Comments?  A possible fix would be to make XMLEncoder.pop protected,
> instead of private, and then have SerializableEntity call pop in
> encodeAsXML:
>
>             if (!c.isEmpty()) {
>
>                 // push the first node, and create the rest as peers.
>                 Iterator it = c.iterator();
>                 encodeObject(encoder, it.next(), true);
>                 while (it.hasNext()) {
>                     encodeObject(encoder, it.next(), false);
>                 }
>                 encoder.pop()<--- something like that...
>             }
>
>
> Robert
>