Finding instances of old (removed) classes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Finding instances of old (removed) classes

GLASS mailing list
I remember I once saw a script to find all instances whose class is an old class version.

I cannot iterate over the class history because the old classes are no longer in there. But I do encounter some instances of those old classes and I want to sweep the repository to detect all such instances.

Does anyone still have that script?

thanks!
Johan
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of old (removed) classes

GLASS mailing list
I don’t have the script but it would involve (Metaclass3 allInstances , Metaclass allInstances).

> On Aug 21, 2015, at 8:02 AM, Johan Brichau via Glass <[hidden email]> wrote:
>
> I remember I once saw a script to find all instances whose class is an old class version.
>
> I cannot iterate over the class history because the old classes are no longer in there. But I do encounter some instances of those old classes and I want to sweep the repository to detect all such instances.
>
> Does anyone still have that script?
>
> thanks!
> Johan
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of old (removed) classes

Paul DeBruicker
In reply to this post by GLASS mailing list
I may be running into this too.  

Is this the old script you had in mind:

http://forum.world.st/instances-of-old-class-versions-td4100977.html

?




GLASS mailing list wrote
I remember I once saw a script to find all instances whose class is an old class version.

I cannot iterate over the class history because the old classes are no longer in there. But I do encounter some instances of those old classes and I want to sweep the repository to detect all such instances.

Does anyone still have that script?

thanks!
Johan
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of old (removed) classes

GLASS mailing list
I think the actual script was in this message[1].

Dale

[1]
http://forum.world.st/instances-of-old-class-versions-tp4100977p4102175.html

On 10/09/2015 10:29 AM, Paul DeBruicker via Glass wrote:

> I may be running into this too.
>
> Is this the old script you had in mind:
>
> http://forum.world.st/instances-of-old-class-versions-td4100977.html
>
> ?
>
>
>
>
>
> GLASS mailing list wrote
>> I remember I once saw a script to find all instances whose class is an old
>> class version.
>>
>> I cannot iterate over the class history because the old classes are no
>> longer in there. But I do encounter some instances of those old classes
>> and I want to sweep the repository to detect all such instances.
>>
>> Does anyone still have that script?
>>
>> thanks!
>> Johan
>> _______________________________________________
>> Glass mailing list
>> Glass@.gemtalksystems
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
>
>
> --
> View this message in context: http://forum.world.st/Finding-instances-of-old-removed-classes-tp4844829p4854802.html
> Sent from the GLASS mailing list archive at Nabble.com.
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of old (removed) classes

Paul DeBruicker
Thanks Dale.

I've now got the list of orphaned classes and  list of references to each of the orphan classes.  

How do I migrate them to the newer/current versions of the classes?

Is it just

System abort.
orphanedClasses do:[:orphanClass | orphanClass migrateTo: (Smalltalk at: orphanClass name)]
System commit.

or something more?


Paul

GLASS mailing list wrote
I think the actual script was in this message[1].

Dale

[1]
http://forum.world.st/instances-of-old-class-versions-tp4100977p4102175.html

On 10/09/2015 10:29 AM, Paul DeBruicker via Glass wrote:
> I may be running into this too.
>
> Is this the old script you had in mind:
>
> http://forum.world.st/instances-of-old-class-versions-td4100977.html
>
> ?
>
>
>
>
>
> GLASS mailing list wrote
>> I remember I once saw a script to find all instances whose class is an old
>> class version.
>>
>> I cannot iterate over the class history because the old classes are no
>> longer in there. But I do encounter some instances of those old classes
>> and I want to sweep the repository to detect all such instances.
>>
>> Does anyone still have that script?
>>
>> thanks!
>> Johan
>> _______________________________________________
>> Glass mailing list
>> Glass@.gemtalksystems
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
>
>
> --
> View this message in context: http://forum.world.st/Finding-instances-of-old-removed-classes-tp4844829p4854802.html
> Sent from the GLASS mailing list archive at Nabble.com.
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of old (removed) classes

Paul DeBruicker

No that won't work.  Its #migrateInstancesTo: rather than #migrateTo:


Several of the references are to GsNMethods in the orphan classes.  I think.  If I migrate will they also be taken care of?

Paul DeBruicker wrote
Thanks Dale.

I've now got the list of orphaned classes and  list of references to each of the orphan classes.  

How do I migrate them to the newer/current versions of the classes?

Is it just

System abort.
orphanedClasses do:[:orphanClass | orphanClass migrateTo: (Smalltalk at: orphanClass name)]
System commit.

or something more?


Paul

GLASS mailing list wrote
I think the actual script was in this message[1].

Dale

[1]
http://forum.world.st/instances-of-old-class-versions-tp4100977p4102175.html

On 10/09/2015 10:29 AM, Paul DeBruicker via Glass wrote:
> I may be running into this too.
>
> Is this the old script you had in mind:
>
> http://forum.world.st/instances-of-old-class-versions-td4100977.html
>
> ?
>
>
>
>
>
> GLASS mailing list wrote
>> I remember I once saw a script to find all instances whose class is an old
>> class version.
>>
>> I cannot iterate over the class history because the old classes are no
>> longer in there. But I do encounter some instances of those old classes
>> and I want to sweep the repository to detect all such instances.
>>
>> Does anyone still have that script?
>>
>> thanks!
>> Johan
>> _______________________________________________
>> Glass mailing list
>> Glass@.gemtalksystems
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
>
>
> --
> View this message in context: http://forum.world.st/Finding-instances-of-old-removed-classes-tp4844829p4854802.html
> Sent from the GLASS mailing list archive at Nabble.com.
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of old (removed) classes

GLASS mailing list
In reply to this post by Paul DeBruicker
Paul,

I'd like to know a little bit more about what you are trying to
accomplish ...

If I assume that the references to the orphaned classes are instances of
the orphaned class  then you will want to migrate those instances to the
new version of the class.

If those references are not from instances of the orphaned class - a
direct reference to the orphaned class (as a key in a dictionary or
something similar) then migration will not solve your problem ... you
will have to do a findAllReferencePathsToObject .... and find clean up
the references.

For instance migration you should do some similar to
GsDeployer>>doBulkMigrate: where the `classList` is your list of
orphaned classes ..

Dale


On 10/09/2015 02:54 PM, Paul DeBruicker via Glass wrote:

> Thanks Dale.
>
> I've now got the list of orphaned classes and  list of references to each of
> the orphan classes.
>
> How do I migrate them to the newer/current versions of the classes?
>
> Is it just
>
> System abort.
> orphanedClasses do:[:orphanClass | orphanClass migrateTo: (Smalltalk at:
> orphanClass name)]
> System commit.
>
> or something more?
>
>
> Paul
>
>
> GLASS mailing list wrote
>> I think the actual script was in this message[1].
>>
>> Dale
>>
>> [1]
>> http://forum.world.st/instances-of-old-class-versions-tp4100977p4102175.html
>>
>> On 10/09/2015 10:29 AM, Paul DeBruicker via Glass wrote:
>>> I may be running into this too.
>>>
>>> Is this the old script you had in mind:
>>>
>>> http://forum.world.st/instances-of-old-class-versions-td4100977.html
>>>
>>> ?
>>>
>>>
>>>
>>>
>>>
>>> GLASS mailing list wrote
>>>> I remember I once saw a script to find all instances whose class is an
>>>> old
>>>> class version.
>>>>
>>>> I cannot iterate over the class history because the old classes are no
>>>> longer in there. But I do encounter some instances of those old classes
>>>> and I want to sweep the repository to detect all such instances.
>>>>
>>>> Does anyone still have that script?
>>>>
>>>> thanks!
>>>> Johan
>>>> _______________________________________________
>>>> Glass mailing list
>>>> Glass@.gemtalksystems
>>>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://forum.world.st/Finding-instances-of-old-removed-classes-tp4844829p4854802.html
>>> Sent from the GLASS mailing list archive at Nabble.com.
>>> _______________________________________________
>>> Glass mailing list
>>>
>> Glass@.gemtalksystems
>>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>> _______________________________________________
>> Glass mailing list
>> Glass@.gemtalksystems
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
>
>
> --
> View this message in context: http://forum.world.st/Finding-instances-of-old-removed-classes-tp4844829p4854833.html
> Sent from the GLASS mailing list archive at Nabble.com.
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of old (removed) classes

GLASS mailing list
In reply to this post by Paul DeBruicker


On 10/09/2015 03:40 PM, Paul DeBruicker via Glass wrote:
> No that won't work.  Its #migrateInstancesTo: rather than #migrateTo:
>
>
> Several of the references are to GsNMethods in the orphan classes.  I think.
> If I migrate will they also be taken care of?
>
>
You can't migrate one version of a class to another ... you _CAN_
migrate the instances of a class ...

