class: MethodChange
changed:
#apply
#printOn: (send #fullClassName instead of #className)
namespace fixes (I hope)
--- a/MethodChange.st Tue Mar 24 15:16:29 2015 +0100
+++ b/MethodChange.st Tue Mar 24 16:30:35 2015 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1993 by Claus Gittinger
All Rights Reserved
@@ -283,7 +285,14 @@
]])
ifFalse:[
"/ try a replacement class in the same namespace again
- suggestion := LastReplacementClass.
+ (className includesString:'::') ifTrue:[
+ suggestion := className copyFrom:(className lastIndexOf:$:)+1.
+ (Smalltalk classNamed:suggestion) isBehavior ifFalse:[
+ suggestion := nil.
+ ].
+ ].
+ suggestion := suggestion ? LastReplacementClass.
+
(class notNil
and:[ (class := class nameSpace classNamed:className) notNil
and:[
@@ -306,11 +315,12 @@
self error:('Cannot apply change for missing class: ' , replacementClassName) mayProceed:true.
^ self
].
- (className endsWith:' class') ifTrue:[
- class := class theMetaclass
- ] ifFalse:[
- class := class theNonMetaclass
- ].
+ class := Smalltalk classNamed:replacementClassName.
+"/ (className endsWith:' class') ifTrue:[
+"/ class := class theMetaclass
+"/ ] ifFalse:[
+"/ class := class theNonMetaclass
+"/ ].
LastReplacementClass := replacementClassName
]
]
@@ -434,7 +444,7 @@
The format is suitable for a human - not meant to be read back."
aStream
- nextPutAll:(self className ? 'unnamed');
+ nextPutAll:(self fullClassName ? 'unnamed');
nextPutAll:' >> ';
nextPutAll:(selector ? '?');
nextPutAll:' {';
@@ -535,14 +545,14 @@
!MethodChange class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/MethodChange.st,v 1.79 2015-02-09 10:09:58 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/MethodChange.st,v 1.80 2015-03-24 15:30:35 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic3/MethodChange.st,v 1.79 2015-02-09 10:09:58 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/MethodChange.st,v 1.80 2015-03-24 15:30:35 cg Exp $'
!
version_SVN
- ^ '$Id: MethodChange.st,v 1.79 2015-02-09 10:09:58 cg Exp $'
+ ^ '$Id: MethodChange.st,v 1.80 2015-03-24 15:30:35 cg Exp $'
! !