[squeak-dev] The Inbox: System-kfr.1036.mcz

H. Hirzel hannes.hirzel at gmail.com
Sat Jun 23 14:02:29 UTC 2018


Adding the two lines

"make sure we don't try to convert classes not in structures to renamed classes"
renamed keysDo:[ :renamedClass | structures at: renamedClass
ifAbsent:[ renamed removeKey: renamedClass]].


to

SmartRefStream>>reshapedClassesIn:


makes a number of *.pr  (SqueakLand project files) load into Squeak
5.2a which previously did not load.  See screen shot. This does not
necessarily mean that they work, but they load without an error
message.

The instance variable 'renamed' of SmartRefStream contains a
dictionary of Classes who have a different name.

When loading a project an instance of the new class is made and a
conversion call is sent to that instance.

(old class name symbol -> new class name).


The instance variable 'structures' contains the structure of classes
(class version and order and names of instance variables written then
the *.pr file was saved

Example:

structures 	

Dictionary of (#Rectangle -> #(<classVersionInteger> 'origin' 'corner')).

Inst var names are strings.


----------------------------------------------------------------------------------
Recommendation: This fix should be moved to the trunk
----------------------------------------------------------------------------------




On Thu, 21 Jun 2018 18:49:47 0000, commits at source.squeak.org
<commits at source.squeak.org> wrote:
> A new version of System was added to project The Inbox:
> http://source.squeak.org/inbox/System-kfr.1036.mcz
>
> ==================== Summary ====================
>
> Name: System-kfr.1036
> Author: kfr
> Time: 21 June 2018, 8:49:18.217801 pm
> UUID: 4150334e-4f5f-744c-b5b7-814cef973cc0
> Ancestors: System-kfr.1035
>
> Remove classes from SmartRefStream instanceVariable renamed that not are in
> structures so we avoid false positives
>
> =============== Diff against System-kfr.1035 ===============
>
> Item was changed:
>   ----- Method: SmartRefStream>>reshapedClassesIn: (in category 'import
> image segment') -----
>   reshapedClassesIn: outPointers
>   	"Look for classes in the outPointer array that have changed shape.  Make
> a fake class for the old shape.  Return a dictionary mapping Fake classes to
> Real classes.  Substitute fake classes for real ones in outPointers."
>
>   	| mapFakeClassesToReal |
>
>   	self flag: #bobconv.	
> + 	"make sure we don't try to convert classes not in structures to renamed
> classes"
> + 	renamed keysDo:[ :renamedClass | structures at: renamedClass ifAbsent:[
> renamed removeKey: renamedClass]].
>
> -
>   	mapFakeClassesToReal := IdentityDictionary new.
>   	outPointers withIndexDo: [:outp :ind | | originalName fakeCls |
>   		outp isBehavior ifTrue: [
>   			originalName := renamed keyAtValue: outp name
>   				ifAbsent: [renamedConv at: ind ifAbsent: [outp name]].
> + 			"in DiskProxy>>comeFullyUpOnReload: we saved the name at the index"
> - 			structures at: originalName ifAbsent: [originalName := outp name].
> "check for false positives in renamed"
> - 				"in DiskProxy>>comeFullyUpOnReload: we saved the name at the index"
>   			fakeCls := self mapClass: outp origName: originalName.
>   			fakeCls == outp ifFalse: [
>   				mapFakeClassesToReal at: fakeCls put: outp.
>   				outPointers at: ind put: fakeCls]]].
>   	^ mapFakeClassesToReal!
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SmartRefStream_instanceVar_called_renamed_fix_2018-06-23.png
Type: image/png
Size: 254288 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180623/74a32787/attachment-0001.png>


More information about the Squeak-dev mailing list