2 references to class with the same name
Gary Chambers
gazzaguru2 at btinternet.com
Tue Feb 27 09:43:18 UTC 2007
Me too, a few weeks ago. Very odd to see it for the first time!
Like Brad, only one method different between the two.
> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org]On Behalf Of Bert
> Freudenberg
> Sent: 26 February 2007 8:47 PM
> To: The general-purpose Squeak developers list
> Subject: Re: 2 references to class with the same name
>
>
>
> On Feb 26, 2007, at 20:46 , Brad Fuller wrote:
>
> > I searched for the answer to this, but mostly found how to deal
> > with instances and obsolete classes. Somehow, I ended up with 2 two
> > classes with the same name, and the class is not obsolete.
> >
> > If I look at the hierarchy of it's (their) superclass
> > (PRStructuresWidget) there are two classes shown:
> >
> > PRSearchWidget #('searchText' 'items')
> > PRSearchWidget #('searchText')
> >
> > PRSearchWidget #('searchText' 'items') is the current "real" class.
> > Somehow PRSearchWidget #('searchText') got in there, which I don't
> > want. I don't know how to get rid of it. Anyone point me to the
> > right documentation on this? Maybe if I file out the current one,
> > then remove the class?
>
> Funny you should mention this. I saw the same thing in about three
> images lately. I have no idea where it comes from. My hunch is
> Monticello, but I have no evidence to back this up.
>
> In all cases I found that one or even two older version of a class
> were still in the subclasses list of its superclass. That is, in the
> browser you could see several subclasses with the same name. Only one
> of these is the "real" one which is also registered in Smalltalk.
>
> I do not hava a bad image now, but to find these, the following
> should work:
>
> bad := OrderedCollection new.
> Smalltalk allClassesDo: [:ea | bad addAll: (ea subclasses reject:
> [:cls | cls isMeta or: [cls == (Smalltalk at: cls name)]])].
> bad
>
> To remove them, try this:
>
> bad do: [:cls | cls superclass removeSubclass: cls]
>
> Hmm, has anybody else seen this?
>
> - Bert -
>
>
>
>
More information about the Squeak-dev
mailing list
|