Added source: accessor.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 06 Nov 2014 04:14:18 +0100
changeset 937 8cbc9884f0cd
parent 936 c4564a0396b9
child 938 f544f968df1d
Added source: accessor.
MCMethodDefinition.st
--- a/MCMethodDefinition.st	Sat Nov 01 01:21:08 2014 +0100
+++ b/MCMethodDefinition.st	Thu Nov 06 04:14:18 2014 +0100
@@ -1,8 +1,7 @@
 "{ Package: 'stx:goodies/monticello' }"
 
 MCDefinition subclass:#MCMethodDefinition
-	instanceVariableNames:'classIsMeta source category selector className timeStamp
-	'
+	instanceVariableNames:'classIsMeta source category selector className timeStamp'
 	classVariableNames:'Definitions'
 	poolDictionaries:''
 	category:'SCM-Monticello-Modeling'
@@ -54,7 +53,7 @@
 		or: [definition className ~= aMethodReference classSymbol]
 		or: [definition classIsMeta ~= aMethodReference classIsMeta]
 		or: [definition category ~= aMethodReference category])
-			ifTrue: [definition := self 
+			ifTrue: [definition := self
 						className: aMethodReference classSymbol
 						classIsMeta: aMethodReference classIsMeta
 						selector: aMethodReference methodSymbol
@@ -63,7 +62,7 @@
 						source: aMethodReference source.
 					self cachedDefinitions at: aMethodReference compiledMethod put: definition].
 	^ definition
-	
+
 !
 
 initialize
@@ -82,11 +81,11 @@
 !MCMethodDefinition methodsFor:'accessing'!
 
 actualClass
-    ^ Smalltalk 
+    ^ Smalltalk
         at:(self installedClassName ? className) asSymbol
-        ifPresent: [:class | 
-            classIsMeta 
-                ifTrue: [class theMetaclass "classSide"] 
+        ifPresent: [:class |
+            classIsMeta
+                ifTrue: [class theMetaclass "classSide"]
                 ifFalse: [class]
         ]
 
@@ -111,7 +110,7 @@
 !
 
 description
-	^ Array	
+	^ Array
 		with: className
 		with: selector
 		with: classIsMeta
@@ -145,6 +144,10 @@
 	^ source
 !
 
+source: something
+	source := something
+!
+
 timeStamp
 	^ timeStamp
 ! !
@@ -154,7 +157,7 @@
 printAnnotations: requests on: aStream
 	"Add a string for an annotation pane, trying to fulfill the annotation requests.
 	These might include anything that
-		Preferences defaultAnnotationRequests 
+		Preferences defaultAnnotationRequests
 	might return. Which includes anything in
 		Preferences annotationInfo
 	To edit these, use:"
@@ -236,7 +239,7 @@
     package := MCStXPackageQuery query.
     actualClass := self actualClass.
     actualClass isNil ifTrue:[
-        MCCannotLoadMethodError 
+        MCCannotLoadMethodError
             raiseRequestWith:self
             errorString:('missing class: %1' bindWith:className).
         ^ self "/ proceeded
@@ -309,9 +312,9 @@
 						stamp := tokens at: tokens size]].
 		methodCategory := tokens after: #methodsFor: ifAbsent: ['as yet unclassifed'].
 		methodCategory = category ifFalse:
-			[methodCategory = (Smalltalk 
-									at: #Categorizer 
-									ifAbsent: [Smalltalk at: #ClassOrganizer]) 
+			[methodCategory = (Smalltalk
+									at: #Categorizer
+									ifAbsent: [Smalltalk at: #ClassOrganizer])
 										default ifTrue: [methodCategory := methodCategory, ' '].
 			^ ChangeRecord new file: file position: position type: #method
 						class: className category: methodCategory meta: classIsMeta stamp: stamp].
@@ -320,7 +323,7 @@
 			[file := sourceFilesCopy at: prevFileIndex]].
 		^ nil]
 			ensure: [sourceFilesCopy do: [:x | x notNil ifTrue: [x close]]]
-	
+
 !
 
 unload
@@ -363,7 +366,7 @@
 existingMethodOrNil
     | actualClass |
     actualClass := self actualClass.
-    ^actualClass 
+    ^actualClass
         ifNil:[nil]
         ifNotNil: [actualClass compiledMethodAt:self selector]
 
@@ -377,7 +380,7 @@
 selector: selectorString
 category: catString
 timeStamp: timeString
-source: sourceString 
+source: sourceString
         className := classString asSymbol.
         selector := selectorString asSymbol.
         category := catString asSymbol.
@@ -396,7 +399,7 @@
 
 isInitializer
 	^ selector = #initialize and: [classIsMeta]
-	
+
 !
 
 isMethodDefinition
@@ -408,7 +411,7 @@
     | oldMethod |
 
     oldMethod := self existingMethodOrNil.
-    ^oldMethod 
+    ^oldMethod
         ifNil:[false]
         ifNotNil:[oldMethod package ~= MCStXPackageQuery query]
 
@@ -424,15 +427,15 @@
 !MCMethodDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCMethodDefinition.st,v 1.14 2013-08-12 00:44:57 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCMethodDefinition.st,v 1.15 2014-11-06 03:14:18 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCMethodDefinition.st,v 1.14 2013-08-12 00:44:57 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCMethodDefinition.st,v 1.15 2014-11-06 03:14:18 vrany Exp $'
 !
 
 version_SVN
-    ^ '$Id: MCMethodDefinition.st,v 1.14 2013-08-12 00:44:57 vrany Exp $'
+    ^ '$Id: MCMethodDefinition.st,v 1.15 2014-11-06 03:14:18 vrany Exp $'
 ! !