On Tue, Oct 20, 2009 at 1:24 PM, Simon Denier <[email protected]> wrote:
> Does anybody have a tool to detect class extensions which override
> methods? Because that's so bad it's evil.

You can have a look at the following script which basically warns you
if you load a package that overrides a method IIRC.

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry
'From Pharo0.1 of 16 May 2008 [Latest update: #10399] on 30 July 2009 at 9:54:19 am'!

!MCMethodDefinition methodsFor: 'accessing' stamp: 'damiencassou 7/30/2009 09:54'!
checkMethodAlreadyExists
	(self actualClass includesSelector: self selector)
		ifTrue: [Warning signal: 'a package is overriding ', self actualClass printString, '>>', self selector]! !

!MCMethodDefinition methodsFor: 'accessing' stamp: 'damiencassou 7/30/2009 09:48'!
load
	self checkMethodAlreadyExists.
	self actualClass
		compile: source
		classified: category
		withStamp: timeStamp
		notifying: (SyntaxError new category: category)! !

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to