The GsNMethods in the orphaned class's method dictionary are not keeping
hte orphaned class alive, but they will go away when the orphaned class
is eventually garbage collected ...

Dale
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of old (removed) classes

Paul DeBruicker
In reply to this post by GLASS mailing list
I'm not sure.  Exploring, I guess.

I think I have some instances that are exhibiting old behavior.  So I'm trying to clean up orphaned classes to see if that fixes the instances behavior problems.  

But it could also be a different bug I haven't found yet.  


GLASS mailing list wrote
Paul,

I'd like to know a little bit more about what you are trying to
accomplish ...

If I assume that the references to the orphaned classes are instances of
the orphaned class  then you will want to migrate those instances to the
new version of the class.

If those references are not from instances of the orphaned class - a
direct reference to the orphaned class (as a key in a dictionary or
something similar) then migration will not solve your problem ... you
will have to do a findAllReferencePathsToObject .... and find clean up
the references.

For instance migration you should do some similar to
GsDeployer>>doBulkMigrate: where the `classList` is your list of
orphaned classes ..

Dale


On 10/09/2015 02:54 PM, Paul DeBruicker via Glass wrote:
> Thanks Dale.
>
> I've now got the list of orphaned classes and  list of references to each of
> the orphan classes.
>
> How do I migrate them to the newer/current versions of the classes?
>
> Is it just
>
> System abort.
> orphanedClasses do:[:orphanClass | orphanClass migrateTo: (Smalltalk at:
> orphanClass name)]
> System commit.
>
> or something more?
>
>
> Paul
>
>
> GLASS mailing list wrote
>> I think the actual script was in this message[1].
>>
>> Dale
>>
>> [1]
>> http://forum.world.st/instances-of-old-class-versions-tp4100977p4102175.html
>>
>> On 10/09/2015 10:29 AM, Paul DeBruicker via Glass wrote:
>>> I may be running into this too.
>>>
>>> Is this the old script you had in mind:
>>>
>>> http://forum.world.st/instances-of-old-class-versions-td4100977.html
>>>
>>> ?
>>>
>>>
>>>
>>>
>>>
>>> GLASS mailing list wrote
>>>> I remember I once saw a script to find all instances whose class is an
>>>> old
>>>> class version.
>>>>
>>>> I cannot iterate over the class history because the old classes are no
>>>> longer in there. But I do encounter some instances of those old classes
>>>> and I want to sweep the repository to detect all such instances.
>>>>
>>>> Does anyone still have that script?
>>>>
>>>> thanks!
>>>> Johan
>>>> _______________________________________________
>>>> Glass mailing list
>>>> Glass@.gemtalksystems
>>>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://forum.world.st/Finding-instances-of-old-removed-classes-tp4844829p4854802.html
>>> Sent from the GLASS mailing list archive at Nabble.com.
>>> _______________________________________________
>>> Glass mailing list
>>>
>> Glass@.gemtalksystems
>>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>> _______________________________________________
>> Glass mailing list
>> Glass@.gemtalksystems
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
>
>
> --
> View this message in context: http://forum.world.st/Finding-instances-of-old-removed-classes-tp4844829p4854833.html
> Sent from the GLASS mailing list archive at Nabble.com.
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of old (removed) classes

GLASS mailing list


On 10/09/2015 04:45 PM, Paul DeBruicker via Glass wrote:
> I'm not sure.  Exploring, I guess.
>
> I think I have some instances that are exhibiting old behavior.  So I'm
> trying to clean up orphaned classes to see if that fixes the instances
> behavior problems.
>
> But it could also be a different bug I haven't found yet.

Okay then using the GsDeployer-style method, collect instances for each
of your orphaned classes ... those with empty instance lists have class
reference issues ... those with non-empty instance lists can be migrated
ala GsDeployer-style method...

If you've already cleaned the known spots up,m then those classes with
reference issues  can be resolved by finding all reference paths ...

Mariano and I went through a similar dance several weeks ago, and I
published a gist with the tode shell script that collected info on some
"orphaned classes"[1]  and I then produced an analysis based on using
the script[2] ... at the end of the analysis I used the `./bug
--references` to track down the reference to some of the orphaned
classes ...

Slightly different scenario, but the `--references`, `--instances`,
`--gc`, and `--reclaim` options might be interesting or useful in your
own little analysis script ...

Dale

[1] https://gist.github.com/dalehenrich/626a3d731fc52f037657
[2] https://gist.github.com/dalehenrich/d80ce234667e56a02682

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass