[squeak-dev] The Inbox: System-hjh.962.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Oct 9 20:07:33 UTC 2017


A new version of System was added to project The Inbox:
http://source.squeak.org/inbox/System-hjh.962.mcz

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

Name: System-hjh.962
Author: hjh
Time: 9 October 2017, 10:07:09.966808 pm
UUID: 5ebbcac7-a3c3-4c48-9ddc-c669d0498b53
Ancestors: System-dtl.961

Update  comment so that the 'finger print'

     #layoutMorphbosfcepcbbochvimol0

refers to an exiting method in method category

    '*Morphic-conversion'

Reformatted code and renamed 
    sel
to
    selector

=============== Diff against System-dtl.961 ===============

Item was changed:
  ----- Method: SmartRefStream>>mapClass: (in category 'read write') -----
+ mapClass: incoming 
+ 	"See if the old class named nm exists. If so, return it. If not, map it to a
+ 	new class, and save the mapping in renamed. "
+ 	
+ 	| cls oldVer selector nm |
+ 	
+ 	self flag: #bobconv.
+ 	nm := renamed
+ 				at: incoming
+ 				ifAbsent: [incoming].
- mapClass: incoming
- 	"See if the old class named nm exists.  If so, return it.  If not, map it to a new class, and save the mapping in renamed.  "
  
+ 	"allow pre-mapping around collisions"
+ 	(nm endsWith: ' class')
+ 		ifTrue: [cls := Smalltalk
+ 						at: nm substrings first asSymbol
+ 						ifAbsent: [].
+ 			cls
+ 				ifNotNil: [^ cls class]]
+ 		ifFalse: [cls := Smalltalk
+ 						at: nm
+ 						ifAbsent: [].
+ 			cls
+ 				ifNotNil: [^ cls]
+ 			"Known class. It will know how to translate the instance."].
- 	| cls oldVer sel nm |
  
+ 	"Known class. It will know how to translate the instance."
+ 	oldVer := self
+ 				versionSymbol: (structures at: nm).
+ 	selector := nm asString.
+ 	selector at: 1 put: (selector at: 1) asLowercase.
+ 	selector := selector , oldVer.
+ 	"i.e. #layoutMorphbosfcepcbbochvimol0"
- 	self flag: #bobconv.	
  
+ 	Symbol
+ 		hasInterned: selector
+ 		ifTrue: [:symb | (self class canUnderstand: selector asSymbol)
+ 				ifTrue: [reshaped
+ 						ifNil: [reshaped := Dictionary new].
+ 					cls := self perform: selector asSymbol]].
  
+ 	"This class will take responsibility"
+ 	cls
+ 		ifNil: [cls := self
+ 						writeClassRenameMethod: selector
+ 						was: nm
+ 						fromInstVars: (structures at: nm).
+ 			cls isString
+ 				ifTrue: [cls := nil]].
+ 	cls
+ 		ifNotNil: [renamed at: nm put: cls name].
+ 	^ cls!
- 	nm := renamed at: incoming ifAbsent: [incoming].	"allow pre-mapping around collisions"
- 	(nm endsWith: ' class') 
- 		ifFalse: [cls := Smalltalk at: nm ifAbsent: [nil].
- 			cls ifNotNil: [^ cls]]  	"Known class.  It will know how to translate the instance."
- 		ifTrue: [cls := Smalltalk at: nm substrings first asSymbol ifAbsent: [nil].
- 			cls ifNotNil: [^ cls class]]. 	"Known class.  It will know how to translate the instance."
- 	oldVer := self versionSymbol: (structures at: nm).
- 	sel := nm asString.
- 	sel at: 1 put: (sel at: 1) asLowercase.
- 	sel := sel, oldVer.	"i.e. #rectangleoc4"
- 	Symbol hasInterned: sel ifTrue: [:symb | 
- 		(self class canUnderstand: sel asSymbol) ifTrue: [
- 			reshaped ifNil: [reshaped := Dictionary new].
- 			cls := self perform: sel asSymbol]].	"This class will take responsibility"
- 	cls ifNil: [cls := self writeClassRenameMethod: sel was: nm
- 					fromInstVars: (structures at: nm).
- 			   cls isString ifTrue: [cls := nil]].
- 	cls ifNotNil: [renamed at: nm put: cls name].
- 	^ cls
- !



More information about the Squeak-dev mailing list