Mantis - Squeak Packages
Viewing Issue Advanced Details
7128 Squeak-Dev minor always 07-18-08 21:50 07-21-08 18:33
stan shepherd  
Damien Cassou  
normal  
assigned  
open  
none    
none  
0007128: Saving preferences creates obsolete classes
The attached test case fails in a new sq3.10.1-7175dev08.06.1 image. (or
sq3.9.1-7075dev08.07.1.image).

testPreferenceSaving
        PreferenceBrowser new saveSelected.
        Smalltalk garbageCollect.
        self should: [SystemNavigation default obsoleteBehaviors size = 0]

SystemNavigation default obsoleteBehaviors inspect actually
has 400+ entries.

Most of the entries are BooleanPreferenceView class or PBBooleanPreferenceView
class, but also other classes such as Scrollbar, UIThemeStandardSqueak, ...

It happens in
Preferences>>savePersonalPreferences
        "Save the current list of Preference settings as the user's personal choices"

        self setParameter:#PersonalDictionaryOfPreferences
                 to:self dictionaryOfPreferences deepCopy

I think during the deepCopy.
Testcase attached
 TestPreferenceSaving.st [^] (482 bytes) 07-18-08 21:50

Notes
(0012389)
Damien Cassou   
07-19-08 08:15   
I don't have enough knowledge to fix it. If you know of somebody who can please tell me. If you can fix it, please do.
(0012390)
stan shepherd   
07-19-08 14:20   
I think I incorrectly posted this to Squeak-Dev, while it should be in the main Squeak branch. Please can an admin move it?
(0012391)
wiz   
07-19-08 17:11   
Hi stan,

I have noticed also that saving preferences to disk and restoring them from the pref browser doesn't work.

I noticed this a fresh july 2008 squeak-dev.
I haven't yet checked in a basic 3.10.2 yet.

It would seem to me that this is probably a general bug rather than specific to squeak-dev.

Changing the status of the report requires someone with editing privs for squeak packages. I have edit privs but only for squeak reports they don't seem to extend to other catagories.

Yoours in curiosity and service, -Jerome Peace
(0012394)
nicolas cellier   
07-19-08 21:16   
Hi Jerome,
the bug was already in 3.8.

As stan detected deepCopy is responsible for the copy being too deep.

Replacing deepCopy with veryDeepCopy does solve the problem.
veryDeepCopy is robust to cyclic references and knows better where to stop.

deepCopy is something we should get rid of IMO...
(0012395)
wiz   
07-19-08 21:57   
Hi Nicolas,

Cool.

I had thought that the old preference browser/panel was able to save and restore preferences ok. At least I remember using it in 3.9.

Is that correct? The deep copy problem only applies to the new browser?
(0012396)
nicolas cellier   
07-21-08 18:33   
I think the fact that deepCopy creates some clone does not prevent the feature to function correctly.
Though, creating those copies:
- is probably unintentional,
- is probably useless,
- is not very clean,
 (might create obscur bugs if cloned class happened to change?),
- IMO should be corrected.