officialClass and isSystemDefined are two unnecessary methods. The .cs attached to this issue remove these methods and take care of the callers. I added an entry to the google code website and I provide a change set file to clean. #1075 http://code.google.com/p/pharo/issues/detail?id=1075 The following demonstrates that no impact is expected from loading the clean. In a fresh 10401, the method #isSystemDefined always return true. To be convinced: (Smalltalk allClasses select: [:cls | cls isSystemDefined not]) isEmpty => true (Smalltalk allClasses select: [:cls | cls class isSystemDefined not]) isEmpty => true This is normal, since isSystemDefined is defined as follows: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Class>>isSystemDefined "Answer true if the receiver is a system-defined class, and not a UniClass (an instance- specific lightweight class)" ^ self == self officialClass MetaClass>>isSystemDefined "Answer false if I am a UniClass (an instance-specific lightweight class)" ^ true Class>>officialClass "I am not a UniClass. (See Player officialClass). Return the class you use to make new subclasses." ^ self MetaClass>>officialClass "We want to make a new instance of the receiver, which is a subclass of MorphicModel. Answer who to make a new subclass of. Also used to tell if a given class is a UniClass, existing only for its single instance." ^ self name last isDigit ifTrue: [MorphicModel] ifFalse: [self] "MorphicModel7 can not have subclasses, but Slider and SystemWindow may" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= When #officialClass is sent to a class, the receiver is always returned. (MorphicModel allSubclasses select: [:cls | cls name last isDigit]) isEmpty => true Before loading the clean, in a fresh 10410 you had: 7124 run, 7102 passes, 4 expected failures, 16 failures, 2 errors, 0 unexpected passes These figures do not change after having loaded the clean. Cheers, Alexandre On 18 Aug 2009, at 16:52, Stéphane Ducasse wrote:
did you got a cs for fixing that? Else could you just log that as a bug entry for 1.1 Stef
On Aug 11, 2009, at 4:04 PM, Alexandre Bergel wrote:
Dear List members,
The following method is defined in Class: -=-=-=-=-=-=-=-=-= Class>>isSystemDefined "Answer true if the receiver is a system-defined class, and not a UniClass (an instance-specific lightweight class)"
^ self == self officialClass -=-=-=-=-=-=-=-=-=
isSystemDefined is sent a number of times. Especially by streams. I guess that this determines what should be serialized what should not.
However, #officialClass has only two implementers:
-=-=-=-=-=-=-=-=-= Class>>officialClass "I am not a UniClass. (See Player officialClass). Return the class you use to make new subclasses."
^ self -=-=-=-=-=-=-=-=-=
And slightly more surprising:
-=-=-=-=-=-=-=-=-= MorphicModel>>officialClass "We want to make a new instance of the receiver, which is a subclass of MorphicModel. Answer who to make a new subclass of. Also used to tell if a given class is a UniClass, existing only for its single instance."
^ self name last isDigit ifTrue: [MorphicModel] ifFalse: [self] "MorphicModel7 can not have subclasses, but Slider and SystemWindow may" -=-=-=-=-=-=-=-=-=
There is a very strong smell for cleaning here. Apparently, most of usage of #isSystemDefined could be replaced by #isBehavior
Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.