'From Squeak3.8alpha of ''17 July 2004'' [latest update: #5976] on 12 August 2004 at 6:06:01 pm'! "Change Set: cleanupFixes Date: 12 August 2004 Author: Michael Rueger Fixes two discard messages, removes unneeded ones and adds a utility method for fixing obsolete class references"! !SystemDictionary methodsFor: 'shrinking' stamp: 'mir 8/3/2004 13:49'! discardFFI "Discard the complete foreign function interface. NOTE: Recreates specialObjectsArray to prevent obsolete references. Has to specially remove external structure hierarchy before ExternalType" Smalltalk at: #ExternalStructure ifPresent:[:cls| (ChangeSet superclassOrder: cls withAllSubclasses asArray) reverseDo: [:c | c removeFromSystem]]. SystemOrganization removeCategoriesMatching: 'FFI-*'. Smalltalk recreateSpecialObjectsArray. "Remove obsolete refs" ByteArray removeSelector: #asExternalPointer. ByteArray removeSelector: #pointerAt:.! ! !SystemDictionary methodsFor: 'shrinking' stamp: 'sma 6/25/2000 17:57'! discardSUnit "Smalltalk discardSUnit" | oc | oc _ OrderedCollection new. (Smalltalk at: #TestCase ifAbsent: [^ self]) allSubclassesWithLevelDo: [:c :i | oc addFirst: c] startingLevel: 0. oc do: [:c | c removeFromSystem]. SystemOrganization removeCategoriesMatching: 'SUnit-*'! ! !SystemDictionary methodsFor: 'squeakland' stamp: 'mir 5/6/2002 14:54'! fixObsoleteReferences "Smalltalk fixObsoleteReferences" | informee obsoleteBindings obsName realName realClass | Preference allInstances do: [:each | informee _ each instVarNamed: #changeInformee. ((informee isKindOf: Behavior) and: [informee isObsolete]) ifTrue: [ Transcript show: each name; cr. each instVarNamed: #changeInformee put: (Smalltalk at: (informee name copyReplaceAll: 'AnObsolete' with: '') asSymbol)]]. CompiledMethod allInstances do: [:method | obsoleteBindings _ method literals select: [:literal | literal isVariableBinding and: [literal value isBehavior] and: [literal value isObsolete]]. obsoleteBindings do: [:binding | obsName _ binding value name. Transcript show: obsName; cr. realName _ obsName copyReplaceAll: 'AnObsolete' with: ''. realClass _ Smalltalk at: realName asSymbol ifAbsent: [UndefinedObject]. binding isSpecialWriteBinding ifTrue: [binding privateSetKey: binding key value: realClass] ifFalse: [binding key: binding key value: realClass]]]. Behavior flushObsoleteSubclasses. Smalltalk garbageCollect; garbageCollect. Smalltalk obsoleteBehaviors size > 0 ifTrue: [Smalltalk obsoleteBehaviors inspect]! !