avoid to put nil in Set
authorStefan Vogel <sv@exept.de>
Fri, 30 Jun 2006 09:55:16 +0200
changeset 1771 9d6581314aed
parent 1770 85f9b6b68406
child 1772 782a3e74a69f
avoid to put nil in Set
Explainer.st
--- a/Explainer.st	Fri Jun 23 16:27:41 2006 +0200
+++ b/Explainer.st	Fri Jun 30 09:55:16 2006 +0200
@@ -63,6 +63,8 @@
 !
 
 explainMessageNode:node in:code forClass:cls short:short
+    "answer a string which explains node"
+
     |receiver nm srchClass selector selectorString implClass 
      boldSelectorString globalValue recClassSet
      implMethod comment info implMethods comments definer instances classesOfInstVars implementingClasses canBeNil|
@@ -149,11 +151,11 @@
         info := Explainer explainSelector:selector inClass:cls short:short.
     ].
 
-    implementingClasses size > 0 ifTrue:[
+    implementingClasses notEmptyOrNil ifTrue:[
         implMethods := implementingClasses collect:[:implClass | implClass compiledMethodAt:selector].
         implMethods size <= 5 ifTrue:[
-            comments := implMethods collect:[:implMethod | implMethod comment].
-            (comments includes:nil) ifFalse:[
+            comments := implMethods collect:[:implMethod | implMethod comment ? ''].
+            (comments includes:'') ifFalse:[
                 comments := comments collect:[:comment | comment firstLine].
                 comments asSet size == 1 ifTrue:[
                     comment := comments first.    
@@ -1162,5 +1164,5 @@
 !Explainer class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Explainer.st,v 1.72 2006-06-21 07:21:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Explainer.st,v 1.73 2006-06-30 07:55:16 stefan Exp $'
 ! !