SourceCodeManagerUtilities.st
changeset 3674 d9b94d8afb2c
parent 3657 2de3a610d07c
child 3676 51859e5df3b5
--- a/SourceCodeManagerUtilities.st	Sat Nov 29 03:33:25 2014 +0100
+++ b/SourceCodeManagerUtilities.st	Sat Nov 29 03:38:01 2014 +0100
@@ -3063,7 +3063,7 @@
 !
 
 ensureCorrectVersionMethodsInClass:aClass usingManager:aManager
-    |theMetaclass src newSrc versionMethodName oldVersionMethodName|
+    |theMetaclass versionMthd src newSrc versionMethodName oldVersionMethodName|
 
     theMetaclass := aClass theMetaclass.
     versionMethodName := aManager nameOfVersionMethodInClasses.
@@ -3074,23 +3074,28 @@
 "/            theMetaclass removeSelector:oldVersionMethodName.   
 "/        ].
         "/ ensure that my version method is parsable (contains $'s)
-        src := (theMetaclass compiledMethodAt:versionMethodName) source.
-        src notNil ifTrue:[
-            newSrc := aManager ensureDollarsInVersionMethod:src.
-            newSrc ~= src ifTrue:[
-                theMetaclass compile:newSrc.
-            ]
+        versionMthd := theMetaclass compiledMethodAt:versionMethodName.
+        versionMthd notNil ifTrue:[
+            src := versionMthd source.
+            src notNil ifTrue:[
+                newSrc := aManager ensureDollarsInVersionMethod:src.
+                newSrc ~= src ifTrue:[
+                    theMetaclass compile:newSrc categorized:#documentation.
+                ]
+            ].
         ].
     ] ifFalse:[
         (theMetaclass includesSelector:oldVersionMethodName) ifTrue:[
             "/ but make sure, it is a version method for this sourcecodemanager...
             (theMetaclass methodDictionary keys count:[:sel | sel startsWith:'version']) size == 1 ifTrue:[
-                src := (theMetaclass compiledMethodAt:oldVersionMethodName) source.
-                (src startsWith:oldVersionMethodName) ifTrue:[
-                    newSrc := versionMethodName 
-                              , (src copyFrom:(oldVersionMethodName size + 1))
-                ].
-                theMetaclass compile:newSrc.
+                versionMthd := theMetaclass compiledMethodAt:oldVersionMethodName.
+                versionMthd notNil ifTrue:[
+                    src := versionMthd source.
+                    (src startsWith:oldVersionMethodName) ifTrue:[
+                        newSrc := versionMethodName , (src copyFrom:(oldVersionMethodName size + 1))
+                    ].
+                    theMetaclass compile:newSrc categorized:#documentation.
+                ]
             ]
         ].
     ].
@@ -4288,10 +4293,10 @@
 !SourceCodeManagerUtilities class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.311 2014-11-28 17:30:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.312 2014-11-29 02:38:01 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.311 2014-11-28 17:30:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.312 2014-11-29 02:38:01 cg Exp $'
 ! !