pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Ghost subclass

RB
Robert Briggs
Sat, Jan 8, 2022 5:25 PM

Hi

I currently have a problem that I am unable to resolve.

I am working on a personal project.

I created a Class ‘ERAElement’ and four subclasses: ‘Component’, ‘CriticalIssue’, ‘Decision’ and ‘Requirement’.

A while ago I removed he subclass Component, and naturally Pharo will not let me create an instance of this subclasses.  However it is still listed in the ERAElement subclass collection. As shown below.

I can test for existence of each subclass as shown below:

However the same code will not accept Component as a possible value.

I can even create a new Subclass Component and get two (different) subclasses with the same name.

Any thoughts as to what is going on and if so how to resolve the problem?

Many thanks in advance for any and all feedback.

Kind regards

Robert Briggs

Hi I currently have a problem that I am unable to resolve. I am working on a personal project. I created a Class ‘ERAElement’ and four subclasses: ‘Component’, ‘CriticalIssue’, ‘Decision’ and ‘Requirement’. A while ago I removed he subclass Component, and naturally Pharo will not let me create an instance of this subclasses.  However it is still listed in the ERAElement subclass collection. As shown below. I can test for existence of each subclass as shown below: However the same code will not accept Component as a possible value. I can even create a new Subclass Component and get two (different) subclasses with the same name. Any thoughts as to what is going on and if so how to resolve the problem? Many thanks in advance for any and all feedback. Kind regards Robert Briggs
GP
Guillermo Polito
Mon, Jan 10, 2022 8:47 AM

Hi Robert,

Can you tell us how did you remove the subclasses? Was it through the UI? Which option? Or was it programatically?
Can you reproduce it?

G

El 8 ene 2022, a las 18:25, Robert Briggs via Pharo-users pharo-users@lists.pharo.org escribió:

Hi

I currently have a problem that I am unable to resolve.

I am working on a personal project.

I created a Class ‘ERAElement’ and four subclasses: ‘Component’, ‘CriticalIssue’, ‘Decision’ and ‘Requirement’.

A while ago I removed he subclass Component, and naturally Pharo will not let me create an instance of this subclasses.  However it is still listed in the ERAElement subclass collection. As shown below.
<image001.png>

I can test for existence of each subclass as shown below:
<image002.png>

However the same code will not accept Component as a possible value.

<image007.png>

I can even create a new Subclass Component and get two (different) subclasses with the same name.

Any thoughts as to what is going on and if so how to resolve the problem?

Many thanks in advance for any and all feedback.

Kind regards
Robert Briggs

Hi Robert, Can you tell us how did you remove the subclasses? Was it through the UI? Which option? Or was it programatically? Can you reproduce it? G > El 8 ene 2022, a las 18:25, Robert Briggs via Pharo-users <pharo-users@lists.pharo.org> escribió: > > Hi > > I currently have a problem that I am unable to resolve. > > I am working on a personal project. > > I created a Class ‘ERAElement’ and four subclasses: ‘Component’, ‘CriticalIssue’, ‘Decision’ and ‘Requirement’. > > A while ago I removed he subclass Component, and naturally Pharo will not let me create an instance of this subclasses. However it is still listed in the ERAElement subclass collection. As shown below. > <image001.png> > > > I can test for existence of each subclass as shown below: > <image002.png> > > However the same code will not accept Component as a possible value. > > <image007.png> > > I can even create a new Subclass Component and get two (different) subclasses with the same name. > > Any thoughts as to what is going on and if so how to resolve the problem? > > Many thanks in advance for any and all feedback. > > Kind regards > Robert Briggs
RB
Robert Briggs
Mon, Jan 10, 2022 9:44 AM

Hi Guillermo

As I explained to Stephane, unfortunately I am not able t remember exactly what I did as I didn’t notice the problem until sometime later.

I assume I removed it through the UI.  I have since been working with programmatically creating subclasses having exported the relevant packages to a fresh image.  It all seems to work as expected.

