It seems there's a strange bug when deserializing a set using JiBX 1.2.1. I use
the following binding:
<binding>
<format type="org.joda.time.LocalDate"
deserializer="com.aplana.jibx.DateTimeSerializer.deserializeISOLocalDate"
serializer="com.aplana.jibx.DateTimeSerializer.serializeISOLocalDate"/>
<mapping class="com.aplana.datecalc.BusinessCalendar" abstract="true">
<value name="earlyBoundary" get-method="getEarlyBoundary"
set-method="setEarlyBoundary"
style="attribute" usage="optional"/>
<value name="lateBoundary" get-method="getEarlyBoundary"
set-method="setLateBoundary"
style="attribute" usage="optional"/>
</mapping>
<mapping name="calendar" class="com.aplana.datecalc.DefaultBusinessCalendar"
extends="com.aplana.datecalc.BusinessCalendar">
<structure map-as="com.aplana.datecalc.BusinessCalendar"/>
<collection name="holidays" get-method="getHolidays"
set-method="setHolidays"
create-type="java.util.HashSet" item-type="org.joda.time.LocalDate"
usage="optional">
<value name="date"/>
</collection>
<collection name="workingDays" get-method="getWorkingDays"
set-method="setWorkingDays"
create-type="java.util.HashSet" item-type="org.joda.time.LocalDate"
usage="optional">
<value name="date"/>
</collection>
</mapping>
</binding>
When deserializing a calendar it fails with UnsupportedOperationException in
AbstractCollection.add. The problem vanishes when changing Set to List
(ArrayList) or
when removing collection 'get' methods and changing binding direction to
'input'.
Thanks,
Oleg
_________________________________________________________________
Новая Windows 7 — найдите правильный компьютер для себя. Узнайте больше.
http://windows.microsoft.com/ru-ru/windows/shop
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users