Fixing obsolete Classes

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

Fixing obsolete Classes

Gisela Decuzzi
Hi, I'm trying to fix this, I have Obsolete classes in the system and I want to remove them, as long as I understood this is because this classes are gone and in some point someone is referencing them.

I do an extended search an get nothing, but still the obsolete classes are there... I don't find no one with references to it but if I run:
SystemNavigation new obsoleteClasses select: [ :each | each isAnonymous not ] 
I get the problem classes.

I found this thread about a similar issue but don't know how to solve the problem http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html

Maybe someone could help me...

Reply | Threaded
Open this post in threaded view
|

Re: Fixing obsolete Classes

Bernat Romagosa
Hi Gisela,

Have you tried DoingIt: Smalltalk fixObsoleteReferences?


2013/6/3 Gisela Decuzzi <[hidden email]>
Hi, I'm trying to fix this, I have Obsolete classes in the system and I want to remove them, as long as I understood this is because this classes are gone and in some point someone is referencing them.

I do an extended search an get nothing, but still the obsolete classes are there... I don't find no one with references to it but if I run:
SystemNavigation new obsoleteClasses select: [ :each | each isAnonymous not ] 
I get the problem classes.

I found this thread about a similar issue but don't know how to solve the problem http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html

Maybe someone could help me...




--
Bernat Romagosa.
Reply | Threaded
Open this post in threaded view
|

Re: Fixing obsolete Classes

Andres Valloud-4
In reply to this post by Gisela Decuzzi
Maybe they have instances.  GC can't remove a class under its instances.

On 6/3/13 2:14 , Gisela Decuzzi wrote:

> Hi, I'm trying to fix this, I have Obsolete classes in the system and I
> want to remove them, as long as I understood this is because this
> classes are gone and in some point someone is referencing them.
>
> I do an extended search an get nothing, but still the obsolete classes
> are there... I don't find no one with references to it but if I run:
> SystemNavigation new obsoleteClassesselect: [ :each | each isAnonymous
> not ]
> I get the problem classes.
>
> I found this thread about a similar issue but don't know how to solve
> the problem
> http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html
>
> Maybe someone could help me...
>

Reply | Threaded
Open this post in threaded view
|

Re: Fixing obsolete Classes

Sebastian Tleye
This happens when you have instances of the class and the class doesn't exists anymore.
"Smalltalk fixObsoleteReferences" didn't completely work for me when i had that problem, i had to find out where those references were.
I think looking for strong pointers of the ObsoleteClass would be a good start.


2013/6/3 Andres Valloud <[hidden email]>
Maybe they have instances.  GC can't remove a class under its instances.


On 6/3/13 2:14 , Gisela Decuzzi wrote:
Hi, I'm trying to fix this, I have Obsolete classes in the system and I
want to remove them, as long as I understood this is because this
classes are gone and in some point someone is referencing them.

I do an extended search an get nothing, but still the obsolete classes
are there... I don't find no one with references to it but if I run:
SystemNavigation new obsoleteClassesselect: [ :each | each isAnonymous

not ]
I get the problem classes.

I found this thread about a similar issue but don't know how to solve
the problem
http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html

Maybe someone could help me...



Reply | Threaded
Open this post in threaded view
|

Re: Fixing obsolete Classes

Gisela Decuzzi
In reply to this post by Bernat Romagosa
Hi Bernat, yes, I ran Smalltalk fixObsoleteReferences. And also ran the garbage collector but if find the obsolete references I get the classes anyway.

Yes, in someway seems to be an instance of this class... but how can I find them?


2013/6/3 Bernat Romagosa <[hidden email]>
Hi Gisela,

Have you tried DoingIt: Smalltalk fixObsoleteReferences?


2013/6/3 Gisela Decuzzi <[hidden email]>
Hi, I'm trying to fix this, I have Obsolete classes in the system and I want to remove them, as long as I understood this is because this classes are gone and in some point someone is referencing them.

I do an extended search an get nothing, but still the obsolete classes are there... I don't find no one with references to it but if I run:
SystemNavigation new obsoleteClasses select: [ :each | each isAnonymous not ] 
I get the problem classes.

I found this thread about a similar issue but don't know how to solve the problem http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html

Maybe someone could help me...




--
Bernat Romagosa.

Reply | Threaded
Open this post in threaded view
|

Re: Fixing obsolete Classes

Bernat Romagosa
Yep, I'd find the pointers to all instances of these obsolete classes, then remove them from any instance variable pointing to them. I'm not sure you can do this with obsolete classes (and I don't have a Pharo image with instances of any obsolete classes running), but probably YourObsoleteClass allInstances should give you the list...


2013/6/3 Gisela Decuzzi <[hidden email]>
Hi Bernat, yes, I ran Smalltalk fixObsoleteReferences. And also ran the garbage collector but if find the obsolete references I get the classes anyway.

Yes, in someway seems to be an instance of this class... but how can I find them?


2013/6/3 Bernat Romagosa <[hidden email]>
Hi Gisela,

Have you tried DoingIt: Smalltalk fixObsoleteReferences?


2013/6/3 Gisela Decuzzi <[hidden email]>
Hi, I'm trying to fix this, I have Obsolete classes in the system and I want to remove them, as long as I understood this is because this classes are gone and in some point someone is referencing them.

I do an extended search an get nothing, but still the obsolete classes are there... I don't find no one with references to it but if I run:
SystemNavigation new obsoleteClasses select: [ :each | each isAnonymous not ] 
I get the problem classes.

I found this thread about a similar issue but don't know how to solve the problem http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html

Maybe someone could help me...




--
Bernat Romagosa.




--
Bernat Romagosa.
Reply | Threaded
Open this post in threaded view
|

Re: Fixing obsolete Classes

Andres Valloud-4
In reply to this post by Sebastian Tleye
How can you have an instance of a class X if the class X doesn't "exist"
anymore?  The whole point here is that an object's class is also a
strong reference to the class, and generally it's skipped by object
reference finders.  The way you find those is by sending allInstances
(or equivalent) to the class.

On 6/3/13 2:19 , Sebastian Tleye wrote:

> This happens when you have instances of the class and the class doesn't
> exists anymore.
> "Smalltalk fixObsoleteReferences" didn't completely work for me when i
> had that problem, i had to find out where those references were.
> I think looking for strong pointers of the ObsoleteClass would be a good
> start.
>
>
> 2013/6/3 Andres Valloud <[hidden email]
> <mailto:[hidden email]>>
>
>     Maybe they have instances.  GC can't remove a class under its instances.
>
>
>     On 6/3/13 2:14 , Gisela Decuzzi wrote:
>
>         Hi, I'm trying to fix this, I have Obsolete classes in the
>         system and I
>         want to remove them, as long as I understood this is because this
>         classes are gone and in some point someone is referencing them.
>
>         I do an extended search an get nothing, but still the obsolete
>         classes
>         are there... I don't find no one with references to it but if I run:
>         SystemNavigation new obsoleteClassesselect: [ :each | each
>         isAnonymous
>
>         not ]
>         I get the problem classes.
>
>         I found this thread about a similar issue but don't know how to
>         solve
>         the problem
>         http://lists.gforge.inria.fr/__pipermail/pharo-project/2011-__January/038824.html
>         <http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html>
>
>         Maybe someone could help me...
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Fixing obsolete Classes

Sebastian Tleye
if you create a class "MyClass" and you do
Smalltalk globals at: #MyLittleClass put: MyClass new.
and then you remove the class "MyClass"
Smalltalk globals at: #MyLittleClass will be a referencing to an obsoleteClass


2013/6/3 Andres Valloud <[hidden email]>
How can you have an instance of a class X if the class X doesn't "exist" anymore?  The whole point here is that an object's class is also a strong reference to the class, and generally it's skipped by object reference finders.  The way you find those is by sending allInstances (or equivalent) to the class.


On 6/3/13 2:19 , Sebastian Tleye wrote:
This happens when you have instances of the class and the class doesn't
exists anymore.
"Smalltalk fixObsoleteReferences" didn't completely work for me when i
had that problem, i had to find out where those references were.
I think looking for strong pointers of the ObsoleteClass would be a good
start.


2013/6/3 Andres Valloud <[hidden email]
<mailto:[hidden email]>>


    Maybe they have instances.  GC can't remove a class under its instances.


    On 6/3/13 2:14 , Gisela Decuzzi wrote:

        Hi, I'm trying to fix this, I have Obsolete classes in the
        system and I
        want to remove them, as long as I understood this is because this
        classes are gone and in some point someone is referencing them.

        I do an extended search an get nothing, but still the obsolete
        classes
        are there... I don't find no one with references to it but if I run:
        SystemNavigation new obsoleteClassesselect: [ :each | each
        isAnonymous

        not ]
        I get the problem classes.

        I found this thread about a similar issue but don't know how to
        solve
        the problem
        http://lists.gforge.inria.fr/__pipermail/pharo-project/2011-__January/038824.html

        <http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html>

        Maybe someone could help me...





Reply | Threaded
Open this post in threaded view
|

Re: Fixing obsolete Classes

Gisela Decuzzi
In reply to this post by Andres Valloud-4
Hi, yes! Thanks for the help, searching it seems that I have shortcuts that has references to obsoletes instances, I will see how to remove them.




2013/6/3 Andres Valloud <[hidden email]>
How can you have an instance of a class X if the class X doesn't "exist" anymore?  The whole point here is that an object's class is also a strong reference to the class, and generally it's skipped by object reference finders.  The way you find those is by sending allInstances (or equivalent) to the class.


On 6/3/13 2:19 , Sebastian Tleye wrote:
This happens when you have instances of the class and the class doesn't
exists anymore.
"Smalltalk fixObsoleteReferences" didn't completely work for me when i
had that problem, i had to find out where those references were.
I think looking for strong pointers of the ObsoleteClass would be a good
start.


2013/6/3 Andres Valloud <[hidden email]
<mailto:[hidden email]>>


    Maybe they have instances.  GC can't remove a class under its instances.


    On 6/3/13 2:14 , Gisela Decuzzi wrote:

        Hi, I'm trying to fix this, I have Obsolete classes in the
        system and I
        want to remove them, as long as I understood this is because this
        classes are gone and in some point someone is referencing them.

        I do an extended search an get nothing, but still the obsolete
        classes
        are there... I don't find no one with references to it but if I run:
        SystemNavigation new obsoleteClassesselect: [ :each | each
        isAnonymous

        not ]
        I get the problem classes.

        I found this thread about a similar issue but don't know how to
        solve
        the problem
        http://lists.gforge.inria.fr/__pipermail/pharo-project/2011-__January/038824.html

        <http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html>

        Maybe someone could help me...





Reply | Threaded
Open this post in threaded view
|

Re: Fixing obsolete Classes

Mariano Martinez Peck
Gisela, you can also get all objects in the system (#allObjectsDo:) whose "class name ='xxx". where xxx is the obsolete-version of the class name.
Then you follow pointers... explore the object -> right button -> "explore pointers" or similar...

cheers, 


On Mon, Jun 3, 2013 at 7:59 AM, Gisela Decuzzi <[hidden email]> wrote:
Hi, yes! Thanks for the help, searching it seems that I have shortcuts that has references to obsoletes instances, I will see how to remove them.




2013/6/3 Andres Valloud <[hidden email]>
How can you have an instance of a class X if the class X doesn't "exist" anymore?  The whole point here is that an object's class is also a strong reference to the class, and generally it's skipped by object reference finders.  The way you find those is by sending allInstances (or equivalent) to the class.


On 6/3/13 2:19 , Sebastian Tleye wrote:
This happens when you have instances of the class and the class doesn't
exists anymore.
"Smalltalk fixObsoleteReferences" didn't completely work for me when i
had that problem, i had to find out where those references were.
I think looking for strong pointers of the ObsoleteClass would be a good
start.


2013/6/3 Andres Valloud <[hidden email]
<mailto:[hidden email]>>


    Maybe they have instances.  GC can't remove a class under its instances.


    On 6/3/13 2:14 , Gisela Decuzzi wrote:

        Hi, I'm trying to fix this, I have Obsolete classes in the
        system and I
        want to remove them, as long as I understood this is because this
        classes are gone and in some point someone is referencing them.

        I do an extended search an get nothing, but still the obsolete
        classes
        are there... I don't find no one with references to it but if I run:
        SystemNavigation new obsoleteClassesselect: [ :each | each
        isAnonymous

        not ]
        I get the problem classes.

        I found this thread about a similar issue but don't know how to
        solve
        the problem
        http://lists.gforge.inria.fr/__pipermail/pharo-project/2011-__January/038824.html

        <http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html>

        Maybe someone could help me...








--
Mariano
http://marianopeck.wordpress.com
Reply | Threaded
Open this post in threaded view
|

Re: Fixing obsolete Classes

Gisela Decuzzi
Yes I finally figure it out... the problem was that I have created shortcuts referencing this classes (before deleting the classes)... and in the KMRepository there were references to the class inside a block, it took me a while to realise that the reference was inside the block because you can't inspect a block and see the code.

I had to reset the KMRepository (close my workspace window, because I have references to the old shortcuts) and that's it.

Searching for strong pointers was a great advice to see who was using these classes.

Thanks all :D


2013/6/3 Mariano Martinez Peck <[hidden email]>
Gisela, you can also get all objects in the system (#allObjectsDo:) whose "class name ='xxx". where xxx is the obsolete-version of the class name.
Then you follow pointers... explore the object -> right button -> "explore pointers" or similar...

cheers, 


On Mon, Jun 3, 2013 at 7:59 AM, Gisela Decuzzi <[hidden email]> wrote:
Hi, yes! Thanks for the help, searching it seems that I have shortcuts that has references to obsoletes instances, I will see how to remove them.




2013/6/3 Andres Valloud <[hidden email]>
How can you have an instance of a class X if the class X doesn't "exist" anymore?  The whole point here is that an object's class is also a strong reference to the class, and generally it's skipped by object reference finders.  The way you find those is by sending allInstances (or equivalent) to the class.


On 6/3/13 2:19 , Sebastian Tleye wrote:
This happens when you have instances of the class and the class doesn't
exists anymore.
"Smalltalk fixObsoleteReferences" didn't completely work for me when i
had that problem, i had to find out where those references were.
I think looking for strong pointers of the ObsoleteClass would be a good
start.


2013/6/3 Andres Valloud <[hidden email]
<mailto:[hidden email]>>


    Maybe they have instances.  GC can't remove a class under its instances.


    On 6/3/13 2:14 , Gisela Decuzzi wrote:

        Hi, I'm trying to fix this, I have Obsolete classes in the
        system and I
        want to remove them, as long as I understood this is because this
        classes are gone and in some point someone is referencing them.

        I do an extended search an get nothing, but still the obsolete
        classes
        are there... I don't find no one with references to it but if I run:
        SystemNavigation new obsoleteClassesselect: [ :each | each
        isAnonymous

        not ]
        I get the problem classes.

        I found this thread about a similar issue but don't know how to
        solve
        the problem
        http://lists.gforge.inria.fr/__pipermail/pharo-project/2011-__January/038824.html

        <http://lists.gforge.inria.fr/pipermail/pharo-project/2011-January/038824.html>

        Maybe someone could help me...








--
Mariano
http://marianopeck.wordpress.com