Regards

R

From: Guillermo Polito guillermopolito@gmail.com
Reply to: Any question about pharo is welcome pharo-users@lists.pharo.org
Date: Monday, 10 January 2022 at 08:47
To: Any question about pharo is welcome pharo-users@lists.pharo.org
Cc: Robert Briggs rbriggs2009@me.com
Subject: [Pharo-users] Re: Ghost subclass

Hi Robert,

Can you tell us how did you remove the subclasses? Was it through the UI? Which option? Or was it programatically?

Can you reproduce it?

G

El 8 ene 2022, a las 18:25, Robert Briggs via Pharo-users pharo-users@lists.pharo.org escribió:

Hi

I currently have a problem that I am unable to resolve.

I am working on a personal project.

I created a Class ‘ERAElement’ and four subclasses: ‘Component’, ‘CriticalIssue’, ‘Decision’ and ‘Requirement’.

A while ago I removed he subclass Component, and naturally Pharo will not let me create an instance of this subclasses.  However it is still listed in the ERAElement subclass collection. As shown below.

<image001.png>

I can test for existence of each subclass as shown below:

<image002.png>

However the same code will not accept Component as a possible value.

<image007.png>

I can even create a new Subclass Component and get two (different) subclasses with the same name.

Any thoughts as to what is going on and if so how to resolve the problem?

Many thanks in advance for any and all feedback.

Kind regards

Robert Briggs

Hi Guillermo As I explained to Stephane, unfortunately I am not able t remember exactly what I did as I didn’t notice the problem until sometime later. I assume I removed it through the UI.  I have since been working with programmatically creating subclasses having exported the relevant packages to a fresh image.  It all seems to work as expected. Regards R From: Guillermo Polito <guillermopolito@gmail.com> Reply to: Any question about pharo is welcome <pharo-users@lists.pharo.org> Date: Monday, 10 January 2022 at 08:47 To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Cc: Robert Briggs <rbriggs2009@me.com> Subject: [Pharo-users] Re: Ghost subclass Hi Robert, Can you tell us how did you remove the subclasses? Was it through the UI? Which option? Or was it programatically? Can you reproduce it? G El 8 ene 2022, a las 18:25, Robert Briggs via Pharo-users <pharo-users@lists.pharo.org> escribió: Hi I currently have a problem that I am unable to resolve. I am working on a personal project. I created a Class ‘ERAElement’ and four subclasses: ‘Component’, ‘CriticalIssue’, ‘Decision’ and ‘Requirement’. A while ago I removed he subclass Component, and naturally Pharo will not let me create an instance of this subclasses. However it is still listed in the ERAElement subclass collection. As shown below. <image001.png> I can test for existence of each subclass as shown below: <image002.png> However the same code will not accept Component as a possible value. <image007.png> I can even create a new Subclass Component and get two (different) subclasses with the same name. Any thoughts as to what is going on and if so how to resolve the problem? Many thanks in advance for any and all feedback. Kind regards Robert Briggs
RB
Robert Briggs
Mon, Jan 10, 2022 10:20 AM

A thought occurred to me.  I use a ERA100SharedPool to hold the CurrentProject global variable, for access by the classes in my model.

I ran a test on the offending image to retrieve and inspect the contents of CurrentProject which is a reference to ERAProject.  Each time an instance of an ERAElement subclass is created an entry is added to a Dictionary of instances of the relevant subclass.  It still holds instances of the Component Subclass created during one of my unit tests.  I wonder if this may be a clue as it is essentially a hanging reference to the subclass.  I probably should have a tear-down method to clean up such references.

R

From: Guillermo Polito guillermopolito@gmail.com
Reply to: Any question about pharo is welcome pharo-users@lists.pharo.org
Date: Monday, 10 January 2022 at 08:47
To: Any question about pharo is welcome pharo-users@lists.pharo.org
Cc: Robert Briggs rbriggs2009@me.com
Subject: [Pharo-users] Re: Ghost subclass

