Unload traits
Phase 1: Disable traits activity and stub out the instance variables that will be removed in Phase 2
Phase 2: Recompile the image with classes in the old format, ie, without the traitsComposition and localSends instance variables
[
ClassDescription subclass: #Metaclass
instanceVariableNames: 'thisClass'
classVariableNames: ' '
poolDictionaries: ' '
category: 'Kernel-Classes'.
ClassDescription subclass: #Class
instanceVariableNames: 'subclasses name classPool sharedPools environment category'
classVariableNames: ' '
poolDictionaries: ' '
category: 'Kernel-Classes'.
] on: Warning do: [:warning | warning resume].
Phase 3: Remove all traits and all references to the Traits classes from the image, including methods that refer to traits functionality
"Kill all traits" "variables are nil-ed out to prevent obsolete refs later"
Smalltalk allTraits do: [:trait | trait removeFromSystem. trait := nil].
"Recompile all methods that were part of a trait"
SystemNavigation default allBehaviorsDo: [:class | class selectorsAndMethodsDo: [:sel :method |
class ~~ method methodClass ifTrue: [class recompile: sel]. method := nil]. class := nil].
"Remove references to traits from various places in the code"
Installer installUrl: 'http://installer.pbwiki.org/f/UnloadTraits-ClearRefs.cs'.
Phase 4: Unload the Traits package and install the Traits compatability stubs for Monticello
Comments (0)
You don't have permission to comment on this page.