#UI_ENHANCEMENT by exept
authorClaus Gittinger <cg@exept.de>
Fri, 23 Aug 2019 21:49:35 +0200
changeset 24592 b003befd8100
parent 24591 2efa5f69125c
child 24593 96186b93d6e2
#UI_ENHANCEMENT by exept class: MessageNotUnderstood changed: #description refactoring & better presentation
MessageNotUnderstood.st
--- a/MessageNotUnderstood.st	Thu Aug 22 01:30:24 2019 +0200
+++ b/MessageNotUnderstood.st	Fri Aug 23 21:49:35 2019 +0200
@@ -134,7 +134,7 @@
 description
     "the human readable description of the exception"
 
-    |searchClass sel description sender|
+    |rcvr searchClass sel description sender|
 
     "extract the class that should have implemented the message.
      (in case of a super-send, this is not the receiver's class)"
@@ -154,9 +154,11 @@
             ].
         ].
     ].
+    rcvr := self receiver.
     searchClass isNil ifTrue:[
-        searchClass := self receiver class.
+        searchClass := rcvr class.
     ].
+
     searchClass notNil ifTrue:[
         "displayString is better than 'cls name',
          since it appends (obsolete) for outdated classes
@@ -164,8 +166,8 @@
           after changing a classes definition),
          and may be also redefined for non-Smalltalk object (i.e. BridgeObjects)"
 
-        searchClass == self receiver class ifTrue:[
-            description := self receiver classDisplayString.
+        searchClass == rcvr class ifTrue:[
+            description := rcvr classDisplayString.
         ] ifFalse:[
             description := searchClass displayString.
         ].
@@ -177,10 +179,10 @@
     ].
     sel := self selector.
     sel class == Symbol ifTrue:[
-        self receiver isNil ifTrue:[
+        rcvr isNil ifTrue:[
             description := 'receiver of "',sel printString,'" is nil'.
-        ] ifFalse:[    
-            (searchClass notNil and:[self receiver isBridgeProxy not and:[searchClass programmingLanguage isSmalltalk]]) ifTrue:[
+        ] ifFalse:[
+            (searchClass notNil and:[rcvr isBridgeProxy not and:[searchClass programmingLanguage isSmalltalk]]) ifTrue:[
                 description := description , ' does not understand: "',sel,'"'.
                 "/ description := sel, ' not understood by ' ,  description.
             ] ifFalse:[ 
@@ -192,7 +194,7 @@
          or a method has been called by #perform: or #valueWithReceiver: with a wrong arg."
 
         "/ assume that it might be ok with other prog. languages
-        (searchClass notNil and:[self receiver isBridgeProxy not and:[searchClass programmingLanguage isSmalltalk]]) ifTrue:[
+        (searchClass notNil and:[rcvr isBridgeProxy not and:[searchClass programmingLanguage isSmalltalk]]) ifTrue:[
             description := description , ' does not understand (nonSymbol): ' , sel printString.
             "/ description := sel printString, ' (nonSymbol) not understood by ' ,  description.
         ] ifFalse:[