#REFACTORING by cg
authorClaus Gittinger <cg@exept.de>
Sun, 03 Mar 2019 23:18:13 +0100
changeset 23826 f122be17a8d0
parent 23825 8debffbe8eac
child 23827 d9f5a3454db2
#REFACTORING by cg class: Behavior changed: #setMethodDictionary:
Behavior.st
--- a/Behavior.st	Sun Mar 03 23:08:07 2019 +0100
+++ b/Behavior.st	Sun Mar 03 23:18:13 2019 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
@@ -1440,7 +1442,6 @@
 
 ! !
 
-
 !Behavior methodsFor:'RefactoringBrowser'!
 
 realClass
@@ -3289,27 +3290,32 @@
     "/ find any methods ...), we convert it here if required.
     "/ No other classes instances are allowed.
 
-    dict class ~~ MethodDictionary ifTrue:[
-        methodDictionary := MethodDictionary withAll:dict.
-        methodDictionary isNil ifTrue:[
-
-            "/ refuse to do this
-            "/ (can only happen in case of memory allocation trouble,
-            "/  where the allocation failed and some exception handler returned
-            "/  nil ...)
-
-            self proceedableError:'cannot set methodDictionary to nil'.
-            ^ self.
+    dict class == MethodDictionary ifTrue:[
+        methodDictionary := dict.
+    ] ifFalse:[
+        (dict class inheritsFrom:MethodDictionary) ifTrue:[
+            "/ the VM can handle those
+            methodDictionary := dict.
+        ] ifFalse:[    
+            methodDictionary := MethodDictionary withAll:dict.
+            methodDictionary isNil ifTrue:[
+
+                "/ refuse to do this
+                "/ (can only happen in case of memory allocation trouble,
+                "/  where the allocation failed and some exception handler returned
+                "/  nil ...)
+
+                self proceedableError:'cannot set methodDictionary to nil'.
+                ^ self.
+            ]
         ]
-    ] ifFalse:[
-        methodDictionary := dict.
     ].
     ^ self.
 
     "Created: / 05-06-1996 / 11:29:36 / stefan"
     "Modified: / 12-06-1996 / 13:58:55 / stefan"
     "Modified: / 22-01-1997 / 21:10:48 / cg"
-    "Modified: / 24-05-2018 / 21:06:15 / Claus Gittinger"
+    "Modified: / 03-03-2019 / 20:06:57 / Claus Gittinger"
 !
 
 setSuperclass:aClass