Trouble removing an AnObsoleteC3 Class
Bert Freudenberg
bert at freudenbergs.de
Thu Feb 1 22:44:48 UTC 2007
On Feb 1, 2007, at 18:33 , Michael Davies wrote:
> Hi all,
>
> I posted this to the beginners list, and got some help understanding
> the problem, but I didn't get to a solution - can anyone help?
>
> I was playing with the test runner and one of the tests seems to have
> left many Obsolete classes hanging around that I'm unable to remove;
> this means that I'm having problems using the Refactoring Browser. In
> order to track the classes down I followed the hints on
> http://wiki.squeak.org/squeak/2631 ; when I got to bringing up the
> Pointer Finder it said:
>
> #ProtoObject -> ProtoObject class
> subclasses: Array
> 9: AnObsoleteC3 class
>
> I inspected protoObject and the subclasses array has 105 members, many
> of them repeated:
>
> {Object . ObjectOut . ImageSegmentRootStub . MessageCatcher .
> DynamicBindingsInfo . MaMinimalObject . MAConditionBuilder .
> MAProxyObject . AnObsoleteC3 . AnObsoleteC4 . AnObsoleteC6 .
> AnObsoleteC3 . AnObsoleteC4 . AnObsoleteC6 . AnObsoleteC3 .
> AnObsoleteC4 . AnObsoleteC6 . AnObsoleteC3 . AnObsoleteC4 .
> AnObsoleteC6 . AnObsoleteC3 . AnObsoleteC4 . AnObsoleteC6 .
> ...etc... }
>
> This didn't look good, so I then did a search through references to
> ProtoObject, and found that TraitsResource (in Traits-Tests) looks
> like the guilty party - it has three methods
> setUpTrivialRequiresFixture, setUpTwoLevelRequiresFixture,
> setUpTranslatingRequiresFixture - these include lines like (for C3,
> C4, C6):
>
> self c3: (self
> createClassNamed: #C3
> superclass: ProtoObject
> uses: { }).
> self c3 superclass: nil.
>
> Another run of the Traits-Tests suite left me with yet more of these
> obsolete classes. I have absolutely no idea how to get rid of these
> classes. Can anybody help me take this any further?
Hey, your report can serve as a role model to many postings here,
very thorough :)
If you just want to clean up your image, something like this should
do it:
(ProtoObject subclasses select: [:each | each isObsolete])
do: [:each | ProtoObject removeSubclass: each]
Can't help with the cause of the problem, but you should file a bug
report.
- Bert -
More information about the Squeak-dev
mailing list
|