author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 09 Oct 2015 17:46:53 +0100 | |
branch | jv |
changeset 3913 | 3d160ce7bef3 |
parent 3303 | 7ed5d48e3756 |
child 3914 | cd8de87107d3 |
permissions | -rw-r--r-- |
25 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
957 | 12 |
"{ Package: 'stx:libbasic3' }" |
13 |
||
3913
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
15 |
|
15 | 16 |
MethodChange subclass:#MethodCategoryChange |
2873 | 17 |
instanceVariableNames:'origin' |
235 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'System-Changes' |
|
15 | 21 |
! |
22 |
||
25 | 23 |
!MethodCategoryChange class methodsFor:'documentation'! |
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
45 | 39 |
documentation |
40 |
" |
|
41 |
instances represent method-category changes (as done in the browser). |
|
42 |
They are typically held in a ChangeSet. |
|
235 | 43 |
|
2873 | 44 |
Change origin. |
45 |
||
46 |
When a changeset diff is generated, two MethodChanges that |
|
47 |
represent the same method (code is the same) might differ only in |
|
48 |
category/ Such changes are transformed to MethodCategoruChanges. |
|
49 |
In that case, origin keeps the reference to original MethodChange. |
|
50 |
||
235 | 51 |
[author:] |
52 |
Claus Gittinger |
|
2873 | 53 |
Jan Vrany |
54 |
||
55 |
[instance variables:] |
|
56 |
origin <MethodChange> Change that cause this category |
|
57 |
change to be created. See comment. |
|
58 |
||
59 |
||
45 | 60 |
" |
25 | 61 |
! ! |
62 |
||
2873 | 63 |
!MethodCategoryChange class methodsFor:'others'! |
64 |
||
65 |
version_CVS |
|
66 |
^ '$Header: /cvs/stx/stx/libbasic3/MethodCategoryChange.st,v 1.22 2012-07-31 12:27:40 vrany Exp $' |
|
67 |
! ! |
|
68 |
||
15 | 69 |
!MethodCategoryChange methodsFor:'accessing'! |
70 |
||
71 |
class:cls selector:sel category:cat |
|
1902
20db5f942dbd
changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
72 |
self className:cls name selector:sel category:cat |
15 | 73 |
|
1902
20db5f942dbd
changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
74 |
"Modified: / 12-11-2006 / 15:55:11 / cg" |
85 | 75 |
! |
76 |
||
654 | 77 |
className:clsName selector:sel category:cat |
78 |
className := clsName. |
|
79 |
selector := sel. |
|
852 | 80 |
methodCategory := cat |
654 | 81 |
|
82 |
"Created: / 16.2.1998 / 14:14:16 / cg" |
|
83 |
! |
|
84 |
||
3913
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
85 |
deltaDetail |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
86 |
"Returns a delta to the current state as a ChangeDelta object" |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
87 |
|
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
88 |
| mth| |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
89 |
|
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
90 |
mth := self changeMethod. |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
91 |
(mth category = methodCategory) ifTrue:[ |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
92 |
^ ChangeDeltaInformation identical |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
93 |
]. |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
94 |
^ ChangeDeltaInformation different |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
95 |
|
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
96 |
"Created: / 09-10-2015 / 17:45:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
97 |
! |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
98 |
|
2873 | 99 |
origin |
100 |
^ origin |
|
101 |
! |
|
102 |
||
103 |
origin:aMethodChange |
|
104 |
origin := aMethodChange. |
|
105 |
! |
|
106 |
||
1052 | 107 |
prettyPrintedSource |
1846 | 108 |
^ self sourceForMethod, Character cr |
1052 | 109 |
, ' category:' , methodCategory storeString |
1846 | 110 |
|
111 |
"Modified: / 09-10-2006 / 13:59:15 / cg" |
|
1052 | 112 |
! |
113 |
||
85 | 114 |
source |
1846 | 115 |
^ self sourceForMethod , ' category:' , methodCategory storeString |
852 | 116 |
|
1846 | 117 |
"Modified: / 09-10-2006 / 13:59:10 / cg" |
2873 | 118 |
! |
119 |
||
120 |
source: aString |
|
121 |
| expr | |
|
122 |
||
123 |
expr := Parser parseExpression: aString onError: [ self error: 'Invalid source']. |
|
124 |
expr isMessage ifFalse:[ self error: 'Invalid source' ]. |
|
125 |
expr selector == #'category:' ifFalse:[ self error: 'Invalid source' ]. |
|
126 |
methodCategory := expr arguments first value. |
|
127 |
||
128 |
"Created: / 20-03-2012 / 22:26:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
852 | 129 |
! ! |
130 |
||
131 |
!MethodCategoryChange methodsFor:'applying'! |
|
132 |
||
133 |
apply |
|
134 |
"apply the change" |
|
85 | 135 |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
136 |
|mthd| |
852 | 137 |
|
138 |
mthd := self changeMethod. |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
139 |
mthd category:methodCategory asSymbol. |
852 | 140 |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
141 |
"Modified: / 23-11-2006 / 16:59:09 / cg" |
15 | 142 |
! ! |
143 |
||
2131 | 144 |
!MethodCategoryChange methodsFor:'testing'! |
964
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
145 |
|
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
146 |
isMethodCategoryChange |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
147 |
^ true |
2263 | 148 |
! |
149 |
||
150 |
isMethodCodeChange |
|
151 |
"true if this is a method's code change (not package, category etc.)" |
|
152 |
||
153 |
^ false |
|
964
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
154 |
! ! |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
155 |
|
2622
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
156 |
!MethodCategoryChange methodsFor:'visiting'! |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
157 |
|
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
158 |
acceptChangeVisitor:aVisitor |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
159 |
^ aVisitor visitMethodCategoryChange:self. |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
160 |
|
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
161 |
"Created: / 25-11-2011 / 17:13:58 / cg" |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
162 |
! ! |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
163 |
|
235 | 164 |
!MethodCategoryChange class methodsFor:'documentation'! |
165 |
||
166 |
version |
|
2873 | 167 |
^ '$Header: /cvs/stx/stx/libbasic3/MethodCategoryChange.st,v 1.22 2012-07-31 12:27:40 vrany Exp $' |
2263 | 168 |
! |
169 |
||
3121
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
170 |
version_HG |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
171 |
|
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
172 |
^ '$Changeset: <not expanded> $' |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
173 |
! |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
174 |
|
2873 | 175 |
version_SVN |
176 |
^ '§Id: MethodCategoryChange.st 1909 2012-03-31 00:14:49Z vranyj1 §' |
|
235 | 177 |
! ! |
3121
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
178 |