class: ClassDescription
authorClaus Gittinger <cg@exept.de>
Thu, 24 Jan 2013 16:50:38 +0100
changeset 14702 8311953750d6
parent 14701 50c3faf6eb60
child 14703 6a9a49cea683
class: ClassDescription changed: #addChangeRecordForMethod: #addSelector:withMethod: #removeSelector: don't write change records for changes to anonymus classes, which are constructed on the fly
ClassDescription.st
--- a/ClassDescription.st	Thu Jan 24 16:24:00 2013 +0100
+++ b/ClassDescription.st	Thu Jan 24 16:50:38 2013 +0100
@@ -820,7 +820,6 @@
     "Created: / 28.3.1998 / 21:21:52 / cg"
 ! !
 
-
 !ClassDescription methodsFor:'Compatibility-V''Age'!
 
 categoriesFor:aSelector are:listOfCategories
@@ -1181,7 +1180,10 @@
     ].
 
     (super addSelector:newSelector withMethod:newMethod) ifTrue:[
-        self addChangeRecordForMethod:newMethod fromOld:oldMethod.
+        "/ only write change records for changes to non-anonymous classes
+        self containingNameSpace notNil ifTrue:[
+            self addChangeRecordForMethod:newMethod fromOld:oldMethod.
+        ]
     ].
 
     "Modified: / 09-09-1996 / 22:39:32 / stefan"
@@ -1219,20 +1221,23 @@
     ].
 
     (super removeSelector:aSelector) ifTrue:[
-        self addChangeRecordForRemoveSelector:aSelector fromOld:oldMethod.
-        "/
-        "/ also notify a change of mySelf;
-        "/
-        self changed:#methodDictionary with:aSelector.
-
-        "/
-        "/ also notify a change of Smalltalk;
-        "/ this allows a dependent of Smalltalk to watch all class
-        "/ changes (no need for observing all classes)
-        "/ - this allows for watchers to find out if its a new method or a method-change
-        "/
-        MethodRemoveChangeNotificationParameter notNil ifTrue:[
-            Smalltalk changed:#methodInClassRemoved with:(MethodRemoveChangeNotificationParameter changeClass:self changeSelector:aSelector).
+        "/ only write change records for changes to non-anonymous classes
+        self containingNameSpace notNil ifTrue:[
+            self addChangeRecordForRemoveSelector:aSelector fromOld:oldMethod.
+            "/
+            "/ also notify a change of mySelf;
+            "/
+            self changed:#methodDictionary with:aSelector.
+
+            "/
+            "/ also notify a change of Smalltalk;
+            "/ this allows a dependent of Smalltalk to watch all class
+            "/ changes (no need for observing all classes)
+            "/ - this allows for watchers to find out if its a new method or a method-change
+            "/
+            MethodRemoveChangeNotificationParameter notNil ifTrue:[
+                Smalltalk changed:#methodInClassRemoved with:(MethodRemoveChangeNotificationParameter changeClass:self changeSelector:aSelector).
+            ]
         ]
     ]
 
@@ -1285,19 +1290,22 @@
 !ClassDescription methodsFor:'changes management'!
 
 addChangeRecordForMethod:aMethod
+    <resource: #obsolete>
     "{ Pragma: +optSpace }"
 
+    self obsoleteMethodWarning:'use addChangeRecordForMethod:fromOld:'.
+
     "add a method-change-record to the changes file and to the current changeSet"
 
     UpdateChangeFileQuerySignal query ifTrue:[
-	self writingChangePerform:#addChangeRecordForMethod:to: with:aMethod.
+        self writingChangePerform:#addChangeRecordForMethod:to: with:aMethod.
     ].
 
     "this test allows a smalltalk without Projects/ChangeSets"
     Project notNil ifTrue:[
-	UpdateChangeListQuerySignal query ifTrue:[
-	    Project addMethodChange:aMethod in:self
-	]
+        UpdateChangeListQuerySignal query ifTrue:[
+            Project addMethodChange:aMethod in:self
+        ]
     ]
 
     "Modified: / 20.1.1997 / 12:36:02 / cg"
@@ -4229,11 +4237,11 @@
 !ClassDescription class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.230 2013-01-03 09:20:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.231 2013-01-24 15:50:38 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.230 2013-01-03 09:20:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.231 2013-01-24 15:50:38 cg Exp $'
 ! !