java.util.Calendar is modifiable, so I think it's a bad idea to let the user set a Calendar value in IDatatypeAware: <https://code.google.com/p/majortom/source/browse/majortom-api/src/main/java/de/topicmapslab/majortom/model/core/IDatatypeAware.java#101>
Comment #1
Posted on Jul 28, 2010 by Happy DogIf IGeoCoordinate and IGeoSurface is also modifiable (I don't know what the parse(String) method does exactly), I'd avoid these datatypes as well.
Or remove parse(String) from IGeoXXX and make it immutable.
Comment #2
Posted on Jul 29, 2010 by Happy BearIGeoXXX replaced by immutable Wgs84XXX
We decide to keep Calendar.
Comment #3
Posted on Jul 29, 2010 by Happy DogACK. I still think, keeping Calendar is dangerous:
final Calendar cal = Calendar.getInstance();
occ.setValue(cal);
cal.set(Calendar.MONTH, 1);
==> The changed value is neither recognized by the occurrence nor by the literal index nor by any event listener
Comment #4
Posted on Jul 29, 2010 by Happy BearThats true,
if we clone the calendar object at setValue() calls, we can avoid something like this.
We will fix that.
Comment #5
Posted on Aug 11, 2010 by Happy Bearcalendar objects are cloned if the objects are used as values of an occurrence or variant.
the getter-methods also return only a clone never the real object, any modifcations of the calendar objects keep unrecognized by the occurrence
Status: Fixed
Labels:
Type-Defect
Priority-Medium