commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] Commented: (BETWIXT-55) Suppress Empty Collection Wrapper Elements
Date Fri, 22 Sep 2006 23:50:23 GMT
    [ ] 
Henri Yandell commented on BETWIXT-55:

Thanks Jesse, getting closer :)  

Could you repeat with 'diff -u'? That creates a patch that the patch command will accept.
I figure it's better to put you through this now so any future patches are nice and easy for
people than to try and hack the change by hand and risk introducing mistakes (I'm not very
into betwixt, but quite happy to dig in a little and understand/apply a patch).

> Suppress Empty Collection Wrapper Elements
> ------------------------------------------
>                 Key: BETWIXT-55
>                 URL:
>             Project: Commons Betwixt
>          Issue Type: Improvement
>         Environment: N/A
>            Reporter: Jesse Sweetland
>            Priority: Trivial
>         Attachments:,
> Attached is a patch that modifies the isEmptyElement method of AbstractBeanWriter to
consider collective element descriptors as empty if the collection properties they reference
have no elements.  This suppresses the output of empty wrapper elements.  For example, consider
the following .betwixt file for class Foo:
> <info> 
>   <element name="foo"> 
>     <element name="bars"> 
>       <element name="bar" property="bars"/> 
>     </element> 
>     <addDefaults/> 
>   </element> 
> </info> 
> Under Betwixt 0.7, an empty <bars/> element is written even if Foo.getBars() returns
a null or empty collection.  This patch determines that the collection descriptor for the
<bar> element is empty, so all of the children elements of the <bars> wrapper
element descriptor are empty, so the <bars> element descriptor itself is empty, and
is therefore ignored.

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:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message