Now we thought that replacing them with self class is not equivalent since we could imagine that hardcoding the class name make sure that subclass cannot redefine methods.
No, in many cases this is not equivalent. In my opinion the rule could avoid many false positives if it would only trigger if there are no subclasses. Of course we would then also get more false negatives.
But I wanted to know what was your experiment to that regards.
Two typical false positives I encountered: 1. Factory or builder methods on the class side usually refer to a wide variety of classes. Sometimes such methods also refer to the receiving class, however since you want to make the method also work when called on subclasses you have to hardcode the receiving class. 2. When collecting pragmas you usually write something along: PRErrorView>>renderOptionsOn: html (Pragma allNamed: #option: from: self class to: PRErrorView) do: [ :each | ... ] Given that PRErrorView has the subclasses PRForbiddenView and PRNotFoundView, there are cases where "self class" is not equal to PRErrorView. And the point of the above code is to find all pragmas, up to PRErrorView. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch