WrappedMethod.st
branchjv
changeset 3329 a4cbc797038b
parent 3300 965757a9a4b7
parent 3306 b4017262b2cd
child 3373 ef0f9ee70942
--- a/WrappedMethod.st	Wed Jun 12 11:54:30 2013 +0100
+++ b/WrappedMethod.st	Mon Jul 01 22:14:32 2013 +0100
@@ -53,7 +53,7 @@
 !WrappedMethod class methodsFor:'others'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/WrappedMethod.st,v 1.34 2013-06-09 13:32:56 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/WrappedMethod.st,v 1.35 2013-06-14 12:25:03 cg Exp $'
 !
 
 version_HG
@@ -210,6 +210,21 @@
     ^ self originalMethod programmingLanguage
 !
 
+replaceOriginalMethodWith:aNewMethod
+    "change the original method which is going to be invoked by this wrapper.
+     The only place where this makes sense is when the original method has to be 
+     replaced by a recompiled breakpointed method (in the debugger)."
+
+    "a kludge: it is in my literal array somewhere"
+    1 to:(super numLiterals) do:[:i |
+        (super literalAt:i) isMethod ifTrue:[
+            super literalAt:i put:aNewMethod.
+            ^ self.
+        ]
+    ].
+    ^ self
+!
+
 restricted:aBoolean
     ^ self originalMethod restricted:aBoolean
 !
@@ -250,6 +265,19 @@
     "Created: / 01-07-2011 / 10:03:32 / cg"
 ! !
 
+!WrappedMethod methodsFor:'printing and storing'!
+
+printOn:aStream
+    "put a printed representation of the receiver onto aStream.
+     Since methods do not store their class/selector, we have to search
+     for it here."
+
+    self basicPrintOn:aStream."/ aStream nextPutAll:(self classNameWithArticle).
+    aStream nextPutAll:'(for '.
+    aStream nextPutAll:self originalMethod whoString.
+    aStream nextPutAll:')'.
+! !
+
 !WrappedMethod methodsFor:'private'!
 
 annotationAtIndex: index
@@ -374,6 +402,6 @@
 !
 
 version_SVN
-    ^ '$Id: WrappedMethod.st,v 1.34 2013-06-09 13:32:56 cg Exp $'
+    ^ '$Id: WrappedMethod.st,v 1.35 2013-06-14 12:25:03 cg Exp $'
 ! !