author | Claus Gittinger <cg@exept.de> |
Tue, 14 Mar 2017 20:30:21 +0100 | |
changeset 17465 | 27a2e4012a0a |
parent 15338 | e6efd621a4f3 |
child 15566 | 184cea584be5 |
permissions | -rw-r--r-- |
8235 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
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 |
" |
|
7446 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
ToDoListEntry subclass:#CompilerWarningToDoListEntry |
|
7511 | 17 |
instanceVariableNames:'checkAction className class selector position equalityParameter' |
7446 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Smalltalk-ToDo' |
|
21 |
! |
|
22 |
||
8235 | 23 |
!CompilerWarningToDoListEntry class methodsFor:'documentation'! |
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
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 |
! ! |
|
7446 | 38 |
|
7529 | 39 |
!CompilerWarningToDoListEntry class methodsFor:'instance creation'! |
40 |
||
41 |
new |
|
42 |
^ self basicNew initialize |
|
43 |
||
44 |
"Created: / 20-11-2006 / 14:58:52 / cg" |
|
45 |
! ! |
|
46 |
||
7752
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
47 |
!CompilerWarningToDoListEntry class methodsFor:'notification'! |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
48 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
49 |
notifyTodo:msg position:position |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
50 |
className:className selector:selector |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
51 |
severity:severityOrSeveritySymbol priority:priorityOrPrioritySymbol |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
52 |
equalityParameter:equalityParameter checkAction:checkAction |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
53 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
54 |
|entry brwsr| |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
55 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
56 |
(brwsr := Tools::ToDoListBrowser current) isNil ifTrue:[^ self ]. |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
57 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
58 |
entry := self new. |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
59 |
entry |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
60 |
severity:severityOrSeveritySymbol |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
61 |
priority:priorityOrPrioritySymbol |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
62 |
timestamp:(Timestamp now) |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
63 |
message:msg |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
64 |
className:className |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
65 |
selector:selector |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
66 |
checkAction:checkAction |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
67 |
equalityParameter:equalityParameter |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
68 |
position:position. |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
69 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
70 |
(Tools::ToDoNotification notNil and:[Tools::ToDoNotification isHandled]) ifTrue:[ |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
71 |
Tools::ToDoNotification raiseRequestWith:entry |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
72 |
] ifFalse:[ |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
73 |
brwsr addEntry:entry |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
74 |
]. |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
75 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
76 |
"Created: / 15-03-2007 / 18:08:06 / cg" |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
77 |
! ! |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
78 |
|
7446 | 79 |
!CompilerWarningToDoListEntry methodsFor:'accessing'! |
80 |
||
81 |
className |
|
82 |
^ className |
|
83 |
||
84 |
"Created: / 22-10-2006 / 01:39:43 / cg" |
|
85 |
! |
|
86 |
||
87 |
className:classNameArg selector:selectorArg checkAction:checkActionArg equalityParameter:equalityParameterArg |
|
88 |
checkAction := checkActionArg. |
|
89 |
className := classNameArg. |
|
90 |
selector := selectorArg. |
|
91 |
equalityParameter := equalityParameterArg. |
|
92 |
||
93 |
"Created: / 22-10-2006 / 01:38:26 / cg" |
|
94 |
! |
|
95 |
||
7645 | 96 |
className:classNameArg selector:selectorArg checkAction:checkActionArg equalityParameter:equalityParameterArg position:positionArg |
97 |
checkAction := checkActionArg. |
|
98 |
className := classNameArg. |
|
99 |
selector := selectorArg. |
|
100 |
equalityParameter := equalityParameterArg. |
|
101 |
position := positionArg. |
|
102 |
||
103 |
"Created: / 22-10-2006 / 01:38:26 / cg" |
|
104 |
! |
|
105 |
||
7446 | 106 |
equalityParameter |
107 |
^ equalityParameter |
|
108 |
||
109 |
"Created: / 21-10-2006 / 21:57:01 / cg" |
|
110 |
! |
|
111 |
||
112 |
methodOrClassName |
|
113 |
selector isNil ifTrue:[^ className ]. |
|
114 |
^ className,' ',selector |
|
115 |
||
116 |
"Created: / 22-10-2006 / 11:05:21 / cg" |
|
117 |
! |
|
118 |
||
7511 | 119 |
position |
120 |
^ position |
|
121 |
! |
|
122 |
||
123 |
position:something |
|
124 |
position := something. |
|
125 |
! |
|
126 |
||
7446 | 127 |
problemClass |
128 |
^ Smalltalk classNamed:className |
|
129 |
||
130 |
"Created: / 21-10-2006 / 21:50:38 / cg" |
|
131 |
"Modified: / 22-10-2006 / 01:39:39 / cg" |
|
132 |
! |
|
133 |
||
134 |
problemClassName |
|
135 |
^ className |
|
136 |
||
137 |
"Created: / 22-10-2006 / 01:40:11 / cg" |
|
138 |
! |
|
139 |
||
140 |
problemMethod |
|
141 |
|cls| |
|
142 |
||
143 |
selector isNil ifTrue:[^ nil]. |
|
144 |
||
145 |
cls := self problemClass. |
|
146 |
cls isNil ifTrue:[^ nil]. |
|
147 |
||
148 |
^ cls compiledMethodAt:selector |
|
149 |
||
150 |
"Created: / 22-10-2006 / 02:42:39 / cg" |
|
151 |
! |
|
152 |
||
153 |
problemSelector |
|
154 |
^ selector |
|
155 |
||
156 |
"Created: / 21-10-2006 / 21:50:58 / cg" |
|
157 |
! |
|
158 |
||
7645 | 159 |
severity:severityArg priority:priorityArg timestamp:timestampArg |
160 |
message:msgArg className:classNameArg selector:selectorArg |
|
161 |
checkAction:checkActionArg equalityParameter:equalityParameterArg |
|
162 |
position:positionArg |
|
7752
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
163 |
|
7645 | 164 |
self |
165 |
severity:severityArg |
|
166 |
priority:priorityArg |
|
167 |
timestamp:timestampArg |
|
168 |
message:msgArg. |
|
169 |
self |
|
170 |
className:classNameArg |
|
171 |
selector:selectorArg |
|
172 |
checkAction:checkActionArg |
|
173 |
equalityParameter:equalityParameterArg. |
|
174 |
self |
|
175 |
position:positionArg |
|
176 |
! |
|
177 |
||
7446 | 178 |
update:something with:aParameter from:changedObject |
179 |
self revalidate. |
|
180 |
||
181 |
"Created: / 21-10-2006 / 21:28:35 / cg" |
|
182 |
! ! |
|
183 |
||
184 |
!CompilerWarningToDoListEntry methodsFor:'duplicate detection'! |
|
185 |
||
186 |
sameAs:anotherEntry |
|
187 |
^ anotherEntry sameAsCompilerWarningToDoListEntry:self |
|
188 |
||
189 |
"Created: / 21-10-2006 / 21:38:15 / cg" |
|
190 |
! |
|
191 |
||
192 |
sameAsCompilerWarningToDoListEntry:anotherEntry |
|
193 |
anotherEntry problemClassName = className ifFalse:[^ false]. |
|
194 |
anotherEntry problemSelector = selector ifFalse:[^ false]. |
|
195 |
anotherEntry equalityParameter = equalityParameter ifFalse:[^ false]. |
|
7927 | 196 |
anotherEntry message = message ifFalse:[^ false]. |
7446 | 197 |
^ true |
198 |
||
199 |
"Created: / 21-10-2006 / 21:41:57 / cg" |
|
200 |
"Modified: / 22-10-2006 / 01:40:03 / cg" |
|
201 |
! ! |
|
202 |
||
203 |
!CompilerWarningToDoListEntry methodsFor:'misc'! |
|
204 |
||
205 |
browse |
|
7734 | 206 |
|brwsr pos| |
7511 | 207 |
|
208 |
brwsr := UserPreferences browserClass |
|
209 |
openInClass:(self problemClass) selector:selector. |
|
7734 | 210 |
|
211 |
(pos := position) isArray ifTrue:[ |
|
7923 | 212 |
pos := pos first. |
213 |
] ifFalse:[ |
|
214 |
(pos isKindOf:Interval) ifTrue:[ |
|
215 |
pos := pos start. |
|
216 |
] |
|
7734 | 217 |
]. |
7923 | 218 |
|
7734 | 219 |
brwsr codeView cursorToCharacterPosition:pos. |
7511 | 220 |
"/ brwsr codeView selectLine:(brwsr codeView cursorLine). |
7446 | 221 |
|
222 |
"Created: / 22-10-2006 / 01:38:11 / cg" |
|
7511 | 223 |
"Modified: / 11-11-2006 / 14:49:35 / cg" |
7446 | 224 |
! ! |
225 |
||
226 |
!CompilerWarningToDoListEntry methodsFor:'validation'! |
|
227 |
||
7732 | 228 |
checkByReparsing |
15337
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
229 |
|stillValid cls mthd| |
7732 | 230 |
|
7792 | 231 |
Tools::ToDoNotification isNil ifTrue:[^ false]. |
232 |
||
7732 | 233 |
stillValid := false. |
234 |
Tools::ToDoNotification handle:[:ex | |
|
235 |
stillValid := (ex parameter sameAs:self). |
|
236 |
ex proceed. |
|
237 |
] do:[ |
|
15337
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
238 |
(cls := self problemClass) isNil ifTrue:[ |
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
239 |
"/ class is gone. |
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
240 |
^ false. |
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
241 |
]. |
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
242 |
(mthd := cls compiledMethodAt:selector) isNil ifTrue:[ |
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
243 |
"/ mthod is gone |
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
244 |
^ false. |
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
245 |
]. |
7732 | 246 |
Compiler |
15337
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
247 |
compile:mthd source |
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
248 |
forClass:cls |
7732 | 249 |
install:false. |
250 |
]. |
|
251 |
^ stillValid. |
|
252 |
||
253 |
"Created: / 21-10-2006 / 21:31:27 / cg" |
|
254 |
"Modified: / 20-11-2006 / 15:34:29 / cg" |
|
255 |
! |
|
256 |
||
7446 | 257 |
checkIfClassIsStillValid |
258 |
className notNil ifTrue:[ |
|
259 |
(Smalltalk classNamed:className) isNil ifTrue:[^ false]. |
|
260 |
]. |
|
261 |
^ true |
|
262 |
||
263 |
"Created: / 21-10-2006 / 21:58:26 / cg" |
|
264 |
"Modified: / 22-10-2006 / 01:41:53 / cg" |
|
265 |
! |
|
266 |
||
267 |
checkIfSelectorIsStillValid |
|
268 |
selector notNil ifTrue:[ |
|
15338
e6efd621a4f3
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
15337
diff
changeset
|
269 |
self problemClass isNil ifTrue:[^ false]. |
7446 | 270 |
(self problemClass compiledMethodAt:selector) isNil ifTrue:[^ false]. |
271 |
]. |
|
272 |
^ true |
|
273 |
||
274 |
"Created: / 21-10-2006 / 21:58:44 / cg" |
|
275 |
"Modified: / 22-10-2006 / 01:40:40 / cg" |
|
276 |
! |
|
277 |
||
278 |
checkIfStillValid |
|
279 |
self checkIfClassIsStillValid ifFalse:[^ false]. |
|
280 |
self checkIfSelectorIsStillValid ifFalse:[^ false]. |
|
7732 | 281 |
|
7529 | 282 |
checkAction isNil ifTrue:[ |
7732 | 283 |
^ self checkByReparsing |
7529 | 284 |
]. |
7446 | 285 |
|
286 |
^ (checkAction value:self) |
|
287 |
||
288 |
"Created: / 21-10-2006 / 21:31:27 / cg" |
|
7529 | 289 |
"Modified: / 20-11-2006 / 15:34:29 / cg" |
7446 | 290 |
! ! |
291 |
||
292 |
!CompilerWarningToDoListEntry class methodsFor:'documentation'! |
|
293 |
||
294 |
version |
|
15338
e6efd621a4f3
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
15337
diff
changeset
|
295 |
^ '$Header: /cvs/stx/stx/libtool/Tools__CompilerWarningToDoListEntry.st,v 1.13 2015-02-20 13:12:01 cg Exp $' |
e6efd621a4f3
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
15337
diff
changeset
|
296 |
! |
e6efd621a4f3
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
15337
diff
changeset
|
297 |
|
e6efd621a4f3
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
15337
diff
changeset
|
298 |
version_CVS |
e6efd621a4f3
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
15337
diff
changeset
|
299 |
^ '$Header: /cvs/stx/stx/libtool/Tools__CompilerWarningToDoListEntry.st,v 1.13 2015-02-20 13:12:01 cg Exp $' |
7446 | 300 |
! ! |
15337
7fc9c63796a2
class: Tools::CompilerWarningToDoListEntry
Claus Gittinger <cg@exept.de>
parents:
8235
diff
changeset
|
301 |