--- a/Tools_ClassChecker.st Mon Dec 08 00:08:22 2008 +0100
+++ b/Tools_ClassChecker.st Mon Dec 08 00:14:26 2008 +0100
@@ -138,7 +138,7 @@
self doCheck:#classVariablesNeverWritten.
self doCheck:#classInstanceVariablesNeverUsed.
self doCheck:#classInstanceVariablesNeverWritten.
- self doCheck:#invalidkeyInImageResourceMethod
+ self doCheck:#invalidKeyInImageResourceMethod
! !
!ClassChecker methodsFor:'checks-individual'!
@@ -277,6 +277,29 @@
self instanceVariablesNeverWrittenIn:checkedClass theNonMetaclass.
!
+invalidKeyInImageResourceMethod
+ Icon flushCachedIcons.
+ checkedClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
+ |img key name|
+
+ (mthd hasResource:#image) ifTrue:[
+ img := mthd valueWithReceiver:nil arguments:#().
+ key := (Icon classVarAt:#KnownIcons) keyAtIdentityValue:img.
+ key notNil ifTrue:[
+ mthd mclass notNil ifTrue:[
+ name := (mthd mclass name , ' ', mthd selector).
+ name ~= key ifTrue:[
+ self
+ rememberBadMethod:mthd
+ key:#invalidKeyInImageResourceMethod
+ info:('key in constantNamed: does not match the method name')
+ ]
+ ]
+ ]
+ ]
+ ].
+!
+
invalidkeyInImageResourceMethod
Icon flushCachedIcons.
checkedClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
@@ -847,5 +870,5 @@
!ClassChecker class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Tools_ClassChecker.st,v 1.11 2008-12-07 22:56:08 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools_ClassChecker.st,v 1.12 2008-12-07 23:14:26 cg Exp $'
! !