Hi Robert,

Can you tell us how did you remove the subclasses? Was it through the UI? Which option? Or was it programatically?

Can you reproduce it?

G

El 8 ene 2022, a las 18:25, Robert Briggs via Pharo-users pharo-users@lists.pharo.org escribió:

Hi

I currently have a problem that I am unable to resolve.

I am working on a personal project.

I created a Class ‘ERAElement’ and four subclasses: ‘Component’, ‘CriticalIssue’, ‘Decision’ and ‘Requirement’.

A while ago I removed he subclass Component, and naturally Pharo will not let me create an instance of this subclasses.  However it is still listed in the ERAElement subclass collection. As shown below.

<image001.png>

I can test for existence of each subclass as shown below:

<image002.png>

However the same code will not accept Component as a possible value.

<image007.png>

I can even create a new Subclass Component and get two (different) subclasses with the same name.

Any thoughts as to what is going on and if so how to resolve the problem?

Many thanks in advance for any and all feedback.

Kind regards

Robert Briggs

A thought occurred to me.  I use a ERA100SharedPool to hold the CurrentProject global variable, for access by the classes in my model. I ran a test on the offending image to retrieve and inspect the contents of CurrentProject which is a reference to ERAProject.  Each time an instance of an ERAElement subclass is created an entry is added to a Dictionary of instances of the relevant subclass.  It still holds instances of the Component Subclass created during one of my unit tests.  I wonder if this may be a clue as it is essentially a hanging reference to the subclass.  I probably should have a tear-down method to clean up such references. R From: Guillermo Polito <guillermopolito@gmail.com> Reply to: Any question about pharo is welcome <pharo-users@lists.pharo.org> Date: Monday, 10 January 2022 at 08:47 To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Cc: Robert Briggs <rbriggs2009@me.com> Subject: [Pharo-users] Re: Ghost subclass Hi Robert, Can you tell us how did you remove the subclasses? Was it through the UI? Which option? Or was it programatically? Can you reproduce it? G El 8 ene 2022, a las 18:25, Robert Briggs via Pharo-users <pharo-users@lists.pharo.org> escribió: Hi I currently have a problem that I am unable to resolve. I am working on a personal project. I created a Class ‘ERAElement’ and four subclasses: ‘Component’, ‘CriticalIssue’, ‘Decision’ and ‘Requirement’. A while ago I removed he subclass Component, and naturally Pharo will not let me create an instance of this subclasses. However it is still listed in the ERAElement subclass collection. As shown below. <image001.png> I can test for existence of each subclass as shown below: <image002.png> However the same code will not accept Component as a possible value. <image007.png> I can even create a new Subclass Component and get two (different) subclasses with the same name. Any thoughts as to what is going on and if so how to resolve the problem? Many thanks in advance for any and all feedback. Kind regards Robert Briggs
RB
Robert Briggs
Mon, Jan 10, 2022 10:51 AM

Just to let you know, I appear to have successfully removed the offending subclass by executing the following in Playground after setting CurrentProject to nil.

| s sc|

s := ERAElement subclasses.

sc := s at: 1.

ERAElement removeSubclass: sc

Let me know if you think there is anything left to do?

Regards

R

From: Robert Briggs via Pharo-users pharo-users@lists.pharo.org
Reply to: Any question about pharo is welcome pharo-users@lists.pharo.org
Date: Monday, 10 January 2022 at 10:21
To: Any question about pharo is welcome pharo-users@lists.pharo.org
Cc: Robert Briggs rbriggs2009@me.com
Subject: [Pharo-users] Re: Ghost subclass

A thought occurred to me.  I use a ERA100SharedPool to hold the CurrentProject global variable, for access by the classes in my model.

I ran a test on the offending image to retrieve and inspect the contents of CurrentProject which is a reference to ERAProject.  Each time an instance of an ERAElement subclass is created an entry is added to a Dictionary of instances of the relevant subclass.  It still holds instances of the Component Subclass created during one of my unit tests.  I wonder if this may be a clue as it is essentially a hanging reference to the subclass.  I probably should have a tear-down method to clean up such references.

