Bug 35805

Critical

GemStone/S

6.1.6, 6.1.5, 6.1.x, 6.0.x, 5.1.5.1

All

6.2

Activate of passivated structures with ScaledDecimals or Fractions

If object graphs contain ScaledDecimals or Fractions that have LargePostiveInteger or LargeNegativeInteger components, they
will not correctly activate from the passivated form.  They may
activate as incorrect values, or get constraint violations.

Workaround

The following methods fix the problem.  File in as SystemUser and
commit.

category: 'Storing and Loading'
classmethod: ScaledDecimal class
loadFrom: passiveObj

"Reads from passiveObj the passive form of an object.  Converts the object to
its active form by loading the information into a new instance of the receiver.
Returns the new instance."

| inst num den scale marker |

marker := passiveObj objectPositionMarker.

passiveObj readNamedIV.
num := passiveObj ivValue.
passiveObj readNamedIV.
den := passiveObj ivValue.
passiveObj readNamedIV.
scale := passiveObj ivValue.

passiveObj skipNamedInstVars.

inst := self numerator: num denominator: den scale: scale.
passiveObj hasRead: inst marker: marker.
^inst.
%

category: 'Storing and Loading'
classmethod: Fraction class
loadFrom: passiveObj

"Reads from passiveObj the passive form of an object.  Converts the object to
its active form by loading the information into a new instance of the receiver.
Returns the new instance."

| inst num den marker |

marker := passiveObj objectPositionMarker.

passiveObj readNamedIV.
num := passiveObj ivValue.
passiveObj readNamedIV.
den := passiveObj ivValue.

passiveObj skipNamedInstVars.

inst := self numerator: num denominator: den.
passiveObj hasRead: inst marker: marker.
^inst.
%


Last updated: 11/2/07