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