AnObsoleteEventMessageSet class isObsolete = true

Lic. Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Thu Aug 18 12:22:58 UTC 2005


Ralph:

Backup your working image.

Open a Workspace and do SmalltalkImage current fixObsoleteReferences.
Or copy the code below and fileIn, just in case you don't have it in your
image.
Could chase a lot of obsolete safely, but not all


!SmalltalkImage methodsFor: 'image cleanup' stamp: 'edc 8/17/2005 07:53'!
fixObsoleteReferences
    | informee obsoleteBindings obsName realName realClass replace arreglar
|
"SmalltalkImage current fixObsoleteReferences"

    Preference allInstances do: [:each |
        informee _ each instVarNamed: #changeInformee.
        ((informee isKindOf: Behavior)
            and: [informee isObsolete])
            ifTrue: [
                Transcript show: each name; cr.
replace _  Smalltalk at: (informee name) ifAbsent:[].
                replace ifNotNil: [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: 'Binding: '; 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]]].

Exist a dangerous killing all process
| outputStream arreglar|
Transcript open.
    outputStream _ ReferenceStream fileNamed: 'clasesObsoletas.txt'.
arreglar _ (Smalltalk obsoleteClasses).
Transcript show: arreglar size;cr.
  1 to: arreglar size do: [:c | (arreglar at:c )
 allInstancesDo: [ :i | i becomeForward: nil].
(arreglar at:c ) printString = 'AnObsoleteUrl' ifTrue: [self halt].
outputStream nextPut: (arreglar at:c ) printString.
Transcript show: (arreglar at:c ) printString  ;cr.
(arreglar at:c )  becomeForward: nil.].
outputStream close.
3 timesRepeat: [Smalltalk garbageCollect].

As chances are what your image blows, you could read 'clasesObsoletas.txt'
and guess what cause the problem.
Replace 'AnObsoleteUrl' for the last -1 class
Or change for arreglar _ (Smalltalk obsoleteClasses) reverse.
Is a very risky and boring process, but eventually you reach zero
obsoleteClasses.

Edgar




	

	
		
___________________________________________________________ 
1GB gratis, Antivirus y Antispam 
Correo Yahoo!, el mejor correo web del mundo 
http://correo.yahoo.com.ar 




More information about the Squeak-dev mailing list