author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 28 Aug 2017 16:16:00 +0100 | |
branch | jv |
changeset 4259 | 4f1299274d32 |
parent 3987 | 738fa61cb840 |
child 4330 | 998eb03f0736 |
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 |
||
3984 | 14 |
"{ NameSpace: Smalltalk }" |
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 |
||
3984 | 63 |
!MethodCategoryChange class methodsFor:'instance creation'! |
64 |
||
65 |
class:cls selector:sel category:cat |
|
66 |
^ self basicNew class:cls selector:sel category:cat |
|
67 |
||
68 |
||
3986 | 69 |
! |
3984 | 70 |
|
3986 | 71 |
className:clsName selector:sel category:cat |
72 |
^ self basicNew className:clsName selector:sel category:cat |
|
2873 | 73 |
|
3986 | 74 |
"Created: / 12-11-2006 / 15:54:25 / cg" |
2873 | 75 |
! ! |
76 |
||
15 | 77 |
!MethodCategoryChange methodsFor:'accessing'! |
78 |
||
79 |
class:cls selector:sel category:cat |
|
1902
20db5f942dbd
changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
80 |
self className:cls name selector:sel category:cat |
15 | 81 |
|
1902
20db5f942dbd
changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
82 |
"Modified: / 12-11-2006 / 15:55:11 / cg" |
85 | 83 |
! |
84 |
||
654 | 85 |
className:clsName selector:sel category:cat |
86 |
className := clsName. |
|
87 |
selector := sel. |
|
852 | 88 |
methodCategory := cat |
654 | 89 |
|
90 |
"Created: / 16.2.1998 / 14:14:16 / cg" |
|
91 |
! |
|
92 |
||
3913
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
93 |
deltaDetail |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
94 |
"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
|
95 |
|
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
96 |
| mth| |
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 |
mth := self changeMethod. |
3914
cd8de87107d3
Oops, fixed MethodCategoryChange>>deltaDetail: care for non-existent method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3913
diff
changeset
|
99 |
(mth notNil and:[mth category = methodCategory]) ifTrue:[ |
3913
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
100 |
^ ChangeDeltaInformation identical |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
101 |
]. |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
102 |
^ ChangeDeltaInformation different |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
103 |
|
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
104 |
"Created: / 09-10-2015 / 17:45:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3914
cd8de87107d3
Oops, fixed MethodCategoryChange>>deltaDetail: care for non-existent method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3913
diff
changeset
|
105 |
"Modified: / 12-10-2015 / 16:34:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3913
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
106 |
! |
3d160ce7bef3
Added MethodCategoryChange>>deltaDetail
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3303
diff
changeset
|
107 |
|
2873 | 108 |
origin |
109 |
^ origin |
|
110 |
! |
|
111 |
||
112 |
origin:aMethodChange |
|
113 |
origin := aMethodChange. |
|
114 |
! |
|
115 |
||
1052 | 116 |
prettyPrintedSource |
1846 | 117 |
^ self sourceForMethod, Character cr |
1052 | 118 |
, ' category:' , methodCategory storeString |
1846 | 119 |
|
120 |
"Modified: / 09-10-2006 / 13:59:15 / cg" |
|
1052 | 121 |
! |
122 |
||
85 | 123 |
source |
1846 | 124 |
^ self sourceForMethod , ' category:' , methodCategory storeString |
852 | 125 |
|
1846 | 126 |
"Modified: / 09-10-2006 / 13:59:10 / cg" |
2873 | 127 |
! |
128 |
||
129 |
source: aString |
|
130 |
| expr | |
|
131 |
||
132 |
expr := Parser parseExpression: aString onError: [ self error: 'Invalid source']. |
|
133 |
expr isMessage ifFalse:[ self error: 'Invalid source' ]. |
|
134 |
expr selector == #'category:' ifFalse:[ self error: 'Invalid source' ]. |
|
135 |
methodCategory := expr arguments first value. |
|
136 |
||
137 |
"Created: / 20-03-2012 / 22:26:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
852 | 138 |
! ! |
139 |
||
140 |
!MethodCategoryChange methodsFor:'applying'! |
|
141 |
||
142 |
apply |
|
143 |
"apply the change" |
|
85 | 144 |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
145 |
|mthd| |
852 | 146 |
|
147 |
mthd := self changeMethod. |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
148 |
mthd category:methodCategory asSymbol. |
852 | 149 |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
150 |
"Modified: / 23-11-2006 / 16:59:09 / cg" |
15 | 151 |
! ! |
152 |
||
2131 | 153 |
!MethodCategoryChange methodsFor:'testing'! |
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 |
isMethodCategoryChange |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
156 |
^ true |
2263 | 157 |
! |
158 |
||
159 |
isMethodCodeChange |
|
160 |
"true if this is a method's code change (not package, category etc.)" |
|
161 |
||
162 |
^ false |
|
964
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
163 |
! ! |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
164 |
|
2622
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
165 |
!MethodCategoryChange methodsFor:'visiting'! |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
166 |
|
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
167 |
acceptChangeVisitor:aVisitor |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
168 |
^ aVisitor visitMethodCategoryChange:self. |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
169 |
|
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
170 |
"Created: / 25-11-2011 / 17:13:58 / cg" |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
171 |
! ! |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
172 |
|
235 | 173 |
!MethodCategoryChange class methodsFor:'documentation'! |
174 |
||
175 |
version |
|
3984 | 176 |
^ '$Header$' |
2263 | 177 |
! |
178 |
||
3986 | 179 |
version_CVS |
180 |
^ '$Header$' |
|
181 |
! |
|
182 |
||
3121
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
183 |
version_HG |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
184 |
|
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
185 |
^ '$Changeset: <not expanded> $' |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
186 |
! |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
187 |
|
2873 | 188 |
version_SVN |
3984 | 189 |
^ '$Id$' |
235 | 190 |
! ! |
3984 | 191 |