Bug 48805

Informational

GemStone/S 64 Bit

3.6.2, 3.6.1, 3.6

DateAndTimes now invariant: offset: and beRounded behavior change

With the addition of special type SmallDateAndTime, instances of DateAndTime, which were previously modifiable, are now invariant. SmallDateAndTime instances, since the value is encoded in the OOP, are inherently not modifiable, and DateAndTime and SmallDateAndTime require consistent behavior.

The method offset:, which previously modified and returned the receiver, returns a new instance of DateAndTime with the new offset in v3.6. If your code expects the receiver to be modified, this may result in silent failures. Since this is an ANSI method, deprecation or error was not appropriate.

The method beRounded also modified the receiver, and will throw an invariant object error for DateAndTime and a shouldNotImplement for SmallDateAndTime. Code should use the method rounded, which returns a new instance.

There are other changes and ways DateAndTime behavior has changed in v3.6, refer to the Release Notes for v3.6 for details.


Last updated: 2/12/21