R

From: Guillermo Polito guillermopolito@gmail.com
Reply to: Any question about pharo is welcome pharo-users@lists.pharo.org
Date: Monday, 10 January 2022 at 08:47
To: Any question about pharo is welcome pharo-users@lists.pharo.org
Cc: Robert Briggs rbriggs2009@me.com
Subject: [Pharo-users] Re: Ghost subclass

Hi Robert,

Can you tell us how did you remove the subclasses? Was it through the UI? Which option? Or was it programatically?

Can you reproduce it?

G

El 8 ene 2022, a las 18:25, Robert Briggs via Pharo-users pharo-users@lists.pharo.org escribió:

Hi

I currently have a problem that I am unable to resolve.

I am working on a personal project.

I created a Class ‘ERAElement’ and four subclasses: ‘Component’, ‘CriticalIssue’, ‘Decision’ and ‘Requirement’.

A while ago I removed he subclass Component, and naturally Pharo will not let me create an instance of this subclasses.  However it is still listed in the ERAElement subclass collection. As shown below.

<image001.png>

I can test for existence of each subclass as shown below:

<image002.png>

However the same code will not accept Component as a possible value.

<image007.png>

I can even create a new Subclass Component and get two (different) subclasses with the same name.

Any thoughts as to what is going on and if so how to resolve the problem?

Many thanks in advance for any and all feedback.

Kind regards

Robert Briggs

Just to let you know, I appear to have successfully removed the offending subclass by executing the following in Playground after setting CurrentProject to nil. | s sc| s := ERAElement subclasses. sc := s at: 1. ERAElement removeSubclass: sc Let me know if you think there is anything left to do? Regards R From: Robert Briggs via Pharo-users <pharo-users@lists.pharo.org> Reply to: Any question about pharo is welcome <pharo-users@lists.pharo.org> Date: Monday, 10 January 2022 at 10:21 To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Cc: Robert Briggs <rbriggs2009@me.com> Subject: [Pharo-users] Re: Ghost subclass A thought occurred to me. I use a ERA100SharedPool to hold the CurrentProject global variable, for access by the classes in my model. I ran a test on the offending image to retrieve and inspect the contents of CurrentProject which is a reference to ERAProject. Each time an instance of an ERAElement subclass is created an entry is added to a Dictionary of instances of the relevant subclass. It still holds instances of the Component Subclass created during one of my unit tests. I wonder if this may be a clue as it is essentially a hanging reference to the subclass. I probably should have a tear-down method to clean up such references. R From: Guillermo Polito <guillermopolito@gmail.com> Reply to: Any question about pharo is welcome <pharo-users@lists.pharo.org> Date: Monday, 10 January 2022 at 08:47 To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Cc: Robert Briggs <rbriggs2009@me.com> Subject: [Pharo-users] Re: Ghost subclass Hi Robert, Can you tell us how did you remove the subclasses? Was it through the UI? Which option? Or was it programatically? Can you reproduce it? G El 8 ene 2022, a las 18:25, Robert Briggs via Pharo-users <pharo-users@lists.pharo.org> escribió: Hi I currently have a problem that I am unable to resolve. I am working on a personal project. I created a Class ‘ERAElement’ and four subclasses: ‘Component’, ‘CriticalIssue’, ‘Decision’ and ‘Requirement’. A while ago I removed he subclass Component, and naturally Pharo will not let me create an instance of this subclasses. However it is still listed in the ERAElement subclass collection. As shown below. <image001.png> I can test for existence of each subclass as shown below: <image002.png> However the same code will not accept Component as a possible value. <image007.png> I can even create a new Subclass Component and get two (different) subclasses with the same name. Any thoughts as to what is going on and if so how to resolve the problem? Many thanks in advance for any and all feedback. Kind regards Robert Briggs