Question

This should hopefully be a simple question. :)

I'm using Pharo / Seaside. I have used the refactoring capability in the IDE to rename and remove a few of my methods and classes. So far so good.

However, I'm having difficulty removing a method that overrides the parent class. For example, I have a class "MyClass" that subclasses "WAComponent". I created a method "style" that overrides a method in the parent class.

I decided I don't really need to override "style" after all and want to Refactor method > Remove "style". At this point I receive the following prompt "Possible call to style in WAPresenter. Browse references?"

How do I proceed? I just want the super's "style" method and not my own override.

Many thanks!

Was it helpful?

Solution

When you try to remove a method; either with the refactoring browser, OmniBrowser, or the standard Browser; the system warns you if there are senders of that message in the image. This gives you an opportunity to see the possible ramifications of the removal. It's not perfect because a) in a dynamic system, it can't be sure if the receiver is an instance of your class, and b) it doesn't catch senders using #perform:

In your case, the message does seem a little confusing. Also, in Pharo 1.3, it seems not to remove the method no matter what you select! But there is no harm in just removing it directly via your browser (Cmd-x in OmniBrowser on Mac or via the menu) because any calls to this method will go to the superclass.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top