Bug 50172

GemStone/S 64 Bit

3.6.6, 3.6.5, 3.6.4, 3.6.3, 3.6.2, 3.6.1, 3.6

3.7, 3.6.7

SmallDateAndTime passivate activate fails for years 2035 to 2072

A passivated SmallDateAndTime instance in the range from approximately 2035 to 2072 will error on activation with a ScaledDecimal issue.

This is since the activation expects the time to be a SmallScaledDecimal, and starting in 2035, the time is outside the range of SmallScaledDecimal. The range of SmallDateAndTime ends in 2072.

Workaround

The following method can be filed in as SystemUser to fix the issue:

classmethod: SmallDateAndTime
loadFrom: passiveObj
  | inst secs ofs |
  passiveObj readNamedIV.
  secs := passiveObj ivValue.
  secs isSpecial ifFalse:[ | cls | "fix 50172"
    (cls := secs class) == ScaledDecimal ifFalse:[ Error signal:'unexpected class ', cls name].
  ].
  passiveObj readNamedIV.
  ofs := passiveObj ivValue.
  ofs _isSmallInteger ifFalse:[ Error signal:'unexpected ', ofs class name ].
  passiveObj skipNamedInstVars.
  inst := self secondsUTC: secs offsetSeconds: ofs .
  inst isSpecial ifFalse:[ Error signal:'a SmallDateAndTime should be special' ].
  ^ inst
%

Last updated: 9/13/23