refactored common code
authorClaus Gittinger <cg@exept.de>
Tue, 28 Jun 2011 23:00:07 +0200
changeset 2370 e87f7109ecfb
parent 2369 ffbd3aa42d28
child 2371 c16f6906f4eb
refactored common code
ClassPrimitiveChange.st
--- a/ClassPrimitiveChange.st	Tue Jun 28 22:59:47 2011 +0200
+++ b/ClassPrimitiveChange.st	Tue Jun 28 23:00:07 2011 +0200
@@ -53,6 +53,32 @@
     "Modified: 3.12.1995 / 14:06:33 / cg"
 ! !
 
+!ClassPrimitiveChange methodsFor:'applying'!
+
+apply
+    "apply the change"
+
+    |class|
+
+    class := self changeClass.
+    class isNil ifTrue:[
+        self error:('Cannot apply change for missing class: ' , className) mayProceed:true.
+        ^ self
+    ].
+    class autoload.         "Most changes cannot be applied to unloaded classes"
+    Class nameSpaceQuerySignal answer:self nameSpace do:[
+        self privateApply
+    ].
+
+    "Created: / 28-06-2011 / 22:58:53 / cg"
+!
+
+privateApply
+    self subclassResponsibility
+
+    "Created: / 28-06-2011 / 22:58:59 / cg"
+! !
+
 !ClassPrimitiveChange methodsFor:'comparing'!
 
 sameAs:changeB
@@ -72,5 +98,9 @@
 !ClassPrimitiveChange class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/ClassPrimitiveChange.st,v 1.6 2009-09-24 08:41:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/ClassPrimitiveChange.st,v 1.7 2011-06-28 21:00:07 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libbasic3/ClassPrimitiveChange.st,v 1.7 2011-06-28 21:00:07 cg Exp $'
 ! !