[squeak-dev] The Trunk: System-cwp.659.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jan 9 01:46:32 UTC 2014


Colin Putney uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-cwp.659.mcz

==================== Summary ====================

Name: System-cwp.659
Author: cwp
Time: 8 January 2014, 8:42:26.454 pm
UUID: 8c4b514d-06fc-4158-9691-bee22b1cf31e
Ancestors: System-fbs.658

Make #fixObsoleteReferences environment-aware, and handle the cases where the non-obsolete class doesn't exist. Also, don't throw an error if not all the references are removed.

=============== Diff against System-fbs.658 ===============

Item was changed:
  ----- Method: SmalltalkImage>>fixObsoleteReferences (in category 'housekeeping') -----
  fixObsoleteReferences
  	"Smalltalk fixObsoleteReferences"
  	
  
  	Smalltalk garbageCollect; garbageCollect.
  
+ 	Preference allInstances do: [:each || informee realName newInformee | 
- 	Preference allInstances do: [:each | | informee | 
  		informee := each instVarNamed: #changeInformee.
  		((informee isKindOf: Behavior)
  			and: [informee isObsolete])
  			ifTrue: [
  				Transcript show: 'Preference: '; show: each name; cr.
+ 				realName := (informee name copyReplaceAll: 'AnObsolete' with: '') asSymbol.
+ 				newInformee := (informee environment declarationOf: realName) value.
+ 				each instVarNamed: #changeInformee put: newInformee]].
- 				each instVarNamed: #changeInformee put: (Smalltalk at: (informee name copyReplaceAll: 'AnObsolete' with: '') asSymbol)]].
   
  	CompiledMethod allInstances do: [:method |
  		| obsoleteBindings |
  		obsoleteBindings := method literals select: [:literal |
  			literal isVariableBinding
  				and: [literal value isBehavior
  				and: [literal value isObsolete]]].
  		obsoleteBindings do: [:binding |
  			| obsName realName realClass |
  			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]]].
  
- 
  	Behavior flushObsoleteSubclasses.
  	Smalltalk garbageCollect; garbageCollect.
+ 	
- 	SystemNavigation default obsoleteBehaviors size > 0
- 		ifTrue: [
- 			SystemNavigation default obsoleteBehaviors inspect.
- 			self error:'Still have obsolete behaviors. See inspector'].
- 
  !



More information about the Squeak-dev mailing list