[Newbies] Obsolete classes - I can find pointers to them, but how to get rid of them

Keith Hodges keith_hodges at yahoo.co.uk
Sat Dec 8 06:02:10 UTC 2007

Michael Davies wrote:
> Ramon Leon posted a useful utility that attempts to clean up a variety
> of common problems in an image:
> http://onsmalltalk.com/programming/smalltalk/squeak-smalltalk-image-maintenance/
> If this doesn't help, at least you know that it's not a simple problem!
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
This is some code from MC1.5 which I think is the most comprehensive
attempt to rehome obsolete instances.

this comes with extensive disclaimers



self fixAllObsoleteReferences
(SystemNavigation default obsoleteBehaviors select: [ :c | c isMeta not ])
    do: [ :obsClass |
        ([obsClass nonObsoleteClass] ifError: [ nil]) ifNotNilDo:
            [ :actualClass |
                actualClass updateInstancesFrom: obsClass.
                obsClass becomeForward: actualClass.   
                ([obsClass metaclass] ifError:[nil]) ifNotNilDo:
                    [:metaClass |
                        metaClass becomeForward: actualClass class ]]].
        SmalltalkImage current fixObsoleteReferences

More information about the Beginners mailing list