[Newbies] Re: Suspected bug when setting preferences
ncellier at ifrance.com
Thu Jul 17 20:48:40 UTC 2008
squeak414 at free.fr a écrit :
> The attached test case fails in a new sq3.10.1-7175dev08.06.1 image. (or
> 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, ...
> Am I right in thinking this is incorrect behaviour?
I tried this in a 3.10 7159 image, inspected one of the
obsoleteBehaviors and got:
self == PBBooleanPreferenceView.
PBBooleanPreferenceView. == PBBooleanPreferenceView.
self class == PBBooleanPreferenceView class.
self methodDictionary == PBBooleanPreferenceView methodDictionary.
Seems to be quite a good clone of (Smaaltalk at: #PBBooleanPreferenceView).
Let see if there is any other instance:
self class allInstances size.
Hmm, i expected at least 2, self and PBBooleanPreferenceView.
self class allInstances detect: [:e | e == self] ifNone: .
self class allInstances detect: [:e | e == PBBooleanPreferenceView]
Is it class that is lying?
There is a single implementors of class, and it is <primitive 111>...
So what? Is it allInstances that is lying?
Ah yes, Metaclass>>allInstances
thisClass class == self ifTrue:[^Array with: thisClass].
So i cannot get allInstances this way.
| inst next all |
all := OrderedCollection new.
inst := self class someInstance.
[inst == nil]
next := inst nextInstance.
all add: inst.
inst := next].
Yes indeed, 168 clones of PBBooleanPreferenceView...
We now have to figure out who created these clones, for what purpose,
before deciding if it is a bug, but it looks like a bug indeed...
More information about the Beginners