Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004800 [Squeak] Kernel minor always 09-09-06 14:50 09-09-06 14:50
Reporter Krivanek View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 3.10
Summary 0004800: [KernelImageOverride] SmartRefStream restoreClassInstVars
Description SmartRefStream >> restoreClassInstVars

original:

restoreClassInstVars
    "Install the values of the class instance variables of UniClasses
(i.e. scripts slotInfo). classInstVars is ((#Player25 scripts slotInfo)
...). Thank you Mark Wai for the bug fix."

    | normal aName newName newCls trans rList start |

    self flag: #bobconv.


    self moreObjects ifFalse: [^ self]. "are no UniClasses with class inst vars"
    classInstVars _ super next. "Array of arrays"
    normal _ Object class instSize. "might give trouble if Player class superclass changes size"
    (structures at: #Player ifAbsent: [#()]) = #(0 'dependents' 'costume') ifTrue:
        [trans _ 1]. "now (0 costume costumes). Do the conversion of Player class
            inst vars in Update 509."
    classInstVars do: [:list |
        aName _ (list at: 1) asSymbol.
        rList _ list.
        newName _ renamed at: aName ifAbsent: [aName].
        newCls _ Smalltalk at: newName
                ifAbsent: [self error: 'UniClass definition missing'].
        ("old conversion" trans == 1 and: [newCls inheritsFrom: Player]) ifTrue: [
            "remove costumeDictionary from Player class inst vars"
            rList _ rList asOrderedCollection.
            rList removeAt: 4]. "costumeDictionary's value"
        start _ list second = 'Update to read classPool' ifTrue: [4] ifFalse: [2].
        newCls class instSize = (normal + (rList size) - start + 1) ifFalse:
            [self error: 'UniClass superclass class has changed size'].
            "Need to install a conversion method mechanism"
        start = 4 ifTrue: [newCls instVarAt: normal - 1 "classPool" put: (list at: 3)].
        start to: rList size do: [:ii |
            newCls instVarAt: normal + ii - start + 1 put: (rList at: ii)]].


override:

restoreClassInstVars
    "Install the values of the class instance variables of UniClasses
(i.e. scripts slotInfo). classInstVars is ((#Player25 scripts slotInfo)
...). Thank you Mark Wai for the bug fix."

    | normal aName newName newCls trans rList start |

    self flag: #bobconv.


    self moreObjects ifFalse: [^ self]. "are no UniClasses with class inst vars"
    classInstVars := super next. "Array of arrays"
    normal := Object class instSize. "might give trouble if Player class superclass changes size"
    (structures at: #Player ifAbsent: [#()]) = #(0 'dependents' 'costume') ifTrue:
        [trans := 1]. "now (0 costume costumes). Do the conversion of Player class
            inst vars in Update 509."
    classInstVars do: [:list |
        aName := (list at: 1) asSymbol.
        rList := list.
        newName := renamed at: aName ifAbsent: [aName].
        newCls := Smalltalk at: newName
                ifAbsent: [self error: 'UniClass definition missing'].

        start := list second = 'Update to read classPool' ifTrue: [4] ifFalse: [2].
        newCls class instSize = (normal + (rList size) - start + 1) ifFalse:
            [self error: 'UniClass superclass class has changed size'].
            "Need to install a conversion method mechanism"
        start = 4 ifTrue: [newCls instVarAt: normal - 1 "classPool" put: (list at: 3)].
        start to: rList size do: [:ii |
            newCls instVarAt: normal + ii - start + 1 put: (rList at: ii)]].


Removed eToys (Player) dependent code. Should be refactored or to be override of eToys.
Additional Information
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
09-09-06 14:50 Krivanek New Issue


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
27 total queries executed.
24 unique queries executed.
Powered by Mantis Bugtracker